Turn on suggestions

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

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® Integrated Performance Primitives
- Use of Least Square Method on IPP

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

jeremy_74

Beginner

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

02-02-2011
08:03 AM

135 Views

Use of Least Square Method on IPP

I'm writing at the moment a Class for Calibrating Cameras with the Tsai Algorithm. Now I have problems to use the IPP for the solution of the overdetermined linear system of equations (maybe the reason is, that school is date back ;-) )

Well I thought I could use one of the two "Least Squares Problem Function" of the IPP. But my structure of equation is:

[A1n A2n A3n A4n A5n A6n A7n] [x1 x2 x3 x4 x5 x6 x7]

n = 0...Count Of Rows

all Ain and Bn are known an all xi are unknown.

How I have to use the transfer parameters of the ipp functions? Can anybody help me, please?

And - yes I know that I'm bad in mathematic.

Link Copied

4 Replies

jeremy_74

Beginner

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

02-03-2011
01:19 AM

135 Views

1. Step:

ippmQRDecomp_m_32f(&A[0], A-Width*4, 4, pBuffer, &AQDR[0], A-Width*4, 4, 7, height);

2. Step:

ippmQRBackSubst_mv_32f(&AQDR[0], A-Width*4, 4, pBuffer, &B[0], 4, &B[0], 4, 7, height);

I think this is the right way for the solution of this overdetermined linear system of equations.

ippStsDivByZeroErr = Returns an error when the source matrix has an incomplete column rank

Has anyone of you any idear? I'm quite sure about the strides, but this means that the column rank is wrong - what I can not imagine..

jeremy_74

Beginner

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

02-03-2011
07:01 AM

135 Views

In my opinion it seems to be a bug in the IPP or the documentation: it works if I swap srcStride1 and srcStride2 !! I will report this to Intel and don't need any further help. I'm just a little bit confused that I am the first who recognized this bug.

Vladimir_Dudnik

Employee

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

02-03-2011
10:14 AM

135 Views

Vladimir

jeremy_74

Beginner

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

02-04-2011
02:58 AM

135 Views

Ipp32f xdis, ydis;

[bash]//Declaration of the needed matrix:[/bash]

int matrixSize = 7 * m_imagePointX.size();

Ipp32f matrixA[matrixSize];

Ipp32f matrixQDR[matrixSize];

Ipp32f matrixB[7] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};

Ipp32f matrixC[m_imagePointX.size()];

int t;

std::cerr<<"CameraCalib::ExecuteCalib: "<

[bash]//Filling the Matrix[/bash]

for(int i=0; i

t = i*7;

xdis = m_dxs * (m_imagePointX

ydis = m_dy * (m_imagePointY

matrixA

matrixA[t+1] = ydis * m_refPointY

matrixA[t+2] = ydis * m_refPointZ

matrixA[t+3] = ydis;

matrixA[t+4] = -1 * xdis * m_refPointX

matrixA[t+5] = -1 * xdis * m_refPointY

matrixA[t+6] = -1 * xdis * m_refPointZ

matrixC

std::cerr<<"t="<

[bash]//calculation:[/bash]

IppStatus status;

int stride1 = 4*7;

int stride2 = 4;

int matrixHeight = m_imagePointX.size();

Ipp32f buffer[matrixHeight+1];

status = ippmQRDecomp_m_32f(&matrixA[0], stride2, stride1, &buffer[0], &matrixQDR[0], stride1, stride2, 7, matrixHeight);

if (status != ippStsNoErr)

{

std::cerr<<"ippmQRDecomp_m_32f Error Status:"<

}

status = ippmQRBackSubst_mv_32f(&matrixQDR[0], stride1, stride2, &buffer[0], &matrixC[0], stride2, &matrixB[0], stride2, 7, matrixHeight);

if (status != ippStsNoErr)

{

std::cerr<<"ippmQRBackSubst_mv_32f Error Status:"<

}

std::cerr<<"Erfolg bei Berechnung:"<

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

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