Edge detection with Canny:
# This work is licensed under the MIT license.
# Copyright (c) 2013-2023 OpenMV LLC. All rights reserved.
# https://github.com/openmv/openmv/blob/master/LICENSE
#
# Edge detection with Canny:
#
# This example demonstrates the Canny edge detector.
import csi
import image
import time
csi0 = csi.CSI()
csi0.reset() # Initialize the camera sensor.
csi0.pixformat(csi.GRAYSCALE) # or csi.RGB565
csi0.framesize(csi.QQVGA) # or csi.QVGA (or others)
csi0.snapshot(time=2000) # Let new settings take affect.
csi0.gainceiling(8)
clock = time.clock() # Tracks FPS.
while True:
clock.tick() # Track elapsed milliseconds between snapshots().
img = csi0.snapshot() # Take a picture and return the image.
# Use Canny edge detector
img.find_edges(image.EDGE_CANNY, threshold=(50, 80))
# Faster simpler edge detection
# img.find_edges(image.EDGE_SIMPLE, threshold=(100, 255))
print(clock.fps()) # Note: Your OpenMV Cam runs about half as fast while