Ask Your Question
0

why imread return empty matrix

asked 2017-02-04 20:57:43 -0600

hanaa gravatar image

l'm work on android app with opencv 2.4.9 and in jni function l try to read images from database l test simple one Mat testSample = imread("/storage/emulated/0/h.jpg"); l search online but can't solve it but imread function return empty so what's problem? and what's debug mode or release mode (Do l face problem because of them if yes how to fix it) sorry l'm beginner

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-06 09:19:03 -0600

RajatGupta gravatar image

updated 2017-02-06 09:22:12 -0600

This happens when image is not there or path is incorrect. Can you verify if image is at the location or not . If yes try with absolute path . Still having issue share code and image .

edit flag offensive delete link more

Comments

actually it;s just simple code Mat b=(Highgui.imread("E:/h.jpg")); tv.setText(b.rows()+""); there's image in this paths and i can open it with other programs it's return 0

hanaa gravatar imagehanaa ( 2017-02-06 10:14:15 -0600 )edit

l thought there's something wrong in configuration because l try it and run right at python

hanaa gravatar imagehanaa ( 2017-02-06 10:18:42 -0600 )edit

neither "/storage/emulated/0/h.jpg" , nor "E:/h.jpg" is a valid path on an actual android device.

berak gravatar imageberak ( 2017-02-07 02:37:46 -0600 )edit

yeah if image is there then maybe path is wrong for accessing the image . Verify that the permission in your androidManifest.xml to read from external storage is correct.

RajatGupta gravatar imageRajatGupta ( 2017-02-07 02:55:46 -0600 )edit

no actually when l read from mobile storage it works but doesn't work from any path in my labtop

hanaa gravatar imagehanaa ( 2017-02-11 20:52:00 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2017-02-04 20:57:43 -0600

Seen: 910 times

Last updated: Feb 06 '17