I am new to opencv and good at matlab
i want to write equalent of below to opencv
[mm,nn]=size(binaryimage);
bwperim(binaryimage);
Please can any one help
I am new to opencv and good at matlab
i want to write equalent of below to opencv
[mm,nn]=size(binaryimage);
bwperim(binaryimage);
Please can any one help
There is a library for these things: http://opencv.willowgarage.com/wiki/cvBlobsLib
For emulating bwperim you can do
Mat m;
Mat dilated = m.clone(); dilate(dilated,one_pixel_wide_element);
Mat output = dilated - m;
where the one_pixel_wide_element
can be constructed using instructions from opencv:
dilation_type = MORPH_RECT;
dilation_size = 1;
Mat element = getStructuringElement( dilation_type,
Size( 2*dilation_size + 1, 2*dilation_size+1 ),
Point( dilation_size, dilation_size ) );
This gives an outer boundary. For inner boundaries do erode (and m-eroded
).