Skip to content

CV_Bool support for masks in 5.x #25895

Open

Description

@asmorkalov

Describe the feature and motivation

  1. Support Mat with CV_Bool as mask.
  2. Promote CV_Bool masks to OpenCL, CUDA, etc.
  3. Promote CV_Bool masks to HAL.
  4. Decided on CV_Bool true value handling: 255
  5. Statndard bool support.

Additional context

No response

Activity

  1. added this to the 5.0 milestone on Jul 10, 2024
  2. vpisarev commented on Jul 12, 2024

    @vpisarev
    Contributor
    1. In most (I hope, all) OpenCV functions mask can currently have CV_8U or sometimes CV_8S type; and any non-zero value value is treated as 'true', so it's compatible with 255, 1 and other values. In 5.x branch in all functions that can now handle CV_Bool, they treat any non-zero value as true. So basically we should just add CV_Bool as allowed mask type and maybe optionally modify cv::compare() to specify output type. Make it CV_Bool by default? Maybe not yet.
  3. asmorkalov commented on Jul 12, 2024

    @asmorkalov
    ContributorAuthor

    Related: #25890

  4. asmorkalov commented on Jul 12, 2024

    @asmorkalov
    ContributorAuthor

    Decisions from core team meeting:

    • Extend mask handling in InputArrays
    • Check mask generators: compare, Ransac, MasNans, etc. M.b. replace output type with CV_Bool.
  5. added a commit that references this issue on Jul 24, 2024
  6. modified the milestones: 5.0, 5.0-release on Sep 28, 2024
  7. asmorkalov commented on May 7, 2026

    @asmorkalov
    ContributorAuthor
  8. self-assigned this
    on May 7, 2026
  9. modified the milestones: 5.0-release, 5.1 on May 22, 2026
  10. added a commit that references this issue on Jul 30, 2026
  11. added 4 commits that reference this issue on Aug 11, 2026
  12. modified the milestones: 5.1, 5.2 on Sep 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions