08-07-2017 06:49 AM
Hey,
I want to compare 2 camera Images and highligh the parts of the new Images, which are different than the former Image.
for the beginning, i want to use 2 Images which i load from my Computer:
1) i load 2 Images which have some differences
2) realise with Imaq absolute difference the subtraction of both
3) the result i got is good.
Now i have 2 questions:
1) how can i Highlight the result of the subtraction on the original Image? so that i can Show to the user the parts of the new Image which are different.
2) Can i applied this method (Imaq absolute difference) on realtime Image taken from my camera?
I will now like to read the Images from a camera and do the same Thing to compare them.
you can get a look on my VI and the result of a comparison.
Thank you for your Replies
Solved! Go to Solution.
08-08-2017 09:19 AM
Hi moidrissou,
you basically have programmed most of the steps you need.
1) Use two loops to extract the coordinates of the pixels, which have a value > 0 in the subtracted image. Together with the conditional disable function of the for loop output, you can generate an array of coordinates of different pixels.
2) Then simply use the IMAQ Overlay Points.vi, with the array from step 1 as input. This will create an overlay on the original Image, which highlights all the pixels, which are different between the two images.
3) If you want to use this algorithm on your camera images, simply use the imaq functions to record images and pass them throught the analysis.
4) If you want to use the vision functions on a realtime system you can do this. However, due to their iterative nature nearly all of these vi's are per definition not deterministic.
Cheers
08-09-2017 02:43 AM
Hi Fabian,
Thank you for your reply. I think that is the right way to do it. I will try to convert the first 2 steps into vi, if i have some questions I will post again. I will first work without camera and see how it Looks like.
Again thank you for your developped reply.
08-09-2017 05:53 AM
Hey Fabian,
here is my code to extract coordinates of different Pixels. it doesn't work very well as i espect. can you please tell me what is wrong? If i get the coordinates, i will start with the overlay.
Thank you for helping me.
Idriss
08-09-2017 06:13 AM
Hi Idriss,
see the attached image. You may have to swap x and y.
Cheers
08-09-2017 06:34 AM
Is it necessary to convert the 2D Array from the for Loop into 1D. Because i am getting another error. the sink requests a 1D Array, but my for Loop brings 2D. you can see the Picture.
08-09-2017 06:42 AM
Change the tunnel Mode from Indexing to Concatenating, you can see this also in the image i attached previously.
08-09-2017 07:01 AM
Thank you very much.
I am now getting a Problem with overlay. Something with "Not an Image".
I am sure that i connected the Image source with an Image. you can get a look on my vi.
Sorry for all this questions, i am new in Vision Acquisition.
08-09-2017 08:38 AM
Hey Fabian,
Thank you for your help. It works when i remove the Imaq Dispose vi.
Now i will acquire the Images from the camera and do the same.
Thanks a lot.
Idriss
08-22-2017 04:31 AM
Hey,
I tested my vi with 2 Images from my Computer and it is working as well.
now i replace the Images with Pictures from my Basler camera and as expected i am getting some Problems:
1) the Pictures, which i receive from the camera are always different, even though the are taken under the same conditions and almost the same. for this reason, i will like to filter the Pictures before comparing them. do you think it is the best solution? and should i use the Gauß-filter or which else?
2) the vi is now very slow. I wanted to know if it is better to compare and Highlight the Images with matlab or openCV or C++. i will then build it in my vi. that means i take the camera Pictures with labview and then compare them with a DLL.
you can get a look on my vi, the subtraction sends Pixels, which are always different from 0.