![]() |
IPSDK
4_1_0_2
IPSDK : Image Processing Software Development Kit
|
Solves an overdeterminated system Ax=b for each pixel using a QR decomposition. More...
| IPSDKIPLLINEARALGEBRA_API image::ImagePtr | ipsdk::imaproc::la::qrSolverImg (const image::ImageConstPtr &pInSeqImg1, const image::ImageConstPtr &pInSeqImg2, const ipUInt32 inNbFeatures) |
| wrapper function for Solves an overdeterminated system Ax=b for each pixel using a QR decomposition More... | |
| IPSDKIPLLINEARALGEBRA_API void | ipsdk::imaproc::la::qrSolverImg (const image::ImageConstPtr &pInSeqImg, const image::ImageConstPtr &pInSeqImg2, const ipUInt32 inNbFeatures, const image::ImagePtr &pOutSeqImg) |
| wrapper function for Solves an overdeterminated system Ax=b for each pixel using a QR decomposition More... | |
Solves an overdeterminated system Ax=b for each pixel using a QR decomposition.
In some cases, it can be necessary to find the parameters of an analytic model. States before and after applying the model are known, but the way the data are transformed is a black box. A common example is finding the motion field between two images. In that example, positions in both images are known but we want to model the displacement for all pixels
Such a transform can be expressed as an overdetermined linear system
. Where
is a set of data, covering several features (for example gratients) on several images,
is a known result we want to reach with an estimate of the linear model parametrized by the coefficients of
.
We have here more equations than unknowns. The most ordinary way to solve the solution is the least squares method :
To efficiently achieve this calculation, it is possible to decompose
into two matrices
and
. We can rewrite the problem :
The first advantage of this factorization is that
, we can rewrite the previous equation :
The second advantage is that
is diagonal, we can easily solve the system. We choose the Householder reflection to achieve the decomposition.
Given two images InSeqImg1 and InSeqImg2, this algorithm solves the system to find the parameters x, stored in the image OutRealSeqImg.
The input image InSeqImg1 is assigned to
, whereas the vector
is represented by InSeqImg2. For each pixel, the coefficients are stored along the temporal dimensions. In the case of InSeqImg1, we use a row-major representation of the matrix
.
The temporal size of
equals the temporal size of
multiplied by the temporal size of
, and the temporal size of
equals the number of features used in the linear system.
Attribute description for algorithm :
| Name | ToolTip | Default Initializer |
|---|---|---|
| ipsdk::imaproc::attr::InSeqImg1 | [Input] First input image sequence | X |
| ipsdk::imaproc::attr::InSeqImg2 | [Input] Second input sequence image | X |
| ipsdk::imaproc::attr::InNbFeatures | [Input] target number of features to be detected by algorithm | X |
| ipsdk::imaproc::attr::OutRealSeqImg | [Output] Real sequence image | customOutput (_pOutRealSeqImg, outputQRSolver(_pInSeqImg1,_pInNbFeatures)) |
Global rule description for algorithm :
ipsdk::imaproc::customImageProperty (_pInSeqImg2,
matchQRSolverInput (_pInSeqImg1,_pInNbFeatures)) &&
ipsdk::imaproc::customImageProperty (_pOutRealSeqImg,
matchQRSolverOutput (_pInSeqImg1,_pInNbFeatures))
| IPSDKIPLLINEARALGEBRA_API image::ImagePtr ipsdk::imaproc::la::qrSolverImg | ( | const image::ImageConstPtr & | pInSeqImg1, |
| const image::ImageConstPtr & | pInSeqImg2, | ||
| const ipUInt32 | inNbFeatures | ||
| ) |
wrapper function for Solves an overdeterminated system Ax=b for each pixel using a QR decomposition
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
| IPSDKIPLLINEARALGEBRA_API void ipsdk::imaproc::la::qrSolverImg | ( | const image::ImageConstPtr & | pInSeqImg, |
| const image::ImageConstPtr & | pInSeqImg2, | ||
| const ipUInt32 | inNbFeatures, | ||
| const image::ImagePtr & | pOutSeqImg | ||
| ) |
wrapper function for Solves an overdeterminated system Ax=b for each pixel using a QR decomposition
| ipsdk::processor::IPSDKBaseProcessingException | on failure |
1.8.14