Skip to content

Added edge detection to img2scad.html #1690

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
merged 1 commit into from
May 21, 2025

Conversation

amatulic
Copy link
Contributor

@amatulic amatulic commented May 21, 2025

Edge detection added. Also updated version.

Before:
image

After:
image

The edge detection uses a Sobel gradient filter, which requires a slightly pre-blurred image.

  • Both Gaussian blur and Edge detection have a radius setting.
  • If Gaussian blur radius is 0, then the Edge detect radius is used for internal Gaussian blurring.
  • If Gaussian blur radius is >0, then Edge detect uses the already-blurred image, with a Sobel filter using the Edge detect radius. In this way various combinations of blurring and gradient filtering can be done.

The Sobel filter, fortunately, is also separable like the Gaussian filter into vertical and horizontal convolutions, which improves the execution speed over filtering with a 2D kernel of arbitrary size.

@adrianVmariano adrianVmariano merged commit eeea026 into BelfrySCAD:master May 21, 2025
3 checks passed
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

Successfully merging this pull request may close these issues.

2 participants