matlab,image-processing,edge-detection,mathematical-morphology,connected-components

You are assuming CC is an array but it's actually a structure. Specifically, this is what the docs say about bwconncomp: bwconncomp Find connected components in binary image. CC = bwconncomp(BW) returns the connected components CC found in BW. BW is a binary image that can have any dimension. CC...

c,image,image-processing,mathematical-morphology,image-morphology

The culprit is your if statement inside the second nested for loop blocks: for(int j = -limit; j <=limit ; j++) { for(int i = -limit; i <=limit ; i++) { if(*(SE + (j+1)*m + (i+1) ) > 0) { pixelvalue = (*(SE + (j+1)*m + ((2*limit)-(i+1)) )) (Image.at<unsigned char>(y+j,x+i));...

c++,math,mathematical-morphology

Answering my own question. Actually, I followed the idea of sbabbi using a list of intervals coming from boost/numeric/interval, representing the union of intervals. Here is an example : typedef boost::numeric::interval_lib::rounded_math<double> RoundedPolicy; typedef boost::numeric::interval_lib::checking_base<double> CheckingPolicy; typedef boost::numeric::interval_lib::policies<RoundedPolicy,CheckingPolicy> IntervalPolicies; typedef boost::numeric::interval<double,IntervalPolicies> interval; //... bool...

image-processing,mathematical-morphology

This is expected behavior since openings and closings are idempotent operations. An operation is idempotent if, whenever it is applied twice to any value, it gives the same result as if it were applied once: f(f(x)) = f(x). Openings are operators on lattice L that are idempotent, increasing, and anti-extensive...

python,image-processing,morphological-analysis,mathematical-morphology,astropy

If i have understood the problem right you would like to keep the blobs while removing the long strands that pass around or through the object. The simplest test i would suggest is using a simple morphological opening (erode and then dilate) that has a radius larger than the thickness...