C++ OpenCv Randomly selecting the pixels having atleast 16 pixels space from one another
Hi Guys,
I have currently an image having dimensions (2800 * 3800), I want to access the pixels randomly and store those pixel's in a vector. What Actually I want is that I should not be be storing or getting pixels which are unique and also these should have a space of 16 i.e consecutive 16 pixels difference between all pixels and Lastly I have to select atleast 300 Pixels.
Suggest me something really robust.
Thanks.
If you want a vector of values that may be pixels values, then use a rng for filling it with values ((example)[http://docs.opencv.org/2.4/doc/tutorials/core/random_generator_and_text/random_generator_and_text.html])... What is the vector for?
@thdrksdfthmn okaye but I want to have combination of 300 pixels having gap of atleast 16 pixels. And If I generate random number for 3800 or 2800 i cant get unique pixels becasuse 300*16 is greater than both 3800 and 2800..!! any suggestion to have a combine Rows & Cols. could be utilize then we can have more unique combinations.
Ok, what I meant is: a pixel is usually 0..255, so you have to generate a value between 0 and 255 and push it in the vector, when you have 16 (or how many you want) you do the thing with the vector, for example you put it in a cv::Mat. But I think I misunderstood... What you want is to have at least 300 positions that are not closer than 16 pixels one to another?
@thdrksdfthmn I want is to have at least 300 positions that are not closer than 16 pixels one to another. Also my image MAt has 2800 rows and 3800 columns.