Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Measuring correlation between original image and binary image

It doesn't make sense to me to be correlating against your input image.

 

If I understand you correctly you want the "best" threshold.  So your correlation should be not against the input image (which is not a measure of the best threshold) but against another binary image which defines what you would hope the output of the thresholding would be.  Maybe you need to define this optimal image manually.

 

You can do the correlation using IMAQ Correlate, but there might be better or simpler ways to define the quality of the threshold.  For example, you might say you want to maximise the number of threshold pixels that are also selected in the optimal image, and minimise the number that are only in one image - this can be computed just by counting.

 

But in any case, you need some definite idea of what the threshold should be giving so that you can measure how close it is to that, and the input image is not that target.

0 Kudos
Message 11 of 24
(2,158 Views)
for two binary image if you multiply them to each other the pixel that are same in two image remain 1 and other will become zero
so you can find difference between threshold method by this way
Message 12 of 24
(2,147 Views)

hi gregs , can you make it more simplified to me ? i couldn't understand you exactly , thanks

0 Kudos
Message 13 of 24
(2,142 Views)

use this vi to compare bettwen throshold

0 Kudos
Message 14 of 24
(2,139 Views)

Hi Hatef ,
something wrong in the program , it doesn't work properly, can you take some screenshots so i can see the results please ?

0 Kudos
Message 15 of 24
(2,133 Views)

To do what you want, just multiply the two images together using IMAQ Multiply, then get the average pixel value using IMAQ Quantify.

 

This won't really help you, though.  The larger the thresholded areas are, the larger the correlation value will be.  Even if you subtract an average value from the original image, the information won't be useful.  Everything will just shift accordingly.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 16 of 24
(2,123 Views)

I compare to different  t threshold ing method with this vi 

for example image bellow show that if you use inter- class variance method you will be have some more pixel to be inside the threshold that using moment method

the white pixels in the image show the pixel that are inside the threshold range for inter class variance but is not inside the range of threshold  for moment

 

the1.png

 

0 Kudos
Message 17 of 24
(2,115 Views)

Also this vi test result show that there is no difference to your image to use wheatear entropy or moment method the result will be same the black image of difference show that there is no difference for your image in this two method   

th2.jpg

0 Kudos
Message 18 of 24
(2,113 Views)

good morning hatef , 
in order to prove the best thresholding method i need to compute a degree of resemblance , seeing the difference only won't help , i need a computed result that proves the efficiency of the threshold method 

0 Kudos
Message 19 of 24
(2,100 Views)
for resemblance you have to have reference image in binary mode. do you have such reference image?! if you have it is easy to do if you do not have such image first you have to create on of them to make it reference image
0 Kudos
Message 20 of 24
(2,090 Views)