- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
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
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
ok, thanks.
the problem was in step parameter.
Ettore.
the problem was in step parameter.
Ettore.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page