这周做的一个android的camera开发,需要获取到视频帧数据,并且需要是nv21格式的byte数组,并且视频帧的图像需要是正方向的。和android相机打过交道的都清楚,android的camera获取到的图片都是横向的,因此,需要进行旋转,对于图像的旋转,其实bitmap这个类已经可以帮我们实现了,但是前提是你需要将你的数据格式转换为Bitmap才行,但是我们如果通过setPreviewCallback来获取视频帧,获取到的图片都是nv21,如果装换为bitmap后,又很难的转换为nv21格式的数据。因此则需要面临一个问题,如歌旋转nv21格式的byte数组,首先先来讲下nv21格式,讲到nv21就也要说说yuv240和nv12:

NV12、NV21(属于YUV420)

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAl0AAACTCAIAAAA7nTuRAAAXNklEQVR4nO2dMZqzKhuG3RbrcBOswS24gd8V2J/LBdidxt7T0tNS8xfPNcioMZrJzPh93HeVZJhongAPvBDeKgIAAMAH1W/fAAAAwI3AFwEAABbwRQAAgAV8EQAAYAFfBAAAWMAXAQAAFvBFAACABXwRAABgAV8EAABYwBcBAAAW7uiLIYSu69q2bdu267oQwm/fEfzZOOestVVVVVU1DMPqxbZtY4zzPFdVNY7jr97pXUCxq4QQmqaRYm3bqtcKIbRtW1VV0zTee+ecMabv+9++2VtwZ8Xu6ItN0zRNkx6rEQJ8hRBCXddVVTnn0ott26YmN89zXdd1Xf/SDd4OFHsBdfRpJBFjHMcx9WbOubqujTG/dHd35J6KnfXFrusuve/V8gnnXFVV8zzrqcakecsEeA3VJWutnmr2kxdwzjGWz0Gxq3jvjTHGmDT7qevae58XYKCfc0/FTvniNE1VdWFm+bS89/6RcQ7DUFVV0sV7vxpNALyMQjQK/Vlr0/ArxhhCoIvfgmJXGccxhZr7vl/1XSwMbbmhYjvuNc+zFvZSDFPhlKZpZGZa/NNfQwje+77v67oex9EYMwzDqvzuJR4Zp9rhp1usKq01rsaqAFcJIWhwOgzDQUhDKx/WWgUqNE9qmqbAHu2SYiIN/FM0rDQUGxzH8bjLyutVWmwrcw5wSbHUMPu+r6rq5djkATvmZIxJo0LV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j+SLAMWfmiymOqu5eNTyN3hS30Cvl1LpLukXkOjFfTE/z7iuPIp6cMPxNXNIt/pRc++6l2ZgxRh3E1vbkmld9UW6/RbtMV7Rtm+9Hapomj5cqSvPKJ4bCUGU+2CW/6t/T09Tqtg9K4KpuyHUg16pL1JRRjwv3xUu6xV/0RbnUPM/pjvOb6/s++dNVX0w8/Txd16UP770PIbAfFV5DgY3tKCqFQ/K6pNGe6t7uBCjf/PV3c0m3iFyHcm19MZUs3Bcv6RZ/0Rfzqpz7YghBZmmMcc6N41hVVdd127vPy+9e9fjzaF/P+IEkCyEYY9LvF7UIFFlfhBOkFZ0UrpmmKe0KqbLfTqX6Fj/X0rqutauwnAWzeEK3XV+MyLWRa7UUlW/vKtwX42ndxK/5orVWJw60bat6772v61rfpdYMtEdIJxRoVCiP1AfLy+9e9eDzSIic1LR2z7thPyqcQS0tHaihhQD9aRgG1fmmafLGqTV/NQGdwVTUBkvxSDetiaSjNiJyxRgfy6W+S3WsbdvUMaq7S7sLcw2LYle3rbP8mFzFjU0AAAAOwBcBAAAW8EUAAIAFfBEAAGABXwQAAFjAFwEAABbwRQAAgAV8EQAAYAFfBAAAWMAXAQAAFvBFAACAhf8DBRaX7b+6ZcMAAAAASUVORK5CYII=" alt="" />

NV12和NV21属于YUV420格式,是一种two-plane模式,即Y和UV分为两个Plane,但是UV(CbCr)为交错存储,而不是分为三个plane。其提取方式与上一种类似,即Y'00、Y'01、Y'10、Y'11共用Cr00、Cb00

YUV420 planar数据存储, 以720×488大小图象YUV420 planar为例,

其存储格式是: 共大小为(720×480×3>>1)字节,

分为三个部分: Y分量:       (720×480)个字节   U(Cb)分量:  (720×480>>2)个字节     V(Cr)分量:   (720×480>>2)个字节

三个部分内部均是行优先存储,三个部分之间是Y,U,V 顺序存储。

即YUV数据的0--720×480字节是Y分量值,    720×480--720×480×5/4字节是U分量    720×480×5/4 --720×480×3/2字节是V分量。

4 :2: 2 和4:2:0 转换:

最简单的方式:

YUV4:2:2 ---> YUV4:2:0  Y不变,将U和V信号值在行(垂直方向)在进行一次隔行抽样。 YUV4:2:0 ---> YUV4:2:2  Y不变,将U和V信号值的每一行分别拷贝一份形成连续两行数据。

在YUV420中,一个像素点对应一个Y,一个4X4的小方块对应一个U和V。对于所有 YUV420图像,它们的Y值排列是完全相同的,因为只有Y的图像就是灰度图像。YUV420sp与YUV420p的数据格式它们的UV排列在原理上是完 全不同的。420p它是先把U存放完后,再存放V,也就是说UV它们是连续的。而420sp它是UV、UV这样交替存放的。(见下图) 有了上面的理论,我就可以准确的计算出一个YUV420在内存中存放的大小。 width * hight =Y(总和) U = Y / 4   V = Y / 4

所以YUV420 数据在内存中的长度是 width * hight * 3 / 2,

假设一个分辨率为8X4的YUV图像,它们的格式如下图:

图:YUV420sp格式

图:YUV420p数据格式如下图

具体的旋转代码如下:

public static byte[] rotateYUV420Degree90(byte[] data, int imageWidth, int imageHeight) {
byte[] yuv = new byte[imageWidth * imageHeight * 3 / 2];
int i = 0;
for (int x = 0; x < imageWidth; x++) {
for (int y = imageHeight - 1; y >= 0; y--) {
yuv[i] = data[y * imageWidth + x];
i++;
}
}
i = imageWidth * imageHeight * 3 / 2 - 1;
for (int x = imageWidth - 1; x > 0; x = x - 2) {
for (int y = 0; y < imageHeight / 2; y++) {
yuv[i] = data[(imageWidth * imageHeight) + (y * imageWidth) + x];
i--;
yuv[i] = data[(imageWidth * imageHeight) + (y * imageWidth)
+ (x - 1)];
i--;
}
}
return yuv;
} private static byte[] rotateYUV420Degree180(byte[] data, int imageWidth, int imageHeight) {
byte[] yuv = new byte[imageWidth * imageHeight * 3 / 2];
int i = 0;
int count = 0;
for (i = imageWidth * imageHeight - 1; i >= 0; i--) {
yuv[count] = data[i];
count++;
}
i = imageWidth * imageHeight * 3 / 2 - 1;
for (i = imageWidth * imageHeight * 3 / 2 - 1; i >= imageWidth
* imageHeight; i -= 2) {
yuv[count++] = data[i - 1];
yuv[count++] = data[i];
}
return yuv;
} public static byte[] rotateYUV420Degree270(byte[] data, int imageWidth,
int imageHeight) {
byte[] yuv = new byte[imageWidth * imageHeight * 3 / 2];
int nWidth = 0, nHeight = 0;
int wh = 0;
int uvHeight = 0;
if (imageWidth != nWidth || imageHeight != nHeight) {
nWidth = imageWidth;
nHeight = imageHeight;
wh = imageWidth * imageHeight;
uvHeight = imageHeight >> 1;// uvHeight = height / 2
} int k = 0;
for (int i = 0; i < imageWidth; i++) {
int nPos = 0;
for (int j = 0; j < imageHeight; j++) {
yuv[k] = data[nPos + i];
k++;
nPos += imageWidth;
}
}
for (int i = 0; i < imageWidth; i += 2) {
int nPos = wh;
for (int j = 0; j < uvHeight; j++) {
yuv[k] = data[nPos + i];
yuv[k + 1] = data[nPos + i + 1];
k += 2;
nPos += imageWidth;
}
}
return rotateYuv420Degree180(rotateYuv420Degree90(data, imageWidth, imageHeight), imageWidth, imageHeight);
}

然后,如果你想要查看旋转后的图像,则通过以下代码即可:

YuvImage yuvimage = new YuvImage(
data,
ImageFormat.NV21,
width,
height,
null);
baos = new ByteArrayOutputStream();
yuvimage.compressToJpeg(new Rect(0, 0, width, height), 100, baos);// 80--JPG图片的质量[0-100],100最高
rawImage = baos.toByteArray();
//将rawImage转换成bitmap
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.RGB_565;
bitmap = BitmapFactory.decodeByteArray(rawImage, 0, rawImage.length, options);

在这里边我们需要注意的是我们的宽和高,需要用转移后的,不可使用转移前的,否则会出现看到的图片有重影的现象。  

  

android camera之nv21旋转的更多相关文章

  1. 【Android】Android Camera原始帧格式转换 —— 获取Camera图像(一)

     概述: 做过Android Camera图像采集和处理的朋友们应该都知道,Android手机相机采集的原始帧(RawFrame)默认是横屏格式的,而官方API有没有提供一个设置Camera采集图像的 ...

  2. Android 7.1 屏幕旋转流程分析

    Android 7.1   屏幕旋转流程分析 一.概述 Android屏幕的旋转在framework主要涉及到三个类,结构如图 PhoneWindowManager:为屏幕的横竖屏转换的管理类. Wi ...

  3. Android Camera开发系列(下)——自定义Camera实现拍照查看图片等功能

    Android Camera开发系列(下)--自定义Camera实现拍照查看图片等功能 Android Camera开发系列(上)--Camera的基本调用与实现拍照功能以及获取拍照图片加载大图片 上 ...

  4. Android -- Camera源码简析,启动流程

    com.android.camera.Camera.java,主要的实现Activity,继承于ActivityBase. ActivityBase 在ActivityBase中执行流程: onCre ...

  5. Android Camera开发经验总结以及踩过的那些坑

    写在开头 需求方:上传试卷的时候,用户自己拍的照片有很多问题.如:不清晰.图片歪了.错误图片等.我们要是能够对拍摄照片进行识别处理就好了,能够裁切矫正就更好了,最好可以像二维码扫描一样,直接识别处理- ...

  6. Android Camera子系统之源码View

    本文基于Android 4.2.2+Linux3.6.9+SAMA5D3 SoC从源码的角度审视Android Camera子系统. 应用层 Androd原生Camera应用 /system/app/ ...

  7. android camera setMeteringArea详解

    摘要: 本文为作者原创,未经允许不得转载:原文由作者发表在博客园:http://www.cnblogs.com/panxiaochun/p/5802814.html setMeteringArea() ...

  8. Android — Camera聚焦流程

    原文  http://www.cnphp6.com/archives/65098 主题 Android Camera.java autoFocus()聚焦回调函数 @Override public v ...

  9. android camera setParameters failed 类问题分析总结

    在 monkey test 测试中出现了一例 RuntimeException ,即 setParameters failed. LOG显示为:09-01 18:47:17.348 15656 156 ...

随机推荐

  1. es安装脚本

    #!/bin/bash file_name="/sdzw/es5/conf/es.config" #安装目录 install_dir="/es5/esinstall&qu ...

  2. Java Web 设置默认首页 (也就是http://域名/项目名称/)访问的页面

    第一种: 默认的是index.jsp页面,放在webapp文件夹下 在web.xml配置如下 第二种: 默认的页面不是放在webapp文件夹下,而是放在web-inf下,那么此时可以用springMV ...

  3. Linux C高级编程——网络编程之以太网(2)

    Linux网络编程--以太网 宗旨:技术的学习是有限的,分享的精神是无限的. 1.以太网帧格式 源地址和目的地址是指网卡的硬件地址(也叫MAC地址),长度是48位,是在网卡出厂时固化的.用ifconf ...

  4. 升级_开阔视野之Oracle图形化升级(dbca建库后升级)—10.2.0.1.0升为10.2.0.5.0

    ***********************************************声明*************************************************** ...

  5. Android常用传感器用法一览(2)

    在Android2.3 gingerbread系统中,google提供了11种传感器供应用层使用. #define SENSOR_TYPE_ACCELEROMETER       1 //加速度#de ...

  6. ffmpeg的新东东:AVFilter

    http://blog.csdn.net/niu_gao/article/details/7219641 利用ffmpeg做图像的pixel format转换你还在用libswscale吗?嘿嘿,过时 ...

  7. malloc、calloc、realloc的区别(转)

    (1)C语言跟内存分配方式 <1>从静态存储区域分配.       内存在程序编译的时候就已经分配好,这块内存在程序的整个运行期间都存在.例如全局变量.static变量.<2> ...

  8. Visual studio之C# 利用Settings保存COM口配置信息

    背景 利用C#做一个串口通信项目,客户需求保存串口COM口的配置信息,在此利用Settings来进行保存. 正文 ".Settings"的创建 点击项目 --> 添加新项 - ...

  9. SecureCRT 默认配置

    1.配置默认设置

  10. Getting started with Chrome Dev Editor

    转自:https://github.com/GoogleChrome/chromedeveditor/blob/master/doc/GettingStarted.md Installation In ...