Skip to content

Improve CCL with new algorithms and tests#21275

Merged
alalek merged 2 commits intoopencv:3.4from
stal12:CCL_improvements
Dec 17, 2021
Merged

Improve CCL with new algorithms and tests#21275
alalek merged 2 commits intoopencv:3.4from
stal12:CCL_improvements

Conversation

@stal12
Copy link
Copy Markdown
Contributor

@stal12 stal12 commented Dec 16, 2021

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 other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to 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

Pull Request Description

This pull request improves Connected Components Labeling functions as it follows:

  1. Introduces the 4-way connectivity version of Spaghetti (Spaghetti4C), generated with the tool described in Bolelli, F., Allegretti, S., & Grana, C. (2021). One DAG to Rule Them All. IEEE Transactions on Pattern Analysis and Machine Intelligence.
  2. Introduces the parallel implementation of Spaghetti and Spaghetti4C algorithms.
  3. Improves regression tests introducing the validation of corner cases, like chessboard images, single row and single column images, etc.
  4. Changes the default algorithm to the current state of the art.

Copy link
Copy Markdown
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contribution!


int ccltype[] = { cv::CCL_DEFAULT, cv::CCL_WU, cv::CCL_GRANA, cv::CCL_BOLELLI, cv::CCL_SAUF, cv::CCL_BBDT, cv::CCL_SPAGHETTI };

for (size_t i = 0; i < input.size(); ++i) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is better to split scenarios on dedicated tests cases.
It is extremely useful to debug scenario in the middle (through test filtering instead of passing code).

@alalek
Copy link
Copy Markdown
Member

alalek commented Dec 30, 2021

@stal12 Could you please take a look on this problem: #21366 ?

@alalek alalek mentioned this pull request Dec 30, 2021
@alalek alalek mentioned this pull request Feb 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants