Closed dodoma closed 8 years ago
It could be related to normalization, for instance using gradient
which produces a float matrix and then converting the magnitude matrix via visualize
returns a result closer to the one from opencv:
Code using https://github.com/gpip/py-ccv:
import sys
from ccv import lib, ccv_read, ccv_write, sobel, gradient, visualize
inp = ccv_read(sys.argv[1])
res = sobel(inp, lib.CCV_8U | lib.CCV_C1)
ccv_write(res, "sobel.jpg")
t, m = gradient(inp)
mo = visualize(m)
ccv_write(mo, 'grad_m.png')
ok, thanks, i'll try it later.
hi, Liuliu
Thanks for ccv first.
I have made a test on ccv_sobel().
I don't know what the window size exact mean. On my raspberry, dx =1, dy = 1 makes best result. Here is the result.
x.jpg, pre_result.jpg, z.jpg
Feel opencv's result more clear, what do you think? Or any suggestion I missed?