Ask Your Question
1

Get pixel informations wit Mat.get(int,int) on Android

asked 2013-04-02 08:52:56 -0600

yt12 gravatar image

Hi, i am trying to get the pixel infromations (RGB) of a specific pixel on Android with OpenCV 2.4.4

Sometimes Mat.get(int,int) returns "null". Is there an bug or another way?

double[] colors = img.get(123, 123);
Log.v(tag, "-->"+ colors[0] +";"+ colors[1] +";"+ colors[2] +"");

thx

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-04-03 01:08:57 -0600

Most likely your Mat is empty or you try to access element that is out of Mat size.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-04-02 08:52:56 -0600

Seen: 2,658 times

Last updated: Apr 03 '13