Answer the question
In order to leave comments, you need to log in
How can I get the outline of an image?
Colleagues good day, I have a question apparently rhetorical, but still. The bottom line is, there is a PNG at the input, here's an example:
Image - transparent background + some kind of figure (yellow))). This image has the exact size and some coordinates for positioning on the map. The question arose, is there a way to get the contour of this figure?
Those. I get such a picture at the input, and at the output I get JSON with the coordinates of the polygon. Converting screen coordinates to geographic coordinates is not a problem. The problem is getting the outline.
I would appreciate any advice on the subject. Thank you in advance.
Answer the question
In order to leave comments, you need to log in
Contours can be selected in several ways.
For example, using the Sobel filter. First, binarize the image, and then go through this filter. It just highlights the borders of the image. After that, you can apply an erosion filter, or binarize again to filter out the gray tones.
https://habr.com/en/post/114452/
Here the images from the cadastre are converted into georeferenced contours.
https://github.com/rendrom/rosreestr2coord
Recently, everyone has become lazy and is doing it through opencv, but in general, read here - https://en.wikipedia.org/wiki/Connected-component_... implementation of the sea:
https://trackingjs.com/
https://github. com/bramp/Connected-component-labelling
blog.acipo.com/blob-detection-js
in general google to help
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question