0

I want to detect peaks in a binary image using jocl. The definition of my peak is a combinition of colered pixels (shown in the image)

Image

how to use t_sampler to know pixel color?

const sampler_t smp = CLK_NORMALIZED_COORDS_FALSE | //Natural coordinates
                      CLK_ADDRESS_CLAMP | //Clamp to zeros
                      CLK_FILTER_NEAREST; //Don't interpolate

PS: my image is a binary image

Marco13
  • 53,703
  • 9
  • 80
  • 159
  • By "peak" you mean exactly such a cross-like pattern, consisting of 5 pixels? In general, you can read a pixel with `int4 pixel = read_imageui(sourceImage, samplerIn, posIn)`, as shown in http://jocl.org/samples/JOCLSimpleImage.java – Marco13 Jul 17 '16 at 21:23
  • Yes I used it but my goal is to know the pixel's color. When I extracted the values it was all 0.0 Is this logic? – Nasima Info Jul 19 '16 at 18:34
  • Well, the question is not very clear. Assuming that you can extract the color, as an `int4`. What do you want to do with it afterwards? – Marco13 Jul 19 '16 at 19:13
  • You see the image in my question. I have to detect this peaks by doing a test in each pixel to see the neighbouring pixels. Considering our image as black & white Image so I should find 5 black pixels to extaract the position of the center pixel – Nasima Info Jul 19 '16 at 19:48

0 Answers0