matlab - Green component after setting Y,Cb and Cr to zero -
i setting y, cb , cr 0 , converting rgb using matlab. don't understand why getting red , blue component 0 in rgb color space while green component has value 132?
edit: (code comment):
i1 = imread('img.jpg'); img = rgb2ycbcr(i1); lumin = img; lumin(:,:,1) =0; lumin(:,:,2) =0; lumin(:,:,3)=0; figure,imshow(lumin); rgn = ycbcr2rgb(lumin); figure,imshow(rgn);
conversion formulas between rgb , ycbcr involve offsets. if zeros in 1 domain not zeros in other domain. if directly use formula convert 0 ycbcr domain matrix rgb positive green values , negative red , blue values. these negative values thresholded 0 seeing.
the wikipedia page http://en.wikipedia.org/wiki/ycbcr , matlab color space conversion block reference page @ http://www.mathworks.com/help/vision/ref/colorspaceconversion.html shows formulas used.
Comments
Post a Comment