Repository navigation
[Feature] ChanVese Segementation - #4160
Closed
dheer-prog wants to merge 30 commits into
Closed
dheer-prog wants to merge 30 commits into
dheer-prog wants to merge 30 commits into
Conversation
Author
|
Hello @asmorkalov , I know the formatting of segmentation.hpp is incorrect, I have created a pull request addressing the issue:- #4157 |
Author
Author
|
Hello @quink-black @asmorkalov , could you please review this pr |
line_descriptor: fix heap buffer overflow in EdgeDrawing() EdgeDrawing() allocates edge pixel buffers of size pixelNum/5, but writes without checking bounds. When the image has high edge density, offsetPFirst/offsetPSecond exceed the buffer, corrupting the heap. Add bounds checks before each write to prevent overflow. This fixes the crash reported in opencv#1999.
fix heap buffer overflow in EdgeDrawing()
PCTSignatures_Impl::getSampleCount() called mSampler->getGrayscaleBits() instead of mSampler->getSampleCount(), so it always returned the grayscale bit depth (default 4) instead of the actual number of sampling points passed to create(). PCTSampler_Impl::getSampleCount() itself was already correct, returning mInitSamplingPoints.size(), so only the accessor delegation needed fixing.
…raticFormDistances Parallel_computeSQFDs::operator() indexed mImageSignatures (a pointer to a std::vector<Mat>) as mImageSignatures[i] instead of dereferencing the vector first, i.e. (*mImageSignatures)[i]. This happened to work for i == 0 (mImageSignatures[0] is equivalent to *mImageSignatures), but for i >= 1 it read past the pointed-to vector as unallocated memory, producing undefined behavior (typically a spurious "Signature ID: N is empty!" exception once imageSignatures has 2 or more elements).
Author
|
@asmorkalov have you had a chance to review this |
…tency-fix cudastereo: fix StereoSGM consistency check launch bounds opencv#4165 Extra: opencv/opencv_extra#1392 check_consistency previously launched dim3(width/16, height/16); integer division floored away a right/bottom strip up to 15 px wide whenever an image dimension was not a multiple of 16, leaving those pixels never visited by check_consistency_kernel. They kept WTA's output and skipped L/R invalidation. On the common 1920x1080 case (1080 mod 16 = 8) this affected the bottom 8 rows of every frame. Switch the grid to cudev::divUp and add an in-kernel bounds-check so the now-overhanging threads return cleanly. Add a regression test (StereoSGM_NonAligned) in test_stereo.cpp that feeds unrelated random images of non-aligned size into cv::cuda::StereoSGM::compute and verifies the previously-uncovered strip is touched by check_consistency. Also fix a latent typo in store_uint8_vector<2u> (second lane was ptr[0] instead of ptr[1], breaking the dest[i] = ptr[i] contract held by the <1u>, <4u>, <8u>, <16u> specializations). The <2u> specialization is unreachable in current code; included as defensive hygiene against a future DP_BLOCK_SIZE = 2u variant. ### Pull Request Readiness Checklist See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] 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
dheer-prog
marked this pull request as draft
July 13, 2026 15:15
dheer-prog
marked this pull request as ready for review
July 13, 2026 15:16
…ecount xfeatures2d: fix PCTSignatures::getSampleCount() copy-paste bug
…read xfeatures2d: fix out-of-bounds read in PCTSignaturesSQFD::computeQuadraticFormDistances
ENGINE_CLASSIC Removal
Fixed CI in 5.x branch.
viz: Add iostream include to precomp.hpp
Remove deprecated CommaInitializer API
Calling a function through a function pointer with a mismatched signature is undefined behavior in C/C++ and causes Clang Control Flow Integrity to trap with `SIGILL` (`ud1`) at indirect call sites.
Fix function pointer signature mismatches
Use [[fallthrough]] instead of comments where needed
Remove references to C++ < 17 and older compiler versions.
Author
|
Made some errors now there are many pr's in this will open new one |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


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
Patch to opencv_extra has the same branch name.