Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Yuriy
Beginner
53 Views

srcROI isn't support x and y that isn't equal to 0 in ippiResizeSqrPixel_8u_C1R

All examples for ippiResizeSqrPixel contain srcROI started in point (0,0) like below

[cpp]Ipp8u* srcData;
IppiRect srcROI = {0, 0, width, height};[/cpp]

For arbitrary start point (x, y) function returns value ippStsNoOperation, to avoid this I use next code

[cpp]IppiRect srcROI = {x, y, width, height};

...

srcData += widthStep * srcROI.y + srcROI.x;
IppiRect newSrcROI = {0, 0, srcROI.width, srcROI.height};
[/cpp]
System specifications:
Intel IPP - 6.0.2.074

Core 2 Duo T9300
Windows Vista SP1
Visual Studio 2005
0 Kudos
3 Replies
Vladimir_Dudnik
Employee
53 Views

That is expected and correct use of IPP function. The ROI parameter specify size of rectangle of interest and pSrc is pointer to the first pixel of that rectangle.

Vladimir

Yuriy
Beginner
53 Views

If this is expected as correct use of IPP function.

Please explain, why ippiResize support source ROI pointed to arbitrary (x,y) not only to (0,0)?

Also why ippiResizeSqrPixel contains IppiRect structure in prototype if it use only width and height parameters? I think IPP has another type for such purposes - IppiSize, which contains inside only width and height.

For example, please take a look to destination parameter of ippiResize function
[cpp]Ipp8u* pDst, int dstStep, IppiSize dstRoiSize[/cpp]
here you may see dstRoiSize.
Yuri_Tikhomirov__Int
New Contributor I
53 Views

Hi Yuriy,

The API of the function ippiResizesqrPixeldiffers from the interface of the function ippiResize because it use other algorithm for several interpolating modes. Also we consider thatsource and resultant images are located in independent systems of co-ordinates.


The destinationpixels are mapped back to the sourceimage and interpolated if get to it. It looks approximately so:

For (I = dstROI.y; I < dstROI.y + dstROI.height; I++) {
For (J = dstROI.x; J < dstROI.x + dstROI.width; J++) {
xCoordSrc = 1 / xFactor * (I + 0.5) - xShift / xFactor;
yCoordSrc = 1 / yFactor * (I + 0.5) - yShift / yFactor;
if (pixel (xCoordSrc, xCoordSrc)is in srcROI) {
interpolate;
}
}
}

Regards,
Beg