Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

5.x merge 4.x #3837

Merged
merged 6 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 0 additions & 21 deletions modules/cudaimgproc/src/histogram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,24 +553,6 @@ namespace
};
}

class OldNppStreamHandlerForEvenLevels
{
public:
explicit OldNppStreamHandlerForEvenLevels(Stream& newStream)
{
oldStream = nppGetStream();
nppSafeSetStream(oldStream, StreamAccessor::getStream(newStream));
}

~OldNppStreamHandlerForEvenLevels()
{
nppSafeSetStream(nppGetStream(), oldStream);
}

private:
cudaStream_t oldStream;
};

void cv::cuda::evenLevels(OutputArray _levels, int nLevels, int lowerLevel, int upperLevel, Stream& stream)
{
const int kind = _levels.kind();
Expand All @@ -583,9 +565,6 @@ void cv::cuda::evenLevels(OutputArray _levels, int nLevels, int lowerLevel, int
else
host_levels = _levels.getMat();

// Update to use NppStreamHandler when nppiEvenLevelsHost_32s_Ctx is included in nppist.lib and libnppist.so
OldNppStreamHandlerForEvenLevels h(stream);

nppSafeCall( nppiEvenLevelsHost_32s(host_levels.ptr<Npp32s>(), nLevels, lowerLevel, upperLevel) );

if (kind == _InputArray::CUDA_GPU_MAT)
Expand Down
2 changes: 2 additions & 0 deletions modules/xfeatures2d/include/opencv2/xfeatures2d.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1213,6 +1213,8 @@ class CV_EXPORTS_W TBMR : public AffineFeature2D
CV_WRAP virtual float getScaleFactor() const = 0;
CV_WRAP virtual void setNScales(int n_scales) = 0;
CV_WRAP virtual int getNScales() const = 0;

CV_WRAP String getDefaultName() const CV_OVERRIDE;
};

/** @brief Class implementing the BRISK keypoint detector and descriptor extractor, described in @cite LCS11 .
Expand Down
7 changes: 6 additions & 1 deletion modules/xfeatures2d/src/tbmr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,11 @@ void TBMR_Impl::detectAndCompute(
useProvidedKeypoints);
}

String TBMR::getDefaultName() const
{
return (Feature2D::getDefaultName() + ".TBMR");
}

Ptr<TBMR> TBMR::create(int _min_area, float _max_area_relative, float _scale,
int _n_scale)
{
Expand All @@ -581,4 +586,4 @@ Ptr<TBMR> TBMR::create(int _min_area, float _max_area_relative, float _scale,
}

} // namespace xfeatures2d
} // namespace cv
} // namespace cv
5 changes: 3 additions & 2 deletions modules/ximgproc/src/find_ellipses.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,9 +1218,10 @@ void EllipseDetectorImpl::getTriplets413(VVP &pi, VVP &pj, VVP &pk,
}
}

void EllipseDetectorImpl::preProcessing(Mat1b &image, Mat1b &dp, Mat1b &dn) {
void EllipseDetectorImpl::preProcessing(Mat1b &src, Mat1b &dp, Mat1b &dn) {
// smooth image
GaussianBlur(image, image, _kernelSize, _sigma);
Mat image;
GaussianBlur(src, image, _kernelSize, _sigma);

// temp variables
Mat1b edges;// edge mask
Expand Down