Skip to content

Mat continuous check should use a more robust way #706

@4o3F

Description

@4o3F

Currently OpenCV isContinuous flag have issues (see opencv/opencv#12018), and should not be relied on for checking whether the Mat is continuous. The following code can reproduce the issue:

let continuous_mat = opencv::core::Mat::new_rows_cols_with_default(
    30076,
    39979,
    opencv::core::CV_8UC3,
    opencv::core::Scalar::all(0.),
)?;
tracing::info!("{}", continuous_mat.is_continuous());

but if I change the data type to CV_8UC1, it resulted in a continuous Mat.
Therefore, the match_is_continuous (code) should be switched to another method for checking.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions