Hi, I’m tried to identify the nuts position to rotate it in the desidered angle. I have an H7 cam, with the script I wrote the center of the blob is correct only if the camera is centered on the vertical of the blob to find.
Its the right behaviour?
Many Thanks in advance
# Single Color Grayscale Blob Tracking Example # # This example shows off single color grayscale tracking using the OpenMV Cam. import sensor, image, time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) # The below grayscale threshold is set to only find extremely bright white areas. thresholds = (65, 255) #thresholds = (255, 88) sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing(320,320) sensor.skip_frames(time = 2000) sensor.set_auto_gain(True) # must be turned off for color tracking sensor.set_auto_whitebal(True) # must be turned off for color tracking sensor.set_auto_exposure(True) clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the # camera resolution. "merge=True" merges all overlapping blobs in the image. while(True): clock.tick() img = sensor.snapshot() for blob in img.find_blobs([thresholds], pixels_threshold=400, area_threshold=1000, merge=False): if blob.area()<7000: print(blob.area()) img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) #print(clock.fps())