Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Overlaying images on specified point

Solved!
Go to solution

Hello!

 

I have 2 pictures, with many similarities. I would like to overlay them on a specified point, or edge, or some unique feature. Is there any way to choose a point (by hand or by an algorithm) then find the one matching it (or similar to it) on the other image? and then overlay the images according to the matched point? Overlaying algorithm is done, now I need to find correspondences between the two images, and then overlay them according to the similarity.

Thank you!

 

gbbalint

0 Kudos
Message 1 of 11
(4,726 Views)

Hello,

 

i can suggest using template matching (correlation). This can detect objects with scale, rotation and occulsion (depends which algorithm you use). It can detect features with sub-pixel accuracy. I work with this functions all of the time and they perform great (roboust and fast).

 

You have some examples already - try searching for them (geometric matching, pattern matching).

If you come accross any problems, i think i have some examples myself. You could also post the images if you like.

 

Alternatively, you could also do this manually - clicking on the approximate area and finding some distinct features. For example, if this objects are elliptical, you can detect edges in a circular pattern, fit the ellipse and find the centerpoint.

 

Or combination of the above.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 2 of 11
(4,722 Views)

Hello!

 

Thank you! I attached two images, to make it clear. I would like to pick for example the left upper peak of the tea boxes, then overlay them, as the coordinates of the peaks are aligned. It means I may need to cut a bit from one of the images, but it doesn't matter. I looked for examples in the LabVIEW help, but if you think you have a vi. for my problem, I would appreciate if you can send it to me.

 

gbbalint

Download All
0 Kudos
Message 3 of 11
(4,711 Views)
Solution
Accepted by topic author gbvbalint

Hello,

 

I have modified the labview example. Run it, input two images (left, right) then "load" them, select the edge ROI (see the image below) and "search". Then overlay one image over another with transparency ("overlay"). The code is a bit messy, but you can clean it up for your project.

 

image.png

 

You have said that the overlaying algorithm is done, could you please share it? Maybe your solution is more sophisticated and can help me with another project.

 

I hope this helps you.

 

Best regards,

K

 

 


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 4 of 11
(4,698 Views)

Hello!

 

I attached the vi. for the overlaying, however it contains my whole code. It gets the RGB color values from both images, then between interpolates them, and the new RGB values will be the values on the mixed picture. Its slow, because it does it pixel-by-pixel, but after I have the whole program working as I want, I will try to enhance the performance.

Thank you for your help!

 

gbbalint

0 Kudos
Message 5 of 11
(4,686 Views)

BTW, does this program work for colored images? If yes what shoould I modificate? Or I need colorful images in the end.

0 Kudos
Message 6 of 11
(4,676 Views)

You know I need to add the cyan and red colors for 3D feeling. But I have no idea where to add them.

0 Kudos
Message 7 of 11
(4,669 Views)

Once you have two grayscale images that are properly aligned, you can combine using color planes to image.  Use one image as the blue and green inputs, and one as the red input.  The output should be your two color image.

 

Bruce

 

Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 11
(4,663 Views)

I don't really understand, You mean, applying the color planes after I overlayed the two images, or before, when I have two images? For the first image apply the green/blue and for the other the red and then overlay? Or after overlaying?

0 Kudos
Message 9 of 11
(4,652 Views)

Hello!

 

I have a result finally. After some processing I got images like that. The only problem with them that they are very bright.

 

gbbalint

0 Kudos
Message 10 of 11
(4,634 Views)