how to convert every point in photo into digital by my own library?
ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to convert every point in photo into digital by my own library?
Hi, I am a C programmer, want to make my own
library (convert every point of photo to digital based on the color of this point), like small OpenCV
how to do that?
There are two very important pieces of information missing from your question:
* The nature of the source photo
* The desired final encoding
If it is a film-to-print photograph then you must first capture it to a digital stream using a device commonly called a scanner. At that point it is digital and your question becomes, "How do I convert one image data format or encoding to another format or encoding using the C language?"
If it is already a digital photo, then it is already... digital, and the question is the same, how to change encoding.
So the basic question, after optional scanning to digital format in the first case, is the same.
Your question as asked has no answer. You must first specify the source encoding and the desired output encoding. It would be helpful if you would describe more completely what you are actually trying to accomplish.
Please see this page, and follow the links at bottom of that page, for guidance in asking a complete question.
astrogeek, thank you and sorry for my incomplete question,
I have a photo of rose and want to
for example:
dot A is at x, y and the color is red (100x, 100y, red)
dot B is at x, y and the color is red (50x, 50y, green)
dot (0x, 0y, white)
and so on.
and save all points in an array.
please see the photo http://imgur.com/a/MkiUa
There are MANY different image formats out there...jpg, png, gif, tiff, bmp, the list goes on and on. Do you want to support them all? Just one? Which one(s)? Most image formats are compressed to save space, so reading it is not just a simple binary parse of the data file. You could use a 3rd party library to read it, or you could use an image conversion tool (eg: imagemagick) to convert to something simple (eg: bmp) and then parse it yourself.
Using PNG is readily portable and working anywhere.
herewith a tutorial example : https://github.com/spartrekus/lodepng
I can give you some tutorial example if you need, using GCC and very simple to use.
xbm file format is also nice since it works on Unix well.
I have a photo of rose and want to
for example:
dot A is at x, y and the color is red (100x, 100y, red)
dot B is at x, y and the color is red (50x, 50y, green)
dot (0x, 0y, white)
and so on.
and save all points in an array.
please see the photo http://imgur.com/a/MkiUa
so it is already digital.
what you describe sounds like a simple bitmap format.
why do you want to reinvent the wheel?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.