Skip to content

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

Closed
wants to merge 3 commits into from

Conversation

VisheshKhosla
Copy link

@VisheshKhosla VisheshKhosla commented Mar 22, 2020

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

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.
@VisheshKhosla VisheshKhosla changed the title Feature Added Dashed Rectangle feature in Drawing.cpp Mar 22, 2020
@VisheshKhosla
Copy link
Author

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.

@VisheshKhosla
Copy link
Author

It shows that docs have failed the merging process.Can i know more about this?

@alalek
Copy link
Member

alalek commented Mar 22, 2020

docs have failed the merging process

This is not true. It is not merging failure.


know more about this

Yes, read https://github.com/opencv/opencv/wiki/How_to_contribute till the end.


Merge pull request #

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) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);
Copy link
Member

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

@asmorkalov
Copy link
Contributor

@VisheshKhosla do you plan to finish the PR in mean time?

@asmorkalov asmorkalov added pr: needs docs Please update corresponding documentation pr: needs test New functionality requires minimal tests set labels Apr 9, 2020
@VisheshKhosla
Copy link
Author

@VisheshKhosla do you plan to finish the PR in mean time?

Yes sure,i am really sorry for the delay.

@asmorkalov
Copy link
Contributor

@vpisarev What is your opinion?

@vpisarev
Copy link
Contributor

@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.

@vpisarev vpisarev closed this Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: imgproc pr: Discussion Required pr: needs docs Please update corresponding documentation pr: needs test New functionality requires minimal tests set
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants