Skip to content

imgcodecs: force reshaping of imdecode() input into a single row#14989

Merged
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:issue_14978
Jul 9, 2019
Merged

imgcodecs: force reshaping of imdecode() input into a single row#14989
opencv-pushbot merged 1 commit intoopencv:3.4from
alalek:issue_14978

Conversation

@alalek
Copy link
Copy Markdown
Member

@alalek alalek commented Jul 6, 2019

OpenCV upstream stuff may reinterpret vector as column.

Fixes Python imdecode() interface.

resolves #14978

OpenCV upstream stuff may reinterpret vector as column.
@mshabunin mshabunin self-assigned this Jul 9, 2019
@opencv-pushbot opencv-pushbot merged commit eedbd1a into opencv:3.4 Jul 9, 2019
@alalek alalek mentioned this pull request Jul 9, 2019
@sunlightyxy
Copy link
Copy Markdown

Hi All,I also encountered this problem when calling opencv410 in Java,How can I solve this problem?thanks all

Code:
System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
String rotate6 = "/tmp/webp.webp";
System.out.println("-----imdecode unchange-----");
Mat imdecode = Imgcodecs.imdecode(new MatOfByte(FileUtils.readFileToByteArray(new File(rotate6))), Imgcodecs.IMREAD_UNCHANGED);
System.out.println("imdecode width=" + imdecode.width());
System.out.println("imdecode height=" + imdecode.height());
LOG:
imdecode_(''): can't read data: OpenCV(4.1.0) /home/yuxiaoyang/repo_test/xmss_3rdparty/opencv-4.1.0-imsize/modules/imgcodecs/src/grfmt_webp.cpp:164: error: (-215:Assertion failed) data.rows == 1 in function 'readData'

imdecode width=0
imdecode height=0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants