Skip to content

[Feature] ChanVese Segementation - #4160

Open
dheer-prog wants to merge 1 commit into
opencv:5.xfrom
dheer-prog:chanvese
Open

[Feature] ChanVese Segementation#4160
dheer-prog wants to merge 1 commit into
opencv:5.xfrom
dheer-prog:chanvese

Conversation

@dheer-prog

@dheer-prog dheer-prog commented Jun 22, 2026

Copy link
Copy Markdown

This is an implementation of the Chan Vese Algorithm based on the following paper:-
T. F. Chan and L. A. Vese, "Active contours without edges," IEEE Transactions on Image Processing, vol. 10, no. 2, pp. 266-277, Feb. 2001

Currently this implementation only outputs a binary image depending upon the segmented region, I'll soon add a way to generate contours using this method, as it ensures that the contours are smooth and not jaggy as that are formed by edge based method like for example Canny Edge detectors

Issue requesting this feature:-#4141

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under Apache 2 License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
  • The PR is proposed to the proper branch
  • There is a reference to the original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

rebase test

basic chan vese

fixed

t

broken chan vese

Added tests

Added Documentation
@dheer-prog

Copy link
Copy Markdown
Author

Hello @asmorkalov , I know the formatting of segmentation.hpp is incorrect, I have created a pull request addressing the issue:- #4157
Once that is merged I'll just rebase this pr and both the Statistical Region Merging pr(#4156) will contain the correct formatting,

@dheer-prog

Copy link
Copy Markdown
Author

Also I was able to find an C implementation of this and hence was to able to add a chanvese_expected.png in test_chanvese.cpp for comparision
chanvese_input
chanvese_output

@dheer-prog

dheer-prog commented Jun 24, 2026

Copy link
Copy Markdown
Author

Hello @quink-black @asmorkalov , could you please review this pr

@dheer-prog

Copy link
Copy Markdown
Author

@asmorkalov have you had a chance to review this

@dheer-prog
dheer-prog marked this pull request as draft July 13, 2026 15:15
@dheer-prog
dheer-prog marked this pull request as ready for review July 13, 2026 15:16
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.

1 participant