09-05-2013 07:49 AM - edited 09-05-2013 07:56 AM
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?
09-05-2013 08:01 AM
@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.
09-05-2013 08:03 AM - edited 09-05-2013 08:04 AM
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
09-05-2013 08:11 AM
@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:
Also you can convert your images in to array using imagetoarray vi subtract the two array and check the difference
09-05-2013 08:12 AM - edited 09-05-2013 08:13 AM
Looks like useful but where is block diagram.I can verify.
09-05-2013 08:21 AM
I got the block diagram also but it compares only U8 images.
09-05-2013 08:26 AM
@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 :
09-05-2013 08:40 AM - edited 09-05-2013 08:42 AM
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.
09-05-2013 10:56 AM
@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.
09-05-2013 11:55 AM - edited 09-05-2013 11:55 AM
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,