mirror of
https://github.com/opencv/opencv.git
synced 2024-11-30 14:29:49 +08:00
updating Posterize in 'image manipulation' Java sample
This commit is contained in:
parent
9e868272e9
commit
2efa446e81
@ -170,13 +170,11 @@ class ImageManipulationsView extends SampleCvViewBase {
|
|||||||
|
|
||||||
case ImageManipulationsActivity.VIEW_MODE_CANNY:
|
case ImageManipulationsActivity.VIEW_MODE_CANNY:
|
||||||
capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
|
capture.retrieve(mRgba, Highgui.CV_CAP_ANDROID_COLOR_FRAME_RGBA);
|
||||||
capture.retrieve(mGray, Highgui.CV_CAP_ANDROID_GREY_FRAME);
|
|
||||||
|
|
||||||
if (mRgbaInnerWindow == null || mGrayInnerWindow == null)
|
if (mRgbaInnerWindow == null || mGrayInnerWindow == null)
|
||||||
CreateAuxiliaryMats();
|
CreateAuxiliaryMats();
|
||||||
|
Imgproc.Canny(mRgbaInnerWindow, mIntermediateMat, 80, 90);
|
||||||
Imgproc.Canny(mGrayInnerWindow, mGrayInnerWindow, 80, 90);
|
Imgproc.cvtColor(mIntermediateMat, mRgbaInnerWindow, Imgproc.COLOR_GRAY2BGRA, 4);
|
||||||
Imgproc.cvtColor(mGrayInnerWindow, mRgbaInnerWindow, Imgproc.COLOR_GRAY2BGRA, 4);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ImageManipulationsActivity.VIEW_MODE_SOBEL:
|
case ImageManipulationsActivity.VIEW_MODE_SOBEL:
|
||||||
@ -223,8 +221,10 @@ class ImageManipulationsView extends SampleCvViewBase {
|
|||||||
Imgproc.pyrMeanShiftFiltering(mIntermediateMat, mIntermediateMat, 5, 50);
|
Imgproc.pyrMeanShiftFiltering(mIntermediateMat, mIntermediateMat, 5, 50);
|
||||||
Imgproc.cvtColor(mIntermediateMat, mRgbaInnerWindow, Imgproc.COLOR_RGB2RGBA);
|
Imgproc.cvtColor(mIntermediateMat, mRgbaInnerWindow, Imgproc.COLOR_RGB2RGBA);
|
||||||
*/
|
*/
|
||||||
Core.convertScaleAbs(mRgbaInnerWindow, mIntermediateMat, 1./64, 0);
|
Imgproc.Canny(mRgbaInnerWindow, mIntermediateMat, 80, 90);
|
||||||
Core.convertScaleAbs(mIntermediateMat, mRgbaInnerWindow, 64, 0);
|
mRgbaInnerWindow.setTo(new Scalar(0, 0, 0, 255), mIntermediateMat);
|
||||||
|
Core.convertScaleAbs(mRgbaInnerWindow, mIntermediateMat, 1./16, 0);
|
||||||
|
Core.convertScaleAbs(mIntermediateMat, mRgbaInnerWindow, 16, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user