kyamagu / mexopencv

Collection and a development kit of matlab mex functions for OpenCV library
http://kyamagu.github.io/mexopencv
Other
661 stars 319 forks source link

Usage #415

Closed MOONBEAR0703 closed 6 years ago

MOONBEAR0703 commented 6 years ago

Usage

I typed result = cv.filter2D(img,kern);, but matlab said there is no definition of "img"

amroamroamro commented 6 years ago

img is the input image, kern is the convolution kernel you want to apply. Obviously you must supply both. Be sure to refer to function documentation.

Quick example:

img = im2single(imread('coins.png'));
kern = [1 1 1; 1 -8 1; 1 1 1];
res = cv.filter2D(img, kern);
imshow(res,[])