[FIX #18553] Enable imshow to take GpuMat inputs in Python#18588
[FIX #18553] Enable imshow to take GpuMat inputs in Python#18588opencv-pushbot merged 1 commit intoopencv:masterfrom
Conversation
|
Bindings generator should stay universal to avoid maintenance hell. It should not known about exact functions. What is about |
Thanks for your comment and the hard work you put in this project @alalek, I understand your concern, though from the users perspective I believe it is more intuitive to use cv2.imshow regardless of the input type as it is described in the documentation rather than having a separate function for GpuMat inputs. In any case leaving it up to your criteria, we can either move on with the current PR or modify it / create a new one with a cv.cuda.cuda_imshow wrapper function (I tried to name it cv.cuda.imshow but I got name conflict errors while building it, I can see if it is a solvable problem though). |
alalek
left a comment
There was a problem hiding this comment.
Thank you for looking into this!
I agree, that updating of bindings generator require much more hard work. Both UMat and GpuMat additions need to be refactored.
Lets put this hack for now. Hopefully we didn't get here very long list of functions here.
modules/python/src2/hdr_parser.py
Outdated
| decls.append(decl) | ||
|
|
||
| if self._generate_gpumat_decls and "cv.cuda" in decl[0]: | ||
| if self._generate_gpumat_decls and any(x in decl[0] for x in ("cv.cuda", "imshow")): |
There was a problem hiding this comment.
This condition looks weak.
Please add this decl[0] == 'cv.imshow' instead.
Or in this form for easy expansion (one new line per case):
delc[0] in [
'cv.imshow', # https://github.com/opencv/opencv/issues/18553
]
da0c208 to
bf49149
Compare
|
Thanks @alalek , I have updated the PR with your suggested change, let me know if anything else is required. |
This pull request fixes #18553 by making the Python bindings generator create a declaration for 'imshow' that works with GpuMat inputs under Python.
Pull Request Readiness Checklist