Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Mat image =imread(argv[1],1); Mat k=(Mat_<float>(3,3)<<0.299,0.587,0.114, 0.596,-0.274,-0.322,0.211,-0.523,0.312); Mat Result; cvtColor(image,image,CV_BGR2RGB); transform(image,Result,k); cvtColor(Result,Result,CV_RGB2BGR); T

Code: Mat image =imread(argv[1],1); Mat k=(Mat_<float>(3,3)<<0.299,0.587,0.114, 0.596,-0.274,-0.322,0.211,-0.523,0.312); Mat Result; cvtColor(image,image,CV_BGR2RGB); transform(image,Result,k); cvtColor(Result,Result,CV_RGB2BGR); TcvtColor(Result,Result,CV_RGB2BGR);

Code: @ berak :Code:- Mat image =imread(argv[1],1); Mat k=(Mat_<float>(3,3)<<0.299,0.587,0.114, 0.596,-0.274,-0.322,0.211,-0.523,0.312); Mat Result; cvtColor(image,image,CV_BGR2RGB); transform(image,Result,k); cvtColor(Result,Result,CV_RGB2BGR);

click to hide/show revision 4
No.4 Revision

updated 2015-09-04 15:00:38 -0600

berak gravatar image

@ berak :Code:-

Mat image =imread(argv[1],1);
 Mat k=(Mat_<float>(3,3)<<0.299,0.587,0.114, k=(Mat_<float>(3,3) << 0.299,0.587,0.114, 0.596,-0.274,-0.322,0.211,-0.523,0.312);
 Mat Result;
 cvtColor(image,image,CV_BGR2RGB);
 transform(image,Result,k); 
    cvtColor(Result,Result,CV_RGB2BGR);

cvtColor(Result,Result,CV_RGB2BGR);