Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic threshold method - clustering

Hello -

 

First, Happy holidays to all.

 

I am reading about the different automatic threshold methods in the Vision Concepts manual.  One of the methods is called clustering and it involves calculating the mean of the individual distributions in order to select the the threshold(s).  This method is applicable for deveoping more than just a binary image - It can allow us to divide the image potentially into several colors based it appears on the number of separable clustered gray distributions.

 

gray level distribution.png

 

However, the concepts manual does not discuss how one determines just exactly how a distribution is defined.  I think we must need to know this in order to determine the means of the distribution.   How is NI doing this?  Since the Vision routines use CINs, it is not possible to explore the code. Are the gray distributions assumed (modeled as) guassian or some other distribution so that one can determine start and end points of each distribution from which to calculate the means?

 

Thanks,

 

Don

 

 

0 Kudos
Message 1 of 7
(5,820 Views)

Hi Don,

 

Did you take a look at this information?  I think this is the answer the "how NI is doing it".

 

Thresholding

The threshold value is the pixel value k for which the following condition is true:

μ1 + μ2  = k
2

where μ1 is the mean of all pixel values that lie between 0 and k, and μ2 is the mean of all the pixel values that lie between k + 1 and 255.

 

I do not know if there is a starting point distribution that is used or assumed.  Also, I am not sure how much of this information I can divulge.  Is there a particular reason why you need to know this information?

 

 

Stephen Meserve
National Instruments
0 Kudos
Message 2 of 7
(5,793 Views)

Yes, of course, I read the concepts manual which is where I posted my information from (and you have gotten yours from).

 

I need to know because I was asked this and I have wondered myself.

 

u1 and u2 are determined from distributions but one needs to define the distribution model in order to calculate u1 and u2.  If one does not know the model, how can one calculate the means of the distribution in order to then calculate k?

 

Sincerely,

 

Don

0 Kudos
Message 3 of 7
(5,762 Views)

Hi Don,

 

The automatic thresholding methods are not meant to be used when this sort of depth of knowledge about the methodology is required.  The manual methods should be used when this level of complexity is involved.

Stephen Meserve
National Instruments
0 Kudos
Message 4 of 7
(5,724 Views)

Just to let you know, if you look at the explanations for the other methods of automatic threholding in the Vision Concepts manual, one can understand the strategy related to those. In those other methods, minimization and maximation strategies are clearly explained and it is understood that those are iterative methods in order to come to the correct solution.  So it is unclear to me why the key assumption regarding the clustering method is not better explained based on the fact that the other methods are relatively clearly explained.

 

Sincerely,

 

Don

0 Kudos
Message 5 of 7
(5,645 Views)

From Wikipedia:

 



  • clustering-based methods, where the gray-level samples are clustered in two parts as background and foreground (object), or alternately are modeled as a mixture of two Gaussians

 

The latter is what I was assuming....

0 Kudos
Message 6 of 7
(5,627 Views)

Hi Don,

 

I am going to have to talk to the developers on this one to see what methods we use and if we can release that information.  This may take a bit.  Thanks for your patience.

Stephen Meserve
National Instruments
0 Kudos
Message 7 of 7
(5,614 Views)