The Wayback Machine - https://web.archive.org/web/20200526114805/https://github.com/opencv/opencv/issues/9788
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

Error in the documentation for cv::getRectSubPix. #9788

Open
csukuangfj opened this issue Oct 6, 2017 · 1 comment
Open

Error in the documentation for cv::getRectSubPix. #9788

csukuangfj opened this issue Oct 6, 2017 · 1 comment

Comments

@csukuangfj
Copy link
Contributor

@csukuangfj csukuangfj commented Oct 6, 2017

System information (version)
  • OpenCV => :master:
Detailed description

The documentation for cv::getRectSubPix is outdated.

Please refer to https://github.com/opencv/opencv/blob/master/modules/imgproc/include/opencv2/imgproc.hpp#L2471

There is no dst in the function parameters.

The documentation says it supports to specify the border type, but the
function itself currently does not support it, as there is no such a parameter
in the function declaration.

In addition, it does not specify the number of channels supported. But
in the implementation, it requires a single channel or 3-channel input.

Please refer to
https://github.com/opencv/opencv/blob/master/modules/imgproc/src/samplers.cpp#L374

@fakabbir
Copy link
Contributor

@fakabbir fakabbir commented Oct 17, 2017

It seems to be outdated but still usefull, if we look at the code

CV_IMPL void
cvGetRectSubPix( const void* srcarr, void* dstarr, CvPoint2D32f center )
{
    cv::Mat src = cv::cvarrToMat(srcarr);
    const cv::Mat dst = cv::cvarrToMat(dstarr);
    CV_Assert( src.channels() == dst.channels() );

    cv::getRectSubPix(src, dst.size(), center, dst, dst.type());
}

and

void cv::getRectSubPix( InputArray _image, Size patchSize, Point2f center,
                       OutputArray _patch, int patchType )

CV_IMPL void cvGetRectSubPix uses src and dst notation. So will it be good to total remove dst ?

Also indication for sinlge/three channel is needed as the assertion takes place

CV_Assert( cn == 1 || cn == 3 );

fakabbir pushed a commit to fakabbir/opencv that referenced this issue Oct 17, 2017
The function name is corrected to GetRectSubPix since, it uses the notation
of src, dst and center. Also added the number of channel assertion criteria.
fakabbir pushed a commit to fakabbir/opencv that referenced this issue Oct 23, 2017
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.
fakabbir pushed a commit to fakabbir/opencv that referenced this issue Oct 23, 2017
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.
vpisarev added a commit that referenced this issue Oct 30, 2017
* Error in the documentation for cv::getRectSubPix. #9788
The function name is corrected to GetRectSubPix since, it uses the notation
of src, dst and center. Also added the number of channel assertion criteria.

* Error in the documentation for cv::getRectSubPix. #9788
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.

* Error in the documentation for cv::getRectSubPix. #9788
Replace dst with patch in the formula, reverted function name to
getRectSubPix, removed BorderTypes comment line due to no explicit call
to the function found.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.