-
Notifications
You must be signed in to change notification settings - Fork 876
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
Drawing functions should take color argument as "gocv.Scalar", not "color.RGBA" #1007
Comments
I just cloned the GoCV source code, added the following functions to the GoCV library:
And they work fine. Thanks |
@go4orward that seems like an very good approach. Just wondering if we should name it |
@deadprogram I agree with you. |
👍 on this problem. I can render a PDF in 16 bit colorspace, and draw the rectangles on it, but because RGBA is only 8 bit, all drawing functions come up black. allowing us to pass in our own Scalar values will overcome this; or enumerating the image matrix types and allowing us to pass in anything (ie: I'd need to pass in RGBA64 in this instance.) A workaround is to convert the matrix to U8 (which is untenable as image quality is lost) or to render the rectangle on an blank matrix and convert to 16bit, then superimpose. Much rather just pass in the right datatype. |
cool just found your PR #1008 |
In the current version 0.31.0 of GoCV,
all the drawing functions (such as Line(), Circle(), FillPoly(), etc.) takes color argument as "color.RGBA".
But C++ OpenCV drawing functions take color argument as "Scalar" which can take "double" values.
While C++ OpenCV drawing functions can draw on any Mat with various pixel types (like CV_16S, CV_16U, CV_32F),
GoCV drawing wrapper functions cannot do the same thing, becasue they only take "color" values as uint8.
IMHO, the APIs of GoCV drawing functions significantly limit the capability of original OpenCV library functions.
Description
First of all, I'd like to thank all the authors of GoCV.
I really appreciate your contributions and the efforts put into this wonderful library.
Related drawing functions include
As a consequence, we cannot use the above drawing functions on gocv.Mat
with different pixel types other than gocv.MatTypeCV8U.
It can be confirmed that all the corresponding C++ OpenCV functions
take the color argument as "Scalar &color".
Steps to Reproduce
There is no bug to be reported (and reproduced) in the current version of GoCV API.
This report suggests GoCV APIs should be "expanded"
to utilize the full capability of C++ OpenCV library.
1.
2.
3.
4.
Your Environment
env.sh
orenv.cmd
script before trying togo run
orgo build
?The text was updated successfully, but these errors were encountered: