Why the output of cvtcolor(rgb to ycrcb) is different from manual function?
Inbuilt Library function : cvtColor(input(in1), output(in2), CV_BGR2YCrCb, 0);
my manual function is as below
for(i=0;i<m;i++)< p="">
{
for(j=0;j<n;j++)
{
in2.at<Vec3b>(i,j)[0]=.299*(in1.at<Vec3b>(i,j)[2])+.587*(in1.at<Vec3b>(i,j)[1])+.114*(in1.at<Vec3b>(i,j)[0]);
in2.at<Vec3b>(i,j)[1]=((in1.at<Vec3b>(i,j)[2])-(in2.at<Vec3b>(i,j)[0]))*.713+128;
in2.at<Vec3b>(i,j)[2]=((in1.at<Vec3b>(i,j)[0])-(in2.at<Vec3b>(i,j)[0]))*.564+128;
}
}
Does anyone have any idea why there's such a difference?
add a comment