yuv

Convert YUVj420p pixel format to RGB888 using gstreamer

百般思念 提交于 2020-01-02 10:08:12
问题 im using gstreamer 1.2 to feed frames from my IP camera to opencv program the stream is (640*368 YUVj420p) and i want to convert it to RBG888 to be able to use it in my opencv program so is there a way to use gstreamer to do that conversion ? or do i have to do it by myself? if so please give me the equation that do this conversion 回答1: After some trials with gstreamer i decided to do the conversion myself and it worked First we have to understand the YUVj420p pixel format As shown in the

Improve SSE (SSSE3) YUV to RGB code

懵懂的女人 提交于 2020-01-01 12:00:35
问题 I am looking to optimise some SSE code I wrote for converting YUV to RGB (both planar and packed YUV functions). I am using SSSE3 at the moment, but if there are useful functions from later SSE versions that's ok. I am mainly interested in how I would work out processor stalls and the like. Anyone know of any tools that do static analysis of SSE code? ; ; Copyright (C) 2009-2010 David McPaul ; ; All rights reserved. Distributed under the terms of the MIT License. ; ; A rather unoptimised set

YUV和RGB的区别(以及YUV444 YUV422 YUV411 YUV420的介绍)

余生颓废 提交于 2020-01-01 09:50:59
RGB是构成多种颜色的三基色(红绿蓝),也称为加成色。主要是图像的采集和显示。YUV是优化彩色视频信号的编码和传输,和rgb相比,YUV占用的带宽少。 YUV中Y表示的是亮度,是通过RGB输入信号确定的,方法是将RGB信号的特定部分叠加到一起。UV表示的是色度,定义了颜色的两个方面的色度和饱和度,分别使用Cr和Cb表示。其中,Cr是GB输入信号的红色部分和RGB信号的亮度的差异。而Cb反映的是RGB输入信号的蓝色部分和RGB的信号亮度值之间的差异。可以参考下面的RGB转YUV的公式。 RGB和YUV是可以相互转化的(根据不同的色域计算有所不同,bt.601-6): RGB转YUV: Y = 0.299*R + 0.587*G + 0.114*B; U = -0.169*R - 0.331*G + 0.5 *B ; V = 0.5 *R - 0.419*G - 0.081*B; YUV转RGB: R = Y + 1.4075 * V; G = Y - 0.3455 * U - 0.7169*V; B = Y + 1.779 * U; 参考: https://www.cnblogs.com/luoyinjie/p/7219319.html 下面介绍一下YUV。YUV分为YUV444,YUV422,YUV420等,含有不同色度分量的编码方式。 YUV444:UV三个信道的抽样率相同

Difference between YUV420 and YUV422

北慕城南 提交于 2019-12-31 14:55:13
问题 Can you please help me understand what are the differences between YUV420 and YUV422 format? I read this, http://www.fourcc.org/yuv.php, but I can't find the difference. And does "YUV420" and "YUV420 SP" mean the same thing? And does "YUV422" and "YUV422 I" mean the samet thing? Thank you. 回答1: 4:2:2 : The two chroma components are sampled at half the sample rate of luma: the horizontal chroma resolution is halved. 4:2:0 : The two chroma components are sampled at half the sample rate of luma

Save frame from TangoService_connectOnFrameAvailable

大憨熊 提交于 2019-12-31 05:52:30
问题 How can I save a frame via TangoService_connectOnFrameAvailable() and display it correctly on my computer? As this reference page mentions, the pixels are stored in the HAL_PIXEL_FORMAT_YV12 format. In my callback function for TangoService_connectOnFrameAvailable, I save the frame like this: static void onColorFrameAvailable(void* context, TangoCameraId id, const TangoImageBuffer* buffer) { ... std::ofstream fp; fp.open(imagefile, std::ios::out | std::ios::binary ); int offset = 0; for(int i

How to convert from YUV to CIImage for iOS

☆樱花仙子☆ 提交于 2019-12-30 03:34:10
问题 I am trying to convert a YUV image to CIIMage and ultimately UIImage. I am fairly novice at these and trying to figure out an easy way to do it. From what I have learnt, from iOS6 YUV can be directly used to create CIImage but as I am trying to create it the CIImage is only holding a nil value. My code is like this -> NSLog(@"Started DrawVideoFrame\n"); CVPixelBufferRef pixelBuffer = NULL; CVReturn ret = CVPixelBufferCreateWithBytes( kCFAllocatorDefault, iWidth, iHeight, kCVPixelFormatType

skin detection in the YUV color space?

谁都会走 提交于 2019-12-30 02:30:07
问题 can i perform skin detection using a set of rules (things like x1 < Y < x2 ) 回答1: The short answer is yes , you can. However, luminance (Y) is actually irrelevant . It's the chrominance (CbCr or UV) that matters. One of the most cited papers in this area is this one (uncompressed PS file). I've implemented it and it seems to work fairly well. UPDATE: the link above seems to have become broken, so here is the bibtex citation of the paper: @ARTICLE{767122, author={Chai, D. and Ngan, K.N.},

420YpCbCr8BiPlanarVideoRange To YUV420 ?/How to copy Y and Cbcr plane to Single plane?

Deadly 提交于 2019-12-29 03:33:28
问题 i have captured video using AVFoundation .i have set (video setting )and get in outputsamplebuffer kCVPixelFormatType_420YpCbCr8BiPlanarVideoRange format. But i need YUV420 format for further processing . My doubt is 1.difference among 420YpCbCr8BiPlanarVideoRange,420YpCbCr8BiPlanarFULLRange, 420YpCbCr8PlanarFullRange,420YpCbCr8Planar and YUV420 ? 2.how can i convert 420YpCbCr8BiPlanarVideoRange to YUV420 ? 3. How to Convert YUV420 To 32BGRA ? 4) or some other Way to do this??? that is Any

OnPreviewFrame data image to imageView

元气小坏坏 提交于 2019-12-28 12:44:13
问题 i'm trying to get the byte[] from the preview of the camera, convert it to bitmap and display it on a imageview with imageView.setImageBitmap() i've managed to start the preview and display it on a surfaceView, but i don't know how to convert the byte[] data (that comes in Yuv format i think) in a RGB bitmap to display it on a imageView. the code i'm trying is the following: camera = camera.open(); parameters = camera.getParameters(); camera.setParameters(parameters); surfaceHolder =

OnPreviewFrame data image to imageView

最后都变了- 提交于 2019-12-28 12:43:12
问题 i'm trying to get the byte[] from the preview of the camera, convert it to bitmap and display it on a imageview with imageView.setImageBitmap() i've managed to start the preview and display it on a surfaceView, but i don't know how to convert the byte[] data (that comes in Yuv format i think) in a RGB bitmap to display it on a imageView. the code i'm trying is the following: camera = camera.open(); parameters = camera.getParameters(); camera.setParameters(parameters); surfaceHolder =