- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I found that cvResize works different way while Intel IPP is detected.
Please take a look into attached samples:
0.bmp - original image
1.bmp - resized with cvResize without using Intell IPP
2.bmp - resized with cvResize with using Intell IPP
3.bmp - resized using ippiResize_8u_C1R with the same interpolation algorithm
as used for cvResize for image 2.bmp
2 and 3.bmp are exactly same, but 1.bmp differs from them. Probably the reason
in border mode? But, I can't found any notices how I may specify it for ippiResize.
Please advise, how I may get exact the same result as I have with OpenCV using
Intel IPP.
As input data for both code samples I have CvRect on anImage.
Source code for cvResize:
Source code for ippiResize:
System specifications:
Please take a look into attached samples:
0.bmp - original image
1.bmp - resized with cvResize without using Intell IPP
2.bmp - resized with cvResize with using Intell IPP
3.bmp - resized using ippiResize_8u_C1R with the same interpolation algorithm
as used for cvResize for image 2.bmp
2 and 3.bmp are exactly same, but 1.bmp differs from them. Probably the reason
in border mode? But, I can't found any notices how I may specify it for ippiResize.
Please advise, how I may get exact the same result as I have with OpenCV using
Intel IPP.
As input data for both code samples I have CvRect on anImage.
Source code for cvResize:
[cpp]CvMat *tMat;
CvMat submat;
tMat = cvGetSubRect((IplImage *)anImage, &submat, cvrect);
cvResize(tMat, (IplImage*)image->img_base, CV_INTER_CUBIC);[/cpp]
Source code for ippiResize:
[cpp]IppStatus ippStatus;
IplImage *srcImage;
IppiSize srcSize, dstSize;
int srcWideStep, dstWideStep;
double xFactor, yFactor;
dstSize.width = image->img_width;
dstSize.height = image->img_height;
dstWideStep = image->img_width * image->img_bpp / 8;
srcImage = (IplImage *)anImage;
srcSize.width = srcImage->width;
srcSize.height = srcImage->height;
srcWideStep = srcImage->widthStep;
assert(0 != cvrect.width && 0 != cvrect.height);
xFactor = (double)dstSize.width / cvrect.width;
yFactor = (double)dstSize.height / cvrect.height;
ippStatus = ippiResize_8u_C1R(
(Ipp8u*)srcImage->imageData, srcSize, srcWideStep, *((IppiRect *)&cvrect),
(Ipp8u*)((IplImage *)image->img_base)->imageData, dstWideStep, dstSize,
xFactor, yFactor, IPPI_INTER_CUBIC
);
assert(ippStsNoErr == ippStatus);
[/cpp]
System specifications:
OpenCV - 1.1
Intel IPP - 6.0.2.074
Core 2 Duo T9300
Windows Vista SP1
Visual Studio 2005
Intel IPP - 6.0.2.074
Core 2 Duo T9300
Windows Vista SP1
Visual Studio 2005
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
I would recommend you to look through IPP documentation for details on how to use IPP Resize functions. You also may find discussion thread with attached example code on this forum.
Regards,
Vladimir
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