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.
Currently OpenCV
isContinuousflag 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: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.