Find Gradient Magnitude using skimage.feature.hog module

22 views Asked by At

I am trying to print total gradient magnitude for 100 in the below array

img=[[150,50,121],[12,100,25],[201,243,244]]

Below is the code I tried

from skimage.feature import hog
from skimage import data, exposure
fdt, hog_image = hog([[150,50,121],[12,100,25],[201,243,244]], orientations=2, pixels_per_cell=(1, 1), cells_per_block=(1, 1), visualize=True)
print(hog_image)

The value I get is 43. But Now when I calculate manually I am getting the value as 193.437 . formulae for manual calculation is as below

import math
math.sqrt((25-12)**2+(243-50)**2)

both results do not match up. Any suggestion on what I am doing wrong. I am running on python version 3

0

There are 0 answers