[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-04-02 Thread T. Modes
Hi Flo,

First your vetting exercise is ok. I commited it to the trunk.

> Of course it did. I didn'nt mention, that i checked out the 2010.0.0
> release from svn, not the trunk.
> So the patches are based on that release. (Should I use the trunk
> instead?)

Okay, I understand.The trunk contains some new features, which will it
make into the next release 2010.2. Especially with the merging of the
layout branch there were some significant changes to the code base. So
all new work should base on the trunk. The release branch is now only
for some critical bug fixing.

Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-04-01 Thread Flo
The SrcPanoImage class changed a lot since the last release, but i
should have used getSize() from the beginning.

This patch is based on the current trunk rev.
http://groups.google.com/group/hugin-ptx/web/ExivOrientationTrust.patch
It only contains the Exiv part. The rotation of the preview image is
not included.
This one should work now.

Flo

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-04-01 Thread Flo

On 1 Apr., 19:10, "T. Modes"  wrote:

> > +bool SrcPanoImage::trustExivOrientation()
> > +{
> > +    if(m_size.width() < m_size.height())
> > +        return false;
> > +
>
> m_size: unknow member variable (or something similiar)
> Did the patch compile on your machine?

You're right, it doesn't work on the current trunk version. The class
simply doesn't have that member any more.
I'll fix this.

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-04-01 Thread Flo
Hi Thomas

On 1 Apr., 19:10, "T. Modes"  wrote:
> I would not rotate that little preview image. It would be helpful to
> see in at least one position the right orientation in the file. In all
> controls which show the image and where you can edit parts (cp, crop,
> mask) the image is rotated in only 90 degrees step.

Ok, the rotation feature was more or less just playing around. I also
don't
like the way it looks (the black frame). It would be easy to rotate
only by 90 degrees.
And even easier not rotating ;)

> Some comment: Don't copy patch/diff files directly in your mail. The
> mailing list can make trouble with line breaks. Please attach the
> patch to your mail or use an other way to exchange data.

Yeah, sorry, did it again, but before reading that.

>
> I tested your patch on my machine. It looked good, but it does not
> compile. The compiler throws an error in
>
> > +bool SrcPanoImage::trustExivOrientation()
> > +{
> > +    if(m_size.width() < m_size.height())
> > +        return false;
> > +
>
> m_size: unknow member variable (or something similiar)
> Did the patch compile on your machine?

Of course it did. I didn'nt mention, that i checked out the 2010.0.0
release from svn, not the trunk.
So the patches are based on that release. (Should I use the trunk
instead?)

Here SrcPanoImage has the member vigra::Size2D m_size.
Gonna check it with the current trunk revision..

Flo

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-04-01 Thread T. Modes
Hi Flo,

> Thanks for your support. I tried to understand the code some more and
> did a little improvement to the Exiv orientation feature.
> - added the trusted tag feature, which doesn't do a lot, actually.
> - rotate the preview in the image panel according to image roll value.
> It's rotated by the exact roll value, what leads to black background,
> if the image is not rotated by full quarters.
>
> Does it make a difference in this case what center for the rotation i
> use? (0, 0) in this case.
>

I would not rotate that little preview image. It would be helpful to
see in at least one position the right orientation in the file. In all
controls which show the image and where you can edit parts (cp, crop,
mask) the image is rotated in only 90 degrees step.

Some comment: Don't copy patch/diff files directly in your mail. The
mailing list can make trouble with line breaks. Please attach the
patch to your mail or use an other way to exchange data.

I tested your patch on my machine. It looked good, but it does not
compile. The compiler throws an error in
> +bool SrcPanoImage::trustExivOrientation()
> +{
> +    if(m_size.width() < m_size.height())
> +        return false;
> +

m_size: unknow member variable (or something similiar)
Did the patch compile on your machine?

Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-03-31 Thread Flo
Hi!

Thanks for your support. I tried to understand the code some more and
did a little improvement to the Exiv orientation feature.
- added the trusted tag feature, which doesn't do a lot, actually.
- rotate the preview in the image panel according to image roll value.
It's rotated by the exact roll value, what leads to black background,
if the image is not rotated by full quarters.

Does it make a difference in this case what center for the rotation i
use? (0, 0) in this case.

I'll look at the makefile part tomorrow ..

Flo


Index: hugin1/hugin/ImagesPanel.cpp
===
--- hugin1/hugin/ImagesPanel.cpp(revision 5095)
+++ hugin1/hugin/ImagesPanel.cpp(working copy)
@@ -654,6 +654,10 @@
 pano->getImage(m_showImgNr).getFilename());
 wxImage img = imageCacheEntry2wxImage(cacheEntry);

+// Rotate the preview image according to roll value.
+img = img.Rotate(-2*PI * pano-
>getSrcImage(m_showImgNr).getRoll() / 360,
+wxPoint(0, 0));
+
 double iRatio = img.GetWidth() / (double) img.GetHeight();

 wxSize sz;
Index: hugin_base/panodata/SrcPanoImage.cpp
===
--- hugin_base/panodata/SrcPanoImage.cpp(revision 5095)
+++ hugin_base/panodata/SrcPanoImage.cpp(working copy)
@@ -417,7 +417,7 @@
 }

 long orientation = 0;
-if (getExiv2Value(exifData,"Exif.Image.Orientation",orientation))
{
+if (getExiv2Value(exifData,"Exif.Image.Orientation",orientation)
&& trustExivOrientation()) {
 switch (orientation) {
 case 3:  // rotate 180
 roll = 180;
@@ -778,5 +779,18 @@
 return false;
 }
 }
+/**
+ * Decides if the Exiv Orientation Tag of an images is plausible.
+ * Current checks:
+ * - If width is smaller than height, image is probably already
rotated, tag may be wrong.
+ * @return true if plausible.
+ */
+bool SrcPanoImage::trustExivOrientation()
+{
+if(m_size.width() < m_size.height())
+return false;
+
+return true;
+}

 } // namespace
Index: hugin_base/panodata/SrcPanoImage.h
===
--- hugin_base/panodata/SrcPanoImage.h  (revision 5095)
+++ hugin_base/panodata/SrcPanoImage.h  (working copy)
@@ -477,6 +479,9 @@
 bool getExiv2Value(Exiv2::ExifData& exifData, std::string
keyName, long & value);
 bool getExiv2Value(Exiv2::ExifData& exifData, std::string
keyName, float & value);
 bool getExiv2Value(Exiv2::ExifData& exifData, std::string
keyName, std::string & value);
+
+/// Check if Exiv orientation tag can be trusted
+bool trustExivOrientation();
 };
 } // namespace

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


Re: [hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-03-30 Thread Bruno Postle

On Tue 30-Mar-2010 at 12:00 -0700, Thomas Modes wrote:



SrcPanoImage somehow encapsulates an image, and when one adds an Image
in the GUI wxAddImagesCmd::execute creates an instance of SrcPanoImage
and calls it's readEXIF(...) method.
This huge method already reads Exif orientation tags and finally sets
m_roll correctly. Although it doesn't do the trusted/not-trusted tag
evaluation.
What doesn't happen though is, that the image is correctly shown in the
gui. Is that what should be done?



Oh sorry, we did not check the vetting exercise. It seems that
somebody has already wrote the code to do this task.


Oops that's my fault, need to change the wiki page.


So from this point, I recommand to change the exercise to:
1.) add a check, if the orientation flag correspond to the image, if
this is not the case disregard the orientation flag.


This check will still be useful.


2.) add a target to the stitching make file which prints some
infomations about the project and the images. (it's not necessary to
expose the function to the gui, it is sufficient to write the
informations in the makefile, the infomation should be printed when
invoke make -f makefile.mk info or something similiar)


That is a much better idea for a task than mine.

--
Bruno

--
You received this message because you are subscribed to the Google Groups "hugin and 
other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe, reply using "remove me" as the subject.


[hugin-ptx] Re: Exif Rotation Feature, vetting exercise

2010-03-30 Thread T. Modes
Hi Florian

> What parts are in hugin_base and in hugin1?

It is as Lukas has already written. In hugin_base there is mainly the
core function.
Hugin1 holds all code which depends on wxWidgets. This is mainly the
gui programs and related code.

> For Example there is an ImageCache class in
> hugin_base/huginapp/ImageCache and another one in hugin1/base_wx/ImageCache.
> While the latter is not used, i think.

The main ImageCache is in hugin_base. hugin1\base_wx\ImageCache
contains the code to convert the image cache entry to an wxImage (the
declaration of ImageCache class is not compiled, see conditional
switch)

> About the Exif Rotation:
> SrcPanoImage somehow encapsulates an image, and when one adds an Image
> in the GUI wxAddImagesCmd::execute creates an instance of SrcPanoImage
> and calls it's readEXIF(...) method.
> This huge method already reads Exif orientation tags and finally sets
> m_roll correctly. Although it doesn't do the trusted/not-trusted tag
> evaluation.
> What doesn't happen though is, that the image is correctly shown in the
> gui. Is that what should be done?
>

Oh sorry, we did not check the vetting exercise. It seems that
somebody has already wrote the code to do this task.

So from this point, I recommand to change the exercise to:
1.) add a check, if the orientation flag correspond to the image, if
this is not the case disregard the orientation flag.
2.) add a target to the stitching make file which prints some
infomations about the project and the images. (it's not necessary to
expose the function to the gui, it is sufficient to write the
informations in the makefile, the infomation should be printed when
invoke make -f makefile.mk info or something similiar)

> How does ImageCache work? And how is it related to SrcPanoImages?
> The Cache seems to store a map of names and entries that point to some
> special vigra:: types.

The image cache stores a image as a vigra::image. It is identified by
the filename.
The SrcPanoImage is not related with the image cache. The SrPanoImage
stores all internal variables, which are assigned to this image. It
does linking of variables and so on.

Thomas

-- 
You received this message because you are subscribed to the Google Groups 
"hugin and other free panoramic software" group.
A list of frequently asked questions is available at: 
http://wiki.panotools.org/Hugin_FAQ
To post to this group, send email to hugin-ptx@googlegroups.com
To unsubscribe from this group, send email to 
hugin-ptx+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/hugin-ptx

To unsubscribe from this group, send email to 
hugin-ptx+unsubscribegooglegroups.com or reply to this email with the words 
"REMOVE ME" as the subject.