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

gocv.FindContours return PointVector instead of []PointVector #1111

Open
svenczbg opened this issue Oct 15, 2023 · 1 comment
Open

gocv.FindContours return PointVector instead of []PointVector #1111

svenczbg opened this issue Oct 15, 2023 · 1 comment

Comments

@svenczbg
Copy link

svenczbg commented Oct 15, 2023

Description

gocv.FindContours is supposed to return a []PointVector but returns just one PointVector

Steps to Reproduce

// now find contours
contours := gocv.FindContours(imgThresh, gocv.RetrievalExternal, gocv.ChainApproxSimple)
for i, c := range contours {
area := gocv.ContourArea(c)
if area < MinimumArea {
continue
}
status = "Motion detected"
statusColor = color.RGBA{255, 0, 0, 0}
gocv.DrawContours(&img, contours, i, statusColor, 2)
rect := gocv.BoundingRect(c)
gocv.Rectangle(&img, rect, color.RGBA{0, 0, 255, 0}, 2)
}

The location of the error is here:
https://github.com/hybridgroup/gocv/blob/release/imgproc.cpp#L223

Your Environment

  • Operating System and version: Raspberry Pi OS, Linux Kernel 5.15.84-v8+
  • OpenCV version used: 4.8.0
  • How did you install OpenCV? Compiled acc. to https://qengineering.eu/install-opencv-on-raspberry-pi.html
  • GoCV version used: 0.34.0
  • Go version: go version go1.21.0 linux/arm64
  • Did you run the env.sh or env.cmd script before trying to go run or go build?
@svenczbg
Copy link
Author

sorry, my fault: I didn't noticed PointVector vs PointsVector

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant