This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sobel functions in IMGLIB are not relevant for HOG

Dear supporter:

Our algorithm team currently requires the information of Histogram of Gradient (HOG) for image processing.  HOG is the combination result of Sobel X(H) , Sobel Y(V)Gradient Magnitude(GM)Gradient Orientation(GO), then Histogram generation.  We'd like to obtain simpler solution of GM thru an idea of absolute(Sobel X)+absolute(Sobel Y), which happens to be able to leverage TI API 

void IMG_sobel_3x3_8
(
const unsigned char *in, /* Input image data */
unsigned char *out, /* Output image data */
short cols, short rows /* Image dimensions */
)

Since our GM here is the combination of abs(Sobel X)+abs(Sobel Y), the addition should be over 255. 

However, as you may see the output data type (unsigned char) has clamped the data larger than 255

to 255

if (O > 255) O = 255; 

Would you please provide a solution by removing the clamping and outputting short data type instead.

We really appreciate your supports.

Joey


  • Joey, 

    Thank you for your post, we'll be working on this issue and let you know of the result as soon as it is possible. I apologize for the delay. 

    -Beverly 

  • Joey, 

    We have been reviewing this function and wanted to make you fully aware of the maximum output value as well as confirm the output you were looking for. 

    For sobel_3x3_8, we wanted to confirm that you are looking for a function that has input data of unsigned char type and outputs data to a short. The limitation on the short data output utilizing the existing sobel_3x3_8 is that it has a maximum value of 32K.

    Let us know when possible and if you have any further input and/or questions. 

    -Beverly

  • Hi, Beverly:

    Your statement regarding to our request is correct, except the maximum output size of 32k seems to

     a bit confusing to us. The TI API, 

    IMG_sobel_3x3_8(

        const unsigned char **n,

        unsigned char *out, <==  we need short (data type)

        short cols,

        short rows

    states the output size should be decided by input cols * (rows-2) -2, so that

    for (i = 0; i < cols*(rows-2) - 2; i++)
    {

    ....

    out[i + 1] = O;

    }

    Thanks a lot for your fully supports,

    Joey from Altek

  • Hi, Beverly:

    If you were talking about the "range" of sign short, the answer is yes to 32K.

    Sorry for the misunderstanding.

    Joey from Altek

  • Joey, 

    Yes, the range of the output value is what I was referring to, sorry for the confusion. 

    -Beverly

    Joey Lin said:

    Hi, Beverly:

    If you were talking about the "range" of sign short, the answer is yes to 32K.

    Sorry for the misunderstanding.

    Joey from Altek

  • 1055.IMG_sobel_3x3_i8_c16.zip

    Joey, 

    Please find attached the modified sobel function: IMG_sobel_3x3_i8_c16  

    It will accept unsigned char input and output short values with a limitation of results in the range of 0-32K due to modifications made on the existing IMG_sobel_3x3_8 function. Test data is included to verify the function. Let us know if you have any questions. 

    -Beverly