I am a Mathematica newbie. I need to sample random points from an image which I have stored in a variable img as:
img = ImageData[image]
Can you guys suggest how I can use a BernoulliDistribution to sample points from the image using Flatten, Map, RandomVariate, Partition and Image functions?
I know a similar problem was discussed here but the solutions there are very convoluted and I am not able to follow them. Thanks a lot for the help and very sorry if this seems like a duplicate post but I have spent the whole evening banging my head over the link to the post above but am not able to reproduce the same with the above functions. Thanks again!