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

HoughLinesPointSet using OpenCVSharp #1722

Open
ShiddhamSharma opened this issue Nov 18, 2024 · 0 comments
Open

HoughLinesPointSet using OpenCVSharp #1722

ShiddhamSharma opened this issue Nov 18, 2024 · 0 comments

Comments

@ShiddhamSharma
Copy link

Summary of your issue

I am trying to use HoughLinesPointSet using OpenCVSharp but could not find any sample or working of the program. I have tried using OpenCV in python and was able to work but can't figure out how to do that in C#.

Environment

OpenCVSharp.Extensions and OpenCVSharp.Windows: 4.9.0.20240103
.Net TargetFramework: 8.0
OpenCV-Python: 4.10.0

Example code:

Sample code I ran in Python:

points = np.array([
    [591.0, 750.0], [598.0, 750.0], [605.0, 751.0], [612.0, 751.0],
    [619.0, 751.0], [626.0, 751.0], [633.0, 752.0], [640.0, 752.0],
    [647.0, 752.0], [652.0, 752.0], [661.0, 752.0]
], dtype=np.float32)

points = points.reshape(-1, 1, 2)

rho_min, rho_max, rho_step = 0.0, 360.0, 1.0
theta_min, theta_max, theta_step = 0.0, math.pi / 2.0, math.pi / 180.0
min_votes = 20
line3d = []
img_size = (800, 800, 3)
image = np.zeros(img_size, dtype=np.uint8)

# Plot each point on the blank image
for point in points:
    x, y = int(point[0][0]), int(point[0][1])
    cv2.circle(image, (x, y), radius=3, color=(255, 0, 0), thickness=-1)

# Run HoughLinesPointSet if available
lines = cv2.HoughLinesPointSet(points, 1, 1, rho_min, rho_max, rho_step, theta_min, theta_max, theta_step)

What did you intend to be?

How do you run this same code in C#?

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