Bug fixes in mask output.
Previously, the output mask of inliers could remain completely uninitialized. This fix is the first part of a solution.
This commit is contained in:
parent
b90800f0c7
commit
87c2b8197a
@ -286,7 +286,7 @@ static bool createAndRunRHORegistrator(double confidence,
|
||||
OutputArray _tempMask){
|
||||
Mat src = _src.getMat();
|
||||
Mat dst = _dst.getMat();
|
||||
Mat tempMask = _tempMask.getMat();
|
||||
Mat tempMask;
|
||||
bool result;
|
||||
double beta = 0.35;/* 0.35 is a value that often works. */
|
||||
|
||||
@ -294,10 +294,7 @@ static bool createAndRunRHORegistrator(double confidence,
|
||||
Mat tmpH = Mat(3, 3, CV_32FC1);
|
||||
|
||||
/* Create output mask. */
|
||||
if(!tempMask.data){
|
||||
tempMask = Mat(npoints, 1, CV_8U);
|
||||
}
|
||||
|
||||
tempMask = Mat(npoints, 1, CV_8U);
|
||||
|
||||
/**
|
||||
* Make use of the RHO estimator API.
|
||||
|
@ -512,6 +512,9 @@ static inline int sacInitRun(RHO_HEST_REFC* p){
|
||||
return 0;
|
||||
}
|
||||
|
||||
memset(p->best.inl, 0, p->arg.N);
|
||||
memset(p->curr.inl, 0, p->arg.N);
|
||||
|
||||
/**
|
||||
* LevMarq workspace alloc.
|
||||
*
|
||||
@ -1155,6 +1158,9 @@ static inline void sacUpdateBounds(RHO_HEST_REFC* p){
|
||||
static inline void sacOutputModel(RHO_HEST_REFC* p){
|
||||
if(sacIsBestModelGoodEnough(p)){
|
||||
memcpy(p->arg.finalH, p->best.H, HSIZE);
|
||||
if(p->arg.inl != p->best.inl){
|
||||
memcpy(p->arg.inl, p->best.inl, p->arg.N);
|
||||
}
|
||||
}else{
|
||||
sacOutputZeroH(p);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user