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


Java CameraBridgeViewBase.setVisibility方法代码示例

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


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

示例1: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_my);
    // get the OverlayView responsible for displaying images on top of the camera
    overlayView = (OverlayView) findViewById(R.id.overlay_view);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.java_camera_view);
    // Michael Troger
    if (FIXED_FRAME_SIZE) {
        mOpenCvCameraView.setMaxFrameSize(FRAME_SIZE_WIDTH, FRAME_SIZE_HEIGHT);
    }
    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);

    mOpenCvCameraView.setCvCameraViewListener(this);

    mi = new ActivityManager.MemoryInfo();
    activityManager = (ActivityManager) getSystemService(ACTIVITY_SERVICE);
}
 
开发者ID:michaeltroger,项目名称:shape-detection,代码行数:23,代码来源:MainActivity.java

示例2: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_main);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial1_activity_java_surface_view);

    // Michael Troger
    if (FIXED_FRAME_SIZE) {
        mOpenCvCameraView.setMaxFrameSize(FRAME_SIZE_WIDTH, FRAME_SIZE_HEIGHT);
    }

    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);

    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:michaeltroger,项目名称:template-matching,代码行数:21,代码来源:MainActivity.java

示例3: init_once

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
private void init_once() {
		Log.d(DEBUG_TAG, "on init once");

		renderer = new CVRenderer(this);
		mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.cv_camera_view);
		mOpenCvCameraView.setVisibility(CameraBridgeViewBase.VISIBLE);
		mOpenCvCameraView.setCvCameraViewListener(renderer);

//		cameraOverlay = (CameraOverlay) findViewById(R.id.display_surface);
//		cameraOverlay.bringToFront();
//		mPreview = (CameraPreview) findViewById(R.id.camera_preview);
//		if (Const.DISPLAY_PREVIEW_ONLY) {
//			RelativeLayout.LayoutParams invisibleLayout = new RelativeLayout.LayoutParams(0, 0);
//			mDisplay.setLayoutParams(invisibleLayout);
//			mDisplay.setVisibility(View.INVISIBLE);
//			mDisplay.setZOrderMediaOverlay(false);
//		}
//		mPreview.setPreviewCallback(previewCallback);
//		cameraOverlay.setImageSize(mPreview.imageSize);

		Const.ROOT_DIR.mkdirs();
		Const.LATENCY_DIR.mkdirs();

		hasStarted = true;
	}
 
开发者ID:cmusatyalab,项目名称:faceswap,代码行数:26,代码来源:GabrielClientActivity.java

示例4: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.camera_activity);
    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.CameraView);
    //mOpenCvCameraView.setMaxFrameSize(240,135);
    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);

    detector = new GestureDetector(this);

    debugConsole = (TextView) findViewById(R.id.debugConsole);

    if(blue.btEnabled) {
        try {
            bt.runBT();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
 
开发者ID:Petroula,项目名称:Android-Car-duino,代码行数:25,代码来源:CameraActivity.java

示例5: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);

    // Load ndk built module, as specified
    // in moduleName in build.gradle
    System.loadLibrary("native");

    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_main);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.camera_view);

    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);

    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:jlhonora,项目名称:opencv-android-sample,代码行数:21,代码来源:MainActivity.java

示例6: onStart

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
@Override
public void onStart() {
	super.onStart();
	cameraButton = (Button) this.getView().findViewById(R.id.camera_button);
	cameraButton.setOnClickListener(new View.OnClickListener(){
		@Override
		public void onClick(View v) {
			getMatcher().execute(lastFrame);
			calculatingMatch = true;
		}
	});
	cameraView = (CameraBridgeViewBase) this.getActivity().findViewById(R.id.javaCameraView);
	cameraView.setVisibility(SurfaceView.VISIBLE);
	cameraView.setCvCameraViewListener(this);
	cameraView.enableView();
}
 
开发者ID:g-rauhoeft,项目名称:enchantment,代码行数:17,代码来源:CameraView.java

示例7: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.face_detect_surface_view);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.fd_activity_surface_view);
    mOpenCvCameraView.setVisibility(CameraBridgeViewBase.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:yippeesoft,项目名称:NotifyTools,代码行数:14,代码来源:FdActivity.java

示例8: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.tutorial1_surface_view);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial1_activity_java_surface_view);

    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);

    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:InnoFang,项目名称:Android-Code-Demos,代码行数:16,代码来源:Tutorial1Activity.java

示例9: initializeVision

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
protected final void initializeVision(int framePreview, TestableVisionOpMode opMode) {
    openCVCamera = (CameraBridgeViewBase) findViewById(framePreview);
    openCVCamera.setVisibility(SurfaceView.VISIBLE);
    openCVCamera.setCvCameraViewListener(this);

    this.opMode = opMode;

    opMode.sensors = new Sensors();
    opMode.fps = new FPS();
    //FIXME this is the line that causes glitchiness
    TestableVisionOpMode.openCVCamera = (JavaCameraView) openCVCamera;
}
 
开发者ID:ykarim,项目名称:FTC2016,代码行数:13,代码来源:VisionEnabledActivity.java

示例10: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    askPermissions();
    JniManager.init();
    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.camera_surface);
    mOpenCvCameraView.setVisibility(CameraBridgeViewBase.VISIBLE);
    mOpenCvCameraView.setMaxFrameSize(640, 480);
    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:uelordi01,项目名称:Android-opencv-native-samples,代码行数:13,代码来源:MainActivity.java

示例11: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.face_detect_surface_view);
    askPermissions();
    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.fd_activity_surface_view);
    mOpenCvCameraView.setVisibility(CameraBridgeViewBase.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);
}
 
开发者ID:uelordi01,项目名称:Android-opencv-native-samples,代码行数:14,代码来源:FdActivity.java

示例12: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    setContentView(R.layout.activity_main);

    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.CAMERA)
            != PackageManager.PERMISSION_GRANTED) {
        Log.i("permission", "request CAMERA");
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.CAMERA}, REQUEST_CAMERA);
    }else {
        Log.i("permission", "CAMERA already granted");
        camera_granted = true;
    }
    if (ContextCompat.checkSelfPermission(MainActivity.this, Manifest.permission.READ_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED) {
        Log.i("permission", "request EXTERNAL_STROAGE");
        ActivityCompat.requestPermissions(MainActivity.this, new String[]{Manifest.permission.READ_EXTERNAL_STORAGE}, REQUEST_EXTERNAL_STROAGE);
    }else {
        Log.i("permission", "EXTERNAL_STROAGE already granted");
        read_external_storage_granted = true;
    }

    OpenCVLoader.initAsync(OpenCVLoader.OPENCV_VERSION_3_2_0, this, mLoaderCallback);

    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.java_surface_view);
    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);

    Log.d("OCR", "onCreate done");

}
 
开发者ID:johnhany,项目名称:MOAAP,代码行数:35,代码来源:MainActivity.java

示例13: onCreate

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
/**
 * Called when the activity is first created.
 */
@Override
public void onCreate(Bundle savedInstanceState) {

    Log.i(TAG, "called onCreate");
    super.onCreate(savedInstanceState);
    getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
    setContentView(R.layout.layout);
    mOpenCvCameraView = (CameraBridgeViewBase) findViewById(R.id.tutorial1_activity_java_surface_view);
    mOpenCvCameraView.setVisibility(SurfaceView.VISIBLE);
    mOpenCvCameraView.setCvCameraViewListener(this);
    tvName = (TextView) findViewById(R.id.text1);

}
 
开发者ID:akshika47,项目名称:OpencvAndroid,代码行数:17,代码来源:MainActivity.java

示例14: OpenCVFrameGrabberInit

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
public OpenCVFrameGrabberInit(CameraBridgeViewBase cameraBridgeViewBase, int frameWidthRequest, int frameHeightRequest, FrameGrabber.CameraOrientation cameraOrientation, boolean ignoreOrientationForDisplay) {
    this.cameraOrientation = cameraOrientation;
    this.ignoreOrientationForDisplay = ignoreOrientationForDisplay;

    cameraBridgeViewBase.setVisibility(SurfaceView.VISIBLE);

    cameraBridgeViewBase.setMinimumWidth(frameWidthRequest);
    cameraBridgeViewBase.setMinimumHeight(frameHeightRequest);
    cameraBridgeViewBase.setMaxFrameSize(frameWidthRequest, frameHeightRequest);
    cameraBridgeViewBase.setCvCameraViewListener(this);
}
 
开发者ID:FTC7393,项目名称:EVLib,代码行数:12,代码来源:OpenCVFrameGrabberInit.java

示例15: OpenCVFrameFeeder

import org.opencv.android.CameraBridgeViewBase; //导入方法依赖的package包/类
public OpenCVFrameFeeder(CameraBridgeViewBase cameraBridgeViewBase, int frameWidthRequest, int frameHeightRequest, FrameGrabber.CameraOrientation cameraOrientation, boolean ignoreOrientationForDisplay) {
    this.cameraOrientation = cameraOrientation;
    this.ignoreOrientationForDisplay = ignoreOrientationForDisplay;

    cameraBridgeViewBase.setVisibility(SurfaceView.VISIBLE);

    cameraBridgeViewBase.setMinimumWidth(frameWidthRequest);
    cameraBridgeViewBase.setMinimumHeight(frameHeightRequest);
    cameraBridgeViewBase.setMaxFrameSize(frameWidthRequest, frameHeightRequest);
    cameraBridgeViewBase.setCvCameraViewListener(this);
}
 
开发者ID:FTC7393,项目名称:EVLib,代码行数:12,代码来源:OpenCVFrameFeeder.java


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