I am trying to generate 100 random points within a free-hand selection of a tree canopy. I have tried several macros that I’ve found online but cannot get them to only generate points within the selection. I know that these macros are not tailored to my images and I don’t know how to program a macro from scratch so I’m not surprised that they aren’t working for me.
I am trying to use ROI.contains, but I keep getting errors as I’m not sure that I’m defining X and Y correctly.
My image consists of a free-hand selection with the area outside deleted so that it is all black, there is also no black in the image. I believe that what I have to do is tell ImageJ to generate 100 random points on my image but to also not place points in areas that have an RGB=255.
I have tried converting to binary to make analysis easier, but there are different shades of green in the background and in the canopy itself so the binary images do not properly separate the canopy from the background.
Any help or advice is much appreciated.