Example Analysis of Matlab Hollow scatter Detection
This article mainly introduces the example analysis of Matlab hollow scatter detection, which is very detailed and has a certain reference value. Interested friends must read it!
Problem description
There is a picture like this, how to extract the red circle coordinates inside and connect these coordinates to form two closed loops?
The process display image is imported into oriPic=imread ('test1.png'); subplot (2 and 2) imshow (oriPic) is binarized according to RGB value.
The principle is that there are few kinds of colors in the picture, only red, black and white, while red and white have larger R channel values, so we can use this point for image segmentation.
Delete the part outside the red and construct a binary graph grayPic=rgb2gray (oriPic); grayPic (oriPic (:,:, 1)