From 2efa446e813a444291eee5f1205b52813c4f6aea Mon Sep 17 00:00:00 2001 From: Andrey Pavlenko Date: Sat, 28 Apr 2012 09:25:07 +0000 Subject: [PATCH] updating Posterize in 'image manipulation' Java sample --- .../imagemanipulations/ImageManipulationsView.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java index cc44c552f3..f1853ed674 100644 --- a/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java +++ b/samples/android/image-manipulations/src/org/opencv/samples/imagemanipulations/ImageManipulationsView.java @@ -170,13 +170,11 @@ class ImageManipulationsView extends SampleCvViewBase { case ImageManipulationsActivity.VIEW_MODE_CANNY: capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA); - capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME); if (mRgbaInnerWindow == null || mGrayInnerWindow == null) CreateAuxiliaryMats(); - - Imgproc.Canny(mGrayInnerWindow, mGrayInnerWindow, 80, 90); - Imgproc.cvtColor(mGrayInnerWindow, mRgbaInnerWindow, Imgproc.COLOR_GRAY2BGRA, 4); + Imgproc.Canny(mRgbaInnerWindow, mIntermediateMat, 80, 90); + Imgproc.cvtColor(mIntermediateMat, mRgbaInnerWindow, Imgproc.COLOR_GRAY2BGRA, 4); break; case ImageManipulationsActivity.VIEW_MODE_SOBEL: @@ -223,8 +221,10 @@ class ImageManipulationsView extends SampleCvViewBase { Imgproc.pyrMeanShiftFiltering(mIntermediateMat, mIntermediateMat, 5, 50); Imgproc.cvtColor(mIntermediateMat, mRgbaInnerWindow, Imgproc.COLOR_RGB2RGBA); */ - Core.convertScaleAbs(mRgbaInnerWindow, mIntermediateMat, 1./64, 0); - Core.convertScaleAbs(mIntermediateMat, mRgbaInnerWindow, 64, 0); + Imgproc.Canny(mRgbaInnerWindow, mIntermediateMat, 80, 90); + mRgbaInnerWindow.setTo(new Scalar(0, 0, 0, 255), mIntermediateMat); + Core.convertScaleAbs(mRgbaInnerWindow, mIntermediateMat, 1./16, 0); + Core.convertScaleAbs(mIntermediateMat, mRgbaInnerWindow, 16, 0); break; }