I need to automate a job. The job is as follows:
The Setup: I am presented with various pictures. Lets assume the pictures are in some picture format, and I can use Photoshop to save them as any type of file that I want. Each picture contains a thick contiguous line, with small follicles coming off of it at various points. Think of a highway with roads branching out, or a tree with branches (but no sub-branches), or even a vein with little capillaries coming off of it.
The Constraints: Since the pictures are likely to be scanned or enlarged, or contain imperfections -- they will not be purely b/w, but will have shades of grey. Also, the branches DO NOT branch out further, and there is no need to count beyond the main stem. Finally, the main stem is visibly and clearly the thickest, and possibly the darkest of all lines present in the picture.
The Goal: To automatically tell the number of branches coming off the main stem, with a margin of error +-20% (but the less error the better).
Why: There are either too many branches to count manually, they are too tiny, or there are way too many such pictures to do it manually in a reasonable amount of time.
How would I tackle this task? I am thinking of various approaches...
1) Using a pre-existing application to analyze the branches in the picture. Does such application exist? For example, MicroStation can draw coordinates visually. But I need to do this in reverse -- to analyze a picture as data.
2) Using a pre-existing application to get rid of the "noise" in the picture, keeping only the largest contiguous object within the field.
3) Writing a program to do #1 or #2 myself. For this I need the following question answered: How do I convert a picture to data? Obviously, most formats use some form of compression to store pixel info. I need to find a decompressed format, or write a program to decompress it. Then i need to be able to interpret the data for every pixel -- color and location.
4) Perhaps I am overcomplicating things and there is an easier way to do this. Remember: The key is doing it simply, not necessarily doing it automatically all the way.
Thanks all.
The Setup: I am presented with various pictures. Lets assume the pictures are in some picture format, and I can use Photoshop to save them as any type of file that I want. Each picture contains a thick contiguous line, with small follicles coming off of it at various points. Think of a highway with roads branching out, or a tree with branches (but no sub-branches), or even a vein with little capillaries coming off of it.
The Constraints: Since the pictures are likely to be scanned or enlarged, or contain imperfections -- they will not be purely b/w, but will have shades of grey. Also, the branches DO NOT branch out further, and there is no need to count beyond the main stem. Finally, the main stem is visibly and clearly the thickest, and possibly the darkest of all lines present in the picture.
The Goal: To automatically tell the number of branches coming off the main stem, with a margin of error +-20% (but the less error the better).
Why: There are either too many branches to count manually, they are too tiny, or there are way too many such pictures to do it manually in a reasonable amount of time.
How would I tackle this task? I am thinking of various approaches...
1) Using a pre-existing application to analyze the branches in the picture. Does such application exist? For example, MicroStation can draw coordinates visually. But I need to do this in reverse -- to analyze a picture as data.
2) Using a pre-existing application to get rid of the "noise" in the picture, keeping only the largest contiguous object within the field.
3) Writing a program to do #1 or #2 myself. For this I need the following question answered: How do I convert a picture to data? Obviously, most formats use some form of compression to store pixel info. I need to find a decompressed format, or write a program to decompress it. Then i need to be able to interpret the data for every pixel -- color and location.
4) Perhaps I am overcomplicating things and there is an easier way to do this. Remember: The key is doing it simply, not necessarily doing it automatically all the way.
Thanks all.