Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

structuring element with erosion

Hi everybody-

I used erosion  (IMAQ Morphology) in a binary image but cluster of pixels looks bigger than original image.
Maybe I should use a 5x5 mask instead of 3x3 mask.
Anybody knows how  to obtain a 5x5 structuring element?

thanks

Mattia
0 Kudos
Message 1 of 5
(3,778 Views)

Dear Mat,

        First you need to determene your IMAQ version and Develpment IDE (LABVIEW,LABWINDOWS or Visual Studio).

In general to create structuring element you may consider:

1-Increase the Image broder (Padding)

2- Create StructureElement Object

3-Use two nested loops to fill all its elements (25 elements)

4-apply the mask

Waleed El-Badry MSc.,MCPD, ISTQB Certified Tester
Assistant Lecturer
Mechatronics Department
Faculty of Engineering
Misr University for Science & Technology



View Waleed El-Badry's profile on LinkedIn

0 Kudos
Message 2 of 5
(3,769 Views)
Dear mat84,

You can find some additional information about using the Erosion Function in the Vision Concepts Manual.

You can also wire a 5x5 array constant to the structuring element input of the IMAQ Morphology function without a problem.

Best Regards,

~Nate
0 Kudos
Message 3 of 5
(3,755 Views)
thank you so much for these helps!

Now it works, but when I use erosion (IMAQ Morphology) it seems to me that the cluster of pixels become bigger, while if I use dilation the cluster become smaller and a lot of pixels went off!...it shouldn`t be the opposite!?

thanks
0 Kudos
Message 4 of 5
(3,752 Views)
Dear Mattia,

You are correct that the normal behavior for an erosion is to make a particle smaller, and for a dilation it is to make the particle bigger. This is normal behavior for binary images where the particle pixel values are = 1 and background pixel values are =0. That is, particle values are white, and the background is black. If you have the opposite image, where the particles are black (0) and the background is white (1), then the functionality of the dilation and erosion functions will be reversed. The Vision Concepts Manual contains more detail in chapter 8 about the definition of a binary image, and shows examples of both dilation and erosion on sample images.

Best Regards,

~Nate


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