Thursday 15 March 2012

Relation between Pixel intensity values of Image and values returned by read_imagef in OpenCL -


Values ​​returned by read_imagef in OpenCL are in the range of 0 to 1, while the pixel intensity range 0 to 255. .. I want to process the intensity values ​​for image segmentation which is based only on intensity values ​​(the operation is done to find differences between two intensity values, sorting, finding the minimum, shuffling e.t.c). How to get these values ​​in the integer form of 0 to 255 (for convenience) ...? Can I multiply every value with 255 or do I have to do something else ...? read_imagef

float4 , And channel data types can be used for images created with UNORM_INT8, UNORM_INT16, SNORM_INT8, SNORM_INT16, HALF_FLOAT and Flat. The conversions are part of the rule, and are given in section 8.3.1.

To answer your question, yes, if your image data type is UNORM_INT8, then you can multiply only by 255.

GPUs are usually faster with UNORM_INT8 with UNSIGNED_INT8 images.

No comments:

Post a Comment