Hello all,
I am trying to do some preprocessing on an image. I load it as a bitmap,
convert it to a mat, and then convert to grayscale. This all works fine,
but I want to improve the contrast before thresholding by using
Imgproc.equalizeHist, but my application always seems to crash or get a
weird result when I call it. I havent been able to find much info on this
online anywhere.

Here's my code:

Mat rgbMat = Utils.bitmapToMat(bmp);
Mat grayMat = new Mat();
Mat bwMat = new Mat();

Imgproc.cvtColor(rgbMat, grayMat, Imgproc.COLOR_RGB2GRAY, 1);
Imgproc.equalizeHist(grayMat, grayMat);
Imgproc.threshold(grayMat, bwMat, 127.5, 255.0, Imgproc.THRESH_OTSU);

Any advice is appreciated

--

Search Discussions

Discussion Posts

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 2 | next ›
Discussion Overview
groupandroid-opencv @
categoriesandroid
postedJan 14, '13 at 8:12a
activeJan 17, '13 at 2:14p
posts2
users2
websiteandroid.com

2 users in discussion

Andrey Pavlenko: 1 post Itsmike: 1 post

People

Translate

site design / logo © 2019 Grokbase