“bad subifd directory” Replacing/removing bad SubIFD

Handling bad SubIFD entries in photos you want to geo tag / the problem

I just converted some of my RAW photos in RawTherapee and polished them in Photoshop CS. Of course I also wanted to GeoTag them (using GeoSetter) before putting the images in my archive. Fortunately, a GPS point was found in my trace for all photos. Unfortunately, I couldn’t write the Exif-GPS position due to a “bad subifd directory”. That’s what exiftool (which geosetter uses) tells me.

So – how to get the geo information into exif – or how to get the bad SubIFD directory out?

The solution:

In the end the issue was rather easy to solve:

  1. copy your images to a linux machine (or vm or whatever)
  2. copy all images to a directory “conv” AND in parallel to “conv2
  3. enter “conv2
  4. remove all exif information from the conv2 images by
    find ./*.jpg -exec exiftool -exif:all= {} ;
  5. enter “conv1” & copy the exif information (except SubIFD) to the cleaned images in “conv2” by
    find ./*.jpg -exec exiftool -tagsfromfile {} -exif:all --subifd:all ../conv2/{};
  6. you’re done.
  7. (fire up geo setter and geo tag your photos)

Be happy!

Finished my Posters for ICIP and MICCAI

Finally finished the posters for my publications:

F. Graf, H.-P. Kriegel, M. Schubert, S. Poelsterl, A. Cavallaro
2D Image Registration in CT Images using Radial Image Descriptors
In Medical Image Computing and Computer-Assisted Intervention (MICCAI), Toronto, Canada, 2011.

and

F. Graf, H.-P. Kriegel, M. Weiler
Robust Segmentation of Relevant Regions in Low Depth of Field Images
In Proceedings of the IEEE International Conference on Image Processing (ICIP), Brussels, Belgium, 2011.

Robust Segmentation of Relevant Regions in Low Depth of Field Images

Great, we got accepted (as a poster) on the ICIP 2011 with the paper “Robust Segmentation of Relevant Regions in Low Depth of Field Images”:

Low depth of field (DOF) is an important technique to emphasize the object of interest (OOI) within an image. When viewing a low depth of field image, the viewer implicitly segments the image into region of interest and non regions of interest which has major impact on the perception of the image. Thus, robust algorithms for the detection of the OOI in low DOF images provide valuable information for subsequent image processing and image retrieval. In this paper we propose a robust and parameterless algorithm for the fully automatic segmentation of low depth of field images. We compare our method with three similar methods and show the superior robustness even though our algorithm does not require any parameters to be set by hand. The experiments are conducted on a real world data set with high and low depth of field images. (Abstract from the paper)

The work is a result of a collaboration with Michael Weiler. We extended his Diploma thesis and produced an improved segmentation algorithm for Low Depth Of Field images. Compared to the other 3 competing algorithms, ours is a bit slower but at least it works. The other algorithms turned out to be extremely unstable and/or sensitive to parameters.

On the project site you can find

  • an online demo
  • the test images,
  • the masks
  • the NetBeans project including the full Java source code for our algorithm and the reimplementation of the comparison partners (of course we had to re-implement as we didn’t even get binaries – as usual)

So if you plan to do some image segmentation, just go there download the stuff and cite our work 😉

Autostitch: Format der pano.txt

Gerade Autostitch ausprobiert. Und siehe da: die Panos sind besser als die von meiner alten Canon Stitch-Software.

Aber: Der Ram-Verbrauch von autostitch ist brachial. Ich wollte 5 Fotos Ă  4592*3056 Pixel zusammenstitchen. NatĂŒrlich sollte das Ausgabefoto auch ca 3000Pixel hoch sein. Nur reichten dazu die mir zur VerfĂŒgung stehenden 2GB leider nicht aus(?!). 2500px Höhe gingen dann gerade noch.

Da autostitch ja netterweise eine pano.txt anlegt, in der die Transformationsdaten stehen, ist die Versuchung gerade groß, das selbst auszuprobieren. – Wenn mal Zeit ist vielleicht …

Dokumentation der pano.txt:

The format of pano.txt is:

filename
width height
T (3 x 3)
R (3 x 3)
f

so that the projection matrix for each image (original size) is:

P = T * K(f) * R

where K(f) = [ f 0 0; 0 f 0; 0 0 1]

The homography between a pair of images is

s * [r_2, c_2, 1] = P_2 * inv(P_1) * [r_1, c_1, 1]

where r is the row coordinate and c is the column.

The demo version renders panoramas in spherical coordinates theta VS
phi (longitude/latitude). You can get the theta/phi ranges from
Edit->Options after stitching. The relationships between theta/phi and
image coordinates are:

s * [r, c, 1] = P * X

where

X = [ -sin(phi); cos(phi)sin(theta); cos(phi)cos(theta) ]

How to load images in Java

Every once in a while there is a question on the NetBeans mailinglist about how to load an image (or other ressource, like a text file) relative to the executing JAR.

The Java Tutorial gives the answer in the chapter “How to use Icons“:

java.net.URL imgURL = getClass().getResource("inSamePackage.png");
java.net.URL imgURL = getClass().getResource("/de/foo/otherPackage.png");

Continue reading How to load images in Java