Skip to content

Depth values ordering is broken #12569

@cv3d

Description

@cv3d
System information (version)
  • OpenCV => 4.0.0-pre
  • Operating System / Platform => All
  • Compiler => All
Detailed description

After introducing CV_16F, assertions like CV_Assert(CV_16F < CV_32F) fails miserably...

Steps to reproduce
    vector<???> order { CV_8U, CV_8S, CV_16U, CV_16S, CV_16F, CV_32S, CV_32F, CV_64F };

    for (int i = 0; i < order.size(); ++i)
    {
        for (int j = 0; j < order.size(); ++j)
        {
            ASSERT_EQ(order[i] <  order[j], i <  j);
            ASSERT_EQ(order[i] <= order[j], i <= j);
            ASSERT_EQ(order[i] >  order[j], i >  j);
            ASSERT_EQ(order[i] >= order[j], i >= j);
        }
    }

At least among IEEE floats, in which CV_16F < CV_32F now returns false 😕

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions