Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Find entropy value in an image

Hi All,

I have a grayscale image and the mask of the particles that I am interested in.

I want to find the entropy value of the particles selected in the mask image.

I looked up TSA entropy VI in signal processing toolkit, however I could not find anything for images.

How can I create this? 

Test images are attached. I want to find out the entropy value for each coin shown in the image.

Regards

Aveo

Download All
0 Kudos
Message 1 of 5
(5,035 Views)

Hello,

 

use the attached .vi to calculate the image entropy.

 

Example_VI_BD.png

 

Of course you need to process each coin seperately, but as you've masked them, this is trivial.

 

P.S.: Since log has a base of 2, this is called Shannon entropy. You can use other bases, e.g. e or 10.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
Message 2 of 5
(5,024 Views)

Hi,

Thanks for the vi.

This is great. But how do I tackle the multiple particles problem?

One solution would be to run a for loop that  creates the mask of one particle in each iteration and then uses your vi to find out entropy.

However this might take a lot of time.

Do you have any other alternative for multiple particles?

Regards

Aveo 

0 Kudos
Message 3 of 5
(5,018 Views)

Hello,

 

I don't see how can the calculations for each particle be avoided.

Regarding the speed, it boils down to your specifications. How much speed do you need? I quickly tested an image with 1000 particles (size ~3000x2000 pix) and the calculation time was ~100 ms (low to midrange laptop). That's still 10 frames/s. This includes also thresholding and particle analysis (to get the actual roi's) - see below:

 

a_BD.png

 

This way, you can also track the objects that deviate from average entropy for example.

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 4 of 5
(5,012 Views)

Hi,

Even I believe there is no way to avoid the loop! Smiley Sad

 

0 Kudos
Message 5 of 5
(5,009 Views)