fixed orb bug commited by mistake
This commit is contained in:
parent
84db4eb6fa
commit
87bbcccea5
@ -1664,7 +1664,7 @@ private:
|
|||||||
GpuMat pattern_;
|
GpuMat pattern_;
|
||||||
|
|
||||||
std::vector<GpuMat> imagePyr_;
|
std::vector<GpuMat> imagePyr_;
|
||||||
cv::Ptr<std::vector<GpuMat>> maskPyr_;
|
std::vector<GpuMat> maskPyr_;
|
||||||
|
|
||||||
GpuMat buf_;
|
GpuMat buf_;
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas
|
|||||||
CV_Assert(mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size()));
|
CV_Assert(mask.empty() || (mask.type() == CV_8UC1 && mask.size() == image.size()));
|
||||||
|
|
||||||
imagePyr_.resize(params_.n_levels_);
|
imagePyr_.resize(params_.n_levels_);
|
||||||
maskPyr_->resize(params_.n_levels_);
|
maskPyr_.resize(params_.n_levels_);
|
||||||
|
|
||||||
for (int level = 0; level < static_cast<int>(params_.n_levels_); ++level)
|
for (int level = 0; level < static_cast<int>(params_.n_levels_); ++level)
|
||||||
{
|
{
|
||||||
@ -502,8 +502,8 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas
|
|||||||
Size sz(cvRound(image.cols * scale), cvRound(image.rows * scale));
|
Size sz(cvRound(image.cols * scale), cvRound(image.rows * scale));
|
||||||
|
|
||||||
ensureSizeIsEnough(sz, image.type(), imagePyr_[level]);
|
ensureSizeIsEnough(sz, image.type(), imagePyr_[level]);
|
||||||
ensureSizeIsEnough(sz, CV_8UC1, (*maskPyr_)[level]);
|
ensureSizeIsEnough(sz, CV_8UC1, maskPyr_[level]);
|
||||||
(*maskPyr_)[level].setTo(Scalar::all(255));
|
maskPyr_[level].setTo(Scalar::all(255));
|
||||||
|
|
||||||
// Compute the resized image
|
// Compute the resized image
|
||||||
if (level != static_cast<int>(params_.first_level_))
|
if (level != static_cast<int>(params_.first_level_))
|
||||||
@ -528,7 +528,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas
|
|||||||
image.copyTo(imagePyr_[level]);
|
image.copyTo(imagePyr_[level]);
|
||||||
|
|
||||||
if (!mask.empty())
|
if (!mask.empty())
|
||||||
mask.copyTo((*maskPyr_)[level]);
|
mask.copyTo(maskPyr_[level]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Filter keypoints by image border
|
// Filter keypoints by image border
|
||||||
@ -537,7 +537,7 @@ void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat& image, const GpuMat& mas
|
|||||||
Rect inner(params_.edge_threshold_, params_.edge_threshold_, sz.width - 2 * params_.edge_threshold_, sz.height - 2 * params_.edge_threshold_);
|
Rect inner(params_.edge_threshold_, params_.edge_threshold_, sz.width - 2 * params_.edge_threshold_, sz.height - 2 * params_.edge_threshold_);
|
||||||
buf_(inner).setTo(Scalar::all(255));
|
buf_(inner).setTo(Scalar::all(255));
|
||||||
|
|
||||||
bitwise_and((*maskPyr_)[level], buf_, (*maskPyr_)[level]);
|
bitwise_and(maskPyr_[level], buf_, maskPyr_[level]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -573,7 +573,7 @@ void cv::gpu::ORB_GPU::computeKeyPointsPyramid()
|
|||||||
|
|
||||||
for (int level = 0; level < static_cast<int>(params_.n_levels_); ++level)
|
for (int level = 0; level < static_cast<int>(params_.n_levels_); ++level)
|
||||||
{
|
{
|
||||||
keyPointsCount_[level] = fastDetector_.calcKeyPointsLocation(imagePyr_[level], (*maskPyr_)[level]);
|
keyPointsCount_[level] = fastDetector_.calcKeyPointsLocation(imagePyr_[level], maskPyr_[level]);
|
||||||
|
|
||||||
ensureSizeIsEnough(3, keyPointsCount_[level], CV_32FC1, keyPointsPyr_[level]);
|
ensureSizeIsEnough(3, keyPointsCount_[level], CV_32FC1, keyPointsPyr_[level]);
|
||||||
|
|
||||||
@ -752,7 +752,7 @@ void cv::gpu::ORB_GPU::operator()(const GpuMat& image, const GpuMat& mask, std::
|
|||||||
void cv::gpu::ORB_GPU::release()
|
void cv::gpu::ORB_GPU::release()
|
||||||
{
|
{
|
||||||
imagePyr_.clear();
|
imagePyr_.clear();
|
||||||
maskPyr_->clear();
|
maskPyr_.clear();
|
||||||
|
|
||||||
buf_.release();
|
buf_.release();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user