Mat imfilter(Mat &src,Mat &psf) { vector<Mat> channels; split(src,channels); Mat picb,picg,picr; picb=channels.at(0); picg=channels.at(1); picr=channels.at(2); Mat Picb,Picg,Picr; filter2D(picb,Picb,picb.depth(),psf); filter2D(picg,Picg,picg.depth(),psf); filter2D(picr,Picr,picr.depth(),psf); channels.at(0)=Picb; channels.at(1)=Picg; channels.at(2)=Picr; Mat dst; merge(channels,dst); return dst; } |
|