c++ - estimate 2D transformation between two set of points using Ransac -
as know, opencv uses ransac in order solve problem of findhomograph
, return useful parameters homograph_mask
. however, if want estimate 2d transformation means affine matrix, there way use same methodlogy of findhomography
uses ransac , return mask ?
estimaterigidtransform use ransac internally, though parameters fixed @ moment - see code here - https://github.com/opencv/opencv/blob/master/modules/video/src/lkpyramid.cpp
cv::mat cv::estimaterigidtransform( inputarray src1, inputarray src2, bool fullaffine ) { const int ransac_max_iters = 500; const int ransac_size0 = 3; const double ransac_good_ratio = 0.5; // ... // ransac stuff: // 1. find consensus for( k = 0; k < ransac_max_iters; k++ ) { int idx[ransac_size0]; point2f a[ransac_size0]; point2f b[ransac_size0]; // choose random 3 non-complanar points & b for( = 0; < ransac_size0; i++ ) { for( k1 = 0; k1 < ransac_max_iters; k1++ ) {
Comments
Post a Comment