opencv - Printing the pixel values of YUV image -
when convert image yuv
rgb
cant value of y when try printing pixels. value 377
, when cast integer 255. presume incorrect. there better way or rather correct way print values of yuv image pixels.
actually priting values (int)src.at<vec3b>(j,i).val[0]= 255
, src.at<vec3b>(j,i).val[0] = 377
also on note, y combination of rgb calculated constants according note. confused how value of y.
this problem of opencv. opencv not gracefully handle (scale) yuv or hsv color spaces uchar
format. vec3b
have 3-channel uchar
, , ranges [0;255].
the solution use matrix type. cv::mat3f
have 3-channel floating point image. values correctly converted cvtcolor
function. can mat3f mat3b assignment.
another solution uses less memory may mat3s , mat3w types, if supported cvtcolor.
Comments
Post a Comment