suggestion with program design - jpeg file interpreter
I'm trying to come up with a way to easily measure the surface area of a leaf. It occurred to me that I could scan the leaf and then count the number of pixels in the image. I have a scanner that will produce a jpeg file.
Any suggestion for how to turn that file into something that would be "countable"?
Thanks,
Ken
Re: suggestion with program design - jpeg file interpreter
How would you want to count the leaf? Colors? Angles? It's possible, but if you do snowflakes, then none are the same...
Re: suggestion with program design - jpeg file interpreter
I would be scanning a dark image against a white background so I think I could just count anything that was non-white (or some other measure of non-whiteness). The scanner is pretty good at identifying forground from background when cropping the image. In that way I could equate the image width in pixels to the measured width of the leaf. That would give me a conversion factor from pixels to inches and total pixels to inches squared.
Re: suggestion with program design - jpeg file interpreter
I just reread your post and see that I didn't quite answer it. I would want to count the number of "dark" pixels in the image.
Re: suggestion with program design - jpeg file interpreter
If you load the image into a PictureBox, it will then have accessible pixels that you can iterate through. You can also load it into an StdPicture object, then create a memory DC. Either way, the GetPixel API will retrieve the color of any pixel.
Re: suggestion with program design - jpeg file interpreter
Thanks! that should work!