-
-
Notifications
You must be signed in to change notification settings - Fork 56.2k
Added Dashed Rectangle feature in Drawing.cpp #16880
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
Conversation
void dash_rectangle(InputOutputArray _img, Point pt1, Point pt2, const Scalar& color, int thickness = 1, int lineType = 8, int shift = 0,int gap=5) Where the gap is the distance between the dashes.
Update drawing.cpp
void dash_rectangle(InputOutputArray _img, Point pt1, Point pt2, |
It shows that docs have failed the merging process.Can i know more about this? |
This is not true. It is not merging failure.
Yes, read https://github.com/opencv/opencv/wiki/How_to_contribute till the end.
These commits will not be accepted. Remove them. |
@@ -1879,6 +1880,45 @@ void rectangle( InputOutputArray img, Rect rec, | |||
rectangle( img, rec.tl(), rec.br() - Point(1<<shift,1<<shift), | |||
color, thickness, lineType, shift ); | |||
} | |||
void dash_rectangle(InputOutputArray _img, Point pt1, Point pt2, | |||
const Scalar& color, int thickness = 1, | |||
int lineType = 8, int shift = 0,int gap=5) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use enum values https://docs.opencv.org/master/d6/d6e/group__imgproc__draw.html#gaf076ef45de481ac96e0ab3dc2c29a777 instead of int 8
modules/imgproc/src/drawing.cpp
Outdated
line(_img, v1, v1, color, thickness, lineType = 8, shift = 0); | ||
line(_img, v2, v2, color, thickness, lineType = 8, shift = 0); | ||
line(_img, v3, v3, color, thickness, lineType = 8, shift = 0); | ||
line(_img, v4, v4, color, thickness, lineType = 8, shift = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drawing points as lines is not a good idea due it's not convenient if this line has length or not. So nothing can be drawn as well. I would like to recommend to replace to filled rectangle
@VisheshKhosla do you plan to finish the PR in mean time? |
Yes sure,i am really sorry for the delay. |
@vpisarev What is your opinion? |
@VisheshKhosla, thank you for the contribution! I think, we need to carefully design and then implement this functionality with extended drawing primitives. Just adding functions one-by-one is not a good idea, that will result in a bloated and inconsistent API. Please, look at the following evolution proposal: https://github.com/opencv/opencv/wiki/OE-24.-Module-HighGUI. I've added there items about dashed figures. Let me close this PR for now, and you are welcome to the discussion thread about the evolution proposal (#11019). Someone needs to compose a detailed API proposal, then it should be discussed and then we should start working on the implementation. |
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.