Content-Length: 261266 | pFad | http://github.com/opencv/opencv/pull/27422

79 Fix incorrect Y-coordinate sampling in drawing primitives (circle, text, ellipse) by KAVYANSHTYAGI · Pull Request #27422 · opencv/opencv · GitHub
Skip to content

Fix incorrect Y-coordinate sampling in drawing primitives (circle, text, ellipse) #27422

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

Merged

Conversation

KAVYANSHTYAGI
Copy link
Contributor

Summary

This PR fixes a logical error in the samples/python/drawing.py script where both X and Y coordinates for drawing primitives (cv.circle, cv.putText, cv.ellipse) were being sampled from the X-axis range (x1, x2). This led to improper distribution and alignment of elements along the Y-axis.

Changes Made

  • Updated the second coordinate in center and org lists to use (y1, y2) instead of mistakenly reusing (x1, x2).
  • Affected functions:
    • circles()
    • string()
    • ellipse()

Impact

This ensures that all shapes and text are now placed randomly and correctly across the entire canvas using the proper X and Y ranges.


Let me know if you'd like help opening a corresponding issue or testing these changes further.

@asmorkalov asmorkalov self-requested a review June 10, 2025 07:19
@asmorkalov asmorkalov self-assigned this Jun 10, 2025
@asmorkalov asmorkalov added this to the 4.12.0 milestone Jun 10, 2025
@asmorkalov asmorkalov merged commit 4b69cc5 into opencv:4.x Jun 10, 2025
25 of 28 checks passed
@asmorkalov asmorkalov mentioned this pull request Jun 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/opencv/opencv/pull/27422

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy