Skip to content

norm with NORM_HAMMING returns strange results #11426

@IdoWSC

Description

@IdoWSC
System information (version)
  • OpenCV => 3.4.0
  • Operating System / Platform => Windows 10 64 bit
  • Compiler => Visual Studio 2015
Detailed description

when using cv2.norm in python using NORM_HAMMING, the results are strange.
For instance the returned distance between 17 and 8 is 0, while clearly 17 = '00010001' and 8 = '00001000'
The real distance is 3.0

Steps to reproduce
a = np.array([8], dtype=np.uint8)
b = np.array([17], dtype=np.uint8)
cv2.norm(a, b, cv2.NORM_HAMMING)
0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions