JavaCV 例程学习笔记 (openCV java版,实际例程用scala编写)第一章

本文记录javaCV官方例程(https://github.com/bytedeco/javacv-examples/blob/master/OpenCV_Cookbook/README.md)学习笔记

例程实例源自Robert Laganière的"OpenCV 2 Computer Vision Application Programming Cookbook" 一书(有空做个这书的网盘下载链接再贴上来,忘了贴可留言提醒我)

 

例程用Scala编写

 

OpenCV (Open Source Computer Vision) is a library of several hundred algorithms for computer vision and video analysis. OpenCV can be us on JVM using two approaches. First are Java wrappers provided by OpenCV. Second are are wrappers based on JavaCPP (C++ wrapper engine for JVM) called OpenCV JavaCPP Presets. There are also JavaCPP presets for other computer vision related libraries like: FFmpeg, libdc1394, PGR FlyCapture, OpenKinect, videoInput, ARToolKitPlus, flandmark, and others. JavaCV combines libraries in JavaCPP Presets and add some additional functionality that makes them easier use on JVM.

 

JavaCV模块对应OpenCV,名称功能如下:

 

  • Main modules:
    • core. Core functionality
    • imgproc. Image processing
    • imgcodecs. Image file reading and writing
    • videoio. Media I/O
    • highgui. High-level GUI
    • video. Video Analysis
    • calib3d. Camera Calibration and 3D Reconstruction
    • features2d. 2D Features Framework
    • objdetect. Object Detection
    • ml. Machine Learning
    • flann. Clustering and Search in Multi-Dimensional Spaces
    • photo. Computational Photography
    • stitching. Images stitching
    • cudaarithm. Operations on Matrices
    • cudabgsegm. Background Segmentation
    • cudacodec. Video Encoding/Decoding
    • cudafeatures2d. Feature Detection and Description
    • cudafilters. Image Filtering
    • cudaimgproc. Image Processing
    • cudalegacy. Legacy support
    • cudaobjdetect. Object Detection
    • cudaoptflow. Optical Flow
    • cudastereo. Stereo Correspondence
    • cudawarping. Image Warping
    • cudev. Device layer
    • hal. Hardware Acceleration Layer
    • shape. Shape Distance and Matching
    • superres. Super Resolution
    • videostab. Video Stabilization
    • viz. 3D Visualizer
  • Extra modules:
    • adas. Advanced Driver Assistance
    • bgsegm. Improved Background-Foreground Segmentation Methods
    • bioinspired. Biologically inspired vision models and derivated tools
    • ccalib. Custom Calibration Pattern for 3D reconstruction
    • cvv. GUI for Interactive Visual Debugging of Computer Vision Programs
    • datasets. Framework for working with different datasets
    • face. Face Recognition
    • latentsvm. Latent SVM
    • line_descriptor. Binary descriptors for lines extracted from an image
    • matlab. MATLAB Bridge
    • optflow. Optical Flow Algorithms
    • reg. Image Registration
    • rgbd. RGB-Depth Processing
    • saliency. Saliency API
    • surface_matching. Surface Matching
    • text. Scene Text Detection and Recognition
    • tracking. Tracking API
    • xfeatures2d. Extra 2D Features Framework
    • ximgproc. Extended Image Processing
    • xobjdetect. Extended object detection
    • xphoto. Additional photo processing algorithms

 

 

 

第一章:

Ex1-图片的打开与显示:

知识点:

1.练习图片的打开,javacpp.opencv_imgcodecs库下imread函数得到图像 opencv_core.Mat 数据

Mat相关介绍及函数链接见:http://bytedeco.org/javacpp-presets/opencv/apidocs/org/bytedeco/javacpp/opencv_core.Mat.html

2. javacv.CanvasFrame 用于创建显示窗口,Java的UI函数库javax.swing.JFrame用于辅助处理javacv的显示动作

3.  javacv.OpenCVFrameConverter用于将opencv_core.Mat转为可显示的Java Buffered image图像数据(即javacv.Frame数据)

 

Ex-2 图片GUI:

 

C++中用Qt GUI工具箱实现,这里使用Scala的Swing库来实现类似功能

知识点:

1. 使用scala.swing.Action()函数定义动作,函数详情:https://www.scala-lang.org/api/2.11.0/scala-swing/#scala.swing.Action (找不到2.10.4的doc)

 

 

 

你可能感兴趣的:(音视频处理)