Anti Aliasing with image stitching

56 views
Skip to first unread message

Johannes

unread,
Mar 13, 2014, 1:44:32 PM3/13/14
to accor...@googlegroups.com
Hi,

I'm doing some rather simple stitch of two images of a flat area.
This works all fine and well but if the images have an angle to each other the rotated image looks awful at edges. See the attached example.

Now my question: Is there a way to get a better quality?
If so, how could I do it?

Thank you and kind Regards,
Johannes

Example.jpg

César

unread,
Mar 21, 2014, 7:13:25 AM3/21/14
to accor...@googlegroups.com
Hi Johannes!

I noticed the message at CodeProject before I could take a look at the forums. In case anyone else would be interested in helping, I am also posting the conversation here. The original was replied in http://www.codeproject.com/Articles/95453/Automatic-Image-Stitching-with-Accord-NET?msg=4782398#xx4782398xx and is as follows!


Thanks for the interest in the library, and thanks for the report! I think that this problem happens because the blending process doesn't employ any kind of interpolation when constructing the final image. It uses just nearest neighbor, and this might result in the behavior you are seeing (i.e. pixelated images). It should be possible to alter the blending algorithm slightly to use bilinear[^]or trilinear interpolation as least, which might lead to better results. 
 
Here there is an example on how to code bilinear interpolation in C#[^]. If you look at the lines 128 to 140, you will see it basically consists on computing four points, then combining them with the multiplications shown in that block. In order to do the same in the Blend algorithm, I suppose it would be necessary to add the same logic to create a new pixel with the interpolated values here (line 398)[^], and then use the new pixel to compute the blending here (line 404)[^]. I also suppose that line 370 would need to be changed [^]slightly to, instead of using just the nearest neighbor pixel, all four other points would have to be obtained.
 
I am not sure if that would be all that is needed, but that is show I would start doing it. I am not sure if I would be able to code it soon, but I will try to take a look!
 

Regarding the high number of features, perhaps you could also try other techniques for the point matching. There are other sample applications, mainly Image Stitching using FREAK and SURF that might produce less points or might give different speeds depending on the application!

Best regards,
Cesar

Johannes

unread,
Mar 21, 2014, 7:49:20 AM3/21/14
to accor...@googlegroups.com
Hello Cesar,

Thank you very much!
Federico (the poster on codeproject) works with me.
I'll try to implement your suggestions and will then send you the code.

For the point matching I found SURF to be the best working yet.
btw. thank you for those examples (in general, not just stitching), they are most helpful.

Wonderful work you are doing here,
Best regards,
Johannes

Reply all
Reply to author
Forward
0 new messages