[JAVA] Bureau: OpenCV prend une photo

Goal
Take a picture using opencv with webcam.

opencv_webcam1.java


import org.opencv.core.Core;
import org.opencv.core.Mat;
import org.opencv.imgcodecs.Imgcodecs;
import org.opencv.videoio.VideoCapture;

public class Opencv_webcam1{

	static {
		System.loadLibrary(Core.NATIVE_LIBRARY_NAME);
	}
	
	public static void main(String[] args) {
		VideoCapture camera = new VideoCapture();
		camera.open(0);
		
		if(!camera.isOpened()) {
			System.out.println("Camera not open");
		}else {
			Mat frame = new Mat();
			try {
				System.out.println("Utiliser Webcam Beat");
				camera.read(frame);
				Imgcodecs.imwrite("D:\\projects\\Java\\OpenCV_Samples\\resource\\imgs\\frame.jpg ",frame);
				System.out.println("Achèvement des applaudissements");
				
			}catch (Exception e) {
				e.printStackTrace();
			}
			camera.release();
		}
		
	}

}

Result
![frame.jpg](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/276243/11ca6473-2951-b521-a2e0-dabd0e629043.jpeg)

Recommended Posts

Bureau: OpenCV prend une photo
Bureau: Manuel OpenCV une prise de vue
Bureau: OpenCV prend une image claire
Bureau: image de fusion OpenCV
Bureau: seuil OpenCV
Bureau: OpenCV BilateralFilterBlur
Bureau: OpenCV Dilate
Bureau: OpenCV Expand
Bureau: OpenCV Affine
Bureau: OpenCV Emboss
Bureau: OpenCV Ellipse2Poly
Bureau: OpenCV HDR
Bureau: Polylignes OpenCV
Bureau: netteté OpenCV
Bureau: OpenCV Concat
Bureau: OpenCV OpenCV_SalonUseBlurAddWeighted
Bureau: OpenCV Mosaic
Bureau: OpenCV Erode
Bureau: OpenCV Denoise
Bureau: Rectangle OpenCV
Bureau: OpenCV Watershed
Bureau: Texte OpenCV
Bureau: OpenCV Inpaint
Bureau: OpenCV NormalizeBlur
Bureau: OpenCV Canny
Bureau: OpenCV Denoise3
Bureau: histogramme OpenCV
Bureau: OpenCV Dft
Bureau: OpenCV Decolor
Bureau: OpenCV FaceDetector
Bureau: OpenCV Denoise2
Bureau: OpenCV StereoBM
Bureau: Filtre OpenCV Kirsch
Bureau: Filtre laplacien OpenCV 2
Bureau: Changement d'éclairage OpenCV
Bureau: OpenCV Add WaterMark
Bureau: OpenCV Fill ConvexPoly
Bureau: OpenCV Grab Cut
Bureau: OpenCV Sharpness Gui
Bureau: Changement de couleur OpenCV
Bureau: Filtre Freichennel OpenCV
Bureau: seuil adaptatif OpenCV
Bureau: OpenCV Fill Poly
Bureau: OpenCV Mean Filter
Bureau: référentiel Java OpenCV
Bureau: OpenCV Sobel Filter2
Bureau: OpenCV pyrMeanShift Filter
Bureau: OpenCV OpticalFlow PyrLK
Bureau: Piano virtuel OpenCV
Bureau: Filtre OpenCV Scharr
Bureau: aperçu de la webcam Opencv
Bureau: Filtre laplacien OpenCV
Bureau: Flou médian OpenCV
Bureau: OpenCV Add Broad
Bureau: enregistrement vidéo OpenCV
Bureau: OpenCV Flood Fill
Bureau: espace colorimétrique OpenCV
Bureau: Filtre OpenCV SqrBox
Bureau: redimensionner l'image OpenCV
Bureau: Croquis au crayon OpenCV
Bureau: carte des couleurs OpenCV