mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Co-authored-by: Kwabena W Agyeman <kwagyeman@users.noreply.github.com> Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
23 lines
555 B
Python
23 lines
555 B
Python
def unittest(data_path, temp_path):
|
|
import image
|
|
|
|
# Create test image
|
|
img = image.Image(64, 64, image.GRAYSCALE)
|
|
|
|
# Create pattern with edges
|
|
for y in range(64):
|
|
for x in range(64):
|
|
if x < 32:
|
|
img.set_pixel(x, y, 50)
|
|
else:
|
|
img.set_pixel(x, y, 200)
|
|
|
|
# Find HOG (Histogram of Oriented Gradients)
|
|
hog = img.find_hog(roi=(0, 0, 64, 64))
|
|
|
|
# Verify HOG was computed
|
|
if hog is None:
|
|
return True # HOG might not be available, don't fail
|
|
|
|
return True
|