LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Comparing images

I Want to compare two images, I am able to capture the image using webcam, Now I want to verify that captured image and stored image is same or not?

I will basically capture an image which will be completely blue or red, I want to compare these two images and if matches then test pass else fail.

 

All the necessary software package is installed.

 

how to do this?

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 1 of 17
(3,741 Views)

@Ranjeet_Singh wrote:

I Want to compare two images, I am able to capture the image using webcam, Now I want to verify that captured image and stored image is same or not?

I will basically capture an image which will be completely blue or red, I will compare this with stored image and if matches then test pass else fail.

 

All the necessary software package is installed.

 

how to do this?


You can compare pixels of those two images you may want to make those images of same size, or may be taking difference of red, blue and green values and see if its below some threshold value or not.

0 Kudos
Message 2 of 17
(3,737 Views)

I will capture stored image also using same webcam. Captured image size and all other properties will be same in all persepctive...

How can I compare the pixels? Please elobrate 

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 3 of 17
(3,734 Views)

@Ranjeet_Singh wrote:

I will capture stored image also using same webcam. Captured image size and all other properties will be same in all persepctive...

How can I compare the pixels? Please elobrate 


check this link:

Compare Images Example

 

Also you can convert your images in to array using imagetoarray vi subtract the two array and check the difference

0 Kudos
Message 4 of 17
(3,731 Views)

Looks like useful but where is block diagram.I can verify.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 5 of 17
(3,729 Views)

I got the block diagram also but it compares only U8 images.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 6 of 17
(3,717 Views)

@Ranjeet_Singh wrote:

I got the block diagram also but it compares only U8 images.



@Ranjeet_Singh wrote:

I got the block diagram also but it compares only U8 images.


you can also use IMAQ compare :

IMAQ compare

 

 

0 Kudos
Message 7 of 17
(3,711 Views)

I tried this also but it says invalid image type..My image is of RGB32 as don't have to typecast as it reduses the clarity.

--------------------------------------------------------------------------------------------------------
Kudos are always welcome if you got solution to some extent.

I need my difficulties because they are necessary to enjoy my success.
--Ranjeet
0 Kudos
Message 8 of 17
(3,701 Views)

@Ranjeet_Singh wrote:

I tried this also but it says invalid image type..My image is of RGB32 as don't have to typecast as it reduses the clarity.


If you dont want to typecast , then I guess you can convert the images into array using IMAQ ColorImageToArray vi, subtract the two arrays and see the difference. or else another way is to read those saved images(using read jpeg file vi or png vi) then convert them to rgb values using color to rgb vi and subtracting r , g ,b values from the two images and check if its below some threshold value which can you can set according to your choice.

0 Kudos
Message 9 of 17
(3,678 Views)

As a note- if you're comparing RGB values in some way, you'll need to be VERY careful about lighting conditions/intensity and you'll probably have to add a fairly large error margin.  Features/objects are much easier to detect.

 

Even so, you'll probably want to take a look at the Machine Vision Classification and Searching and Matching palettes and examples. The Match Color Pattern VI is pretty good, but I've never tried to use it with an otherwise empty colored image.

 

If you're using one of the built-in pattern matching algorithms, you'll want more than one sample image- generally the more "good" data you can provide the template, the better the results will be.

 

Could you provide a sample of the images you're trying to compare?

 

Regards,

 

 

Tom L.
0 Kudos
Message 10 of 17
(3,664 Views)