Community
cancel
Showing results for 
Search instead for 
Did you mean: 
giacomo_c_
Beginner
88 Views

warpAffineLinear performance

I'm trying to convert an application built with Ipp 8.0.1 to Ipp 2017.1.
Problem arises with function ippiResizeSqrPixel_16s_C1R removed from current library.
I need precise scale factor and x and y shift control with subpixel accuracy so the substitute function found is warpAffineLinear (are there other options?) with transformation coeffs used for scaling and offset. 
I wrote a simple test program (source code attached ) to verify the performance differences between the old and the new api. This program compares warpAffineLinear and ippiResizeSqrPixel_16s_C1R ( IPP 9.0 legacy libraries version ipp90legacy_win_9.0.0.008) used with LINEAR_INTERPOLATION.

Parameters explored are : 
- image edge size (square images)
- zoom scale factor
- single thread vs multithread (only for warpAffine)

Below there is the output obtained. Last 2 columns show execution time in ms.

1) Observing only single thread cases (lines 0,1,2, 6,7,8, 12,13,14) warpAffineLinear is a little slower than ippiResizeSqrPixel_16s_C1R for zoom factor greater or equal 1 but is VERY SLOWER for zoom factor less than 1 (lines 0,6,12)

2) Using a multi thread implementation with image tiling (8 thread for 8 tiles) warpAffineLinear perform better for scale factors greater or equal than 1 (lines 4,5, 10,11, 16,17) but still there are performance problems with scale factor less than 1 (line 3, 9, 15). For example for a 1024x1024 image with a scale factor of 0.99 (line 3) warpAffine takes 1.28 ms while for a scale factor of 1.01 (line 5) it takes 0.61 ms.

My real application executes thousand of image resize operation with images of size about 1500x1500.

-----------------------------------------------------------------------------------------------------------------------
line  image      scale  threads   warpAffine(ms)   ippiResizeSqrPixel_16s_C1R(ms)
  0   1024     0.9900     1         3.4699         1.2519
  1   1024     1.0000     1         1.3585         1.2664
  2   1024     1.0100     1         1.3355         1.2734
  3   1024     0.9900     8         1.2801         1.4048
  4   1024     1.0000     8         0.5745         1.5947
  5   1024     1.0100     8         0.6185         1.2758


  6   2048     0.9900     1        17.7146         5.2773
  7   2048     1.0000     1         6.2307         5.3990
  8   2048     1.0100     1         6.3813         5.3994
  9   2048     0.9900     8         5.3796         5.5666
 10   2048     1.0000     8         2.7698         5.6583
 11   2048     1.0100     8         2.6872         5.3551


 12   4096     0.9900     1        57.0254         19.7586
 13   4096     1.0000     1        23.9561         20.2563
 14   4096     1.0100     1        23.2165         20.0609
 15   4096     0.9900     8        16.9511         20.3904
 16   4096     1.0000     8        10.6648         20.2441
 17   4096     1.0100     8        10.6935         20.3870

Thank's in advance

 

0 Kudos
1 Reply
Valentin_K_Intel
Employee
88 Views

Hi Giacomo,

Thank you for the information. We will investigate it.

Best regards,
Valentin

Reply