Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
6 Views

sobel question

Hi all,
i have to do Sobel filtering of a graylvel image (w*h* unsigned char)
Roi is { w,h}
unsigned char source_gray[MAX_SIZE_X*MAX_SIZE_Y];
short int source_gray_16[MAX_SIZE_X*MAX_SIZE_Y];
short int sobel_temp_a[MAX_SIZE_X*MAX_SIZE_Y];
short int sobel_temp_b[MAX_SIZE_X*MAX_SIZE_Y];

ippiConvert_8u16s_C1R(source_gray,w,source_gray_16,w,Roi);
ippiFilterSobelHoriz_16s_C1R(source_gray_16,w, sobel_temp_a, w, Roi);
ippiFilterSobelVert_16s_C1R(source_gray_16,w, sobel_temp_b, w, Roi);
ippiAbs_16s_C1IR(sobel_temp_a, w,Roi);
ippiAbs_16s_C1IR(sobel_temp_b, w,Roi);
ippiAdd_16s_C1IRSfs(sobel_temp_a, w,sobel_temp_b, w, Roi,0);

but the result is not a sobel filter. It seem only radnom data.

i i make the convolution without ippi function the resulting image is ok.

What is wrong in my code?

Thanks to all
Ettore



0 Kudos
2 Replies
Highlighted
6 Views

Hello,

please remember (better to familiarize yourself with IPP manual) that image step parameter is number of BYTES between adjacent image rows. For 16-bit images it is width*sizeof(Ipp16s) ( + optional number of padding bytes, 0 in your particular case).

Regards,
Vladimir

0 Kudos
Highlighted
Beginner
6 Views

ok, thanks.
the problem was in step parameter.

Ettore.

0 Kudos