- 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
Hi Komal,
You can use WarpAffineCubic instead of ResizeShift with Cubic interpolation. The interpolation used by WarpAffineCubic is not the same cubic interpolation as ResizeShift uses, but the quality of the output image is the similar to the quality of the image produced by ResizeShift. Details of the cubic interpolation used by WarpAffine can be found here: https://software.intel.com/en-us/node/505191
To get the transform similar to ResizeShift, you need to set warp affine coefficients in the following way:
coeffs[0][0] = xFr coeffs[0][1] = 0 coeffs[0][2] = xShift * xFr
coeffs[1][0] = 0 coeffs[1][1] = yFr coeffs[1][2] = yShift * yFr
IPP 9.0 Resize functionality does not support subpixel shifts and scale factors. Scale factors are defined automatically by the ratio of image sizes as dst.width/src.width and dst.height/src.height.
On top of that the resize model is slightly changed, ResizeShift considers image as a set of pixel points and it resizes a number of "distances" between image pixels, while IPP 9.0 Resize considers images as a set of "square" pixels and it resizes a number of such "squares". For example, if we 2x increase 4x4 image, in the first case for image width = 4 we have 3 distances and applying scale=2 we'll have 6 distances and 7 pixels output, while for the second approach we'll have 8 pixels.
Thanks,
Valentin
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Komal,
You can use WarpAffineCubic instead of ResizeShift with Cubic interpolation. The interpolation used by WarpAffineCubic is not the same cubic interpolation as ResizeShift uses, but the quality of the output image is the similar to the quality of the image produced by ResizeShift. Details of the cubic interpolation used by WarpAffine can be found here: https://software.intel.com/en-us/node/505191
To get the transform similar to ResizeShift, you need to set warp affine coefficients in the following way:
coeffs[0][0] = xFr coeffs[0][1] = 0 coeffs[0][2] = xShift * xFr
coeffs[1][0] = 0 coeffs[1][1] = yFr coeffs[1][2] = yShift * yFr
IPP 9.0 Resize functionality does not support subpixel shifts and scale factors. Scale factors are defined automatically by the ratio of image sizes as dst.width/src.width and dst.height/src.height.
On top of that the resize model is slightly changed, ResizeShift considers image as a set of pixel points and it resizes a number of "distances" between image pixels, while IPP 9.0 Resize considers images as a set of "square" pixels and it resizes a number of such "squares". For example, if we 2x increase 4x4 image, in the first case for image width = 4 we have 3 distances and applying scale=2 we'll have 6 distances and 7 pixels output, while for the second approach we'll have 8 pixels.
Thanks,
Valentin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
On top of that the resize model is slightly changed, ResizeShift considers image as a set of pixel points and it resizes a number of "distances" between image pixels, while IPP 9.0 Resize considers images as a set of "square" pixels and it resizes a number of such "squares". For example, if we 2x increase 4x4 image, in the first case for image width = 4 we have 3 distances and applying scale=2 we'll have 6 distances and 7 pixels output, while for the second approach we'll have 8 pixels.so is this applicable for IPP 9.0 WarpAffine() method as well ? Does WarpAffine() method too considers image as a set of "square" pixels ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, this is not applicable for IPP 9.0 WarpAffine() method. It works with image pixels as with points. So the used approach is similar to ResizeShift.
Thanks,
Valentin
- 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
Hi Komal,
Sorry for the delay with the answer, I was on sick leave.
The interpolation IPPI_INTER_CUBIC has the same form as the ippCubic interpolation (https://software.intel.com/en-us/node/505191), but it uses different formulas:
k(x) = (1.0/6.0) * ( {3.0 * (x^3) - 6.0*(x^2) - 3.0*x + 6.0; |x|<1}; {-(x^3) + 6.0*(x^2) - 11.0 * x + 6.0; 1<=|x|<2}; {0; |x|>=2} )
Best regards,
Valentin
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page