yuv

Rotating YUV image data for Portrait Mode Using RenderScript

故事扮演 提交于 2021-02-15 04:35:00
问题 for a video image processing project, I have to rotate the incoming YUV image data so that the data is not shown horizontally but vertically. I used this project which gave me a tremendous insight in how to convert YUV image data to ARGB for processing them in real-time. The only drawback of that project is that it is only in landscape. There is no option for portrait mode (I do not know why the folks at Google present an example sample which handles only the landscape orientation). I wanted

Rotating YUV image data for Portrait Mode Using RenderScript

坚强是说给别人听的谎言 提交于 2021-02-15 04:34:24
问题 for a video image processing project, I have to rotate the incoming YUV image data so that the data is not shown horizontally but vertically. I used this project which gave me a tremendous insight in how to convert YUV image data to ARGB for processing them in real-time. The only drawback of that project is that it is only in landscape. There is no option for portrait mode (I do not know why the folks at Google present an example sample which handles only the landscape orientation). I wanted

Rotating YUV image data for Portrait Mode Using RenderScript

和自甴很熟 提交于 2021-02-15 04:34:18
问题 for a video image processing project, I have to rotate the incoming YUV image data so that the data is not shown horizontally but vertically. I used this project which gave me a tremendous insight in how to convert YUV image data to ARGB for processing them in real-time. The only drawback of that project is that it is only in landscape. There is no option for portrait mode (I do not know why the folks at Google present an example sample which handles only the landscape orientation). I wanted

Deference of YCrCb and YUV

非 Y 不嫁゛ 提交于 2021-02-10 14:28:43
问题 I was working on a image format converter, and I was trying to convert YcbCr to RGB. For the testing purpouse I was Looking for YcbCr formated image. Googling it always gives result of YUV, rather yCrCb. Are those formats same? is there any way to download (or convert) YCbCr Image ? 来源: https://stackoverflow.com/questions/29091813/deference-of-ycrcb-and-yuv

Deference of YCrCb and YUV

荒凉一梦 提交于 2021-02-10 14:28:02
问题 I was working on a image format converter, and I was trying to convert YcbCr to RGB. For the testing purpouse I was Looking for YcbCr formated image. Googling it always gives result of YUV, rather yCrCb. Are those formats same? is there any way to download (or convert) YCbCr Image ? 来源: https://stackoverflow.com/questions/29091813/deference-of-ycrcb-and-yuv

Lossless RGB24 to YUV444 transformation

混江龙づ霸主 提交于 2021-02-08 07:55:42
问题 I am currently attempting to undergo lossless compression of RGB24 files using H264 on FFMPEG. However, the color space transformation used in the H264 compression (RGB24 -> YUV444) has proven to be lossy (I'm guessing due to quantisation error). Is there anything else I can use (eg a program) to transform my RGB24 files to YUV losslessly, before compressing them with lossless H264? The ultimate goal is to compress an RGB24 file then decompress it, with the decompressed file exactly matching

Using opengl es shader to convert YUV to RGB

半世苍凉 提交于 2021-02-06 11:04:29
问题 I want to convert yuv to rgb in opengl es shader with just one sampler which contains yuv data. My code is below: 1) I send yuv data to texture: GLES20.glTexImage2D(GLES20.GL_TEXTURE_2D, 0, GLES20.GL_LUMINANCE, mData.w, mData.h * 3 / 2, 0, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE, ByteBuffer.wrap(mData.yuv)); 2) My vertex shader: attribute vec4 position; attribute vec2 inputTextureCoordinate; attribute mediump float width; varying vec2 v_texCoord; varying mediump vec2 v_vuTexCoord;

Python | Numpy array images transformations

与世无争的帅哥 提交于 2021-02-05 08:43:05
问题 I have a Numpy image array with shape (1000, 50, 100, 3) ( class 'numpy.ndarray' ) which is containing 1000 images RGB (height = 50, width = 100, channels = 3). I want to first convert the RGB values to YUV values and rescale them to obtain yuv values. A prototypical implementation of a pixel-wise converter is given below. My question : Is there a simple way how I can carry out this transformation? def yuv(_pixel): R, G, B = _pixel[0], _pixel[1], _pixel[2] Y = 0.299 * R + 0.587 * G + 0.114 *

Python | Numpy array images transformations

柔情痞子 提交于 2021-02-05 08:43:00
问题 I have a Numpy image array with shape (1000, 50, 100, 3) ( class 'numpy.ndarray' ) which is containing 1000 images RGB (height = 50, width = 100, channels = 3). I want to first convert the RGB values to YUV values and rescale them to obtain yuv values. A prototypical implementation of a pixel-wise converter is given below. My question : Is there a simple way how I can carry out this transformation? def yuv(_pixel): R, G, B = _pixel[0], _pixel[1], _pixel[2] Y = 0.299 * R + 0.587 * G + 0.114 *

YUV转RGB(NV21-ARGB)的Neon优化代码

柔情痞子 提交于 2020-11-27 02:42:24
说明 此代码仅限于 NV21 格式转 ARGB 格式。 NV21 格式中,Y 单独存储,UV分量交错存储。 使用如下公式: R = Y + 1.402*(V-128); G = Y - 0.34414*(U-128) - 0.71414*(V-128); B = Y + 1.772*(U-128); 浮点乘法用 6位精度处理(即a*b = ((a << 6)*b )>>6) 代码 #ifdef HAS_NEON #include <arm_neon.h> #endif void convertToRGBA( unsigned char * yuv, int w, int h, int * rgba) { for ( int i= 0 ; i<h; ++i) { unsigned char * dst = ( unsigned char *)(rgba + w*i); unsigned char * y = yuv + w*i; unsigned char * uv = yuv + w*h + w*(i/ 2 ); int count = w; #ifdef HAS_NEON /*一次处理16个像素*/ int c = count/ 16 ; asm volatile ( "mov r4, %[c]\t\n" "beq 2f\t\n" "vmov.u8 d7, #255\t\n" /