Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to obtain 256 bins/pixels from an LBP image?
    primarykey
    data
    text
    <p>I am implementing uniform LBP in C. But I am confused regarding the concept. I have implemented LBP. Suppose i have an image of 512*512 dimensions. After LBP it will be 510*510. Now how to get 256 bins/pixels from this LBP image. </p> <pre><code>for(i=1; i &lt; image_src-&gt;width - 1; i++) { for(j=1; j &lt; image_src-&gt;height - 1; j++) { const unsigned char center = image_get_pixel_value(image_src, i, j , 0); unsigned char code = 0; if(center &lt;= image_get_pixel_value(image_src, i-1, j-1 , 0)) code += 128; if(center &lt;= image_get_pixel_value(image_src, i-1, j , 0)) code += 64; if(center &lt;= image_get_pixel_value(image_src, i-1, j+1 , 0)) code += 32; if(center &lt;= image_get_pixel_value(image_src, i, j+1 , 0)) code += 16; if(center &lt;= image_get_pixel_value(image_src, i+1, j+1 , 0)) code += 8; if(center &lt;= image_get_pixel_value(image_src, i+1, j , 0)) code += 4; if(center &lt;= image_get_pixel_value(image_src, i+1, j-1 , 0)) code += 2; if(center &lt;= image_get_pixel_value(image_src, i, j-1 , 0)) code += 1; image_set_pixel_value(image_tar, i-1, j-1, 0, code); } } </code></pre> <p>And this is the lookup table:</p> <pre><code>int UniformPattern59[16][16] = { 1, 2, 3, 4, 5, 0, 6, 7, 8, 0, 0, 0, 9, 0, 10, 11, 12, 0, 0, 0, 0, 0, 0, 0, 13, 0, 0, 0, 14, 0, 15, 16, 17, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 18, 0, 0, 0, 0, 0, 0, 0, 19, 0, 0, 0, 20, 0, 21, 22, 23, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 24, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 25, 0, 0, 0, 0, 0, 0, 0, 26, 0, 0, 0, 27, 0, 28, 29, 30, 31, 0, 32, 0, 0, 0, 33, 0, 0, 0, 0, 0, 0, 0, 34, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 35, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 36, 37, 38, 0, 39, 0, 0, 0, 40, 0, 0, 0, 0, 0, 0, 0, 41, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 43, 44, 0, 45, 0, 0, 0, 46, 0, 0, 0, 0, 0, 0, 0, 47, 48, 49, 0, 50, 0, 0, 0, 51, 52, 53, 0, 54, 55, 56, 57, 58 }; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload