Quantcast
Channel: OpenCV Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 41027

Implementation of Matlab function rgb2ntsc in opencv using c++

$
0
0
I am trying to implement rgb2ntsc colorspace conversion in OpenCV using C++. for(int i=0;i(i,j); R = intensity.val[2]; G = intensity.val[1]; B = intensity.val[0]; Y = 0.299*R+0.587*G+0.114*B; I = 0.596*R-0.274*G-0.322*B; Q = 0.211*R-0.523*G+0.312*B; Result.at(i,j)[0] = (float)Y; Result.at(i,j)[1] = (float)I; Result.at(i,j)[2] = (float)Q; } } I have done this for the implementation of rgb2ntsc. But my output image is not similar to the output of Matlab's rgb2ntsc function. Here are my input image, output image and matlab output image. Can I do any additional operation? ![input image](/upfiles/14413606228957847.jpg) ![My output image](/upfiles/14413605678878022.jpg) ![Matlab output image](/upfiles/1441360590507892.jpg)

Viewing all articles
Browse latest Browse all 41027


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>