LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

compare the pixel values of two pictures

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!!

0 Kudos
Message 1 of 10
(4,101 Views)

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

0 Kudos
Message 2 of 10
(4,083 Views)

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.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 10
(4,058 Views)

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.

0 Kudos
Message 4 of 10
(4,047 Views)

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

 

0 Kudos
Message 5 of 10
(4,026 Views)

@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

0 Kudos
Message 6 of 10
(4,024 Views)

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.

0 Kudos
Message 7 of 10
(4,005 Views)

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

0 Kudos
Message 8 of 10
(4,000 Views)

It seems like the mode isn't being interpreted correctly and you are actually in Center/Span mode instead of Stop/Start mode.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 10
(3,985 Views)

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?

 

0 Kudos
Message 10 of 10
(3,959 Views)