Re: [OpenCV4Android] What is a better way to read an image in a downsampling way, and then get the brightness value based

280 views
Skip to first unread message

Alexander Smorkalov

unread,
Dec 18, 2012, 2:17:56 AM12/18/12
to android...@googlegroups.com
Hello Linda Li,

You can use color conversions from OpenCV Java API. You can convert rgba frame to gray scale by function Imgproc.cvtColor(mRgba, mGray, Imgproc.COLOR_RGBA2GRAY). It is the preferred way for most CV algorithms.

Andrey Pavlenko

unread,
Dec 18, 2012, 3:21:34 AM12/18/12
to android...@googlegroups.com
Mat imread(const string& filename, int flags=1);
function can automatically convert the image to gray-scale when the `CV_LOAD_IMAGE_GRAYSCALE` flag is specified;

as for downscaling - you can call 
Reply all
Reply to author
Forward
0 new messages