I am using video player.
I want to add grascale images to it.
so I write this code in draw function.
( ofVideoPlayer fingerMovie;)
(ofxCvColorImage img;)
ofPixels pixels = fingerMovie.getPixels();
img.setFromPixels(pixels);
cv::Mat mat=ofxCv::toCv(img);
cv::cvtColor(mat,mat,cv::COLOR_BGR2GRAY);
img.draw(400,20);
But I cannot get gray image.
Please tell me what is wrong with this.
I checked channels is changed 3->1 by cv::cvtColor
But it is not show gray image .why?
Today I found this problem’s true answer .
I lost
ofxCv::toOf(mat,m_colorimg.getPixels());
before draw.
When you lost it ,you will get Original+edited image in draw.(not pure edited image)
I think it is pure edited image.