Hi Brunna,
I too encountered the same issue. This issue arises because the "rgb2ycbcr" function expects the input to be a valid numeric array representing an RGB image. Kindly refer to the below case as an example:
RGB = imread("board.tif");
Ensure that RGB must be from one of the following formats:
- A c-by-3 colormap, where each row specifies an RGB color value
- An m-by-n-by-3 image matrix
So, to resolve this issue, you need to modify your function as follows:
imwrite(x, 'C:/Users/aaaa/Documents/PDI/Atividade1/imagens/x_rgb2yuv.jpg', 'jpg');
This would ensure that the image is properly read before being processed.
For further reference, kindly refer to the MATLAB documentation below: