Ask Your Question
0

ANDROID: How to posterize a Bitmap or a Mat in OpenCV? (Image included.)

asked 2013-09-15 11:45:31 -0600

Max Muster gravatar image

updated 2013-09-15 11:47:05 -0600

hello.

does anyone know how i can posterize a Bitmap or a Mat in OpenCV? i am capturing pictures from the camera and i need them to get posterized. example:

the picture i am capturing from the camera looks like this:

image description

and i want to make the picture look somehow like this programmatically:

image description

basically i need to make everything except the icons darker / black and highlight the icons by making them more white.

is there a way to do this with openCV?

thanks in advance.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
2

answered 2013-09-16 02:37:22 -0600

Andrey Pavlenko gravatar image

I suggest you use cv::threshold(THRESH_BINARY).

edit flag offensive delete link more
2

answered 2013-09-16 04:31:02 -0600

updated 2013-09-17 04:47:04 -0600

Better is to use :

Size  ksize = new Size(5, 5);
Mat MorphKernel = Imgproc.getStructuringElement(Imgproc.MORPH_CROSS, ksize);
Imgproc.morphologyEx(Rgb, Rgb, Imgproc.MORPH_RECT, MorphKernel);
edit flag offensive delete link more

Comments

@Pascal66 thanks, but the class MorphKernel doesnt seem to exist within my openCV. im using opencv 2.4.6 by the way.

Max Muster gravatar imageMax Muster ( 2013-09-17 02:28:23 -0600 )edit

It was a Mat, i've modified the code. You have asked for Android.

And Imgproc.threshold as suggested.

Pascal66 gravatar imagePascal66 ( 2013-09-17 04:48:22 -0600 )edit

thanks for the reply. sadly this doesnt change anything for the way my image looks. it looks just the same as before.

Max Muster gravatar imageMax Muster ( 2013-09-17 07:19:45 -0600 )edit

it still looks like the first picture i posted in the first post here.

Max Muster gravatar imageMax Muster ( 2013-09-18 00:36:39 -0600 )edit
1

answered 2013-09-16 02:18:31 -0600

Try with threshold on RGB channels.

edit flag offensive delete link more

Question Tools

Stats

Asked: 2013-09-15 11:45:31 -0600

Seen: 2,101 times

Last updated: Sep 17 '13