the ir_beacon_grayscale_tracking has not tell the different between the ir image and normal image.
i got not idea without ir image.
does it means turn on the ir led and take a snap? i know that
# IR Beacon Grayscale Tracking Example
#
# This example shows off IR beacon Grayscale tracking using the OpenMV Cam.
import sensor, image, time
from pyb import LED#<----------------------change this
thresholds = (255, 255) # thresholds for bright white light from IR.
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.FHD)#<----------------------change this
sensor.set_windowing((240, 240)) # 240x240 center pixels of VGA
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must be turned off for color tracking
sensor.set_auto_whitebal(False) # must be turned off for color tracking
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.
LED(4).on()##<----------------------change this
while(True):
clock.tick()
img = sensor.snapshot()
for blob in img.find_blobs([thresholds], pixels_threshold=200, area_threshold=200, merge=True):
ratio = blob.w() / blob.h()
if (ratio >= 0.5) and (ratio <= 1.5): # filter out non-squarish blobs
img.draw_rectangle(blob.rect())
img.draw_cross(blob.cx(), blob.cy())
print(clock.fps())
If so, it’s because the LEDs are so powerful that they are shining through the PCB and washing out the camera sensor. This is a known problem and why we removed the IR LEDs for newer designs.
Unless you are using the MT9V034 global shutter camera in triggered mode the camera image is asynchronous to your code as the camera is just spitting out frames all the time. It is not aligned to the LED.