Automated objects selection by color and distance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Automated objects selection by color and distance

Pavel Kartashov
I have an image with ~2500 objects of very irregular shape divided by (conditional) colours by 29 classes. Simply there are 2500 objects of 29 colours) All objects board each other without gaps. I have to divide the image into layers (or separate images) with certain conditions:
- number of layers is limited, prefferably four or five;
- all objects on one layer must have minimum distance of X from each other;
- for as many classes as possible the whole class must stay at one layer;
- classes (or objects of same colour) distrubuted between >1 layer are to be distributed in minimum number of layers;

Sure this problem has almost infinite number of solutions. Also it's probable that due to distances and shapes all 29 classes (colours) would be found on every layer (what is not prefferable!).

Do I understand it right that I would have to write a macros to do this and standard version of ImageJ won't work? Sure macros is to have a number of manual inputs like from which colours to start, etc. It seems possible to do this manually but with mistakes, without last condition fulfilled and in a very long time. Unfortunately I can't allocate so many resources and have to automate this - to play with the image and find the acceptable solution.