mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Merge pull request #794 from kwagyeman/kwabena/fix_lepton_examples
Fix get stats call order
This commit is contained in:
commit
f51f8e180f
@ -51,8 +51,8 @@ while(True):
|
|||||||
clock.tick()
|
clock.tick()
|
||||||
img = sensor.snapshot()
|
img = sensor.snapshot()
|
||||||
for blob in img.find_blobs(threshold_list, pixels_threshold=200, area_threshold=200, merge=True):
|
for blob in img.find_blobs(threshold_list, pixels_threshold=200, area_threshold=200, merge=True):
|
||||||
|
stats = img.get_statistics(thresholds=threshold_list, roi=blob.rect())
|
||||||
img.draw_rectangle(blob.rect())
|
img.draw_rectangle(blob.rect())
|
||||||
img.draw_cross(blob.cx(), blob.cy())
|
img.draw_cross(blob.cx(), blob.cy())
|
||||||
stats = img.get_statistics(thresholds=threshold_list, roi=blob.rect())
|
|
||||||
img.draw_string(blob.x(), blob.y() - 10, "%.2f C" % map_g_to_temp(stats.mean()), mono_space=False)
|
img.draw_string(blob.x(), blob.y() - 10, "%.2f C" % map_g_to_temp(stats.mean()), mono_space=False)
|
||||||
print("FPS %f - Lepton Temp: %f C" % (clock.fps(), sensor.ioctl(sensor.IOCTL_LEPTON_GET_FPA_TEMPERATURE)))
|
print("FPS %f - Lepton Temp: %f C" % (clock.fps(), sensor.ioctl(sensor.IOCTL_LEPTON_GET_FPA_TEMPERATURE)))
|
||||||
|
|||||||
@ -52,9 +52,9 @@ while(True):
|
|||||||
clock.tick()
|
clock.tick()
|
||||||
img = sensor.snapshot()
|
img = sensor.snapshot()
|
||||||
for blob in img.find_blobs(threshold_list, pixels_threshold=200, area_threshold=200, merge=True):
|
for blob in img.find_blobs(threshold_list, pixels_threshold=200, area_threshold=200, merge=True):
|
||||||
|
stats = img.get_statistics(thresholds=threshold_list, roi=blob.rect())
|
||||||
img.draw_rectangle(blob.rect())
|
img.draw_rectangle(blob.rect())
|
||||||
img.draw_cross(blob.cx(), blob.cy())
|
img.draw_cross(blob.cx(), blob.cy())
|
||||||
stats = img.get_statistics(thresholds=threshold_list, roi=blob.rect())
|
|
||||||
img.draw_string(blob.x(), blob.y() - 10, "%.2f C" % map_g_to_temp(stats.mean()), mono_space=False)
|
img.draw_string(blob.x(), blob.y() - 10, "%.2f C" % map_g_to_temp(stats.mean()), mono_space=False)
|
||||||
lcd.display(img)
|
lcd.display(img)
|
||||||
print("FPS %f - Lepton Temp: %f C" % (clock.fps(), sensor.ioctl(sensor.IOCTL_LEPTON_GET_FPA_TEMPERATURE)))
|
print("FPS %f - Lepton Temp: %f C" % (clock.fps(), sensor.ioctl(sensor.IOCTL_LEPTON_GET_FPA_TEMPERATURE)))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user