Question about the target number in image segmentation (solved. Thank you for your ideas)

Source: Internet
Author: User
Topic

As the research focus is on computer image processing, A Study on Image Segmentation is currently underway. The process of splitting the target image from the original image has basically been completed. Now we are numbering the target image, and I am using the four adjacent domain labels.AlgorithmThe algorithm is self-implemented, but now there is a problem: the target image count cannot cover all the target images, and some of them are missed. Now, we will release the experiment results and Algorithm Implementation ideas. If the person is doing this or has a good idea, leave a message to discuss it.

Original and split Images

This is the target image obtained from the original image using the segmentation algorithm, as shown below:

Split image (Black is the target image, white is the background ):

How to Implement the target counting algorithm (currently, the counting is inaccurate)

1. The algorithm adopts the four adjacent domain determination method.

The following method is used to determine the point in which each pixel value is the target pixel value:

Traverse the left and top points of the point respectively. If the left and top points are both background points, they are marked as new numbers. If the pixel value of one of the left and top points is not the background point, use the number of This vertex as the number of the current vertex. If neither the left vertex nor the top vertex is the background vertex, the left vertex, the top vertex, and the current vertex are numbered according to the smallest number of the two vertices.

2. Revision

The following algorithm is used to revise each target point in an image:

Traverse the top, bottom, left, and right adjacent contacts of the target point. If the four adjacent contacts are background points, the number of the point does not need to be modified. If at least one of the four points is the target point, sort these points and the current point, find the smallest number, and correct the number of all the target points to the smallest number.

3. Counting Process

To traverse each target point in the image, we need to maintain an array of numbers A. If a number does not exist in a, it is considered that the number has not been numbered, write the number of the vertex on the image, and add the vertex to the array.

Effect after completion

Note: a large majority of targets have been numbered, but some of them have not yet been numbered. The problem is that I cannot figure out the problem at that stage. Is it an algorithm problem? Or are there problems with number determination? It's getting bored now ....

Problem

The key to the above problem lies in the third part. The equivalence class occurs during the counting process, which leads to inaccurate counting results.

The explanation for the equivalence category in Baidu encyclopedia is:

Equivalence Class)

In mathematics, given an equivalent relationship between a set X and X ~, Then, the equivalence class of one element a in X is a subset of all elements with a medium price of A in X: A = {X; x ~ A}

For detailed explanations, see the explanation of equivalence classes in Baidu encyclopedia.

Processing effect after adding the processing equivalence class

Thanks

Here, I would like to thank yuanyou @ xiaotie for providing me with an understanding of his ideas. I also want to thank all the friends who posted messages on my blog for providing different ideas, so that I can learn different algorithm ideas.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.