Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Visual Computing (Graphics and Gaming)
- Media (Intel® oneAPI Video Processing Library, Intel Media SDK)
- Intel MediaSDK Lens distortion correction (using RAW accelerator) can’t get the same corrected image as PTGUI and Matlab

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

yue_c_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-23-2017
08:52 PM

52 Views

Intel MediaSDK Lens distortion correction (using RAW accelerator) can’t get the same corrected image as PTGUI and Matlab,even using the same parameters: a b c d.

1.The **meida_raw_accelerator_man.pdf** describes the 3^{rd} degree polynomial for correcting lens distortion :

After doing some research and reading articles,we found the polynomial for correcting lens distortion should be:

2.We use polynomial as the correcting polynomial.

Set parameters value: a=0.0925 b=-0.2676 c=-0.0997c=1.2755

Source image: circle.bmp

PTGUI result: result_ptgui.bmp

Matlab result:result_matlab.bmp

MediaSDK result: result_mediasdk_0.bmp

Matlab code:untitle.m

close all; clear all; clc; tic; A = imread('circle.bmp'); img_gray = rgb2gray(A); [m,n,k] = size(A); P =[0.0925 -0.2676 -0.0997 1.2755]; C=[]; x0 = m/2; y0 = n/2; for u=1:m for v=1:n r = sqrt((u-x0)^2+(v-y0)^2); rt = polyval(P,r/x0)*r; if r ==0 C(u,v,1)=A(x0,y0,1); C(u,v,2)=A(x0,y0,2); C(u,v,3)=A(x0,y0,3); else i = fix((u-x0)*rt/r)+x0; j = fix((v-y0)*rt/r)+y0; C(u,v,1)=A(i,j,1); C(u,v,2)=A(i,j,2); C(u,v,3)=A(i,j,3); end end end C = uint8(C); imshow(C); toc;

MediaSDK program: sample_camera_d.exe

MediaSDK command line:

sample_camera_d.exe -i bayer_circle.raw -f bggr -b 16 -w 4000 -h 3000 -lens 0.0925 -0.2676 -0.0997 1.2755 -o result_mediasdk_

PTGUI and Matlab can get the same result with the same params a,b,c and d. But the MediaSDK lens correction fails to get the same result under the same a b c d.

Now ,we call parameters of PTGUI and Matlab as a,b,c,d. The params of MediaSDK are a_{m }b_{m }c_{m }d_{m}.we want to know that :

(1)we know the value of the params a b c and d, how to set the value of a_{m }b_{m }c_{m }d_{m }to get the same corrected image as PTGUI and Matlab.

(2)What’s the relationship between a b c d and a_{m }b_{m }c_{m }d_{m}

_{(3)}Does mediaSDK use polynomial ? If not,what is the mediaSDK polynomial for correcting.And how can we translate a b c d for quick correcting.

ps.does not the sample_camera.exe support the argb16 input format? the problem is described in the topic:

https://software.intel.com/en-us/forums/intel-media-sdk/topic/704495

Link Copied

1 Reply

yue_c_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-23-2017
09:07 PM

52 Views

the source and destination image which is bmp format.And the bayer format of the source image .

thanks.

For more complete information about compiler optimizations, see our Optimization Notice.