资源简介
《深入理解OpenCV:实用计算机视觉项目解析》系统地介绍如何使用OpenCV来构建与计算机视觉相关的应用,如增强现实、车牌识别、人脸检测等。每章都会介绍一个典型的计算机视觉应用问题,并并提供相关的背景介绍及全部源代码,为快速解决实际计算机视觉项目遇到的问题提供系统实用指南。
代码片段和文件信息
/*****************************************************************************
* Cartoonifier for Android.
******************************************************************************
* by Shervin Emami 5th Dec 2012 (shervin.emami@gmail.com)
* http://www.shervinemami.info/
******************************************************************************
* Ch1 of the book “Mastering OpenCV with Practical Computer Vision Projects“
* Copyright Packt Publishing 2012.
* http://www.packtpub.com/cool-projects-with-opencv/book
*****************************************************************************/
#include
#include
#include
#include
#include “cartoon.h“
#include “ImageUtils.h“ // Handy functions for debugging OpenCV images by Shervin Emami.
using namespace std;
using namespace cv;
extern “C“ {
// Just show the plain camera image without modifying it.
JNIEXPORT void JNICALL Java_com_Cartoonifier_CartoonifierView_ShowPreview(JNIEnv* env jobject
jint width jint height jbyteArray yuv jintArray bgra)
{
// Get native access to the given Java arrays.
jbyte* _yuv = env->GetByteArrayElements(yuv 0);
jint* _bgra = env->GetIntArrayElements(bgra 0);
// Prepare a cv::Mat that points to the YUV420sp data.
Mat myuv(height + height/2 width CV_8UC1 (uchar *)_yuv);
// Prepare a cv::Mat that points to the BGRA output data.
Mat mbgra(height width CV_8UC4 (uchar *)_bgra);
// Convert the color format from the camera‘s
// NV21 “YUV420sp“ format to an Android BGRA color image.
cvtColor(myuv mbgra CV_YUV420sp2BGRA);
// OpenCV can now access/modify the BGRA image if we want ...
// Release the native lock we placed on the Java arrays.
env->ReleaseIntArrayElements(bgra _bgra 0);
env->ReleaseByteArrayElements(yuv _yuv 0);
}
DECLARE_TIMING(CartoonifyImage);
// Modify the camera image using the Cartoonifier filter.
JNIEXPORT void JNICALL Java_com_Cartoonifier_CartoonifierView_CartoonifyImage(JNIEnv* env jobject
jint width jint height jbyteArray yuv jintArray bgra
jboolean sketchMode jboolean alienMode jboolean evilMode jboolean debugMode)
{
START_TIMING(CartoonifyImage);
// Get native access to the given Java arrays.
jbyte* _yuv = env->GetByteArrayElements(yuv 0);
jint* _bgra = env->GetIntArrayElements(bgra 0);
// Input color format (from camera):
// “myuv“ is the color image in the camera‘s native NV21 YUV 420 “semi-planar“ format which means
// the first part of the array is the grayscale pixel array followed by a quarter-sized pixel
// array that is the U & V color channels interleaved. So if we just want to access a grayscale
// image we can get it directly from the 1st part of a YUV420sp semi-planar image without any
// conversions. But if we want a color image (eg: BGRA color format that i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2012-12-29 04:28 code-master\
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\
文件 444 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\.classpath
文件 5500 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\.cproject
文件 2972 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\.project
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\.settings\
文件 617 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\.settings\org.eclipse.jdt.core.prefs
文件 1349 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\AndroidManifest.xm
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\jni\
文件 1538 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\jni\Android.mk
文件 84 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\jni\Application.mk
文件 5308 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\jni\jni_part.cpp
文件 361 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\project.properties
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\res\
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\res\drawable\
文件 5760 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\res\drawable\icon.png
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\res\values\
文件 118 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\res\values\strings.xm
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\com\
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\com\Cartoonifier\
文件 4003 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\com\Cartoonifier\CartoonifierApp.java
文件 10271 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\com\Cartoonifier\CartoonifierView.java
文件 9315 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Android\src\com\Cartoonifier\CartoonifierViewba
目录 0 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\
文件 290 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\CMakeLists.txt
文件 21322 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\ImageUtils.h
文件 87458 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\ImageUtils_0.7.cpp
文件 13555 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\cartoon.cpp
文件 1634 2012-12-29 04:28 code-master\Chapter1_AndroidCartoonifier\Cartoonifier_Desktop\cartoon.h
............此处省略365个文件信息
相关资源
- opencv 3.1.0.zip
- face_landmark_model.dat
- 算法设计 智能剪刀算法 opencv
- 学习OpenCV必备书籍5本中文版
- opencv4.1-build-X64-debug.zip
- resnet50_weights_tf_dim_ordering_tf_kernels.h5
- caffe+opencv+dilb 在vs上配置
- opencv dnn模块的demo
- mingw64+opencv.zip
- 使用OpenCV人头检测
- opencv3.4.1完整资源
- 编译OpenCV3.4.1x86版本 +contrib+vs2017x64
- 基于VC+opencv的人脸识别识别出五官
- OPENCV函数学习手册.pdf
- 《深入理解OpenCV实用计算机视觉项目
- opencv3.4+contrib模块编译好的安装包
- OpenCV计算机视觉编程攻略第3版.pdf源码
- opencv contrib (Extra modules) 用cmake 生成
- OpenCV3.4.4 源代码
- opencv学习资源.zip
- 基于OPENCV的车牌识别系统源码
- 自己写的QT图像处理系统打包的过程可
- opencv2.3.0
- opencv3编程入门毛星宇
- OpenCV3编程入门(完整版).pdf+代码
- opencv-2.4.11
- 学习OpenCV3
- OpenCV几包计数
- 用OpenCV对图像中圆的检测以及拟合
- 投影互动软件非源代码
评论
共有 条评论