Answer the question
In order to leave comments, you need to log in
How to convert input image outlines to a set of vectors on openCV?
The general task is a very peculiar "printer" on an arduino.
The goal is to draw pictures, but not like a plotter (linearly), but in a smart way (how, for example, a person would draw it :)
What is:
There is a c ++ program, openCV, which selects image contours with different depths and displays a grayscale matrix - i.e. the image is converted into a matrix in which each element is a value from 0 to 255, where 0 is white, 1 is black (or inverted, it doesn't matter).
This is done so that I can calculate the coordinates of each point/pixel in the image that has a "color" or presence.
This approach is inconvenient for a "smart" printer in that it is necessary to introduce algorithms for clustering points, transformations, adjust the scale relative to the pixels of the image and what will be on paper .. Although if you help, I will only be grateful :)
But the following is
necessary : will allow the selected contours of the input image to be converted into a vector / set of vectors and output, for example, to a file in some readable correct form
. these vectors, not pixels.
In the description of the library, I hardly found information on such vectors, but I can’t apply it.
Please advise what to do or in which direction to look, maybe there is a more competent solution to the problem.
Thank you!
Answer the question
In order to leave comments, you need to log in
Isn't it: potrace
Potrace(TM) is a tool for tracing a bitmap, which means, transforming a bitmap into a smooth, scalable image. The input is a bitmap (PBM, PGM, PPM, or BMP format), and the default output is an encapsulated PostScript file (EPS). A typical use is to create EPS files from scanned data, such as company or university logos, handwritten notes, etc. The resulting image is not "jaggy" like a bitmap, but smooth. It can then be rendered at any resolution.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question