Finding a specific edge in multiple images?

3 views (last 30 days)
I have a set of fotos taken by a camera that shifts slightly in the wind. I am trying to correct the shift automatically. This is the image I want to use as reference: http://i101.photobucket.com/albums/m80/klar_01/marks.jpg
This is an example of a shifted image: http://i101.photobucket.com/albums/m80/klar_01/shift2.jpg
I have cropped the reference image and isolated a part of the main horizon line using canny edge detection and a threshold. I would like to find this edge in the other images and then transform the images to line up with the reference. Unfortunately the lighting situation changes a lot and the edge can not always be picked out clearly.
This is the horizon line from the reference image (green) and the canny edges I get for the shifted image (purple). http://i101.photobucket.com/albums/m80/klar_01/edges.jpg
I can see where the green and pruple lines should line up but I have no idea how to express this in code, as I can't get a clear edge in the shifted image.
Any suggestions would be much appreciated. Other ideas about how to approach the problem would also be very welcome!
I have the computer vision toolbox and have tried using the inbuilt feature matching functions with SURF features and corner points. Points do not match up correctly, presumeably because of the changing light.

Accepted Answer

Image Analyst
Image Analyst on 21 Apr 2013
Did you try imregister()?
  3 Comments
Image Analyst
Image Analyst on 22 Apr 2013
Sorry - I haven't used the imregister function as much as you have, so I can't help any more. You know more about it than me at this point.
Harshan Desu
Harshan Desu on 7 May 2020
Hello Image Analyst, can u suggest me a way find and extract only a specfic edge from one image. Please help me out.

Sign in to comment.

More Answers (1)

Alex Taylor
Alex Taylor on 23 Apr 2013
Edited: Alex Taylor on 23 Apr 2013
Lea, I will look into this a bit, I'm busy with other things at the moment. I do have a couple other questions for you though:
1) Did you try the 'multimodal' configuration from imregconfig? Because MutualInformation is a noisy metric, pairing MutualInformation with RegularStepGradientDescent can be unstable from for some input images. Sometimes it works fine. A more typical configuration is to use the OnePlusOneEvolutionary optimizer with MutualInformation metric.
2) Am I correct that you are solving 2-D problems only? This is not volumetric registration?
3) Are you solving 1000s of independent 2-D registration problems, or does the transformation estimate from one set of images in your dataset tell you anything about the transformation you will expect for subsequent registration problems?
I'll try to mess around with your images when I get a minute and see if I can come up with anything better. In the meantime, you might take a look at the Image Registration GUI from the File Exchange. It is useful for sweeping through the parameters of the metric/optimizer configurations.
- Alex
  3 Comments
Alex Taylor
Alex Taylor on 23 Apr 2013
Lea,
To my eyes, it looks like I can get reasonable registration results by simply accounting for translation in the full sized images. Do you have reason to believe there is also rotation in your camera due to wind? It's hard to tell from only having the two images. You mention "shift" in the camera, which I interpret to mean translation, but I see you are using a 'rigid' model in imregtform...
Lea
Lea on 26 Apr 2013
Edited: Lea on 26 Apr 2013
Alex, thanks so much for your input.
It's probably just translation, you're right. I'm not 100% sure as I didn't set up the camera and don't know how it can move, so I guess I was being extra careful. changing that would be an easy way to make it quicker, I'll investigate the camera rig.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!