Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Wrong step for Mat(std::vector) in 5.x #26497

Closed
Assignees
vpisarev
Milestone
@vrabaud

Description

@vrabaud

System Information

Latest Debian, OpenCV 5.x at2ed6d0f (nov 19th)

Detailed description

It seems the step is not properly computed for a matrix built using anstd::vector

Steps to reproduce

TEST(Imgproc_Resize, vec){  std::vector<float>vec(4);  MatA(vec), B;  std::cout<<A.size()<<std::endl;resize(A,B,Size(2,2),0,0,INTER_LINEAR);}

triggers:

[ RUN      ] Imgproc_Resize.vec[4 x 1]unknown file: FailureC++ exception with description "OpenCV(5.0.0-pre) /usr/local/google/home/vrabaud/opencv5/src/opencv/modules/core/src/matrix.cpp:904: error: (-2:Unspecified error) in function 'cv::Mat::Mat(Size, int, void *, size_t)'>  (expected: '_step >= minstep'), where>     '_step' is 4> must be greater than or equal to>     'minstep' is 16" thrown in the test body.[  FAILED  ] Imgproc_Resize.vec (0 ms)

Whensrc.step is cast to asize_t at

hal::resize(src.type(), src.data, src.step, src.cols, src.rows, dst.data, dst.step, dst.cols, dst.rows, inv_scale_x, inv_scale_y, interpolation);
, the value 4 (sizeof(float)) is chosen instead of 16 (4*sizeof(float)). This is because of

Issue submission checklist

  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files (videos, images, onnx, etc)

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp