mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Update ulab example.
This commit is contained in:
parent
91dac4c7d5
commit
ec38ff9ec2
@ -5,13 +5,14 @@
|
|||||||
# there's not much that can be done about it, lowering the resolution might help.
|
# there's not much that can be done about it, lowering the resolution might help.
|
||||||
|
|
||||||
import sensor, image, time, ulab as np
|
import sensor, image, time, ulab as np
|
||||||
|
from ulab import numerical
|
||||||
|
|
||||||
sensor.reset() # Reset and initialize the sensor.
|
sensor.reset() # Reset and initialize the sensor.
|
||||||
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
|
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
|
||||||
sensor.set_framesize(sensor.QQVGA) # Set frame size to QVGA (320x240)
|
sensor.set_framesize(sensor.QQVGA) # Set frame size to QVGA (320x240)
|
||||||
clock = time.clock() # Create a clock object to track the FPS.
|
clock = time.clock() # Create a clock object to track the FPS.
|
||||||
|
|
||||||
while (True):
|
while (True):
|
||||||
img = sensor.snapshot() # Take a picture and return the image.
|
img = sensor.snapshot() # Take a picture and return the image.
|
||||||
a = np.array(img, dtype=np.uint8)
|
a = np.array(img, dtype=np.uint8)
|
||||||
print("mean: %d std:%d"%(np.mean(a), np.std(a)))
|
print("mean: %d std:%d"%(numerical.mean(a), numerical.std(a)))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user