Difference of Gaussian: different outputs in OpenCV and ImageMagick

asked 2018-03-24 15:53:58 -0600

convert "inp.jpg" -morphology Convolve DoG:15,100,0 "test.jpg" <- This is the imagemagick command I use to get the result of DoG.

In OpenCV, I do:-
g1 = cv2.getGaussianKernel(15,100)
g2 = cv2.getGaussianKernel(15,0)
DoGkernel = g1-g2
out = cv2.filter2D(img, -1 , DoGkernel)

input Image :- image description output Image:- image description

There is considerable difference. Am I doing something wrong? Any help would be appreciated.

edit retag flag offensive close merge delete

Comments

What you see is not what is calculated. can you compare values calculated using opencv and imagemagick

LBerger gravatar imageLBerger ( 2018-03-24 16:09:20 -0600 )edit

oh..sure.. wlll do..

dibyadas gravatar imagedibyadas ( 2018-03-24 16:55:38 -0600 )edit

It might also be good to tell us what you trying to achieve with the DoG filter? Furthermore I expect that you are visualizing stuff in the wrong data container.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-03-26 06:06:58 -0600 )edit