当前位置: 首页>>代码示例>>Java>>正文


Java BuildConfig.DEBUG属性代码示例

本文整理汇总了Java中org.opencv.BuildConfig.DEBUG属性的典型用法代码示例。如果您正苦于以下问题:Java BuildConfig.DEBUG属性的具体用法?Java BuildConfig.DEBUG怎么用?Java BuildConfig.DEBUG使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.opencv.BuildConfig的用法示例。


在下文中一共展示了BuildConfig.DEBUG属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onPreviewFrame

@Override
public void onPreviewFrame(byte[] frame, Camera arg1) {
    if (BuildConfig.DEBUG)
        Log.d(TAG, "Preview Frame received. Frame size: " + frame.length);
    synchronized (this) {
        mFrameChain[mChainIdx].put(0, 0, frame);
        mCameraFrameReady = true;
        this.notify();
    }
    if (mCamera != null)
        mCamera.addCallbackBuffer(mBuffer);
}
 
开发者ID:SCHS-Robotics,项目名称:Team9261-2017-2018,代码行数:12,代码来源:JavaCameraView.java

示例2: enhancement

/**
 * Enhance the image after ridge filter.
 * Apply mask, binary threshold, thinning, ..., etc.
 */
private void enhancement(Mat source, Mat result, int blockSize, int rows, int cols, int padding) {
    Mat MatSnapShotMask = snapShotMask(rows, cols, padding);
    Mat paddedMask = imagePadding(MatSnapShotMask, blockSize);

    if (BuildConfig.DEBUG && !paddedMask.size().equals(source.size())) {
        throw new RuntimeException("Incompatible sizes of image and mask");
    }

    // apply the original mask to get rid of extras
    Core.multiply(source, paddedMask, result, 1.0, CvType.CV_8UC1);

    // apply binary threshold
    Imgproc.threshold(result, result, 0, 255, Imgproc.THRESH_BINARY);
}
 
开发者ID:jorenham,项目名称:fingerblox,代码行数:18,代码来源:ImageProcessing.java

示例3: deliverAndDrawFrame

/**
 * This method shall be called by the subclasses when they have valid
 * object and want it to be delivered to external client (via callback) and
 * then displayed on the screen.
 * @param frame - the current frame to be delivered
 */
protected void deliverAndDrawFrame(CvCameraViewFrame frame) {
    Mat modified;

    if (mListener != null) {
        modified = mListener.onCameraFrame(frame);
    } else {
        modified = frame.rgba();
    }

    boolean bmpValid = true;
    if (modified != null) {
        try {
            Utils.matToBitmap(modified, mCacheBitmap);
        } catch(Exception e) {
            Log.e(TAG, "Mat type: " + modified);
            Log.e(TAG, "Bitmap type: " + mCacheBitmap.getWidth() + "*" + mCacheBitmap.getHeight());
            Log.e(TAG, "Utils.matToBitmap() throws an exception: " + e.getMessage());
            bmpValid = false;
        }
    }

    if (bmpValid && mCacheBitmap != null) {
        Canvas canvas = getHolder().lockCanvas();
        if (canvas != null) {
            canvas.drawColor(0, android.graphics.PorterDuff.Mode.CLEAR);
            if (BuildConfig.DEBUG)
                Log.d(TAG, "mStretch value: " + mScale);

            if (mScale != 0) {
                canvas.drawBitmap(mCacheBitmap, new Rect(0,0,mCacheBitmap.getWidth(), mCacheBitmap.getHeight()),
                     new Rect((int)((canvas.getWidth() - mScale*mCacheBitmap.getWidth()) / 2),
                     (int)((canvas.getHeight() - mScale*mCacheBitmap.getHeight()) / 2),
                     (int)((canvas.getWidth() - mScale*mCacheBitmap.getWidth()) / 2 + mScale*mCacheBitmap.getWidth()),
                     (int)((canvas.getHeight() - mScale*mCacheBitmap.getHeight()) / 2 + mScale*mCacheBitmap.getHeight())), null);
            } else {
                 canvas.drawBitmap(mCacheBitmap, new Rect(0,0,mCacheBitmap.getWidth(), mCacheBitmap.getHeight()),
                     new Rect((canvas.getWidth() - mCacheBitmap.getWidth()) / 2,
                     (canvas.getHeight() - mCacheBitmap.getHeight()) / 2,
                     (canvas.getWidth() - mCacheBitmap.getWidth()) / 2 + mCacheBitmap.getWidth(),
                     (canvas.getHeight() - mCacheBitmap.getHeight()) / 2 + mCacheBitmap.getHeight()), null);
            }

            if (mFpsMeter != null) {
                mFpsMeter.measure();
                mFpsMeter.draw(canvas, 20, 30);
            }
            getHolder().unlockCanvasAndPost(canvas);
        }
    }
}
 
开发者ID:vipycm,项目名称:mao-android,代码行数:56,代码来源:CameraBridgeViewBase.java


注:本文中的org.opencv.BuildConfig.DEBUG属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。