From 8da5a21b60eceffd4c69ec45d73b19bcf26f599e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=BC=80=E6=99=BA?= Date: Sun, 18 Apr 2021 17:52:23 +0800 Subject: [PATCH] Update ulab.py --- scripts/examples/OpenMV/04-Image-Filters/ulab.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/examples/OpenMV/04-Image-Filters/ulab.py b/scripts/examples/OpenMV/04-Image-Filters/ulab.py index 8af9d1a38..b7cfa4927 100644 --- a/scripts/examples/OpenMV/04-Image-Filters/ulab.py +++ b/scripts/examples/OpenMV/04-Image-Filters/ulab.py @@ -4,8 +4,8 @@ # NOTE: ndarrays cause the heap to be fragmented easily. If you run out of memory, # there's not much that can be done about it, lowering the resolution might help. -import sensor, image, time, ulab as np -from ulab import numerical +import sensor, image, time +from ulab import numpy as np sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) @@ -15,4 +15,5 @@ clock = time.clock() # Create a clock object to track the FPS while (True): img = sensor.snapshot() # Take a picture and return the image. a = np.array(img, dtype=np.uint8) - print("mean: %d std:%d"%(numerical.mean(a), numerical.std(a))) + print("mean: %d std:%d"%(np.mean(a), np.std(a))) +