|
-
September 22nd, 2009, 05:22 PM
#1
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
-
September 22nd, 2009, 06:55 PM
#2
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...
-
September 22nd, 2009, 07:55 PM
#3
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.
-
September 22nd, 2009, 07:56 PM
#4
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.
-
September 24th, 2009, 08:05 AM
#5
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.
Please remember to rate the posts and threads that you find useful.
How can something be both new and improved at the same time?
-
September 24th, 2009, 06:38 PM
#6
Re: suggestion with program design - jpeg file interpreter
Thanks! that should work!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|