Avoid adding false UMat/GpuMat declaration#20502
Merged
opencv-pushbot merged 1 commit intoopencv:3.4from Aug 6, 2021
Merged
Conversation
Contributor
|
Maybe the problem is not in duplicated blocks, but in missing For example, I was looking at the code generated for //================================
CV_EXPORTS_W bool solve(InputArray src1, InputArray src2, OutputArray dst, int flags = DECOMP_LU);
//================================
static PyObject* pyopencv_cv_solve(PyObject* , PyObject* args, PyObject* kw)
{
using namespace cv;
pyPrepareArgumentConversionErrorsStorage(2);
{
PyObject* pyobj_src1 = NULL;
Mat src1;
PyObject* pyobj_src2 = NULL;
Mat src2;
PyObject* pyobj_dst = NULL;
Mat dst;
PyObject* pyobj_flags = NULL;
int flags=DECOMP_LU;
bool retval;
//...
}
{
PyObject* pyobj_src1 = NULL;
UMat src1;
PyObject* pyobj_src2 = NULL;
UMat src2;
PyObject* pyobj_dst = NULL;
UMat dst;
PyObject* pyobj_flags = NULL;
int flags=DECOMP_LU;
bool retval;
//...
}
}and //================================
CV_EXPORTS_W int solveLP(InputArray Func, InputArray Constr, OutputArray z);
//================================
static PyObject* pyopencv_cv_solveLP(PyObject* , PyObject* args, PyObject* kw)
{
using namespace cv;
pyPrepareArgumentConversionErrorsStorage(2);
{
PyObject* pyobj_Func = NULL;
Mat Func;
PyObject* pyobj_Constr = NULL;
Mat Constr;
PyObject* pyobj_z = NULL;
Mat z;
int retval;
//...
}
{
PyObject* pyobj_Func = NULL;
Mat Func;
PyObject* pyobj_Constr = NULL;
Mat Constr;
PyObject* pyobj_z = NULL;
Mat z;
int retval;
//...
}
pyRaiseCVOverloadException("solveLP");
return NULL;
}With your fix second duplicated block in |
Contributor
Author
|
For 3.4, shouldn't the declaration be CV_EXPORTS_W int solveLP(const Mat& Func, const Mat& Constr, Mat& z);instead? On next where it is CV_EXPORTS_W int solveLP(InputArray Func, InputArray Constr, OutputArray z);I indeed got static PyObject* pyopencv_cv_solveLP(PyObject* , PyObject* py_args, PyObject* kw)
{
using namespace cv;
pyPrepareArgumentConversionErrorsStorage(2);
{
PyObject* pyobj_Func = NULL;
Mat Func;
PyObject* pyobj_Constr = NULL;
Mat Constr;
PyObject* pyobj_z = NULL;
Mat z;
int retval;
// ...
{
PyObject* pyobj_Func = NULL;
UMat Func;
PyObject* pyobj_Constr = NULL;
UMat Constr;
PyObject* pyobj_z = NULL;
UMat z;
int retval;
// ...
pyRaiseCVOverloadException("solveLP");
return NULL;
} |
Contributor
|
Yes, you are right. I was looking into wrong documentation version. |
mshabunin
approved these changes
Aug 5, 2021
alalek
approved these changes
Aug 6, 2021
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The header parser checks if the function take
Matorvector<Mat>to generateUMat/GpuMatdeclarations. These variant is generated by mappingInputArray,InputOutputArray, etc. tomat="Mat","UMat", or"GpuMat".If the argument type is explicitly
Mat, the parser still try to generate alternative declarations, but no mapping will be performed and the declaration is duplicated. Takeimreadmulti()for instance:Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.