Questions tagged [yuv]

YUV is a color space typically used as part of a color image pipeline.

720 questions
37
votes
9 answers

Converting YUV->RGB(Image processing)->YUV during onPreviewFrame in android?

I am capturing image using SurfaceView and getting Yuv Raw preview data in public void onPreviewFrame4(byte[] data, Camera camera) I have to perform some image preprocessing in onPreviewFrame so i need to convert Yuv preview data to RGB data than…
Hitesh Patel
  • 2,798
  • 2
  • 30
  • 62
32
votes
8 answers

YUV_420_888 interpretation on Samsung Galaxy S7 (Camera2)

I wrote a conversion from YUV_420_888 to Bitmap, considering the following logic (as I understand it): To summarize the approach: the kernel’s coordinates x and y are congruent both with the x and y of the non-padded part of the Y-Plane…
Settembrini
  • 1,338
  • 1
  • 19
  • 32
31
votes
6 answers

Convert bitmap array to YUV (YCbCr NV21)

How to convert Bitmap returned by BitmapFactory.decodeFile() to YUV format (simillar to what camera's onPreviewFrame() returns in byte array)?
Abhijeet Pathak
  • 1,866
  • 3
  • 19
  • 28
30
votes
1 answer

Using FFMPEG to losslessly convert YUV to another format for editing in Adobe Premier

I have a raw YUV video file that I want to do some basic editing to in Adobe CS6 Premiere, but it won't recognize the file. I thought to use ffmpeg to convert it to something Premiere would take in, but I want this to be lossless because afterwards…
kilgoretrout
  • 2,891
  • 5
  • 26
  • 39
27
votes
4 answers

Displaying YUV Image in Android

In my application, we need to display the Video frame receives from server to our android application, Server is sending video data @ 50 frame per second, having encoded in WebM i.e. using libvpx to encode and decode the images, Now after decoding…
Amitg2k12
  • 3,723
  • 9
  • 45
  • 92
27
votes
5 answers

Problems when scaling a YUV image using libyuv library

I'm developing a camera app based on Camera API 2 and I have found several problems using the libyuv. I want to convert YUV_420_888 images retrieved from a ImageReader, but I'm having some problems with scaling in a reprocessable surface. In…
Francisco Durdin Garcia
  • 9,572
  • 4
  • 39
  • 79
24
votes
3 answers

Rotate an YUV byte array on Android

I'm looking to rotate a YUV frame preview recieved from a Preview Callblack, so far I've founded this post which cointains an algorithm to rotate the frame preview but is messing the preview image camera pixels rotated another way to rotate the…
Francisco
  • 243
  • 1
  • 2
  • 5
22
votes
3 answers

How to convert RGB -> YUV -> RGB (both ways)

I want a pair of conversion algorithms, one from RGB to YUV, the other from YUV to RGB, that are inverses of each other. That is, a round-trip conversion should leave the value unchanged. (If you like, replace YUV with Y'UV, YUV, YCbCr,…
Camille Goudeseune
  • 2,525
  • 2
  • 25
  • 47
19
votes
7 answers

Convert Android camera2 api YUV_420_888 to RGB

I am writing an app that takes the camera feed, converts it to rgb, in order to do some processing. It works fine on the old camera implementation which uses NV21 Yuv format. The issue I am having is with the new Yuv format, YUV_420_888. The image…
19
votes
2 answers

Camera.PreviewCallback equivalent in Camera2 API

Is there any equivalent for Camera.PreviewCallback in Camera2 from API 21,better than mapping to a SurfaceTexture and pulling a Bitmap ? I need to be able to pull preview data off of the camera as YUV?
17
votes
3 answers

How to deal with RGB to YUV conversion

The formula says: Y = 0.299 * R + 0.587 * G + 0.114 * B; U = -0.14713 * R - 0.28886 * G + 0.436 * B; V = 0.615 * R - 0.51499 * G - 0.10001 * B; What if, for example, the U variable becomes negative? U = -0.14713 * R - 0.28886 * G + 0.436 *…
maximus
  • 3,476
  • 13
  • 51
  • 96
17
votes
1 answer

Difference between YUV420 and YUV422

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…
michael
  • 93,094
  • 111
  • 230
  • 334
17
votes
2 answers

How to convert RGB from YUV420p for ffmpeg encoder?

I want to make .avi video file from bitmap images by using c++ code. I wrote the following code: //Get RGB array data from bmp file uint8_t* rgb24Data = new uint8_t[3*imgWidth*imgHeight]; hBitmap = (HBITMAP) LoadImage( NULL, _T("myfile.bmp"),…
TTGroup
  • 3,177
  • 9
  • 40
  • 75
16
votes
3 answers

Convert android.media.Image (YUV_420_888) to Bitmap

I'm trying to implement camera preview image data processing using camera2 api as proposed here: Camera preview image data processing with Android L and Camera2 API. I successfully receive callbacks using onImageAvailableListener, but for future…
mol
  • 2,348
  • 4
  • 18
  • 34
15
votes
1 answer

PIL's colour space conversion YCbCr -> RGB

The algorithm used by PIL v1.1.7 gives 'washed out' looking results. When converting the same source data using ffmpeg it looks correct. Using mplayer gives identical results to ffmpeg (perhaps they use the same library underneath). This leads me…
wim
  • 266,989
  • 79
  • 484
  • 630
1
2 3
47 48