From 53fa4430becb004426c73c1799e08f3d9e3d31f5 Mon Sep 17 00:00:00 2001 From: iabdalkader Date: Wed, 5 Jul 2023 16:27:06 +0200 Subject: [PATCH] examples: Fix imports. --- scripts/examples/00-HelloWorld/helloworld.py | 3 ++- scripts/examples/01-Camera/00-Snapshot/emboss_snapshot.py | 3 ++- scripts/examples/01-Camera/00-Snapshot/snapshot.py | 3 ++- .../01-Camera/00-Snapshot/snapshot_on_face_detection.py | 4 +++- .../01-Camera/00-Snapshot/snapshot_on_movement.py | 4 +++- .../examples/01-Camera/00-Snapshot/time_lapse_photos.py | 5 ++++- scripts/examples/01-Camera/01-Video-Recording/gif.py | 5 ++++- .../01-Camera/01-Video-Recording/gif_on_face_detection.py | 6 +++++- .../01-Camera/01-Video-Recording/gif_on_movement.py | 6 +++++- .../01-Camera/01-Video-Recording/imageio_memory.py | 4 +++- .../examples/01-Camera/01-Video-Recording/imageio_read.py | 4 +++- .../01-Camera/01-Video-Recording/imageio_write.py | 5 ++++- scripts/examples/01-Camera/01-Video-Recording/mjpeg.py | 5 ++++- .../01-Video-Recording/mjpeg_on_face_detection.py | 6 +++++- .../01-Camera/01-Video-Recording/mjpeg_on_movement.py | 6 +++++- .../01-Camera/02-Optical-Flow/absolute-rotation-scale.py | 4 +++- .../01-Camera/02-Optical-Flow/absolute-translation.py | 3 ++- .../02-Optical-Flow/differential-rotation-scale.py | 4 +++- .../01-Camera/02-Optical-Flow/differential-translation.py | 3 ++- .../image-patches-absolute-rotation-scale.py | 4 +++- .../02-Optical-Flow/image-patches-absolute-translation.py | 3 ++- .../image-patches-differential-rotation-scale.py | 4 +++- .../image-patches-differential-translation.py | 3 ++- .../examples/01-Camera/03-Event-Cameras/frogeye2020.py | 4 +++- .../03-Event-Cameras/frogeye2020_with_tracking.py | 4 +++- scripts/examples/01-Camera/04-Global-Shutter/high_fps.py | 3 ++- .../01-Camera/04-Global-Shutter/triggered_mode.py | 3 ++- .../05-FLIR-Lepton/lepton_get_object_high_temp.py | 3 ++- .../01-Camera/05-FLIR-Lepton/lepton_get_object_temp.py | 3 ++- .../05-FLIR-Lepton/lepton_get_object_temp_color.py | 3 ++- .../05-FLIR-Lepton/lepton_get_object_temp_color_lcd.py | 4 +++- .../05-FLIR-Lepton/lepton_get_object_temp_lcd.py | 4 +++- .../lepton_hotspot_grayscale_color_tracking.py | 3 ++- .../lepton_hotspot_grayscale_color_tracking_lcd.py | 4 +++- .../lepton_hotspot_rgb565_color_tracking.py | 3 ++- .../lepton_hotspot_rgb565_color_tracking_lcd.py | 4 +++- ...lepton_target_temp_hotspot_grayscale_color_tracking.py | 3 ++- .../lepton_target_temp_hotspot_rgb565_color_tracking.py | 3 ++- .../examples/01-Camera/06-Time-of-Flight/tof_camera.py | 4 +++- .../examples/01-Camera/06-Time-of-Flight/tof_overlay.py | 5 ++++- .../07-Sensor-Control/sensor_auto_gain_control.py | 3 ++- .../07-Sensor-Control/sensor_exposure_control.py | 3 ++- .../07-Sensor-Control/sensor_horizontal_mirror.py | 3 ++- .../07-Sensor-Control/sensor_manual_whitebal_control.py | 3 ++- .../01-Camera/07-Sensor-Control/sensor_vertical_flip.py | 3 ++- .../07-Sensor-Control/sesnor_manual_gain_control.py | 3 ++- .../08-Readout-Control/100_fps_ir_led_tracking.py | 3 ++- .../01-Camera/08-Readout-Control/apriltag_tracking.py | 3 ++- .../02-Image-Processing/00-Drawing/arrow_drawing.py | 4 +++- .../02-Image-Processing/00-Drawing/circle_drawing.py | 4 +++- .../examples/02-Image-Processing/00-Drawing/copy2fb.py | 4 +++- .../02-Image-Processing/00-Drawing/cross_drawing.py | 4 +++- .../02-Image-Processing/00-Drawing/ellipse_drawing.py | 4 +++- .../examples/02-Image-Processing/00-Drawing/flood_fill.py | 3 ++- .../02-Image-Processing/00-Drawing/image_drawing.py | 4 +++- .../00-Drawing/image_drawing_advanced.py | 5 ++++- .../00-Drawing/image_drawing_alpha_blending_test.py | 4 +++- .../image_drawing_alpha_blending_with_color_table_test.py | 4 +++- .../00-Drawing/image_drawing_alpha_table_test.py | 4 +++- .../image_drawing_alpha_table_with_color_table_test.py | 4 +++- .../00-Drawing/image_drawing_scale_down_test.py | 4 +++- .../00-Drawing/image_drawing_scale_up_test.py | 4 +++- .../00-Drawing/image_drawing_with_custom_palette.py | 5 ++++- .../02-Image-Processing/00-Drawing/keypoints_drawing.py | 4 +++- .../02-Image-Processing/00-Drawing/line_drawing.py | 4 +++- .../02-Image-Processing/00-Drawing/rectangle_drawing.py | 4 +++- .../02-Image-Processing/00-Drawing/text_drawing.py | 4 +++- .../01-Image-Filters/adaptive_histogram_equalization.py | 3 ++- .../02-Image-Processing/01-Image-Filters/blur_filter.py | 3 ++- .../01-Image-Filters/cartoon_filter.py | 3 ++- .../01-Image-Filters/color_bilateral_filter.py | 3 ++- .../01-Image-Filters/color_binary_filter.py | 3 ++- .../01-Image-Filters/color_light_removal.py | 3 ++- .../02-Image-Processing/01-Image-Filters/edge_filter.py | 3 ++- .../01-Image-Filters/erode_and_dilate.py | 3 ++- .../01-Image-Filters/gamma_correction.py | 3 ++- .../01-Image-Filters/grayscale_bilateral_filter.py | 3 ++- .../01-Image-Filters/grayscale_binary_filter.py | 3 ++- .../01-Image-Filters/grayscale_light_removal.py | 3 ++- .../01-Image-Filters/histogram_equalization.py | 3 ++- .../01-Image-Filters/kernel_filters.py | 3 ++- .../01-Image-Filters/lens_correction.py | 3 ++- .../02-Image-Processing/01-Image-Filters/linear_polar.py | 3 ++- .../02-Image-Processing/01-Image-Filters/log_polar.py | 3 ++- .../01-Image-Filters/mean_adaptive_threshold_filter.py | 3 ++- .../02-Image-Processing/01-Image-Filters/mean_filter.py | 3 ++- .../01-Image-Filters/median_adaptive_threshold_filter.py | 3 ++- .../02-Image-Processing/01-Image-Filters/median_filter.py | 3 ++- .../midpoint_adaptive_threshold_filter.py | 3 ++- .../01-Image-Filters/midpoint_filter.py | 3 ++- .../01-Image-Filters/mode_adaptive_threshold_filter.py | 3 ++- .../02-Image-Processing/01-Image-Filters/mode_filter.py | 3 ++- .../02-Image-Processing/01-Image-Filters/negative.py | 3 ++- .../perspective_and_rotation_correction.py | 3 ++- .../01-Image-Filters/perspective_correction.py | 3 ++- .../01-Image-Filters/rotation_correction.py | 3 ++- .../01-Image-Filters/sharpen_filter.py | 3 ++- .../examples/02-Image-Processing/01-Image-Filters/ulab.py | 3 ++- .../01-Image-Filters/unsharp_filter.py | 3 ++- .../01-Image-Filters/vflip_hmirror_transpose.py | 4 +++- .../automatic_grayscale_color_tracking.py | 3 ++- .../02-Color-Tracking/automatic_rgb565_color_tracking.py | 3 ++- .../02-Color-Tracking/black_grayscale_line_following.py | 4 +++- .../02-Color-Tracking/image_histogram_info.py | 3 ++- .../02-Color-Tracking/image_statistics_info.py | 3 ++- .../02-Color-Tracking/ir_beacon_grayscale_tracking.py | 3 ++- .../02-Color-Tracking/ir_beacon_rgb565_tracking.py | 3 ++- .../02-Color-Tracking/multi_color_blob_tracking.py | 4 +++- .../02-Color-Tracking/multi_color_code_tracking.py | 3 ++- .../02-Color-Tracking/single_color_code_tracking.py | 4 +++- .../single_color_grayscale_blob_tracking.py | 4 +++- .../single_color_rgb565_blob_tracking.py | 4 +++- .../in_memory_advanced_frame_differencing.py | 5 ++++- .../in_memory_basic_frame_differencing.py | 5 ++++- .../03-Frame-Differencing/in_memory_shadow_removal.py | 5 ++++- .../in_memory_structural_similarity.py | 5 ++++- .../on_disk_advanced_frame_differencing.py | 5 ++++- .../on_disk_basic_frame_differencing.py | 5 ++++- .../03-Frame-Differencing/on_disk_shadow_removal.py | 5 ++++- .../on_disk_structural_similarity.py | 5 ++++- .../00-TensorFlow/tf_image_classification.py | 5 ++++- .../00-TensorFlow/tf_object_detection.py | 5 ++++- .../03-Machine-Learning/01-ST-CubeAI/nn_stm32cubeai.py | 4 +++- .../03-Machine-Learning/02-Haar-Cascade/face_detection.py | 4 +++- .../02-Haar-Cascade/face_eye_detection.py | 4 +++- .../02-Haar-Cascade/face_recognition.py | 4 +++- .../03-Machine-Learning/02-Haar-Cascade/face_tracking.py | 4 +++- .../03-Machine-Learning/02-Haar-Cascade/iris_detection.py | 4 +++- scripts/examples/04-Barcodes/find_barcodes.py | 5 ++++- scripts/examples/04-Barcodes/find_datamatrices.py | 4 +++- .../examples/04-Barcodes/find_datamatrices_w_lens_zoom.py | 4 +++- scripts/examples/04-Barcodes/qrcodes_with_lens_corr.py | 3 ++- scripts/examples/04-Barcodes/qrcodes_with_lens_zoom.py | 3 ++- scripts/examples/05-Feature-Detection/edges.py | 4 +++- scripts/examples/05-Feature-Detection/find_circles.py | 3 ++- .../examples/05-Feature-Detection/find_line_segments.py | 3 ++- scripts/examples/05-Feature-Detection/find_lines.py | 3 ++- scripts/examples/05-Feature-Detection/find_rects.py | 3 ++- scripts/examples/05-Feature-Detection/hog.py | 3 ++- scripts/examples/05-Feature-Detection/keypoints.py | 4 +++- scripts/examples/05-Feature-Detection/keypoints_save.py | 4 +++- scripts/examples/05-Feature-Detection/lbp.py | 4 +++- .../05-Feature-Detection/linear_regression_fast.py | 3 ++- .../05-Feature-Detection/linear_regression_robust.py | 3 ++- scripts/examples/05-Feature-Detection/selective_search.py | 3 ++- .../examples/05-Feature-Detection/template_matching.py | 4 +++- scripts/examples/06-April-Tags/find_apriltags.py | 5 ++++- scripts/examples/06-April-Tags/find_apriltags_3d_pose.py | 4 +++- scripts/examples/06-April-Tags/find_apriltags_max_res.py | 6 +++++- .../examples/06-April-Tags/find_apriltags_w_lens_zoom.py | 4 +++- scripts/examples/06-April-Tags/find_small_apriltags.py | 5 ++++- .../07-Interface-Library/00-Arduino/arduino_i2c_slave.py | 3 ++- .../07-Interface-Library/00-Arduino/arduino_spi_slave.py | 4 +++- .../01-Pixy-Emulation/apriltags_pixy_i2c_emulation.py | 6 +++++- .../01-Pixy-Emulation/apriltags_pixy_spi_emulation.py | 6 +++++- .../01-Pixy-Emulation/apriltags_pixy_uart_emulation.py | 6 +++++- .../01-Pixy-Emulation/pixy_i2c_emulation.py | 6 +++++- .../01-Pixy-Emulation/pixy_spi_emulation.py | 6 +++++- .../01-Pixy-Emulation/pixy_uart_emulation.py | 6 +++++- .../02-MAVLink/mavlink_apriltags_landing_target.py | 6 +++++- .../02-MAVLink/mavlink_opticalflow.py | 5 ++++- .../07-Interface-Library/03-Modbus/modbus_apriltag.py | 2 +- ...transfer_jpg_as_the_remote_device_for_your_computer.py | 6 +++++- ...pg_streaming_as_the_remote_device_for_your_computer.py | 5 ++++- .../image_transfer_raw_as_the_controller_device.py | 8 +++++++- .../image_transfer_raw_as_the_remote_device.py | 5 ++++- .../popular_features_as_the_controller_device.py | 4 +++- .../popular_features_as_the_remote_device.py | 8 +++++++- .../36-Web-Servers/rtsp_video_server_lan.py | 6 +++++- .../36-Web-Servers/rtsp_video_server_wlan.py | 6 +++++- .../00-Board-Control/adc_read_int_channel.py | 3 ++- scripts/examples/09-OpenMV-Boards/00-Board-Control/can.py | 3 ++- .../09-OpenMV-Boards/00-Board-Control/cpufreq_scaling.py | 5 ++++- .../09-OpenMV-Boards/00-Board-Control/spi_control.py | 3 ++- .../examples/09-OpenMV-Boards/00-Board-Control/usb_hid.py | 3 ++- .../examples/09-OpenMV-Boards/00-Board-Control/usb_vcp.py | 4 +++- .../00-Board-Control/vsync_gpio_output.py | 3 ++- scripts/examples/09-OpenMV-Boards/01-WiFi-Shield/dns.py | 3 ++- .../09-OpenMV-Boards/01-WiFi-Shield/http_client.py | 3 ++- .../09-OpenMV-Boards/01-WiFi-Shield/http_client_ssl.py | 4 +++- .../examples/09-OpenMV-Boards/01-WiFi-Shield/http_post.py | 5 ++++- .../09-OpenMV-Boards/01-WiFi-Shield/mjpeg_streamer.py | 6 +++++- .../09-OpenMV-Boards/01-WiFi-Shield/mjpeg_streamer_ap.py | 6 +++++- .../09-OpenMV-Boards/01-WiFi-Shield/mjpeg_streamer_fir.py | 6 +++++- .../examples/09-OpenMV-Boards/01-WiFi-Shield/mqtt_pub.py | 3 ++- .../examples/09-OpenMV-Boards/01-WiFi-Shield/mqtt_sub.py | 3 ++- scripts/examples/09-OpenMV-Boards/01-WiFi-Shield/ntp.py | 5 ++++- scripts/examples/09-OpenMV-Boards/01-WiFi-Shield/scan.py | 3 ++- .../examples/09-OpenMV-Boards/01-WiFi-Shield/static_ip.py | 5 ++++- scripts/examples/09-OpenMV-Boards/02-LCD-Shield/lcd.py | 3 ++- .../04-Thermopile-Shield/thermal_camera.py | 4 +++- .../04-Thermopile-Shield/thermal_overlay.py | 5 ++++- .../04-Thermopile-Shield/thermal_overlay_lcd.py | 6 +++++- scripts/examples/09-OpenMV-Boards/09-TV-Shield/tv.py | 4 +++- .../examples/09-OpenMV-Boards/11-Low-Power/deep_sleep.py | 4 +++- .../09-OpenMV-Boards/11-Low-Power/extint_wakeup.py | 4 +++- .../09-OpenMV-Boards/11-Low-Power/sensor_sleep.py | 3 ++- .../examples/09-OpenMV-Boards/11-Low-Power/stop_mode.py | 4 +++- scripts/examples/09-OpenMV-Boards/99-Tests/colorbar.py | 3 ++- scripts/examples/09-OpenMV-Boards/99-Tests/fps.py | 3 ++- scripts/examples/09-OpenMV-Boards/99-Tests/selftest.py | 4 +++- scripts/examples/09-OpenMV-Boards/99-Tests/unittests.py | 4 +++- scripts/examples/09-OpenMV-Boards/main.py | 3 ++- .../Nano-33-BLE-Sense/02-Audio/audio_fft.py | 4 +++- .../Nano-33-BLE-Sense/04-Thermal/thermal_camera.py | 4 +++- .../10-Arduino-Boards/Nano-RP2040/03-Audio/audio_fft.py | 4 +++- .../10-Arduino-Boards/Nano-RP2040/03-WiFi/ap_mode.py | 6 +++++- .../10-Arduino-Boards/Nano-RP2040/03-WiFi/http_client.py | 3 ++- .../examples/10-Arduino-Boards/Nano-RP2040/03-WiFi/ntp.py | 5 ++++- .../10-Arduino-Boards/Nano-RP2040/03-WiFi/scan.py | 3 ++- .../Nano-RP2040/05-Thermal/thermal_camera.py | 4 +++- .../Nicla-Vision/00-Board-Control/adc_read_int_channel.py | 3 ++- .../Nicla-Vision/00-Board-Control/can.py | 3 ++- .../Nicla-Vision/00-Board-Control/cpufreq_scaling.py | 5 ++++- .../Nicla-Vision/00-Board-Control/spi_control.py | 3 ++- .../Nicla-Vision/00-Board-Control/usb_hid.py | 3 ++- .../Nicla-Vision/00-Board-Control/usb_vcp.py | 4 +++- .../Nicla-Vision/00-Board-Control/vsync_gpio_output.py | 3 ++- .../10-Arduino-Boards/Nicla-Vision/02-Audio/audio_fft.py | 4 +++- .../Nicla-Vision/02-Audio/micro_speech.py | 6 +++++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/dns.py | 3 ++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/http_client.py | 3 ++- .../Nicla-Vision/03-WiFi/http_client_ssl.py | 4 +++- .../Nicla-Vision/03-WiFi/mjpeg_streamer.py | 6 +++++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/mqtt_pub.py | 3 ++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/mqtt_sub.py | 3 ++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/ntp.py | 5 ++++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/scan.py | 3 ++- .../10-Arduino-Boards/Nicla-Vision/03-WiFi/static_ip.py | 5 ++++- .../Nicla-Vision/05-Low-Power/deep_sleep.py | 4 +++- .../Nicla-Vision/05-Low-Power/extint_wakeup.py | 4 +++- .../Nicla-Vision/05-Low-Power/stop_mode.py | 4 +++- .../Portenta-H7/00-Board-Control/adc_read_int_channel.py | 3 ++- .../10-Arduino-Boards/Portenta-H7/00-Board-Control/can.py | 3 ++- .../Portenta-H7/00-Board-Control/cpufreq_scaling.py | 5 ++++- .../Portenta-H7/00-Board-Control/spi_control.py | 3 ++- .../Portenta-H7/00-Board-Control/usb_hid.py | 3 ++- .../Portenta-H7/00-Board-Control/usb_vcp.py | 4 +++- .../Portenta-H7/00-Board-Control/vsync_gpio_output.py | 3 ++- .../10-Arduino-Boards/Portenta-H7/01-Audio/audio_fft.py | 4 +++- .../Portenta-H7/01-Audio/micro_speech.py | 6 +++++- .../examples/10-Arduino-Boards/Portenta-H7/02-WiFi/dns.py | 3 ++- .../10-Arduino-Boards/Portenta-H7/02-WiFi/http_client.py | 3 ++- .../Portenta-H7/02-WiFi/http_client_ssl.py | 4 +++- .../Portenta-H7/02-WiFi/mjpeg_streamer.py | 6 +++++- .../10-Arduino-Boards/Portenta-H7/02-WiFi/mqtt_pub.py | 3 ++- .../10-Arduino-Boards/Portenta-H7/02-WiFi/mqtt_sub.py | 3 ++- .../examples/10-Arduino-Boards/Portenta-H7/02-WiFi/ntp.py | 5 ++++- .../10-Arduino-Boards/Portenta-H7/02-WiFi/scan.py | 3 ++- .../10-Arduino-Boards/Portenta-H7/02-WiFi/static_ip.py | 5 ++++- .../Portenta-H7/05-Ethernet/eth_cable_test.py | 3 ++- .../Portenta-H7/05-Ethernet/http_client.py | 3 ++- .../Portenta-H7/05-Ethernet/http_client_ssl.py | 4 +++- .../Portenta-H7/05-Ethernet/peer_to_peer.py | 3 ++- .../Portenta-H7/06-Low-Power/deep_sleep.py | 4 +++- .../Portenta-H7/06-Low-Power/extint_wakeup.py | 4 +++- .../06-Low-Power/himax_wakeup_on_motion_detection.py | 5 ++++- .../Portenta-H7/06-Low-Power/sensor_sleep.py | 3 ++- .../Portenta-H7/06-Low-Power/stop_mode.py | 4 +++- 259 files changed, 751 insertions(+), 259 deletions(-) diff --git a/scripts/examples/00-HelloWorld/helloworld.py b/scripts/examples/00-HelloWorld/helloworld.py index a18b84b21..ba7d02c7b 100644 --- a/scripts/examples/00-HelloWorld/helloworld.py +++ b/scripts/examples/00-HelloWorld/helloworld.py @@ -2,7 +2,8 @@ # # Welcome to the OpenMV IDE! Click on the green run arrow button below to run the script! -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/01-Camera/00-Snapshot/emboss_snapshot.py b/scripts/examples/01-Camera/00-Snapshot/emboss_snapshot.py index 69bc105c6..56e4f66ee 100644 --- a/scripts/examples/01-Camera/00-Snapshot/emboss_snapshot.py +++ b/scripts/examples/01-Camera/00-Snapshot/emboss_snapshot.py @@ -4,7 +4,8 @@ # # You can use your OpenMV Cam to save modified image files. -import sensor, image, pyb +import sensor +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/00-Snapshot/snapshot.py b/scripts/examples/01-Camera/00-Snapshot/snapshot.py index 8eb621e6d..340da39d5 100644 --- a/scripts/examples/01-Camera/00-Snapshot/snapshot.py +++ b/scripts/examples/01-Camera/00-Snapshot/snapshot.py @@ -4,7 +4,8 @@ # # You can use your OpenMV Cam to save image files. -import sensor, image, pyb +import sensor +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/00-Snapshot/snapshot_on_face_detection.py b/scripts/examples/01-Camera/00-Snapshot/snapshot_on_face_detection.py index a716df263..3611cfb99 100644 --- a/scripts/examples/01-Camera/00-Snapshot/snapshot_on_face_detection.py +++ b/scripts/examples/01-Camera/00-Snapshot/snapshot_on_face_detection.py @@ -5,7 +5,9 @@ # This example demonstrates using face tracking on your OpenMV Cam to take a # picture. -import sensor, image, pyb +import sensor +import image +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/00-Snapshot/snapshot_on_movement.py b/scripts/examples/01-Camera/00-Snapshot/snapshot_on_movement.py index 4b0a625e1..e1f56936d 100644 --- a/scripts/examples/01-Camera/00-Snapshot/snapshot_on_movement.py +++ b/scripts/examples/01-Camera/00-Snapshot/snapshot_on_movement.py @@ -5,7 +5,9 @@ # This example demonstrates using frame differencing with your OpenMV Cam to do # motion detection. After motion is detected your OpenMV Cam will take picture. -import sensor, image, pyb, os +import sensor +import pyb +import os RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/00-Snapshot/time_lapse_photos.py b/scripts/examples/01-Camera/00-Snapshot/time_lapse_photos.py index be6c370dd..332d5d316 100644 --- a/scripts/examples/01-Camera/00-Snapshot/time_lapse_photos.py +++ b/scripts/examples/01-Camera/00-Snapshot/time_lapse_photos.py @@ -8,7 +8,10 @@ # pictures it will run the bootloader each time. Please power the camera # from something other than USB to not have the bootloader run. -import pyb, machine, sensor, image, pyb, os +import pyb +import machine +import sensor +import os # Create and init RTC object. This will allow us to set the current time for # the RTC and let us set an interrupt to wake up later on. diff --git a/scripts/examples/01-Camera/01-Video-Recording/gif.py b/scripts/examples/01-Camera/01-Video-Recording/gif.py index 35f0933d7..57d0b91a5 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/gif.py +++ b/scripts/examples/01-Camera/01-Video-Recording/gif.py @@ -6,7 +6,10 @@ # recorder object RGB565 frames or Grayscale frames. Use photo editing software # like GIMP to compress and optimize the Gif before uploading it to the web. -import sensor, image, time, gif, pyb +import sensor +import time +import gif +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/01-Video-Recording/gif_on_face_detection.py b/scripts/examples/01-Camera/01-Video-Recording/gif_on_face_detection.py index 0732ca1c8..4306be49c 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/gif_on_face_detection.py +++ b/scripts/examples/01-Camera/01-Video-Recording/gif_on_face_detection.py @@ -9,7 +9,11 @@ # This example demonstrates using face tracking on your OpenMV Cam to take a # gif. -import sensor, image, time, gif, pyb +import sensor +import image +import time +import gif +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/01-Video-Recording/gif_on_movement.py b/scripts/examples/01-Camera/01-Video-Recording/gif_on_movement.py index 4cf3fbae6..f542327a5 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/gif_on_movement.py +++ b/scripts/examples/01-Camera/01-Video-Recording/gif_on_movement.py @@ -9,7 +9,11 @@ # This example demonstrates using frame differencing with your OpenMV Cam to do # motion detection. After motion is detected your OpenMV Cam will take video. -import sensor, image, time, gif, pyb, os +import sensor +import time +import gif +import pyb +import os RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/01-Video-Recording/imageio_memory.py b/scripts/examples/01-Camera/01-Video-Recording/imageio_memory.py index d64341be4..7270d500c 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/imageio_memory.py +++ b/scripts/examples/01-Camera/01-Video-Recording/imageio_memory.py @@ -2,7 +2,9 @@ # # This example shows how to use the ImageIO stream to record frames in memory and play them back. # Note: While this should work on any board, the board should have an SDRAM to be of any use. -import sensor, image, time +import sensor +import image +import time # Number of frames to pre-allocate and record N_FRAMES = 500 diff --git a/scripts/examples/01-Camera/01-Video-Recording/imageio_read.py b/scripts/examples/01-Camera/01-Video-Recording/imageio_read.py index 430c2fe30..c30d05612 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/imageio_read.py +++ b/scripts/examples/01-Camera/01-Video-Recording/imageio_read.py @@ -8,7 +8,9 @@ # Altered to allow full speed reading from SD card for extraction of sequences to the network etc. # Set the new pause parameter to false -import sensor, image, time +import sensor +import image +import time snapshot_source = False # Set to true once finished to pull data from sensor. diff --git a/scripts/examples/01-Camera/01-Video-Recording/imageio_write.py b/scripts/examples/01-Camera/01-Video-Recording/imageio_write.py index aa3f5bff0..9cbd7a72f 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/imageio_write.py +++ b/scripts/examples/01-Camera/01-Video-Recording/imageio_write.py @@ -6,7 +6,10 @@ # OpenMV Cam sees for later analysis using the Image Reader object. Images written to disk # by the Image Writer object are stored in a simple file format readable by your OpenMV Cam. -import sensor, image, pyb, time +import sensor +import image +import pyb +import time record_time = 10000 # 10 seconds in milliseconds diff --git a/scripts/examples/01-Camera/01-Video-Recording/mjpeg.py b/scripts/examples/01-Camera/01-Video-Recording/mjpeg.py index 1e3f732e4..bb5f5bb08 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/mjpeg.py +++ b/scripts/examples/01-Camera/01-Video-Recording/mjpeg.py @@ -7,7 +7,10 @@ # recording a Mjpeg file you can use VLC to play it. If you are on Ubuntu then # the built-in video player will work too. -import sensor, image, time, mjpeg, pyb +import sensor +import time +import mjpeg +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_face_detection.py b/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_face_detection.py index fd567a4f6..ddbcb3122 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_face_detection.py +++ b/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_face_detection.py @@ -10,7 +10,11 @@ # This example demonstrates using face tracking on your OpenMV Cam to take a # mjpeg. -import sensor, image, time, mjpeg, pyb +import sensor +import image +import time +import mjpeg +import pyb RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_movement.py b/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_movement.py index 5f13363f2..5d4d0944f 100644 --- a/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_movement.py +++ b/scripts/examples/01-Camera/01-Video-Recording/mjpeg_on_movement.py @@ -10,7 +10,11 @@ # This example demonstrates using frame differencing with your OpenMV Cam to do # motion detection. After motion is detected your OpenMV Cam will take video. -import sensor, image, time, mjpeg, pyb, os +import sensor +import time +import mjpeg +import pyb +import os RED_LED_PIN = 1 BLUE_LED_PIN = 3 diff --git a/scripts/examples/01-Camera/02-Optical-Flow/absolute-rotation-scale.py b/scripts/examples/01-Camera/02-Optical-Flow/absolute-rotation-scale.py index 1dafa06ee..a55900ff2 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/absolute-rotation-scale.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/absolute-rotation-scale.py @@ -10,7 +10,9 @@ # forward/backwards to see the numbers change. # I.e. Z direction changes only. -import sensor, image, time, math +import sensor +import time +import math # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/absolute-translation.py b/scripts/examples/01-Camera/02-Optical-Flow/absolute-translation.py index f4dd2e49f..9071b9005 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/absolute-translation.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/absolute-translation.py @@ -10,7 +10,8 @@ # watch the numbers change. Note that you can see displacement numbers # up +- half of the hoizontal and vertical resolution. -import sensor, image, time +import sensor +import time # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/differential-rotation-scale.py b/scripts/examples/01-Camera/02-Optical-Flow/differential-rotation-scale.py index 8e1b54c64..ea00004a6 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/differential-rotation-scale.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/differential-rotation-scale.py @@ -10,7 +10,9 @@ # forward/backwards to see the numbers change. # I.e. Z direction changes only. -import sensor, image, time, math +import sensor +import time +import math # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/differential-translation.py b/scripts/examples/01-Camera/02-Optical-Flow/differential-translation.py index 04416cf09..fbefae11a 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/differential-translation.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/differential-translation.py @@ -10,7 +10,8 @@ # watch the numbers change. Note that you can see displacement numbers # up +- half of the hoizontal and vertical resolution. -import sensor, image, time +import sensor +import time # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-rotation-scale.py b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-rotation-scale.py index 414a105e6..3eda1db97 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-rotation-scale.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-rotation-scale.py @@ -22,7 +22,9 @@ BLOCK_H = 16 # pow2 # forward/backwards to see the numbers change. # I.e. Z direction changes only. -import sensor, image, time, math +import sensor +import time +import math # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-translation.py b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-translation.py index 0bfae8ca6..9525ef75b 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-translation.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-absolute-translation.py @@ -20,7 +20,8 @@ BLOCK_H = 16 # pow2 # watch the numbers change. Note that you can see displacement numbers # up +- half of the hoizontal and vertical resolution. -import sensor, image, time +import sensor +import time # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-rotation-scale.py b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-rotation-scale.py index bb1bc2eea..5b32fd8e0 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-rotation-scale.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-rotation-scale.py @@ -22,7 +22,9 @@ BLOCK_H = 16 # pow2 # forward/backwards to see the numbers change. # I.e. Z direction changes only. -import sensor, image, time, math +import sensor +import time +import math # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-translation.py b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-translation.py index 0a87c42f3..106be8342 100644 --- a/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-translation.py +++ b/scripts/examples/01-Camera/02-Optical-Flow/image-patches-differential-translation.py @@ -20,7 +20,8 @@ BLOCK_H = 16 # pow2 # watch the numbers change. Note that you can see displacement numbers # up +- half of the hoizontal and vertical resolution. -import sensor, image, time +import sensor +import time # NOTE!!! You have to use a small power of 2 resolution when using # find_displacement(). This is because the algorithm is powered by diff --git a/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020.py b/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020.py index 445c0849a..e8e25c6db 100644 --- a/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020.py +++ b/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020.py @@ -3,7 +3,9 @@ # The frogeye2020 is a 320x240 event camera. There are two bits per pixel which show no motion, # motion in one direction, or motion in another direction. The sensor runs at 50 FPS. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020_with_tracking.py b/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020_with_tracking.py index c373715dc..a99205804 100644 --- a/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020_with_tracking.py +++ b/scripts/examples/01-Camera/03-Event-Cameras/frogeye2020_with_tracking.py @@ -3,7 +3,9 @@ # The frogeye2020 is a 320x240 event camera. There are two bits per pixel which show no motion, # motion in one direction, or motion in another direction. The sensor runs at 50 FPS. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/01-Camera/04-Global-Shutter/high_fps.py b/scripts/examples/01-Camera/04-Global-Shutter/high_fps.py index d2cf12ded..bae9ea673 100644 --- a/scripts/examples/01-Camera/04-Global-Shutter/high_fps.py +++ b/scripts/examples/01-Camera/04-Global-Shutter/high_fps.py @@ -12,7 +12,8 @@ # time so you will not get the maximum readout speed unless you reduce the exposure time too. # This results in a dark image however so YOU NEED A LOT of lighting for high FPS. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE diff --git a/scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py b/scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py index 08e78c916..764615e0a 100644 --- a/scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py +++ b/scripts/examples/01-Camera/04-Global-Shutter/triggered_mode.py @@ -12,7 +12,8 @@ # continously by the camera and because you have to wait for the integration to finish before # readout of the frame. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to GRAYSCALE diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_high_temp.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_high_temp.py index fc8c2cb56..7ddf0bfc9 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_high_temp.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_high_temp.py @@ -17,7 +17,8 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(100, 255)] # track very hot objects diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp.py index 15c91ebf2..6165e728a 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp.py @@ -17,7 +17,8 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(200, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color.py index 2cd2c5406..a9c0cf554 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color.py @@ -17,7 +17,8 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(200, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color_lcd.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color_lcd.py index f7d389b57..4e69da4c7 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color_lcd.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_color_lcd.py @@ -17,7 +17,9 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math, lcd +import sensor +import time +import lcd # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(200, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_lcd.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_lcd.py index 6594395b1..7064bfee2 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_lcd.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_get_object_temp_lcd.py @@ -17,7 +17,9 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math, lcd +import sensor +import time +import lcd # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(200, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking.py index 36127724a..c007bc7e5 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking.py @@ -7,7 +7,8 @@ # stablizes. You can force the re-calibration to not happen if you need to via the lepton API. # However, it is not recommended because the image will degrade overtime. -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(220, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking_lcd.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking_lcd.py index c642da053..b3ed117fd 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking_lcd.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_grayscale_color_tracking_lcd.py @@ -7,7 +7,9 @@ # stablizes. You can force the re-calibration to not happen if you need to via the lepton API. # However, it is not recommended because the image will degrade overtime. -import sensor, image, time, math, lcd +import sensor +import time +import lcd # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(220, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking.py index 3bab9b536..438acdee8 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking.py @@ -7,7 +7,8 @@ # stablizes. You can force the re-calibration to not happen if you need to via the lepton API. # However, it is not recommended because the image will degrade overtime. -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) threshold_list = [( 70, 100, -30, 40, 20, 100)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking_lcd.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking_lcd.py index 2ca9d9043..8a9cb8116 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking_lcd.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_hotspot_rgb565_color_tracking_lcd.py @@ -7,7 +7,9 @@ # stablizes. You can force the re-calibration to not happen if you need to via the lepton API. # However, it is not recommended because the image will degrade overtime. -import sensor, image, time, math, lcd +import sensor +import time +import lcd # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) threshold_list = [( 70, 100, -30, 40, 20, 100)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_grayscale_color_tracking.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_grayscale_color_tracking.py index c5ffa1a51..2b97f2714 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_grayscale_color_tracking.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_grayscale_color_tracking.py @@ -17,7 +17,8 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (Grayscale Min, Grayscale Max) threshold_list = [(220, 255)] diff --git a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_rgb565_color_tracking.py b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_rgb565_color_tracking.py index 7ce91a823..2797c6f73 100644 --- a/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_rgb565_color_tracking.py +++ b/scripts/examples/01-Camera/05-FLIR-Lepton/lepton_target_temp_hotspot_rgb565_color_tracking.py @@ -17,7 +17,8 @@ # leptons don't have radiometry support or they don't activate their calibration process often # enough to deal with temperature changes (FLIR 2.5). -import sensor, image, time, math +import sensor +import time # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) threshold_list = [( 70, 100, -30, 40, 20, 100)] diff --git a/scripts/examples/01-Camera/06-Time-of-Flight/tof_camera.py b/scripts/examples/01-Camera/06-Time-of-Flight/tof_camera.py index 5493ad767..dcc4b9ef8 100644 --- a/scripts/examples/01-Camera/06-Time-of-Flight/tof_camera.py +++ b/scripts/examples/01-Camera/06-Time-of-Flight/tof_camera.py @@ -3,7 +3,9 @@ # This example shows off how to overlay a depth map onto # OpenMV Cam's live video output from the main camera. -import image, time, tof +import image +import time +import tof IMAGE_SCALE = 10 # Higher scaling uses more memory. drawing_hint = image.BILINEAR # or image.BILINEAR or 0 (nearest neighbor) diff --git a/scripts/examples/01-Camera/06-Time-of-Flight/tof_overlay.py b/scripts/examples/01-Camera/06-Time-of-Flight/tof_overlay.py index 317ccc125..dcb7d515e 100644 --- a/scripts/examples/01-Camera/06-Time-of-Flight/tof_overlay.py +++ b/scripts/examples/01-Camera/06-Time-of-Flight/tof_overlay.py @@ -2,7 +2,10 @@ # # This example shows off how to overlay a depth map onto # OpenMV Cam's live video output from the main camera. -import sensor, image, time, tof +import sensor +import image +import time +import tof sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sensor_auto_gain_control.py b/scripts/examples/01-Camera/07-Sensor-Control/sensor_auto_gain_control.py index 3ecdc89d7..90fee87ea 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sensor_auto_gain_control.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sensor_auto_gain_control.py @@ -22,7 +22,8 @@ # more when the lighting changes versus the exposure being constant and # the gain changing. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sensor_exposure_control.py b/scripts/examples/01-Camera/07-Sensor-Control/sensor_exposure_control.py index edc994c44..9f7bc3f78 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sensor_exposure_control.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sensor_exposure_control.py @@ -15,7 +15,8 @@ # noise. So, it's best to let the exposure increase as much as possible # and then use gain control to make up any remaining ground. -import sensor, image, time +import sensor +import time # Change this value to adjust the exposure. Try 10.0/0.1/etc. EXPOSURE_TIME_SCALE = 1.0 diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sensor_horizontal_mirror.py b/scripts/examples/01-Camera/07-Sensor-Control/sensor_horizontal_mirror.py index 467b46286..6291dc5c3 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sensor_horizontal_mirror.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sensor_horizontal_mirror.py @@ -3,7 +3,8 @@ # This example shows off horizontally mirroring the image in hardware # from the camera sensor. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sensor_manual_whitebal_control.py b/scripts/examples/01-Camera/07-Sensor-Control/sensor_manual_whitebal_control.py index d9420ada3..69ba02bb3 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sensor_manual_whitebal_control.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sensor_manual_whitebal_control.py @@ -13,7 +13,8 @@ # the sensor on startup you can control the colors # the camera sees. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sensor_vertical_flip.py b/scripts/examples/01-Camera/07-Sensor-Control/sensor_vertical_flip.py index 0470f27bf..453f4ab81 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sensor_vertical_flip.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sensor_vertical_flip.py @@ -3,7 +3,8 @@ # This example shows off vertically flipping the image in hardware # from the camera sensor. -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/01-Camera/07-Sensor-Control/sesnor_manual_gain_control.py b/scripts/examples/01-Camera/07-Sensor-Control/sesnor_manual_gain_control.py index 01d7d3232..3099c37a0 100644 --- a/scripts/examples/01-Camera/07-Sensor-Control/sesnor_manual_gain_control.py +++ b/scripts/examples/01-Camera/07-Sensor-Control/sesnor_manual_gain_control.py @@ -15,7 +15,8 @@ # noise. So, it's best to let the exposure increase as much as possible # and then use gain control to make up any remaining ground. -import sensor, image, time +import sensor +import time # Change this value to adjust the gain. Try 10.0/0/0.1/etc. GAIN_SCALE = 1.0 diff --git a/scripts/examples/01-Camera/08-Readout-Control/100_fps_ir_led_tracking.py b/scripts/examples/01-Camera/08-Readout-Control/100_fps_ir_led_tracking.py index 95493db42..5791d2f8d 100644 --- a/scripts/examples/01-Camera/08-Readout-Control/100_fps_ir_led_tracking.py +++ b/scripts/examples/01-Camera/08-Readout-Control/100_fps_ir_led_tracking.py @@ -3,7 +3,8 @@ # This example is was designed and tested on the OpenMV Cam H7 Plus using the OV5640 sensor. -import sensor, image, time +import sensor +import time EXPOSURE_MICROSECONDS = 1000 TRACKING_THRESHOLDS = [(128, 255)] # When you lower the exposure you darken everything. diff --git a/scripts/examples/01-Camera/08-Readout-Control/apriltag_tracking.py b/scripts/examples/01-Camera/08-Readout-Control/apriltag_tracking.py index c465d1d92..ce5c6c9f8 100644 --- a/scripts/examples/01-Camera/08-Readout-Control/apriltag_tracking.py +++ b/scripts/examples/01-Camera/08-Readout-Control/apriltag_tracking.py @@ -3,7 +3,8 @@ # This example is was designed and tested on the OpenMV Cam H7 Plus using the OV5640 sensor. -import sensor, image, time +import sensor +import time # This example script forces the exposure to a constant value for the whole time. However, you may # wish to dynamically adjust the exposure when the readout window shrinks to a small size. diff --git a/scripts/examples/02-Image-Processing/00-Drawing/arrow_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/arrow_drawing.py index 33b190280..31f00be4b 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/arrow_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/arrow_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing arrows on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/circle_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/circle_drawing.py index 373d5a40f..49756d30f 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/circle_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/circle_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing circles on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/copy2fb.py b/scripts/examples/02-Image-Processing/00-Drawing/copy2fb.py index 3b0761a5a..07dbedd13 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/copy2fb.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/copy2fb.py @@ -2,7 +2,9 @@ # # This example shows how to load and copy an image to framebuffer for testing. -import sensor, image, time +import sensor +import image +import time # Still need to init sensor sensor.reset() diff --git a/scripts/examples/02-Image-Processing/00-Drawing/cross_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/cross_drawing.py index 8d7e1e5ff..68b422bf4 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/cross_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/cross_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing crosses on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/ellipse_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/ellipse_drawing.py index 9080a99d2..d527ab3d0 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/ellipse_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/ellipse_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing ellipses on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/flood_fill.py b/scripts/examples/02-Image-Processing/00-Drawing/flood_fill.py index 4857ce3ca..49976dc05 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/flood_fill.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/flood_fill.py @@ -2,7 +2,8 @@ # # This example shows off flood filling areas in the image. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing.py index 5931c394d..091d4ab0f 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing.py @@ -2,7 +2,9 @@ # # This example shows off how to draw images in the frame buffer. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_advanced.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_advanced.py index 6d3b7b7e0..b4d2fa94e 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_advanced.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_advanced.py @@ -2,7 +2,10 @@ # # Exercise draw image with many different values for testing -import sensor, image, time, pyb +import sensor +import image +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_test.py index 8cae0107a..a77e9a819 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_test.py @@ -5,7 +5,9 @@ # area scaling along with color channel extraction, alpha blending, # color palette application, and alpha palette application. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_with_color_table_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_with_color_table_test.py index a3f70c0a6..bb27e926c 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_with_color_table_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_blending_with_color_table_test.py @@ -5,7 +5,9 @@ # area scaling along with color channel extraction, alpha blending, # color palette application, and alpha palette application. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_test.py index 7ca783fe9..58937de34 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_test.py @@ -5,7 +5,9 @@ # area scaling along with color channel extraction, alpha blending, # color palette application, and alpha palette application. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_with_color_table_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_with_color_table_test.py index 014a2c1ce..f1e7129de 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_with_color_table_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_alpha_table_with_color_table_test.py @@ -5,7 +5,9 @@ # area scaling along with color channel extraction, alpha blending, # color palette application, and alpha palette application. -import sensor, image, time +import sensor +import image +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_down_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_down_test.py index 7b4f9a67c..ed9c10d98 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_down_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_down_test.py @@ -7,7 +7,9 @@ # DISABLE THE FRAME BUFFER TO SEE THE REAL FPS -import sensor, image, time +import sensor +import image +import time up_hint = 0 # image.BILINEAR image.BICUBIC down_hint = image.AREA # image.BILINEAR image.BICUBIC image.AREA diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_up_test.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_up_test.py index 92bcf91ee..bc43d230a 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_up_test.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_scale_up_test.py @@ -7,7 +7,9 @@ # DISABLE THE FRAME BUFFER TO SEE THE REAL FPS -import sensor, image, time +import sensor +import image +import time hint = 0 # image.BILINEAR image.BICUBIC diff --git a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_with_custom_palette.py b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_with_custom_palette.py index d379b3342..b9de5099d 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_with_custom_palette.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/image_drawing_with_custom_palette.py @@ -2,7 +2,10 @@ # # This example shows off how to draw images in the frame buffer with a custom generated color palette. -import sensor, image, time, pyb +import sensor +import image +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/keypoints_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/keypoints_drawing.py index c41a8161d..db2bc8b1e 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/keypoints_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/keypoints_drawing.py @@ -3,7 +3,9 @@ # This example shows off drawing keypoints on the OpenMV Cam. Usually you call draw_keypoints() # on a keypoints object but you can also call it on a list of 3-value tuples... -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/line_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/line_drawing.py index eb2d761bd..c84ee6c83 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/line_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/line_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing lines on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/rectangle_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/rectangle_drawing.py index ab2afac66..ce73fcc60 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/rectangle_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/rectangle_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing rectangles on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/00-Drawing/text_drawing.py b/scripts/examples/02-Image-Processing/00-Drawing/text_drawing.py index da37af656..806f63787 100644 --- a/scripts/examples/02-Image-Processing/00-Drawing/text_drawing.py +++ b/scripts/examples/02-Image-Processing/00-Drawing/text_drawing.py @@ -2,7 +2,9 @@ # # This example shows off drawing text on the OpenMV Cam. -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/adaptive_histogram_equalization.py b/scripts/examples/02-Image-Processing/01-Image-Filters/adaptive_histogram_equalization.py index a958b531e..180d30018 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/adaptive_histogram_equalization.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/adaptive_histogram_equalization.py @@ -6,7 +6,8 @@ # the image contrast versus a global histogram equalization. Additionally, # you may specify a clip limit to prevent the contrast from going wild. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/blur_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/blur_filter.py index 6074d2f2b..c5a39d9de 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/blur_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/blur_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the guassian filter to blur images. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/cartoon_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/cartoon_filter.py index c1703ca47..b5193ef52 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/cartoon_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/cartoon_filter.py @@ -4,7 +4,8 @@ # filter works by joining similar pixel areas of an image and replacing # the pixels in those areas with the area mean. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/color_bilateral_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/color_bilateral_filter.py index 1bdbbb7eb..7e860678a 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/color_bilateral_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/color_bilateral_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the bilateral filter on color images. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/color_binary_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/color_binary_filter.py index b8686f7bc..425d1bbc3 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/color_binary_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/color_binary_filter.py @@ -3,7 +3,8 @@ # This script shows off the binary image filter. You may pass binary any # number of thresholds to segment the image by. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_framesize(sensor.QVGA) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/color_light_removal.py b/scripts/examples/02-Image-Processing/01-Image-Filters/color_light_removal.py index 270104cfb..3855a6b3a 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/color_light_removal.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/color_light_removal.py @@ -7,7 +7,8 @@ # histeq() on the image without outliers from oversaturated # parts of the image breaking the algorithm... -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/edge_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/edge_filter.py index cdc03ddf3..111f22471 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/edge_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/edge_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the laplacian filter to detect edges. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/erode_and_dilate.py b/scripts/examples/02-Image-Processing/01-Image-Filters/erode_and_dilate.py index 06a6fde68..2b66a50bb 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/erode_and_dilate.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/erode_and_dilate.py @@ -4,7 +4,8 @@ # a binary image to remove noise. This example was originally a test but its # useful for showing off how these functions work. -import pyb, sensor, image +import pyb +import sensor sensor.reset() sensor.set_framesize(sensor.QVGA) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/gamma_correction.py b/scripts/examples/02-Image-Processing/01-Image-Filters/gamma_correction.py index 2dd1137c5..03c876d91 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/gamma_correction.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/gamma_correction.py @@ -3,7 +3,8 @@ # This example shows off gamma correction to make the image brighter. The gamma # correction method can also fix contrast and brightness too. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_bilateral_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_bilateral_filter.py index 6b3a67b21..88ace3880 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_bilateral_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_bilateral_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the bilateral filter on grayscale images. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_binary_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_binary_filter.py index dfaed5012..7e02cbe20 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_binary_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_binary_filter.py @@ -3,7 +3,8 @@ # This script shows off the binary image filter. You may pass binary any # number of thresholds to segment the image by. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_framesize(sensor.QVGA) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_light_removal.py b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_light_removal.py index d42b8a8e9..3748ccd91 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_light_removal.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/grayscale_light_removal.py @@ -7,7 +7,8 @@ # histeq() on the image without outliers from oversaturated # parts of the image breaking the algorithm... -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/histogram_equalization.py b/scripts/examples/02-Image-Processing/01-Image-Filters/histogram_equalization.py index 2a3aece50..137a00957 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/histogram_equalization.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/histogram_equalization.py @@ -3,7 +3,8 @@ # This example shows off how to use histogram equalization to improve # the contrast in the image. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/kernel_filters.py b/scripts/examples/02-Image-Processing/01-Image-Filters/kernel_filters.py index 9b9dd565f..508635d85 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/kernel_filters.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/kernel_filters.py @@ -2,7 +2,8 @@ # # This example shows off how to use a generic kernel filter. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/lens_correction.py b/scripts/examples/02-Image-Processing/01-Image-Filters/lens_correction.py index 56066f583..91b6dadc1 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/lens_correction.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/lens_correction.py @@ -5,7 +5,8 @@ # detection. Increase the strength below until lines are straight in the view. # Zoom in (higher) or out (lower) until you see enough of the image. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/linear_polar.py b/scripts/examples/02-Image-Processing/01-Image-Filters/linear_polar.py index 98106542f..cd481617f 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/linear_polar.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/linear_polar.py @@ -5,7 +5,8 @@ # become translations in the X direction and linear changes # in scale become linear translations in the Y direction. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/log_polar.py b/scripts/examples/02-Image-Processing/01-Image-Filters/log_polar.py index d79f374b9..99479b3e1 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/log_polar.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/log_polar.py @@ -5,7 +5,8 @@ # become translations in the X direction and exponential changes # in scale (x2, x4, etc.) become linear translations in the Y direction. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/mean_adaptive_threshold_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/mean_adaptive_threshold_filter.py index 2d140ecc4..b3435d1bd 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/mean_adaptive_threshold_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/mean_adaptive_threshold_filter.py @@ -4,7 +4,8 @@ # When mean(threshold=True) the mean() method adaptive thresholds the image # by comparing the mean of the pixels around a pixel, minus an offset, with that pixel. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/mean_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/mean_filter.py index c6de0c81b..132a594d2 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/mean_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/mean_filter.py @@ -4,7 +4,8 @@ # filter in a NxN neighborhood. Mean filtering removes noise in the image by # bluring everything. But, it's the fastest kernel filter operation. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/median_adaptive_threshold_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/median_adaptive_threshold_filter.py index 673b28482..a81b3b9ac 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/median_adaptive_threshold_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/median_adaptive_threshold_filter.py @@ -4,7 +4,8 @@ # When median(threshold=True) the median() method adaptive thresholds the image # by comparing the median of the pixels around a pixel, minus an offset, with that pixel. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/median_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/median_filter.py index 441464a36..5a2193194 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/median_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/median_filter.py @@ -4,7 +4,8 @@ # with the median value of it's NxN neighborhood. Median filtering is good for # removing noise in the image while preserving edges. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_adaptive_threshold_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_adaptive_threshold_filter.py index adaeaaa5d..39549205a 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_adaptive_threshold_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_adaptive_threshold_filter.py @@ -4,7 +4,8 @@ # When midpoint(threshold=True) the midpoint() method adaptive thresholds the image # by comparing the midpoint of the pixels around a pixel, minus an offset, with that pixel. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_filter.py index ee9ab5d94..340f47cad 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/midpoint_filter.py @@ -3,7 +3,8 @@ # This example shows off midpoint filtering. Midpoint filtering replaces each # pixel by the average of the min and max pixel values for a NxN neighborhood. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/mode_adaptive_threshold_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/mode_adaptive_threshold_filter.py index 8ab9a0675..29ae76b52 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/mode_adaptive_threshold_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/mode_adaptive_threshold_filter.py @@ -5,7 +5,8 @@ # by comparing the mode of the pixels around a pixel, minus an offset, with that pixel. # Avoid using the mode filter on RGB565 images. It will cause artifacts on image edges... -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/mode_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/mode_filter.py index 170937c58..cc0135bf7 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/mode_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/mode_filter.py @@ -5,7 +5,8 @@ # of pixels around it. Avoid using the mode filter on RGB565 images. It will # cause artifacts on image edges... -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/negative.py b/scripts/examples/02-Image-Processing/01-Image-Filters/negative.py index 36186cba9..ff89a26ef 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/negative.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/negative.py @@ -3,7 +3,8 @@ # This example shows off negating the image. This is not a particularly # useful method but it can come in handy once in a while. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_and_rotation_correction.py b/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_and_rotation_correction.py index b89117d40..77c3f8df6 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_and_rotation_correction.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_and_rotation_correction.py @@ -4,7 +4,8 @@ # perspective distortion and then to rotate the new corrected image in 3D # space aftwards to handle movement. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_correction.py b/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_correction.py index a8f2aa58d..ba8ec3849 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_correction.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/perspective_correction.py @@ -3,7 +3,8 @@ # This example shows off how to use the rotation_corr() to fix perspective # issues related to how your OpenMV Cam is mounted. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/rotation_correction.py b/scripts/examples/02-Image-Processing/01-Image-Filters/rotation_correction.py index b95e41d78..0eef3421c 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/rotation_correction.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/rotation_correction.py @@ -3,7 +3,8 @@ # This example shows off how to use the rotation_corr() to play with the scene # window your OpenMV Cam sees. -import sensor, image, time +import sensor +import time # Degrees per frame to rotation by... X_ROTATION_DEGREE_RATE = 5 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/sharpen_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/sharpen_filter.py index 0f541e203..e6165c431 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/sharpen_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/sharpen_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the laplacian filter to sharpen images. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/ulab.py b/scripts/examples/02-Image-Processing/01-Image-Filters/ulab.py index b7cfa4927..f16c68798 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/ulab.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/ulab.py @@ -4,7 +4,8 @@ # NOTE: ndarrays cause the heap to be fragmented easily. If you run out of memory, # there's not much that can be done about it, lowering the resolution might help. -import sensor, image, time +import sensor +import time from ulab import numpy as np sensor.reset() # Reset and initialize the sensor. diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/unsharp_filter.py b/scripts/examples/02-Image-Processing/01-Image-Filters/unsharp_filter.py index eb8eb2270..89bd423ee 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/unsharp_filter.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/unsharp_filter.py @@ -2,7 +2,8 @@ # # This example shows off using the guassian filter to unsharp mask filter images. -import sensor, image, time +import sensor +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/02-Image-Processing/01-Image-Filters/vflip_hmirror_transpose.py b/scripts/examples/02-Image-Processing/01-Image-Filters/vflip_hmirror_transpose.py index bf43c4e73..3d8b225f8 100644 --- a/scripts/examples/02-Image-Processing/01-Image-Filters/vflip_hmirror_transpose.py +++ b/scripts/examples/02-Image-Processing/01-Image-Filters/vflip_hmirror_transpose.py @@ -8,7 +8,9 @@ # vflip=True, hmirror=True, transpose=False -> 180 degree rotation # vflip=False, hmirror=True, transpose=True -> 270 degree rotation -import sensor, image, time, pyb +import sensor +import time +import pyb sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_grayscale_color_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_grayscale_color_tracking.py index 51f8a0a91..e52bde80c 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_grayscale_color_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_grayscale_color_tracking.py @@ -2,7 +2,8 @@ # # This example shows off single color automatic grayscale color tracking using the OpenMV Cam. -import sensor, image, time +import sensor +import time print("Letting auto algorithms run. Don't put anything in front of the camera!") sensor.reset() diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_rgb565_color_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_rgb565_color_tracking.py index 50a3f4e6e..af46fc50e 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_rgb565_color_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/automatic_rgb565_color_tracking.py @@ -2,7 +2,8 @@ # # This example shows off single color automatic RGB565 color tracking using the OpenMV Cam. -import sensor, image, time +import sensor +import time print("Letting auto algorithms run. Don't put anything in front of the camera!") sensor.reset() diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/black_grayscale_line_following.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/black_grayscale_line_following.py index 6e0674b63..706340e40 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/black_grayscale_line_following.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/black_grayscale_line_following.py @@ -10,7 +10,9 @@ # 45 or so degree angle. Please make sure that only the line is within the # camera's field of view. -import sensor, image, time, math +import sensor +import time +import math # Tracks a black line. Use [(128, 255)] for a tracking a white line. GRAYSCALE_THRESHOLD = [(0, 64)] diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/image_histogram_info.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/image_histogram_info.py index 04b386b3e..ac669b70c 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/image_histogram_info.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/image_histogram_info.py @@ -2,7 +2,8 @@ # # This script computes the histogram of the image and prints it out. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) # or RGB565. diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/image_statistics_info.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/image_statistics_info.py index 04f306109..93c9459ab 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/image_statistics_info.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/image_statistics_info.py @@ -2,7 +2,8 @@ # # This script computes the statistics of the image and prints it out. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) # or RGB565. diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_grayscale_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_grayscale_tracking.py index 0a4d9e0b7..4f95a2eb5 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_grayscale_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_grayscale_tracking.py @@ -2,7 +2,8 @@ # # This example shows off IR beacon Grayscale tracking using the OpenMV Cam. -import sensor, image, time +import sensor +import time thresholds = (255, 255) # thresholds for bright white light from IR. diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_rgb565_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_rgb565_tracking.py index 033908131..75d668750 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_rgb565_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/ir_beacon_rgb565_tracking.py @@ -2,7 +2,8 @@ # # This example shows off IR beacon RGB565 tracking using the OpenMV Cam. -import sensor, image, time +import sensor +import time thresholds = (100, 100, 0, 0, 0, 0) # thresholds for bright white light from IR. diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_blob_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_blob_tracking.py index bc94d257d..f14cd83ac 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_blob_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_blob_tracking.py @@ -2,7 +2,9 @@ # # This example shows off multi color blob tracking using the OpenMV Cam. -import sensor, image, time, math +import sensor +import time +import math # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) # The below thresholds track in general red/green things. You may wish to tune them... diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_code_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_code_tracking.py index 917fb5057..06125db6f 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_code_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/multi_color_code_tracking.py @@ -5,7 +5,8 @@ # A color code is a blob composed of two or more colors. The example below will # only track colored objects which have two or more the colors below in them. -import sensor, image, time +import sensor +import time # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) # The below thresholds track in general red/green things. You may wish to tune them... diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_code_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_code_tracking.py index ed8fa651e..72a15fe8e 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_code_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_code_tracking.py @@ -5,7 +5,9 @@ # A color code is a blob composed of two or more colors. The example below will # only track colored objects which have both the colors below in them. -import sensor, image, time, math +import sensor +import time +import math # Color Tracking Thresholds (L Min, L Max, A Min, A Max, B Min, B Max) # The below thresholds track in general red/green things. You may wish to tune them... diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_grayscale_blob_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_grayscale_blob_tracking.py index 8f8b44d3b..ec5d907b4 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_grayscale_blob_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_grayscale_blob_tracking.py @@ -2,7 +2,9 @@ # # This example shows off single color grayscale tracking using the OpenMV Cam. -import sensor, image, time, math +import sensor +import time +import math # Color Tracking Thresholds (Grayscale Min, Grayscale Max) # The below grayscale threshold is set to only find extremely bright white areas. diff --git a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_rgb565_blob_tracking.py b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_rgb565_blob_tracking.py index e7dc5bec1..cf9843b13 100644 --- a/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_rgb565_blob_tracking.py +++ b/scripts/examples/02-Image-Processing/02-Color-Tracking/single_color_rgb565_blob_tracking.py @@ -2,7 +2,9 @@ # # This example shows off single color RGB565 tracking using the OpenMV Cam. -import sensor, image, time, math +import sensor +import time +import math threshold_index = 0 # 0 for red, 1 for green, 2 for blue diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py index d130151a9..fde8e5785 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_advanced_frame_differencing.py @@ -4,7 +4,10 @@ # example is advanced because it preforms a background update to deal with the # backgound image changing overtime. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_basic_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_basic_frame_differencing.py index cbe0daed2..2b1d438ab 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_basic_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_basic_frame_differencing.py @@ -4,7 +4,10 @@ # called basic frame differencing because there's no background image update. # So, as time passes the background image may change resulting in issues. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_shadow_removal.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_shadow_removal.py index b1f65895f..1f1bc7f9f 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_shadow_removal.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_shadow_removal.py @@ -3,7 +3,10 @@ # This example demonstrates using frame differencing with your OpenMV Cam using # shadow removal to help reduce the affects of cast shadows in your scene. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_structural_similarity.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_structural_similarity.py index 18762ff81..e80342b71 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_structural_similarity.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/in_memory_structural_similarity.py @@ -5,7 +5,10 @@ # 8x8 blocks of pixels between two images to determine a similarity # score between two images. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time # The image has likely changed if the sim.min() is lower than this. MIN_TRIGGER_THRESHOLD = -0.4 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py index 503643d13..9725b7abd 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_advanced_frame_differencing.py @@ -6,7 +6,10 @@ # example is advanced because it preforms a background update to deal with the # backgound image changing overtime. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_basic_frame_differencing.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_basic_frame_differencing.py index 2b0b775e9..93b937b0f 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_basic_frame_differencing.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_basic_frame_differencing.py @@ -6,7 +6,10 @@ # called basic frame differencing because there's no background image update. # So, as time passes the background image may change resulting in issues. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_shadow_removal.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_shadow_removal.py index a48677ae8..b6062f851 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_shadow_removal.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_shadow_removal.py @@ -5,7 +5,10 @@ # This example demonstrates using frame differencing with your OpenMV Cam using # shadow removal to help reduce the affects of cast shadows in your scene. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time TRIGGER_THRESHOLD = 5 diff --git a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_structural_similarity.py b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_structural_similarity.py index 4a1e73706..151d43c24 100644 --- a/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_structural_similarity.py +++ b/scripts/examples/02-Image-Processing/03-Frame-Differencing/on_disk_structural_similarity.py @@ -7,7 +7,10 @@ # 8x8 blocks of pixels between two images to determine a similarity # score between two images. -import sensor, image, pyb, os, time +import sensor +import pyb +import os +import time # The image has likely changed if the sim.min() is lower than this. MIN_TRIGGER_THRESHOLD = -0.4 diff --git a/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_image_classification.py b/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_image_classification.py index a29379c91..6c3a557f4 100644 --- a/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_image_classification.py +++ b/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_image_classification.py @@ -18,7 +18,10 @@ # of activations. Note that use a CNN with a sliding window is extremely compute # expensive so for an exhaustive search do not expect the CNN to be real-time. -import sensor, image, time, os, tf +import sensor +import time +import os +import tf sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_object_detection.py b/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_object_detection.py index cf0625655..571ffe71e 100644 --- a/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_object_detection.py +++ b/scripts/examples/03-Machine-Learning/00-TensorFlow/tf_object_detection.py @@ -2,7 +2,10 @@ # # This examples uses the builtin FOMO model to detect faces. -import sensor, image, time, tf, math +import sensor +import time +import tf +import math sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/03-Machine-Learning/01-ST-CubeAI/nn_stm32cubeai.py b/scripts/examples/03-Machine-Learning/01-ST-CubeAI/nn_stm32cubeai.py index 542aaf458..4b53e8d50 100644 --- a/scripts/examples/03-Machine-Learning/01-ST-CubeAI/nn_stm32cubeai.py +++ b/scripts/examples/03-Machine-Learning/01-ST-CubeAI/nn_stm32cubeai.py @@ -1,7 +1,9 @@ # STM32 CUBE.AI on OpenMV MNIST Example # See https://github.com/openmv/openmv/blob/master/src/stm32cubeai/README.MD -import sensor, image, time, nn_st +import sensor +import time +import nn_st sensor.reset() # Reset and initialize the sensor. sensor.set_contrast(3) diff --git a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_detection.py b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_detection.py index aca735d33..12da0291a 100644 --- a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_detection.py +++ b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_detection.py @@ -11,7 +11,9 @@ # contrast check in constant time (the reason for feature detection being # grayscale only is because of the space requirment for the integral image). -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_eye_detection.py b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_eye_detection.py index 13e5ab454..a166bede1 100644 --- a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_eye_detection.py +++ b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_eye_detection.py @@ -4,7 +4,9 @@ # the eyes within the face. If you want to determine the eye gaze please see the # iris_detection script for an example on how to do that. -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_recognition.py b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_recognition.py index 8a514664a..a68ccfc41 100644 --- a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_recognition.py +++ b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_recognition.py @@ -7,7 +7,9 @@ # # NOTE: This is just a PoC implementation of the paper mentioned above, it does Not work well in real life conditions. -import sensor, time, image +import sensor +import time +import image SUB = "s2" NUM_SUBJECTS = 5 diff --git a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_tracking.py b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_tracking.py index f4571e872..7da30278f 100644 --- a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_tracking.py +++ b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/face_tracking.py @@ -5,7 +5,9 @@ # script finds a face in the image using the frontalface Haar Cascade. # After which the script uses the keypoints feature to automatically learn your # face and track it. Keypoints can be used to automatically track anything. -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/iris_detection.py b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/iris_detection.py index 9d51498c3..6fc0e263f 100644 --- a/scripts/examples/03-Machine-Learning/02-Haar-Cascade/iris_detection.py +++ b/scripts/examples/03-Machine-Learning/02-Haar-Cascade/iris_detection.py @@ -7,7 +7,9 @@ # # Note: This script does not detect a face first, use it with the telephoto lens. -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/04-Barcodes/find_barcodes.py b/scripts/examples/04-Barcodes/find_barcodes.py index 07dee507c..775034cb3 100644 --- a/scripts/examples/04-Barcodes/find_barcodes.py +++ b/scripts/examples/04-Barcodes/find_barcodes.py @@ -3,7 +3,10 @@ # This example shows off how easy it is to detect bar codes using the # OpenMV Cam M7. Barcode detection does not work on the M4 Camera. -import sensor, image, time, math +import sensor +import image +import time +import math sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/04-Barcodes/find_datamatrices.py b/scripts/examples/04-Barcodes/find_datamatrices.py index 95d0fe38a..a8df0caa9 100644 --- a/scripts/examples/04-Barcodes/find_datamatrices.py +++ b/scripts/examples/04-Barcodes/find_datamatrices.py @@ -3,7 +3,9 @@ # This example shows off how easy it is to detect data matrices using the # OpenMV Cam M7. Data matrices detection does not work on the M4 Camera. -import sensor, image, time, math +import sensor +import time +import math sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/04-Barcodes/find_datamatrices_w_lens_zoom.py b/scripts/examples/04-Barcodes/find_datamatrices_w_lens_zoom.py index 889326df1..751cad8bd 100644 --- a/scripts/examples/04-Barcodes/find_datamatrices_w_lens_zoom.py +++ b/scripts/examples/04-Barcodes/find_datamatrices_w_lens_zoom.py @@ -3,7 +3,9 @@ # This example shows off how easy it is to detect data matrices using the # OpenMV Cam M7. Data matrices detection does not work on the M4 Camera. -import sensor, image, time, math +import sensor +import time +import math sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/04-Barcodes/qrcodes_with_lens_corr.py b/scripts/examples/04-Barcodes/qrcodes_with_lens_corr.py index 06b839f49..cecd345a3 100644 --- a/scripts/examples/04-Barcodes/qrcodes_with_lens_corr.py +++ b/scripts/examples/04-Barcodes/qrcodes_with_lens_corr.py @@ -3,7 +3,8 @@ # This example shows the power of the OpenMV Cam to detect QR Codes # using lens correction (see the qrcodes_with_lens_corr.py script for higher performance). -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/04-Barcodes/qrcodes_with_lens_zoom.py b/scripts/examples/04-Barcodes/qrcodes_with_lens_zoom.py index c9798a4bf..5a39d3dbe 100644 --- a/scripts/examples/04-Barcodes/qrcodes_with_lens_zoom.py +++ b/scripts/examples/04-Barcodes/qrcodes_with_lens_zoom.py @@ -3,7 +3,8 @@ # This example shows the power of the OpenMV Cam to detect QR Codes # without needing lens correction. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/05-Feature-Detection/edges.py b/scripts/examples/05-Feature-Detection/edges.py index 166820b72..d84fa7b2f 100644 --- a/scripts/examples/05-Feature-Detection/edges.py +++ b/scripts/examples/05-Feature-Detection/edges.py @@ -1,7 +1,9 @@ # Edge detection with Canny: # # This example demonstrates the Canny edge detector. -import sensor, image, time +import sensor +import image +import time sensor.reset() # Initialize the camera sensor. sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 diff --git a/scripts/examples/05-Feature-Detection/find_circles.py b/scripts/examples/05-Feature-Detection/find_circles.py index a208b4a5b..445766fde 100644 --- a/scripts/examples/05-Feature-Detection/find_circles.py +++ b/scripts/examples/05-Feature-Detection/find_circles.py @@ -6,7 +6,8 @@ # Note that the find_circles() method will only find circles which are completely # inside of the image. Circles which go outside of the image/roi are ignored... -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # grayscale is faster diff --git a/scripts/examples/05-Feature-Detection/find_line_segments.py b/scripts/examples/05-Feature-Detection/find_line_segments.py index 4aa42cf17..dd86a10f3 100644 --- a/scripts/examples/05-Feature-Detection/find_line_segments.py +++ b/scripts/examples/05-Feature-Detection/find_line_segments.py @@ -8,7 +8,8 @@ enable_lens_corr = False # turn on for straighter lines... -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # grayscale is faster diff --git a/scripts/examples/05-Feature-Detection/find_lines.py b/scripts/examples/05-Feature-Detection/find_lines.py index 6c45fcfbc..6675ec081 100644 --- a/scripts/examples/05-Feature-Detection/find_lines.py +++ b/scripts/examples/05-Feature-Detection/find_lines.py @@ -11,7 +11,8 @@ enable_lens_corr = False # turn on for straighter lines... -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # grayscale is faster diff --git a/scripts/examples/05-Feature-Detection/find_rects.py b/scripts/examples/05-Feature-Detection/find_rects.py index 5fafba626..d56f37558 100644 --- a/scripts/examples/05-Feature-Detection/find_rects.py +++ b/scripts/examples/05-Feature-Detection/find_rects.py @@ -7,7 +7,8 @@ # distortion causes those rectangles to look bent. Rounded rectangles are no problem! # (But, given this the code will also detect small radius circles too)... -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7) diff --git a/scripts/examples/05-Feature-Detection/hog.py b/scripts/examples/05-Feature-Detection/hog.py index 7bc17446b..5a9e6a300 100644 --- a/scripts/examples/05-Feature-Detection/hog.py +++ b/scripts/examples/05-Feature-Detection/hog.py @@ -5,7 +5,8 @@ # Note: Due to JPEG artifacts, the HoG visualization looks blurry. To see the # image without JPEG artifacts, uncomment the lines that save the image to uSD. -import sensor, image, time +import sensor +import time sensor.reset() # Set sensor settings diff --git a/scripts/examples/05-Feature-Detection/keypoints.py b/scripts/examples/05-Feature-Detection/keypoints.py index 0c4316a4d..f2a2f286f 100644 --- a/scripts/examples/05-Feature-Detection/keypoints.py +++ b/scripts/examples/05-Feature-Detection/keypoints.py @@ -2,7 +2,9 @@ # Show the camera an object and then run the script. A set of keypoints will be extracted # once and then tracked in the following frames. If you want a new set of keypoints re-run # the script. NOTE: see the docs for arguments to tune find_keypoints and match_keypoints. -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/05-Feature-Detection/keypoints_save.py b/scripts/examples/05-Feature-Detection/keypoints_save.py index bcd1a2edf..6230ab0de 100644 --- a/scripts/examples/05-Feature-Detection/keypoints_save.py +++ b/scripts/examples/05-Feature-Detection/keypoints_save.py @@ -4,7 +4,9 @@ # You can use the keypoints_editor.py util to remove unwanted keypoints. # # NOTE: Please reset the camera after running this script to see the new file. -import sensor, time, image +import sensor +import time +import image # Reset sensor sensor.reset() diff --git a/scripts/examples/05-Feature-Detection/lbp.py b/scripts/examples/05-Feature-Detection/lbp.py index b54838313..72e5ea19d 100644 --- a/scripts/examples/05-Feature-Detection/lbp.py +++ b/scripts/examples/05-Feature-Detection/lbp.py @@ -7,7 +7,9 @@ # a lot of work to be made into somethin useful. This script will reamin to show # that the functionality exists, but, in its current state is inadequate. -import sensor, time, image +import sensor +import time +import image sensor.reset() # Reset sensor diff --git a/scripts/examples/05-Feature-Detection/linear_regression_fast.py b/scripts/examples/05-Feature-Detection/linear_regression_fast.py index f200e4ace..b34c7de7c 100644 --- a/scripts/examples/05-Feature-Detection/linear_regression_fast.py +++ b/scripts/examples/05-Feature-Detection/linear_regression_fast.py @@ -14,7 +14,8 @@ THRESHOLD = (0, 100) # Grayscale threshold for dark things... BINARY_VISIBLE = True # Does binary first so you can see what the linear regression # is being run on... might lower FPS though. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/05-Feature-Detection/linear_regression_robust.py b/scripts/examples/05-Feature-Detection/linear_regression_robust.py index 9f24c618d..8764c01aa 100644 --- a/scripts/examples/05-Feature-Detection/linear_regression_robust.py +++ b/scripts/examples/05-Feature-Detection/linear_regression_robust.py @@ -16,7 +16,8 @@ THRESHOLD = (0, 100) # Grayscale threshold for dark things... BINARY_VISIBLE = True # Does binary first so you can see what the linear regression # is being run on... might lower FPS though. -import sensor, image, time +import sensor +import time sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/05-Feature-Detection/selective_search.py b/scripts/examples/05-Feature-Detection/selective_search.py index c44c931e9..c4b168a77 100644 --- a/scripts/examples/05-Feature-Detection/selective_search.py +++ b/scripts/examples/05-Feature-Detection/selective_search.py @@ -1,6 +1,7 @@ # Selective Search Example -import sensor, image, time +import sensor +import time from random import randint sensor.reset() # Reset and initialize the sensor. diff --git a/scripts/examples/05-Feature-Detection/template_matching.py b/scripts/examples/05-Feature-Detection/template_matching.py index 79d9c66a7..a18e80236 100644 --- a/scripts/examples/05-Feature-Detection/template_matching.py +++ b/scripts/examples/05-Feature-Detection/template_matching.py @@ -8,7 +8,9 @@ # a lot of work to be made into somethin useful. This script will reamin to show # that the functionality exists, but, in its current state is inadequate. -import time, sensor, image +import time +import sensor +import image from image import SEARCH_EX, SEARCH_DS # Reset sensor diff --git a/scripts/examples/06-April-Tags/find_apriltags.py b/scripts/examples/06-April-Tags/find_apriltags.py index 02409b0f0..8b3de069a 100644 --- a/scripts/examples/06-April-Tags/find_apriltags.py +++ b/scripts/examples/06-April-Tags/find_apriltags.py @@ -3,7 +3,10 @@ # This example shows the power of the OpenMV Cam to detect April Tags # on the OpenMV Cam M7. The M4 versions cannot detect April Tags. -import sensor, image, time, math +import sensor +import image +import time +import math sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/06-April-Tags/find_apriltags_3d_pose.py b/scripts/examples/06-April-Tags/find_apriltags_3d_pose.py index 64e763253..64cbd6955 100644 --- a/scripts/examples/06-April-Tags/find_apriltags_3d_pose.py +++ b/scripts/examples/06-April-Tags/find_apriltags_3d_pose.py @@ -3,7 +3,9 @@ # This example shows the power of the OpenMV Cam to detect April Tags # on the OpenMV Cam M7. The M4 versions cannot detect April Tags. -import sensor, image, time, math +import sensor +import time +import math sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/06-April-Tags/find_apriltags_max_res.py b/scripts/examples/06-April-Tags/find_apriltags_max_res.py index 82f05427c..b28b1889c 100644 --- a/scripts/examples/06-April-Tags/find_apriltags_max_res.py +++ b/scripts/examples/06-April-Tags/find_apriltags_max_res.py @@ -3,7 +3,11 @@ # This example shows the power of the OpenMV Cam to detect April Tags # on the OpenMV Cam M7. The M4 versions cannot detect April Tags. -import sensor, image, time, math, omv +import sensor +import image +import time +import math +import omv sensor.reset() sensor.set_pixformat(sensor.GRAYSCALE) diff --git a/scripts/examples/06-April-Tags/find_apriltags_w_lens_zoom.py b/scripts/examples/06-April-Tags/find_apriltags_w_lens_zoom.py index 3778ccb68..b1dfbd0c9 100644 --- a/scripts/examples/06-April-Tags/find_apriltags_w_lens_zoom.py +++ b/scripts/examples/06-April-Tags/find_apriltags_w_lens_zoom.py @@ -3,7 +3,9 @@ # This example shows the power of the OpenMV Cam to detect April Tags # on the OpenMV Cam M7. The M4 versions cannot detect April Tags. -import sensor, image, time, math +import sensor +import time +import math sensor.reset() sensor.set_pixformat(sensor.RGB565) diff --git a/scripts/examples/06-April-Tags/find_small_apriltags.py b/scripts/examples/06-April-Tags/find_small_apriltags.py index cbd54bf9e..b2709c170 100644 --- a/scripts/examples/06-April-Tags/find_small_apriltags.py +++ b/scripts/examples/06-April-Tags/find_small_apriltags.py @@ -9,7 +9,10 @@ # pass the thresholding test... otherwise, you don't get a distance # benefit. -import sensor, image, time, math, omv +import sensor +import image +import time +import omv # Set the thresholds to find a white object (i.e. tag border) thresholds = (150, 255) diff --git a/scripts/examples/07-Interface-Library/00-Arduino/arduino_i2c_slave.py b/scripts/examples/07-Interface-Library/00-Arduino/arduino_i2c_slave.py index 41aa5e09d..fd633e7d3 100644 --- a/scripts/examples/07-Interface-Library/00-Arduino/arduino_i2c_slave.py +++ b/scripts/examples/07-Interface-Library/00-Arduino/arduino_i2c_slave.py @@ -6,7 +6,8 @@ # OpenMV Cam Master I2C Clock (P4) - Arduino Uno Clock (A5) # OpenMV Cam Ground - Arduino Ground -import pyb, ustruct +import pyb +import ustruct text = "Hello World!\n" data = ustruct.pack("<%ds" % len(text), text) diff --git a/scripts/examples/07-Interface-Library/00-Arduino/arduino_spi_slave.py b/scripts/examples/07-Interface-Library/00-Arduino/arduino_spi_slave.py index 7b3131c2f..857187731 100644 --- a/scripts/examples/07-Interface-Library/00-Arduino/arduino_spi_slave.py +++ b/scripts/examples/07-Interface-Library/00-Arduino/arduino_spi_slave.py @@ -8,7 +8,9 @@ # OpenMV Cam Slave Select (P3) - Arduino Uno SS (10) # OpenMV Cam Ground - Arduino Ground -import pyb, ustruct, time +import pyb +import ustruct +import time text = "Hello World!\n" data = ustruct.pack(" sudo ifconfig eth0 192.168.1.100 up # $> ping 192.168.1.102 -import network, time +import network +import time lan = network.LAN() lan.active(True) diff --git a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/deep_sleep.py b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/deep_sleep.py index 5dd595604..4fb26c7b2 100644 --- a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/deep_sleep.py +++ b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/deep_sleep.py @@ -2,7 +2,9 @@ # This example demonstrates the low-power deep sleep mode plus sensor shutdown. # Note the camera will reset after wake-up from deep sleep. To find out if the cause of reset # is deep sleep, call the machine.reset_cause() function and test for machine.DEEPSLEEP_RESET -import pyb, machine, sensor +import pyb +import machine +import sensor # Create and init RTC object. rtc = pyb.RTC() diff --git a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/extint_wakeup.py b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/extint_wakeup.py index 7ce436696..a80f5ef4f 100644 --- a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/extint_wakeup.py +++ b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/extint_wakeup.py @@ -1,7 +1,9 @@ # ExtInt Wake-Up from Stop Mode Example # This example demonstrates using external interrupts to wake up from low-power mode. -import time, pyb, machine +import time +import pyb +import machine from pyb import Pin, ExtInt def callback(line): diff --git a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/himax_wakeup_on_motion_detection.py b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/himax_wakeup_on_motion_detection.py index 9aa5f504e..45f3b7ab3 100644 --- a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/himax_wakeup_on_motion_detection.py +++ b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/himax_wakeup_on_motion_detection.py @@ -1,7 +1,10 @@ # This examples shows how to use the Himax Motion Detection feature # to wake up from low-power Stop Mode on motion detection interrupts. -import sensor, image, time, pyb, machine +import sensor +import time +import pyb +import machine from pyb import Pin, ExtInt sensor.reset() diff --git a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/sensor_sleep.py b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/sensor_sleep.py index feaa0c633..33185f097 100644 --- a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/sensor_sleep.py +++ b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/sensor_sleep.py @@ -2,7 +2,8 @@ # This example demonstrates the sensor sleep mode. The sleep mode saves around # 40mA when enabled and it's automatically cleared when calling sensor reset(). -import sensor, image, time +import sensor +import time sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) diff --git a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/stop_mode.py b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/stop_mode.py index 7c3c4abdc..e51b36b60 100644 --- a/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/stop_mode.py +++ b/scripts/examples/10-Arduino-Boards/Portenta-H7/06-Low-Power/stop_mode.py @@ -1,7 +1,9 @@ # Stop Mode Example # This example demonstrates using the low-power Stop Mode. -import time, pyb, machine +import time +import pyb +import machine # Create and init RTC object. rtc = pyb.RTC()