06-28-2017 08:03 AM
Hi,
I am working on a project in my laboratory. i will like to compare two pictures which i am grapping with a camera. if the next picture is different than the previous i will highlight the part of the new picture, which are different than the old. do you think it is possible to realise it with labview? i wanted to compare each pixel value( old with new), if they are different i will highlight them. do you think it is the go way?
thank you!!
06-28-2017 08:19 AM
This is possible. Note that there are IMAQ functions that subtract, absolute-value-subtract, or XOR two images. Probably best to be working with gray-scale images ...
Bob Schor
06-28-2017 09:57 AM
You will also have to define what is "same" - i.e., "close enough". Corresponding pixels will almost never be identical from one picture to the next.
06-29-2017 01:37 AM
Hi,
thank you for your Replies. the main Idea is to compare to recognise any changes on pictures, taken by a camera in Labview. I though it was easy to compare the pixel-values.
06-29-2017 07:44 AM
Hey,
like the others said the substraction will not be the problem:
IMAQ Subtract VI - NI Vision 2011 for LabVIEW Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370281P-01/imaqvision/imaq_subtract/
But 2 images will never be the same. There is always noise in the image. So it can be more complicated than you think.
regards
Heinz
06-29-2017 07:48 AM
@moidrissou wrote:
thank you for your Replies. the main Idea is to compare to recognise any changes on pictures, taken by a camera in Labview. I though it was easy to compare the pixel-values.
What we've answered is that it is easy to "compare the pixel values". The "difficult part" is to define what you mean by "compare", how you want to define "different", and what you want to do with it.
If you take images at 30 frames per second with a Web Cam, for example, I am willing to make a small wager (a dime, $0.10) that no two frames will be identical (many sources of "electronic noise", camera or subject movement, etc.). This is probably going to be the "hard part" of your task.
Bob Schor
06-30-2017 03:02 AM
Hey,
thank you for your time. what if i filter the pictures with a Gauß-filter before comparing them. when i compare them, if there is something different in the second picture, i will like to highlight this part. i am going to write a small VI which just compare two pictures, from my computer and i will let you know if i have difficulty.
06-30-2017 03:10 AM
hey,
did you already look into the many examples delivered with labview. Why reeinvent the wheel?
What you are trying to do sounds like a Golden Template Comparsion:
NI Vision: Golden Template Comparison - YouTube
https://www.youtube.com/watch?v=Ux7mQGaEmkI
LabVIEW example:
LabVIEW\examples\Vision\Golden Template Comparison\Golden Template Inspection.vi
Regards,
Heinz
06-30-2017 09:44 AM
It seems like the mode isn't being interpreted correctly and you are actually in Center/Span mode instead of Stop/Start mode.
07-05-2017 01:47 AM
Hey,
i already wrote the first part of my project. I am Using the Gauß Filter to move all details from the pictures before comparing them. and i compared them using subtraction of pixel value. now i wanted to know how i can developp a loop which will compare the same part of both images and highlight the part of the new image, where something has changed. You can look in my code to see what i did until now. may bee pixel to pixel comparison may make my VI work slow?
I was thinking about, if i can divide every image in several Parts and compare each part, instead of comparing each pixel?