Any image, whether Chinese characters or images it there is always a the outermost contour line, the contour line can be a discontinuous (
Don't cut closed curve)
, also can be continuous,
Closed curve)
。
These contours on bitmap image is the actual contour point sets.
Contour tracking method as shown in the figure below: on the dot matrix figure, from left to right and from bottom to top the order of the search.
Search to the first black spots (
Gray is not for 255)
Must be the most left boundary point, the black spots, is set to point A, the boundary point as the starting point.
If the boundaries are continuous, then each boundary point can take advantage of a boundary point before the perspective of the zhang said.
And use tracking principles: starting from the first boundary point, define the initial tracking direction along the upper left, if the top left of the point are black spots, for the boundary point;
Otherwise the search direction clockwise 45 °, that have been found so far, the first black spots.
And then to the black spots on the basis of the previous search direction for the new boundary counterclockwise 90 °, continue to search the same way to the next point.
Front were as the starting point A, the search ends.
We are here to help you! If you close the chatbox, you will automatically receive a response from us via email. Please be sure to leave your contact details so that we can better assist