Login  Register

Re: Generating random points and tallying proportion of points that fall within object

Posted by atawewe on Jun 02, 2014; 4:23pm
URL: http://imagej.273.s1.nabble.com/Generating-random-points-and-tallying-proportion-of-points-that-fall-within-object-tp5007986p5007989.html

Thanks for helping to resolve this challenge!
Your solution does work, because it generates 1000 random points. But I think there's a problem because the output always says: "0 points out of 1000 inside objects of interest". I have tried it out on 3 different images and get the same output.
I have no experience writing macros, but reading through the one you generously wrote to solve my problem, I think the problem is that the code is searching for points for which the x and y coordinates equal 255. My guess is that there needs to be a line of code that extracts the pixel value or the color of that point to determine if it equals 255.