Questions tagged [ycbcr]
19 questions
8
votes
4 answers
Function to convert YCbCr to RGB?
I have Y, Cb and Cr values, each with a size of 8 bits. What would be a simple C function which can convert these values to R,G,B (each with a size of 8 bits)?
Here is a prototype of the function I am looking for:
void convertYCbCrToRGB(
…

SunnyShah
- 28,934
- 30
- 90
- 137
2
votes
0 answers
How can I generate the faces of a YCbCr cube in VB.NET
I have written a program in VB.NET to generate just one face of a YCbCr colour space cube. I want the final image to look similar to the CbCr plane at constant luma on Wikipedia (where Y=1).
Ultimately, I want to create images of all 6 faces of the…

Drummy
- 203
- 1
- 5
1
vote
1 answer
I can't get vImage (Accelerate Framework) to convert 420Yp8_Cb8_Cr8 (planar) to ARGB8888
I'm trying to convert Planar YpCbCr to RGBA and it's failing with error kvImageRoiLargerThanInputBuffer.
I tried two different ways. Here're some code snippets.
Note 'thumbnail_buffers + 1' and 'thumbnail_buffers + 2' have width and height half of…

Mustang
- 363
- 2
- 9
1
vote
0 answers
How to save Ycbcr numpy array to an image without changing its array points?
I had an rgb image which I converted into Ycbcr array.
rgb = cv2.imread(image)
r,g,b = cv2.split(rgb)
def ycbcr(r, g, b):
y = .299*r + .587*g + .114*b
cb = 128 -.168736*r -.331364*g + .5*b
cr = 128 +.5*r - .418688*g - .081312*b
…

Iamnotperfect
- 109
- 1
- 2
- 11
1
vote
1 answer
How to convert Y Cb Cr to RGB in MATLAB manually?
I've been tasked with performing a 4:2:0 chroma subsampling (color compression) on a series of JPEGs.
The first step is to ensure that I can generate my Y, Cb, and Cr values and then convert back to RGB and display the image. Then I can go back…

Jared Boyd
- 11
- 2
1
vote
1 answer
python "can't assign to comparison" error
I want single YCbCr-channels that are smaller or bigger that 128 of a picture set to 0.
But I keep getting the error "can't assign to comparison" and I don't really know what I am doing wrong.
This is the code:
def calc_coloursplash(image_data,…

ryanmitchell
- 13
- 1
- 3
0
votes
0 answers
How can i convert YCbCr to BGR24 using ImageISharp
I get an image in IntPtr or an array of bytes in the YUV420 color space. How can I use ImageSharp to convert an image to BGR4 color space?
I can't find conversion examples anywhere with imageSharp . Therefore I use other library for conversion. But…

zerpico
- 103
- 3
0
votes
0 answers
Increasing the Y value in a YCbCr image in Python (pillow) results desaturated image
I'm using the code below to convert from/to RGB/YCbCr images, which works properly when I don't do any adjustment over Y values.
def rgb2ycbcr(im):
xform = np.array([[.299, .587, .114], [-.1687, -.3313, .5], [.5, -.4187, -.0813]])
ycbcr =…
0
votes
0 answers
Python - White balance check on a YCbCr image
long-time reader first-time poster. I do test engineering for medical cameras and I was curious if there was a way to check if a YCbCr image was white balanced using python code. I know there are multiple options to perform white balance but I'm…
0
votes
0 answers
What is the best way to display each ycbcr channel of an image separately in Python with numpy, scipy, skimage etc?
UPDATED:This function is supposed to take in an ndarray (eg, one obtained from pyplot.imread()) and display each YCbCr channel separately:
import numpy as np
import matplotlib.pyplot as plt
from skimage import color
def plot_ycbcr(a):
b =…

aimlesslegs
- 41
- 5
0
votes
1 answer
OV7670: Why does the test pattern work, but the colors of a picture are wrong?
I am working with the OV7670 camera module connected to an FPGA (Cyclone V DE0-CV board). When outputting the 8-bar color bar test pattern, everything is fine. To output the test pattern, register 0x71 is set to 0xB5.
When trying to output an…

Jokkefar
- 11
- 3
0
votes
1 answer
Matlab: Save image frames as YCbCr video
So I have 10 separate image frames of YCbCr format. How can I export it as a YCbCr video in Matlab so that it can be viewed through a supported video player?
Update-1
for Frame_Index = 1: frames
YCbCr_Movie_Structure_Array(Frame_Index).cdata =…
user4282023
0
votes
1 answer
Finding the colour that matches one from a given palette
I have a palette of colours, that's either 32 or 256. Then I have a stream of incoming colours (in RGB). I want to find out which colour in the palette the incoming colour matches most closely with. I believe this sort of algorithm is used in many…

Raze
- 2,175
- 14
- 30
0
votes
1 answer
Why converting BGR to YCbCr in OpenCV inherit different value compared to manually counting it using equation?
I tried to check whether my image conversion have the same RGB value as manually converting using RGB to YCbCr equation. Using python :
import cv2
import numpy as np
file_src='rgb_color.bmp' //input image
file_dst='ycbcr_color.bmp' //output…

BronzeCoin
- 1
- 2
0
votes
1 answer
How to correctly read an image in YCbCr mode?
How do I know if I have read an PNG image in YCbCr mode correctly? I'm getting different pixel values which is confusing.
def convert_rgb_to_ycbcr(img):
y = 16. + (64.738 * img[:, :, 0] + 129.057 * img[:, :, 1] + 25.064 * img[:, :, 2]) / 255.
…

Steven Chen
- 397
- 1
- 6
- 19