Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

i can give you a c++ answer only, but looking at this it should be quite easy:

Mat img = imread("lena.jpg");
Mat_<float> sepia(3,3); 
//sepia << .393,.769,.189  // rgb
//        ,.349,.686,.168
//        ,.272,.534,.131;
sepia << .131,.769,.272    // bgr (diag elems swapped)
        ,.349,.686,.168
        ,.189,.534,.393;
Mat out;
cv::transform(img,out,sepia);
imshow("i",out);
waitKey();

image description

i can give you a c++ answer only, but looking at this it should be quite easy:

Mat img = imread("lena.jpg");
Mat_<float> sepia(3,3); 
//sepia << .393,.769,.189  // rgb
//        ,.349,.686,.168
//        ,.272,.534,.131;
sepia << .131,.769,.272 .131,.534,.272    // bgr (diag elems (rows and cols swapped)
        ,.349,.686,.168
,.168,.686,.349
 ,.189,.534,.393;
,.189,.769,.393;
Mat out;
cv::transform(img,out,sepia);
imshow("i",out);
waitKey();

image descriptionimage description

i can give you a c++ answer only, but looking at this it should be quite easy:

Mat img = imread("lena.jpg");
Mat_<float> sepia(3,3); 
//sepia << .393,.769,.189  // rgb
//        ,.349,.686,.168
//        ,.272,.534,.131;
sepia << .131,.534,.272    // bgr (rows and as well as cols swapped)
        ,.168,.686,.349
        ,.189,.769,.393;
Mat out;
cv::transform(img,out,sepia);
imshow("i",out);
waitKey();

image description