Feature #2833 Sepia size in Image Manipulations demo implemented.

This commit is contained in:
Alexander Smorkalov 2013-02-26 11:25:33 +04:00
parent 9f15daf0a0
commit 11885e86ee

View File

@ -68,7 +68,6 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView
private float mBuff[]; private float mBuff[];
private Mat mRgbaInnerWindow; private Mat mRgbaInnerWindow;
private Mat mGrayInnerWindow; private Mat mGrayInnerWindow;
private Mat mBlurWindow;
private Mat mZoomWindow; private Mat mZoomWindow;
private Mat mZoomCorner; private Mat mZoomCorner;
private Mat mSepiaKernel; private Mat mSepiaKernel;
@ -220,9 +219,6 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView
if (mGrayInnerWindow == null && !mGray.empty()) if (mGrayInnerWindow == null && !mGray.empty())
mGrayInnerWindow = mGray.submat(top, top + height, left, left + width); mGrayInnerWindow = mGray.submat(top, top + height, left, left + width);
if (mBlurWindow == null)
mBlurWindow = mRgba.submat(0, rows, cols / 3, cols * 2 / 3);
if (mZoomCorner == null) if (mZoomCorner == null)
mZoomCorner = mRgba.submat(0, rows / 2 - rows / 10, 0, cols / 2 - cols / 10); mZoomCorner = mRgba.submat(0, rows / 2 - rows / 10, 0, cols / 2 - cols / 10);
@ -236,8 +232,6 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView
mZoomWindow.release(); mZoomWindow.release();
if (mZoomCorner != null) if (mZoomCorner != null)
mZoomCorner.release(); mZoomCorner.release();
if (mBlurWindow != null)
mBlurWindow.release();
if (mGrayInnerWindow != null) if (mGrayInnerWindow != null)
mGrayInnerWindow.release(); mGrayInnerWindow.release();
if (mRgbaInnerWindow != null) if (mRgbaInnerWindow != null)
@ -254,7 +248,6 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView
mIntermediateMat = null; mIntermediateMat = null;
mRgbaInnerWindow = null; mRgbaInnerWindow = null;
mGrayInnerWindow = null; mGrayInnerWindow = null;
mBlurWindow = null;
mZoomCorner = null; mZoomCorner = null;
mZoomWindow = null; mZoomWindow = null;
} }
@ -327,7 +320,9 @@ public class ImageManipulationsActivity extends Activity implements CvCameraView
break; break;
case ImageManipulationsActivity.VIEW_MODE_SEPIA: case ImageManipulationsActivity.VIEW_MODE_SEPIA:
Core.transform(mRgba, mRgba, mSepiaKernel); if ((mRgbaInnerWindow == null) || (mRgba.cols() != mSizeRgba.width) || (mRgba.height() != mSizeRgba.height))
CreateAuxiliaryMats();
Core.transform(mRgbaInnerWindow, mRgbaInnerWindow, mSepiaKernel);
break; break;
case ImageManipulationsActivity.VIEW_MODE_ZOOM: case ImageManipulationsActivity.VIEW_MODE_ZOOM: