meerk40t / meerk40t

Hackable Laser software for K40 / GRBL / Fibre Lasers
MIT License
233 stars 62 forks source link

Contour generation GUI in image properties #2685

Closed jpirnay closed 1 week ago

jpirnay commented 1 week ago

Add a contour generation tab to the image property panel. This panel will allow to generate contours identified within the image. grafik

Summary by Sourcery

Add a contour generation feature to the image property panel, allowing users to generate and manage contours from images with various customization options.

New Features:

Enhancements:

sourcery-ai[bot] commented 1 week ago

Reviewer's Guide by Sourcery

This PR adds a new contour generation feature to the image property panel. The implementation includes a new ContourPanel class that allows users to detect and generate contours from images with various parameters for customization. The panel provides real-time preview functionality and supports both polygon and bounding rectangle detection methods.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Added a new ContourPanel class for contour generation functionality
  • Implemented contrast and brightness adjustment controls
  • Added controls for minimum/maximum contour size as percentage
  • Added options for contour simplification (None, Visvalingam, Douglas-Peucker)
  • Implemented detection method selection (Polygons vs Bounding rectangles)
  • Added preview functionality with automatic updates
  • Created a list view to display detected contours with area information
meerk40t/gui/propertypanels/imageproperty.py
Modified image contour detection functions to include area information
  • Updated img_to_polygons to return area percentage with geometries
  • Updated img_to_rectangles to return area percentage with geometries
  • Added area information to contour processing feedback
meerk40t/image/imagetools.py
Registered the new ContourPanel in the application
  • Added ContourPanel registration to kernel under 'property/ImageNode/ImageContour'
meerk40t/gui/wxmeerk40t.py

Tips and commands #### Interacting with Sourcery - **Trigger a new review:** Comment `@sourcery-ai review` on the pull request. - **Continue discussions:** Reply directly to Sourcery's review comments. - **Generate a GitHub issue from a review comment:** Ask Sourcery to create an issue from a review comment by replying to it. - **Generate a pull request title:** Write `@sourcery-ai` anywhere in the pull request title to generate a title at any time. - **Generate a pull request summary:** Write `@sourcery-ai summary` anywhere in the pull request body to generate a PR summary at any time. You can also use this command to specify where the summary should be inserted. #### Customizing Your Experience Access your [dashboard](https://app.sourcery.ai) to: - Enable or disable review features such as the Sourcery-generated pull request summary, the reviewer's guide, and others. - Change the review language. - Add, remove or edit custom review instructions. - Adjust other review settings. #### Getting Help - [Contact our support team](mailto:support@sourcery.ai) for questions or feedback. - Visit our [documentation](https://docs.sourcery.ai) for detailed guides and information. - Keep in touch with the Sourcery team by following us on [X/Twitter](https://x.com/SourceryAI), [LinkedIn](https://www.linkedin.com/company/sourcery-ai/) or [GitHub](https://github.com/sourcery-ai).