Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

large structuring elements

Hi!

 

I'm working on an application in VB.net. I woudl like to use  GrayMorphology() with a structuring element of 40x40pixels. Here is what I do:

 

 Dim struct As New NationalInstruments.CWIMAQControls.CWIMAQStructuringElement

 struct.SetSize(40, 40)

 Vision.GrayMorphology(Image1, Image2, CWIMAQControls.CWIMAQGrayMorphOperations.cwimaqGrayMorphClose, ElemStruct)

 

previously i do Image2.BorderWidth = 22

 

the closing does not work. 

 

Thanks.

 

 

0 Kudos
Message 1 of 4
(3,403 Views)

In LabVIEW it works.

 

I'm not expert in VB, but I guess that Image2.BorderWidth = 22 may not really (means physically) set the border width.

Look for the function named "ImageBorderSize" or something like that.

 

In additional, all elemenths (or some) in Structuring Element should be equal to 1. If all of them are zeroes, then nothing will be changed in image.

 

Andrey.

 

Message Edited by Andrey Dmitriev on 06-10-2010 07:00 PM
0 Kudos
Message 2 of 4
(3,387 Views)

Sometimes the structuring element needs odd dimensions.  Even dimensions confuse it since there is no center pixel.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 4
(3,373 Views)

I found the solution!

The border width has not to be defined on the destination image but only on the source image.

 

For information, Image.borderWidth works fine.

 

Thanks for your reply!

 

 

0 Kudos
Message 4 of 4
(3,363 Views)