Skip to content
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

rotatedrect enhance #1188

Open
kongggg opened this issue Jul 31, 2024 · 3 comments
Open

rotatedrect enhance #1188

kongggg opened this issue Jul 31, 2024 · 3 comments

Comments

@kongggg
Copy link

kongggg commented Jul 31, 2024

there is no such function as "void cv::RotatedRect::points ( Point2f pts[] ) const" or "RotatedRect (const Point2f &center, const Size2f &size, float angle)" in opencv C-lib

Description

add functions:
func NewRotatedRect(center image.Point, width, height int, angle float64) RotatedRect {}
func NewRotatedRect2f(center Point2f, width, height float32, angle float64) RotatedRect2f {}
func (rect RotatedRect) Points() []image.Point {}
func (rect RotatedRect2f) Points() []Point2f {}

@diegohce
Copy link
Collaborator

Hi @kongggg !

If I am not mistaken

func (rect RotatedRect) Points() []image.Point {}
func (rect RotatedRect2f) Points() []Point2f {}

are already fields (or attributes) of the RotatedRect type

as per the gocv source code type definitions:

type RotatedRect struct {
	Points       []image.Point
	BoundingRect image.Rectangle
	Center       image.Point
	Width        int
	Height       int
	Angle        float64
}

type RotatedRect2f struct {
	Points       []Point2f
	BoundingRect image.Rectangle
	Center       Point2f
	Width        float32
	Height       float32
	Angle        float64
}

Regarding the NewRotatedRect* functions, please @deadprogram let me know if someone is addressing those. If not, I am already Go'ing (writing go) :-)

Cheers!

@kongggg
Copy link
Author

kongggg commented Aug 21, 2024

Nice Job!

@deadprogram
Copy link
Member

Tagged for closing this after next release.

@deadprogram deadprogram reopened this Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants