[GRASS-user] align large number of images in a automated way

Dear all,

I have a large number of images that was taken using a camera in the top of a 15 m tall tower.

Now I need to align or spatially synchronize them using same automated solution, because it is not feasible one by one (I have 18,000 photos).

Any hint are welcome.

best wishes

Miltinho - mcr@rc.unesp.br
Laboratório de Ecologia Espacial e Conservação - LEEC
Depto de Ecologia - UNESP - Rio Claro
Av. 24A, 1515- Bela Vista
13506-900 Rio Claro, SP, Brasil

Fone: +55 19 3526-9647 (office) 19 3526-9680 (lab)
Cel: 19 9853-3220 / 19 9853-5430

Depto Ecologia http://ib.rc.unesp.br/#!/departamentos/ecologia/
PG ECO & BIODIV http://ib.rc.unesp.br/#!/departamentos/ecologia/pos-graduacao-em-ecologia-e-biodiversidade/

CV http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true

Google citations http://scholar.google.com/citations?user=OWX_2eAAAAAJ

Hello Milton,

On Wed, 30 Jul 2014 12:41:04 +1000, Milton Ribeiro <miltinho.astronauta@gmail.com> wrote:

Dear all,

I have a large number of images that was taken using a camera in the top of
a 15 m tall tower.

Now I need to align or spatially synchronize them using same automated
solution, because it is not feasible one by one (I have 18,000 photos).

Any hint are welcome.

It might be able to be done using Hugin and a script, but not knowing all the details of your project I can't be sure there wouldn't be any problems.
If you can put a few of the images somewhere I can access them (eg Dropbox) I could have a look at how Hugin might handle it.

Cheers,
--
Regards,
Terry Duell

Hi Miltinho,

If I understood you correctly, I think we are facing similar challenges, because we are planning to test our wildlife foto traps in a remote sensing context where we need to have a proper georeference for each image.

I assume all your images are equal, means they cover the same surface on the ground and are taken from the same angle and with the same camera?

Because of other obligations we have not really started the work yet, but we consider two alternative solutions:

A full GRASS based ortorectification: http://gis.cri.fmach.it/uploads/CAGEO_2011.pdf (for this one I have to talk to our camera operator that he provides the necessary information on fiducial marks, and necessary camera parameters, not sure if we can make it work)

Or (more “quick and dirty”) using ground control points in gdalwarp (http://www.gdal.org/gdalwarp.html). Probably, you may have to add the GCPs to the image using gdal_translate (then VRT is a recommended output format) in advance to gdalwarp.

Don`t know how far this work got: http://linfiniti.com/2010/10/automated-gcp-collection-in-quantum-gis/

In any case I would be interested in how you solved this at the end…

Cheers and good luck

Stefan

···

Dear all,

I have a large number of images that was taken using a camera in the top of a 15 m tall tower.

Now I need to align or spatially synchronize them using same automated solution, because it is not feasible one by one (I have 18,000 photos).

Any hint are welcome.

best wishes

Miltinho - mcr@rc.unesp.br
Laboratório de Ecologia Espacial e Conservação - LEEC
Depto de Ecologia - UNESP - Rio Claro
Av. 24A, 1515- Bela Vista
13506-900 Rio Claro, SP, Brasil

Fone: +55 19 3526-9647 (office) 19 3526-9680 (lab)
Cel: 19 9853-3220 / 19 9853-5430

Depto Ecologia http://ib.rc.unesp.br/#!/departamentos/ecologia/
PG ECO & BIODIV http://ib.rc.unesp.br/#!/departamentos/ecologia/pos-graduacao-em-ecologia-e-biodiversidade/

CV http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true

Google citations http://scholar.google.com/citations?user=OWX_2eAAAAAJ

On Wed, Jul 30, 2014 at 8:42 AM, Terry Duell <tduell@iinet.net.au> wrote:
...

It might be able to be done using Hugin and a script, but not knowing all
the details of your project I can't be sure there wouldn't be any problems.
If you can put a few of the images somewhere I can access them (eg Dropbox)
I could have a look at how Hugin might handle it.

I would suggest the same: the underlying software used by Hugin is the
SIFT algorithm
On my Fedora box, I have autopano-sift-C-2.5.1-8.fc20.x86_64 (from
http://free.rpmfusion.org/,
Autopano: Match Keypoints generated by generatekeys).

You just feed in the images and it will turn back the GCPs. Then can
then go into the common (GRASS) image processing chain.

Markus

--
http://courses.neteler.org
http://gis.cri.fmach.it/neteler/

Milton wrote:

I have a large number of images that was taken using a camera in the
top of a 15 m tall tower. Now I need to align or spatially
synchronize them using same automated solution, because it is not
feasible one by one (I have 18,000 photos). Any hint are welcome.
best wishes

(I'll second the recommendation for Hugin, it's great)
http://hugin.sourceforge.net/
http://hugin.sourceforge.net/docs/manual/Autopano-sift.html

Stefan:

If I understood you correctly, I think we are facing similar
challenges, because we are planning to test our wildlife foto traps
in a remote sensing context where we need to have a proper
georeference for each image.

I assume all your images are equal, means they cover the same surface
on the ground and are taken from the same angle and with the same
camera?

Because of other obligations we have not really started the work yet,
but we consider two alternative solutions: A full GRASS based
ortorectification: http://gis.cri.fmach.it/uploads/CAGEO_2011.pdf
(for this one I have to talk to our camera operator that he provides
the necessary information on fiducial marks, and necessary camera
parameters, not sure if we can make it work) Or (more "quick and
dirty") using ground control points in gdalwarp
(http://www.gdal.org/gdalwarp.html). Probably, you may have to add
the GCPs to the image using gdal_translate (then VRT is a recommended
output format) in advance to gdalwarp.

you may be interested in this earlier work, I seem to recall there was
a FOSS4G presentation/proceedings about it too some years ago too (does
a picture from a hill looking down on a dock with a Lake beyond jog the
memory of anyone?).

http://grass.osgeo.org/gdp/stereo-grass/index.html
http://grasswiki.osgeo.org/wiki/Image_processing#Stereo_ideas
http://grasswiki.osgeo.org/wiki/Orthorectification_digital_camera

regards,
Hamish

On Wed, Jul 30, 2014 at 10:00 AM, Hamish <hamish.webmail@gmail.com> wrote:

you may be interested in this earlier work, I seem to recall there was
a FOSS4G presentation/proceedings about it too some years ago too (does
a picture from a hill looking down on a dock with a Lake beyond jog the
memory of anyone?).

Yes, I made that together with Ivan Michelazzi.

http://grasswiki.osgeo.org/wiki/Orthorectification_digital_camera

Reference:

M. Neteler, D. Grasso, I. Michelazzi, L. Miori, S. Merler, and C.
Furlanello, 2005: An integrated toolbox for image registration, fusion
and classification. International Journal of Geoinformatics, 1(1), pp.
51-61
http://www.grassbook.org/neteler/papers/neteler2005_IJG_051-061_draft.pdf

cheers
Markus

The only problem I see with using Hugin is the lack of orthorectification. I suppose you must assume planar images.
I hope there will arrive enough fundings to bring bundle adjustment development on…

giovanni

Milton wrote:

I have a large number of images that was taken using a camera in the
top of a 15 m tall tower. Now I need to align or spatially
synchronize them using same automated solution, because it is not
feasible one by one (I have 18,000 photos). Any hint are welcome.
best wishes

(I’ll second the recommendation for Hugin, it’s great)
http://hugin.sourceforge.net/
http://hugin.sourceforge.net/docs/manual/Autopano-sift.html

Stefan:

If I understood you correctly, I think we are facing similar
challenges, because we are planning to test our wildlife foto traps
in a remote sensing context where we need to have a proper
georeference for each image.

I assume all your images are equal, means they cover the same surface
on the ground and are taken from the same angle and with the same
camera?

Because of other obligations we have not really started the work yet,
but we consider two alternative solutions: A full GRASS based
ortorectification: http://gis.cri.fmach.it/uploads/CAGEO_2011.pdf
(for this one I have to talk to our camera operator that he provides
the necessary information on fiducial marks, and necessary camera
parameters, not sure if we can make it work) Or (more “quick and
dirty”) using ground control points in gdalwarp
(http://www.gdal.org/gdalwarp.html). Probably, you may have to add
the GCPs to the image using gdal_translate (then VRT is a recommended
output format) in advance to gdalwarp.

you may be interested in this earlier work, I seem to recall there was
a FOSS4G presentation/proceedings about it too some years ago too (does
a picture from a hill looking down on a dock with a Lake beyond jog the
memory of anyone?).

http://grass.osgeo.org/gdp/stereo-grass/index.html
http://grasswiki.osgeo.org/wiki/Image_processing#Stereo_ideas
http://grasswiki.osgeo.org/wiki/Orthorectification_digital_camera

regards,
Hamish


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

On Wed, Jul 30, 2014 at 11:17 AM, G. Allegri <giohappy@gmail.com> wrote:

The only problem I see with using Hugin is the lack of orthorectification. I
suppose you must assume planar images.

The request is, I think, related to a stack of images (from a tower)
rather than a flight.

I hope there will arrive enough fundings to bring bundle adjustment
development on...

Here in FEM (http://gis.cri.fmach.it/) Stephan Turek has started to
implement bundle block adjustment during his ERASMUS stay last year.
It would be nice to expand that prototype.
However, not related to the request as far as I understand.

Markus

Here in FEM (http://gis.cri.fmach.it/) Stephan Turek has started to
implement bundle block adjustment during his ERASMUS stay last year.
It would be nice to expand that prototype.
However, not related to the request as far as I understand.

Sorry,
I saw that you were citing GRASS orthorectification papers, so I thought it
was a requirement.

giovanni

Markus

--
Giovanni Allegri
http://about.me/giovanniallegri
Twitter: https://twitter.com/_giohappy_
blog: http://blog.spaziogis.it
GEO+ geomatica in Italia http://bit.ly/GEOplus

Hi again,

given that from that tower (or in our cases wildlife foto traps) exactly the same images are taken at different points in time (assuming cameras are mounted with fixed angle and so on), one could ideally use one and the same set of GCPs on all images…

I did not digg through our image material yet, so I cannot estimate the maximum shift between images, but I expect (hope) it is neglectable…

In that case orthrectification in GRASS GIS should be scriptable (should`nt it?). I will have a look at our images asap (though that might be some days or weeks).

Cheers
Stefan

Dear all,

Thanks for all your replies.
Considering the answers and comments I complement my request:

  1. I have no interest on the spatial coordinates, only need align the images (so I can use a local coordinate)
  2. Although the camera is fixed, there are some variability on the image positions, the platn canopy change positions etc (and we did some fix on the camera support, so part of the imagens have a diffent field of view - but we can bypass this aligning using two or three packages of images)
  3. This is part of our E-phenology project, that means that we have interest on phenological changes thoughout of time
  4. I will define regions of interest on the subset of images (let say part of a canopy) and analyze the greeness or other vegetation change index, so is important have all the package of images well aligned.
  5. Unfortunatelly, as I have 18,000 images (and increasing), collect ground control point is not the solution :frowning:

I will carefully check your suggestions, but if you have other hints, this will be very welcome

milton

···

2014-07-30 8:03 GMT-03:00 Blumentrath, Stefan <Stefan.Blumentrath@nina.no>:

Hi again,

given that from that tower (or in our cases wildlife foto traps) exactly the same images are taken at different points in time (assuming cameras are mounted with fixed angle and so on), one could ideally use one and the same set of GCPs on all images…

I did not digg through our image material yet, so I cannot estimate the maximum shift between images, but I expect (hope) it is neglectable…

In that case orthrectification in GRASS GIS should be scriptable (should`nt it?). I will have a look at our images asap (though that might be some days or weeks).

Cheers
Stefan


grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

Miltinho - mcr@rc.unesp.br
Laboratório de Ecologia Espacial e Conservação - LEEC
Depto de Ecologia - UNESP - Rio Claro
Av. 24A, 1515- Bela Vista
13506-900 Rio Claro, SP, Brasil

Fone: +55 19 3526-9647 (office) 19 3526-9680 (lab)
Cel: 19 9853-3220 / 19 9853-5430

Depto Ecologia http://ib.rc.unesp.br/#!/departamentos/ecologia/
PG ECO & BIODIV http://ib.rc.unesp.br/#!/departamentos/ecologia/pos-graduacao-em-ecologia-e-biodiversidade/

CV http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4792988H6&mostrarNroCitacoesISI=true&mostrarNroCitacoesScopus=true

Google citations http://scholar.google.com/citations?user=OWX_2eAAAAAJ

Dear Milton,

I made a quick test with the sample data you sent to me:

autopano-sift-c output.pto dir_2014_002_17_1.jpg dir_2014_002_16_7.jpg
[...]
  555 keypoints found
[...]
Filtering... (dir_2014_002_17_1.jpg, dir_2014_002_16_7.jpg)
   A. Join Filtration: 32 to 32
   B. Score Filtration: 32 to 25
Filtered partition [0,1] from 32 matches down to 25

cat output.pto
# Hugin project file generated by APSCpp
[...]
# automatically generated control points
c n0 N1 x290.400812 y143.672441 X289.377092 Y142.525139 t0
c n0 N1 x566.209025 y383.642656 X566.343984 Y383.440512 t0
c n0 N1 x321.360169 y120.632838 X321.409832 Y120.057093 t0
c n0 N1 x45.026134 y21.912848 X43.642776 Y22.815530 t0
c n0 N1 x299.155503 y122.350252 X298.325028 Y122.493041 t0
[...]
c n0 N1 x377.501999 y142.803118 X372.855780 Y145.767751 t0

So, it easily find a lot of common points (runtime of autopano-sift-c
is 0.72 seconds on my office Linux PC). In a scripted approach you
could match the 18,000 images against a master image or the like, then
convert the resulting output.pto files into a text file structure
readable by i.rectify.

Hope this helps,
Markus

On Thu, 31 Jul 2014 01:15:54 +1000, Markus Neteler <neteler@osgeo.org> wrote:

Dear Milton,

I made a quick test with the sample data you sent to me:

autopano-sift-c output.pto dir_2014_002_17_1.jpg dir_2014_002_16_7.jpg
[...]
  555 keypoints found
[...]
Filtering... (dir_2014_002_17_1.jpg, dir_2014_002_16_7.jpg)
   A. Join Filtration: 32 to 32
   B. Score Filtration: 32 to 25
Filtered partition [0,1] from 32 matches down to 25

cat output.pto
# Hugin project file generated by APSCpp
[...]
# automatically generated control points
c n0 N1 x290.400812 y143.672441 X289.377092 Y142.525139 t0
c n0 N1 x566.209025 y383.642656 X566.343984 Y383.440512 t0
c n0 N1 x321.360169 y120.632838 X321.409832 Y120.057093 t0
c n0 N1 x45.026134 y21.912848 X43.642776 Y22.815530 t0
c n0 N1 x299.155503 y122.350252 X298.325028 Y122.493041 t0
[...]
c n0 N1 x377.501999 y142.803118 X372.855780 Y145.767751 t0

So, it easily find a lot of common points (runtime of autopano-sift-c
is 0.72 seconds on my office Linux PC). In a scripted approach you
could match the 18,000 images against a master image or the like, then
convert the resulting output.pto files into a text file structure
readable by i.rectify.

I have run Milton's test images through a script which calls a number of hugin command line programs to generate control points, optimise and spit out remapped images. It seems to work quite well, with a mean error of 0.1 pix and max error of 0.3 pix.

Cheers,
--
Regards,
Terry Duell

Milton Cezar Ribeiro wrote

5. Unfortunatelly, as I have 18,000 images (and increasing), collect
ground
control point is not the solution

That's only 12.5 minutes of video at 24 fps and the requirements you've
described sound like a pretty typical camera stabilization problem. Why not
take a look at camera tracking/stabilization software?

In most cases such software will offer a high level of automation, however
more importantly, at least from my perspective, they will also provide a
good UI that will help you diagnose problems when the optimization process
eventually goes off the rails. Something that you won't have if you opt for
a completely command line solution.

If you're looking for an open-source solution Blender has a decent tracker.
The biggest feature it is probably missing for your application is being
able to use ground control points in addition to image points. Most of the
other commercial options do provide this feature, which would give you more
reliable and accurate solves.

Best,

--
View this message in context: http://osgeo-org.1560.x6.nabble.com/align-large-number-of-images-in-a-automated-way-tp5154069p5154296.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Hei again,

now I have digged a bit in this
http://grasswiki.osgeo.org/wiki/Orthorectification_digital_camera
and this
http://www.grassbook.org/neteler/papers/neteler2005_IJG_051-061_draft.pdf
and this:
http://www.grassbook.org/sample2nd/grassbook_2nd_2004_chapter10_aerial.pdf

Unfortunately I am still struggeling with understanding the calculation of the fiducial marks for the handheld camera (and the principal point of symmetry):
Is not the number of pixels for a know distance on the ground heavily affected by the camera perspective and the distance of the object to the camera, esp if the picture is not really taken in a birds-eye perspective (e.g. from a tower)? And does not the same problem arise for the principal point of symmetry (e.g. in a photo taken more parallel to the ground)?

Sorry for the probably fundamental questions, but all this is new for me...

Would it be a solution to take the average of distance in pixels and meters between the set of GCPs?
Esp. because my pictures only contain mountainous vegetation and rocks (no bridges, houses, roads and so on) it will be already a challenge to get good GCPs...

I could provide an example image if that helps understanding my problem...

Best,
Stefan

Just leaving a note that I found some more related information in an older post on this list: http://lists.osgeo.org/pipermail/grass-user/2008-January/042499.html

Cheers,
Stefan