Ask Your Question
1

How to implement filters ?

asked 2014-03-20 10:27:41 -0600

FLY gravatar image

updated 2016-01-17 18:59:14 -0600

I am trying to make filters like sepia filter in my app like other photo editing applications , till now I don't have any idea about it , Can any one help me out for it about its algorithms and how to do it ? and Can I implement in opencv using native c++ or we have any of its build in functions ?

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
3

answered 2014-03-21 13:30:01 -0600

berak gravatar image

updated 2014-03-21 13:56:16 -0600

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 as well as cols swapped)
        ,.168,.686,.349
        ,.189,.769,.393;
Mat out;
cv::transform(img,out,sepia);
imshow("i",out);
waitKey();

image description

edit flag offensive delete link more

Comments

@berak my good helper :P so do we need to be strong in photoshop to get these values if we make our own filters ? or we simply need hit and trail

FLY gravatar imageFLY ( 2014-03-22 09:14:54 -0600 )edit

you want an elephant brain, and you want to get good at math, no ? ;-]

berak gravatar imageberak ( 2014-03-22 10:34:48 -0600 )edit
-1

answered 2014-03-21 11:43:44 -0600

wuling gravatar image
edit flag offensive delete link more

Comments

but can i use it in a native c++ or in opencv ?

FLY gravatar imageFLY ( 2014-03-21 11:55:59 -0600 )edit

Question Tools

Stats

Asked: 2014-03-20 10:27:41 -0600

Seen: 2,664 times

Last updated: Mar 21 '14