Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

## Re: [Vxl-users] rrel estimation libraries

 Re: [Vxl-users] rrel estimation libraries From: Amitha Perera - 2004-05-28 13:57:54 ```Sancar, Please avoid sending HTML emails to the vxl lists. A number of us use text-based email readers, and it is a lot of effort to read HTML-encoded emails. Sancar ADALI wrote: > I have been using robust estimation libraries in rrel for a while > for finding 2d homography between two sets of points. I added a term > for the residuals of inliers in the objective function of > rrel_ransac_obj. I was wondering whether there's a particular reason > this term wasn't included. The reason is that the RANSAC objective function, by definition, is 0 for inliers and 1 for outliers. And the documentation for that objective function http://paine.wiau.man.ac.uk/pub/doc_vxl/contrib/rpl/rrel/html/classrrel__ransac__obj.html tells you not to use RANSAC anyway. > Here's the objective function where the term I add > is the commented line: > double > rrel_ransac_obj::fcn( vect_const_iter begin, vect_const_iter end, > double scale, > vnl_vector* /*param_vector*/ ) const > { > double sum = 0; > double thres = scale * scale_mult_; > for ( ; begin != end; ++begin ) { > if ( *begin < -thres || *begin > thres ) > sum += 1.0; > //else sum+= vnl_math_sqr(*begin/vnl_math_abs(thres)); > } > return sum; > } With that line added, your objective function becomes a truncated linear loss function. Very similar to the truncated quadratic loss function http://paine.wiau.man.ac.uk/pub/doc_vxl/contrib/rpl/rrel/html/classrrel__trunc__quad__obj.html Try using that instead. You'll probably find it performs similar to your truncated linear function. > I've also made some changes in rrel_homography2d_est like rejecting > homographies that result from fitting four points that are close by, > or those which have matrices with determinant that are lower than > some threshold or higher than a threshold. These are all practical > strategies for finding a valid homography that aren't in the > original random sampling algorithm. > I'm not sure whether these changes should be made to > rrel_ransam_search class or whether these changes should be > incorporated into a derived class though. Please send me feedback > about this. I don't have too much experience in the theory of homography estimation. Is there a way to automatically set these thresholds to be valid for any homography estimation problem? Given enough samples, these estimates should be rejected anyway simply because their cost is higher than a better one. Is the problem that not enough samples are being used? Or that the samples are not random (biased in some way, perhaps)? Is this an artifact of using RANSAC instead of a smoother loss function? I think practical improvements to theoretical algorithms is a good thing. However, I also think that we need to understand a little of why the theory is breaking down first. Perhaps others with more experience in this will also comment. Amitha. ```

 [Vxl-users] rrel estimation libraries From: Sancar ADALI - 2004-05-28 01:21:52 ```
I have been using robust estimation libraries in rrel for a while for finding 2d homography between two sets of points. I added a term for the residuals of inliers in the objective function of rrel_ransac_obj. I was wondering whether there's a particular reason this term wasn't included. If there's no particular reason, I think this term should be added since I've seen a clear improvement in the robust fitting. Here's the objective function where the term I add is  the commented line:

double
rrel_ransac_obj::fcn( vect_const_iter begin, vect_const_iter end,
double scale,
vnl_vector<double>* /*param_vector*/ ) const
{
double sum = 0;
double thres = scale * scale_mult_;
for ( ; begin != end; ++begin ) {
if ( *begin < -thres || *begin > thres )
sum += 1.0;
//else sum+= vnl_math_sqr(*begin/vnl_math_abs(thres));
}
return sum;
}

I've also made some changes in rrel_homography2d_est  like rejecting homographies that result from fitting four points that are close by, or those which have matrices with determinant that are lower than some threshold or higher than a threshold. These are all practical strategies for finding a valid homography that aren't in the original random sampling algorithm. I'm not sure whether these changes  should be made to rrel_ransam_search class or whether these changes should be incorporated into a derived class though. Please send me feedback about this.

 Re: [Vxl-users] rrel estimation libraries From: Amitha Perera - 2004-05-28 13:57:54 ```Sancar, Please avoid sending HTML emails to the vxl lists. A number of us use text-based email readers, and it is a lot of effort to read HTML-encoded emails. Sancar ADALI wrote: > I have been using robust estimation libraries in rrel for a while > for finding 2d homography between two sets of points. I added a term > for the residuals of inliers in the objective function of > rrel_ransac_obj. I was wondering whether there's a particular reason > this term wasn't included. The reason is that the RANSAC objective function, by definition, is 0 for inliers and 1 for outliers. And the documentation for that objective function http://paine.wiau.man.ac.uk/pub/doc_vxl/contrib/rpl/rrel/html/classrrel__ransac__obj.html tells you not to use RANSAC anyway. > Here's the objective function where the term I add > is the commented line: > double > rrel_ransac_obj::fcn( vect_const_iter begin, vect_const_iter end, > double scale, > vnl_vector* /*param_vector*/ ) const > { > double sum = 0; > double thres = scale * scale_mult_; > for ( ; begin != end; ++begin ) { > if ( *begin < -thres || *begin > thres ) > sum += 1.0; > //else sum+= vnl_math_sqr(*begin/vnl_math_abs(thres)); > } > return sum; > } With that line added, your objective function becomes a truncated linear loss function. Very similar to the truncated quadratic loss function http://paine.wiau.man.ac.uk/pub/doc_vxl/contrib/rpl/rrel/html/classrrel__trunc__quad__obj.html Try using that instead. You'll probably find it performs similar to your truncated linear function. > I've also made some changes in rrel_homography2d_est like rejecting > homographies that result from fitting four points that are close by, > or those which have matrices with determinant that are lower than > some threshold or higher than a threshold. These are all practical > strategies for finding a valid homography that aren't in the > original random sampling algorithm. > I'm not sure whether these changes should be made to > rrel_ransam_search class or whether these changes should be > incorporated into a derived class though. Please send me feedback > about this. I don't have too much experience in the theory of homography estimation. Is there a way to automatically set these thresholds to be valid for any homography estimation problem? Given enough samples, these estimates should be rejected anyway simply because their cost is higher than a better one. Is the problem that not enough samples are being used? Or that the samples are not random (biased in some way, perhaps)? Is this an artifact of using RANSAC instead of a smoother loss function? I think practical improvements to theoretical algorithms is a good thing. However, I also think that we need to understand a little of why the theory is breaking down first. Perhaps others with more experience in this will also comment. Amitha. ```