# Tag Info

10

If you are not worried about the speed or exact contour of hand, below is a simple solution. The method is like this : You take each contour and find distance to other contours. If distance is less than 50, they are nearby and you put them together. If not, they are put as different. So checking distance to each contour is a time consuming process. Takes a ...

5

You will want to use the morphological closing operation, which is the erosion of the dilation of an image. This means that you first dilate the image, removing the small 'holes' in the interior of the image, and then you erode the image, shrinking the boundary. If you want the final boundary to be 'smaller' than the original boundary, simply erode more than ...

4

I guess the basic question here becomes - what difference does non-flat structuring elements make w.r.t flat structuring elements ? From the definition of dilation one can see that the structuring element can define a support (like in flat structuring elements) or another function itself (gray scale structuring elements). Look at wiki which defines the ...

4

To fix the connectivity issue, you can try a close operation: cv::Mat structuringElement = cv::getStructuringElement(cv::MORPH_ELLIPSE, cv::Size(40, 40)); cv::morphologyEx( inputImage, outputImage, cv::MORPH_CLOSE, structuringElement ); I doubt that this will produce the results that you want, but you can give it a try.

3

What you are essentially doing is a matched filter. However, thanks to Hough transform, your filter (line) is oriented and therefore I would call it an oriented matched filter. For generating the Bresenham line and sampling the pixels you might want the use the OpenCV line iterator. The simple usage would be similar to: cv::LineIterator it(image, pt1, pt2, ...

3

After couple days of research, I have found another interesting solution. The Similar algorithm for segmentation of overlapping objects is described in this article (the algorithm below is an adaptation for objects of parallelogram shape). It uses properties of the boundary to perform separation. Perhaps someone may find it interesting. Overlapping ...

2

For planar elements (implied by the wording "structuring element") the containment of origin is enough to maintain the properties of anti-extensivity for erosion, and extensivity for dilation as can be found in many texts and you also pointed that out. So, yes, this is enough for the non-negativity for the arithmetic difference (this is directly shown by ...

2

I looked up in Jaehne, Gonzalez, Soille (the one you've posted as well as Mathematical Morphology and Its Applications to Image and Signal Processing) and some other special morphological papers and haven't found neither any design criteria for the structuring element nor any special hints why it has to be symmetrical. Personally I think that a symmetrical ...

2

It looks like you're "oversegmenting" your image. Morphological operations, as bjnoernz has suggested, would help. In particular, a watershedding approach should get closer to what you want than just checking distance (as in python example above). See http://cmm.ensmp.fr/~beucher/wtshed.html.

2

According to this paper, the grayscale dilation of image $I$ by a non-flat structuring element $S$ is defined as follows: $[I ⊕ S](x,y) = \displaystyle\max_{(s,t)∈S}\{I(x-s,y-t)+S(s,t)\}$ Since the origin of the structuring element is in the top right corner, we have that $s∈[0,1]$ and $t∈[-2,0]$ excluding the point $(s,t)=(0,-1)$. So using your example of ...

2

Referring to MATLAB, the basic steps are Determine the connected components: CC = bwconncomp(BW, conn); Compute the area of each component: S = regionprops(CC, 'Area'); Remove small objects: L = labelmatrix(CC); BW2 = ismember(L, find([S.Area] >= P)); At the last step, after obtaining $L$, you might as well retain the component with the largest area ...

2

Looks like you are using Matlab. Try bwareaopen(I, N), where I is the original binary image and N is the estimated size of each unwanted connected region. You can try edit bwareaopen for more details. Basically the algorithm tries to find the size of connected regions. Connected-component labeling with union-find algorithm is expected to get you there.

2

You can use a line structure with 90 degree and a pre-defined thickness to erode the image. Then scan along the x-axis. In each y-axis line, it can be viewed as connection parts if there are more than 4 pixels.

2

I guess this depends on the digital distance transform that one is approximating on the 3d grid and there are various local connectivities possible. There is an implementation in ImageJ here. It would also be good to verify if you are using a non-flat structuring element or a correct 3d structuring element. Read Matlab reference here. In the place of ...

2

You are correct. Erosion of that image with that structuring element should cause all of the 1's to disappear. There are two ways to look at it. One is that only ones that are surrounded by ones will remain. There are no such ones. The other is that you will only have ones remain where you can fit the structure element into a set of ones in the image, ...

1

Morphological Erosion is not associative as dilation. Much like addition is associative but not subtraction. Consider the following basic definitions first:$$(A \ominus B)^C = A^C \oplus \widetilde{B} \tag{1}$$ $$(A \oplus B)^C = A^C \ominus \widetilde{B} \tag{2}$$ where $\widetilde{B}$ is the reflection of kernel $B$ and $A^C$ is the compliment of image $A$...

1

Your data seems to be quite noisy in a sense that there are a lot of holes in the fibers. When you know a typical minimal size of a fiber (probably its widths), you could use a binary closing filter: Dilate the image with a structural element of the typical width of a fiber. Most likely a circle with a diameter equal to the minimal fiber widths could be ...

1

As you said closing is completely defined by a dilatation followed by an erosion with the same structuring element (SE) (respectively opening is an erosion followed by a dilation with the same structuring element). The key point is that is must be the same structuring element and this is much more specific than an erosion followed by a dilatation with ...

1

N-connectedness means that from any pixel to any other within the component, there should exist a path composed of N-connected steps. In other words, as long as two groups have one connected neighbor, they should be merged into a single group. It does not mean a 2 or 3 pixel group, but rather a component which consists of linked pixels. See the ...

1

Morphological operators are primarily defined over binary images where values 0,1 could correspond to areas identified as foreground and background respectively. In your case, you can create a binary image of the region you want to apply the operator on by assigning the "islands" of noisy classified regions to the "foreground" (e.g 4 now becomes the value ...

1

You can think of closing as the dual operator to opening; while opening the image using structuring elemnts $B$ at different sizes gives you values for the Pattern Spectrum $P(k)$ at $k >= 0$, closing will give you values at $k < 0$. These give you an idea of the sizes of "holes" present in the image, rather than the actual objects. Closing the image ...

1

When you use the opening, the overall operation is called a granulometry. However, when you use a closing, it's called an anti-granulometry. It's the dual operation. Combined together, they form the Pattern Spectrum. In your case, if you apply a closing, you will certainly measure the structures between the marbles. However, it is definitely not ...

1

Take a look to this paper from Santiago Velasco, it's about Conditional Toggle Mapping, and it's application to denoising.

1

Why do not use hough transform for finding lines and then finding table region? you can use hough transform to find horizontal and vertical lines. and then extract region of lines.

1

Easy problem. Use silhouette image label (bwlabel), region property (regionprops) and area open (bwareaopen) functions in MATLAB after defining the fraction of the blobs to remove as a function of the area of the largest blob, which is your object. The fragment of the code is as follows: alpha=0.05;%fraction of insignificant blobs in an image [labeledImage,...

1

If you know the median filter principle, that's exactly the same type of operation. For each pixel, you take a look to all the neighbor pixels (defined by the structuring element), and you take the max (dilation) or the min (erosion). Therefore it's like the median filter, but instead of taking the median value, you take the min/max. The mathematical ...

1

Structuring element is mostly supposed to be a binary array (though you can try 0 0 7 7 by yourself). H=[0 0 1 1] u, v are the pixel coordinate at I. In your example, the only pixel value that will change is I(1,2) (the array label starts from 0 instead of 1). I = 1 2 3 3 7 2 Consider I(1,2), from the formula, I(1,2) I(1,1), and I(1,0)...

1

Though I didnot play with the rolling ball algorithm, I guess based on your comparison results it is quite obvious that the two algorithms you are interested in donot have a big difference. This is often the results, when you tried to compare some algorithm which is claimed to be better with some classic algorithm: a paper method is often no better than the ...

1

You are actually drawing the skeleton of the background (brighter region). change cv::threshold(image, image, threshold, 255, cv::THRESH_BINARY); in your codes to cv::threshold(image, image, threshold, 255, cv::THRESH_BINARY_INV); You should be able to get the right skeleton.

1

The asymmetric structuring elements produce a translation dilation on the original set or image. The size of the translation is determined by the offset in the center of the structuring element. For example you could try this using matlab for the dilation operator: I = imread('circles.png'); se = strel('disk',10); %you could see it with se = strel('line',5,...

Only top voted, non community-wiki answers of a minimum length are eligible