diff --git a/scripts/examples/Arduino/Portenta-H7/01-Basics/helloworld.py b/scripts/examples/Arduino/Portenta-H7/01-Basics/helloworld.py index a18b84b21..8b9a257d5 100644 --- a/scripts/examples/Arduino/Portenta-H7/01-Basics/helloworld.py +++ b/scripts/examples/Arduino/Portenta-H7/01-Basics/helloworld.py @@ -5,7 +5,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/spi_control.py b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/spi_control.py index 58effa166..207081ddc 100644 --- a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/spi_control.py +++ b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/spi_control.py @@ -59,7 +59,7 @@ write_command(0x3A, 0x05) write_command(0x29) sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # must be this +sensor.set_pixformat(sensor.GRAYSCALE) # must be this sensor.set_framesize(sensor.QQVGA2) # must be this sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/usb_vcp.py b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/usb_vcp.py index 159cfd101..288eaeeac 100644 --- a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/usb_vcp.py +++ b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/usb_vcp.py @@ -25,7 +25,7 @@ from pyb import USB_VCP usb = USB_VCP() sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. diff --git a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py index 7035971b0..4f9c44b83 100644 --- a/scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py +++ b/scripts/examples/Arduino/Portenta-H7/02-Board-Control/vsync_gpio_output.py @@ -6,7 +6,7 @@ import sensor, image, time from pyb import Pin sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) # This pin will be toggled on/off on VSYNC rising and falling edges. diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/arrow_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/arrow_drawing.py index 33b190280..44aafb63c 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/arrow_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/arrow_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/circle_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/circle_drawing.py index 373d5a40f..7b24570df 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/circle_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/circle_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/cross_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/cross_drawing.py index 8d7e1e5ff..9fb287dfb 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/cross_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/cross_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/ellipse_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/ellipse_drawing.py index 9080a99d2..ed653dae1 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/ellipse_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/ellipse_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/flood_fill.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/flood_fill.py index 4857ce3ca..445f6525b 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/flood_fill.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/flood_fill.py @@ -5,7 +5,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing.py index 5931c394d..7ed9962be 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_advanced.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_advanced.py index 42261d160..d87e4cc7b 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_advanced.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_advanced.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_test.py index 8cae0107a..e5a1da6f2 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_test.py @@ -8,12 +8,12 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) hint = image.BICUBIC # image.BILINEAR image.BICUBIC -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) @@ -33,7 +33,7 @@ small_img.set_pixel(3, 3, (50, 255, 195)) #small_img.to_grayscale() #small_img.to_bitmap() -big_img = image.Image(128, 128, sensor.RGB565) +big_img = image.Image(128, 128, sensor.GRAYSCALE) big_img.draw_image(small_img, 0, 0, x_scale=32, y_scale=32, hint=hint) #big_img.to_grayscale() #big_img.to_bitmap() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_with_color_table_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_with_color_table_test.py index a3f70c0a6..e7c0d8cbb 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_with_color_table_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_blending_with_color_table_test.py @@ -8,7 +8,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) hint = image.BICUBIC # image.BILINEAR image.BICUBIC @@ -23,7 +23,7 @@ hint |= 0 # image.EXTRACT_RGB_CHANNEL_FIRST # hint |= 0 # image.APPLY_COLOR_PALETTE_FIRST -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) @@ -43,7 +43,7 @@ small_img.set_pixel(3, 3, (50, 255, 195)) #small_img.to_grayscale() #small_img.to_bitmap() -big_img = image.Image(128, 128, sensor.RGB565) +big_img = image.Image(128, 128, sensor.GRAYSCALE) big_img.draw_image(small_img, 0, 0, x_scale=32, y_scale=32, hint=hint) #big_img.to_grayscale() #big_img.to_bitmap() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_test.py index 7ca783fe9..4262874d5 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_test.py @@ -8,12 +8,12 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) hint = image.BICUBIC # image.BILINEAR image.BICUBIC -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) @@ -33,7 +33,7 @@ small_img.set_pixel(3, 3, (50, 255, 195)) #small_img.to_grayscale() #small_img.to_bitmap() -big_img = image.Image(128, 128, sensor.RGB565) +big_img = image.Image(128, 128, sensor.GRAYSCALE) big_img.draw_image(small_img, 0, 0, x_scale=32, y_scale=32, hint=hint) #big_img.to_grayscale() #big_img.to_bitmap() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_with_color_table_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_with_color_table_test.py index 014a2c1ce..8bb3096e3 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_with_color_table_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_alpha_table_with_color_table_test.py @@ -8,7 +8,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) hint = image.BICUBIC # image.BILINEAR image.BICUBIC @@ -23,7 +23,7 @@ hint |= 0 # image.EXTRACT_RGB_CHANNEL_FIRST # hint |= 0 # image.APPLY_COLOR_PALETTE_FIRST -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) @@ -43,7 +43,7 @@ small_img.set_pixel(3, 3, (50, 255, 195)) #small_img.to_grayscale() #small_img.to_bitmap() -big_img = image.Image(128, 128, sensor.RGB565) +big_img = image.Image(128, 128, sensor.GRAYSCALE) big_img.draw_image(small_img, 0, 0, x_scale=32, y_scale=32, hint=hint) #big_img.to_grayscale() #big_img.to_bitmap() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_down_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_down_test.py index 7b4f9a67c..0d4b8e573 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_down_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_down_test.py @@ -18,7 +18,7 @@ medium_img = image.Image(32, 32, sensor.RGB565, copy_to_fb=True) #medium_img.to_grayscale() #medium_img.to_bitmap() -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) @@ -38,7 +38,7 @@ small_img.set_pixel(3, 3, (50, 255, 195)) #small_img.to_grayscale() #small_img.to_bitmap() -big_img = image.Image(128, 128, sensor.RGB565) +big_img = image.Image(128, 128, sensor.GRAYSCALE) big_img.draw_image(small_img, 0, 0, x_scale=32, y_scale=32, hint=up_hint) #big_img.to_grayscale() #big_img.to_bitmap() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_up_test.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_up_test.py index 92bcf91ee..5f664a8c1 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_up_test.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_scale_up_test.py @@ -17,7 +17,7 @@ big_img = image.Image(128, 128, sensor.RGB565, copy_to_fb=True) #big_img.to_grayscale() #big_img.to_bitmap() -small_img = image.Image(4, 4, sensor.RGB565) +small_img = image.Image(4, 4, sensor.GRAYSCALE) small_img.set_pixel(0, 0, (0, 0, 127)) small_img.set_pixel(1, 0, (47, 255, 199)) small_img.set_pixel(2, 0, (0, 188, 255)) diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_with_custom_palette.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_with_custom_palette.py index d379b3342..2665e6f3a 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_with_custom_palette.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/image_drawing_with_custom_palette.py @@ -15,12 +15,12 @@ clock = time.clock() # Initialise palette source colors into an image palette_source_colors = [(255, 0, 0), (0, 255, 0), (0, 0, 255), (255, 0, 255)] -palette_source_color_image = image.Image(len(palette_source_colors), 1, sensor.RGB565) +palette_source_color_image = image.Image(len(palette_source_colors), 1, sensor.GRAYSCALE) for i, color in enumerate(palette_source_colors): palette_source_color_image[i] = color # Scale the image to palette width and smooth them -palette = image.Image(256,1, sensor.RGB565) +palette = image.Image(256,1, sensor.GRAYSCALE) palette.draw_image(palette_source_color_image, 0, 0, x_scale=palette.width() / palette_source_color_image.width()) palette.mean(int(palette.width() / palette_source_color_image.width()/2)) diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/keypoints_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/keypoints_drawing.py index c41a8161d..84c56562b 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/keypoints_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/keypoints_drawing.py @@ -6,7 +6,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/line_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/line_drawing.py index eb2d761bd..76ebad142 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/line_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/line_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/rectangle_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/rectangle_drawing.py index ab2afac66..a268a29e5 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/rectangle_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/rectangle_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/03-Drawing/text_drawing.py b/scripts/examples/Arduino/Portenta-H7/03-Drawing/text_drawing.py index da37af656..3bd016e10 100644 --- a/scripts/examples/Arduino/Portenta-H7/03-Drawing/text_drawing.py +++ b/scripts/examples/Arduino/Portenta-H7/03-Drawing/text_drawing.py @@ -5,7 +5,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/adaptive_histogram_equalization.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/adaptive_histogram_equalization.py index a958b531e..cd3b46fd5 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/adaptive_histogram_equalization.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/adaptive_histogram_equalization.py @@ -9,7 +9,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/cartoon_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/cartoon_filter.py index c1703ca47..94ea4a18e 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/cartoon_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/cartoon_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # or GRAYSCALE... +sensor.set_pixformat(sensor.GRAYSCALE) # or GRAYSCALE... sensor.set_framesize(sensor.QVGA) # or QQVGA... sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_bilateral_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_bilateral_filter.py index 1bdbbb7eb..0345ede12 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_bilateral_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_bilateral_filter.py @@ -5,7 +5,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.RGB565 +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_binary_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_binary_filter.py index b8686f7bc..642347908 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_binary_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_binary_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() sensor.set_framesize(sensor.QVGA) -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_light_removal.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_light_removal.py index 270104cfb..738e60168 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_light_removal.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/color_light_removal.py @@ -10,7 +10,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/erode_and_dilate.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/erode_and_dilate.py index 06a6fde68..db755b2ae 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/erode_and_dilate.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/erode_and_dilate.py @@ -24,7 +24,7 @@ while(True): img.binary([grayscale_thres]) img.dilate(2) - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) for i in range(20): img = sensor.snapshot() img.binary([rgb565_thres]) diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/gamma_correction.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/gamma_correction.py index 2dd1137c5..7c735fd1b 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/gamma_correction.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/gamma_correction.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/histogram_equalization.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/histogram_equalization.py index 2a3aece50..00ea2f319 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/histogram_equalization.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/histogram_equalization.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/lens_correction.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/lens_correction.py index 56066f583..b4945cafa 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/lens_correction.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/lens_correction.py @@ -8,7 +8,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/linear_polar.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/linear_polar.py index 98106542f..239c6a1bc 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/linear_polar.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/linear_polar.py @@ -8,7 +8,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/log_polar.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/log_polar.py index d79f374b9..0bac70bf4 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/log_polar.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/log_polar.py @@ -8,7 +8,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_adaptive_threshold_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_adaptive_threshold_filter.py index 2d140ecc4..e33eae788 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_adaptive_threshold_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_adaptive_threshold_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_filter.py index c6de0c81b..7e6c4833e 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/mean_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_adaptive_threshold_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_adaptive_threshold_filter.py index 673b28482..c13a95a6d 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_adaptive_threshold_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_adaptive_threshold_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_filter.py index 441464a36..dcd144910 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/median_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_adaptive_threshold_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_adaptive_threshold_filter.py index adaeaaa5d..12fa15b71 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_adaptive_threshold_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_adaptive_threshold_filter.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_filter.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_filter.py index ee9ab5d94..09313e192 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_filter.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/midpoint_filter.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/negative.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/negative.py index 36186cba9..669ecb4d6 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/negative.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/negative.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_and_rotation_correction.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_and_rotation_correction.py index b89117d40..2dc3b6aad 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_and_rotation_correction.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_and_rotation_correction.py @@ -7,7 +7,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_correction.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_correction.py index a8f2aa58d..83f149ce1 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_correction.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/perspective_correction.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/rotation_correction.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/rotation_correction.py index b95e41d78..cc3fbdc7d 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/rotation_correction.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/rotation_correction.py @@ -22,7 +22,7 @@ FOV_WINDOW = 60 # Between 0 and 180. Represents the field-of-view of the scene # the image in 3D intersecting the scene window. sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/vflip_hmirror_transpose.py b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/vflip_hmirror_transpose.py index bf43c4e73..2953eb254 100644 --- a/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/vflip_hmirror_transpose.py +++ b/scripts/examples/Arduino/Portenta-H7/04-Image-Filters/vflip_hmirror_transpose.py @@ -11,7 +11,7 @@ import sensor, image, time, pyb sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/emboss_snapshot.py b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/emboss_snapshot.py index 69bc105c6..46e5c3b10 100644 --- a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/emboss_snapshot.py +++ b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/emboss_snapshot.py @@ -10,7 +10,7 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. diff --git a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot.py b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot.py index 8eb621e6d..ce5a5fcec 100644 --- a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot.py +++ b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot.py @@ -10,7 +10,7 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. diff --git a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot_on_movement.py b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot_on_movement.py index 4b0a625e1..a834f0d4f 100644 --- a/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot_on_movement.py +++ b/scripts/examples/Arduino/Portenta-H7/05-Snapshot/snapshot_on_movement.py @@ -11,10 +11,9 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif.py index 35f0933d7..f96c719cb 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif.py @@ -12,7 +12,7 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif_on_movement.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif_on_movement.py index 4cf3fbae6..4f52d6c32 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif_on_movement.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/gif_on_movement.py @@ -15,10 +15,9 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_memory.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_memory.py index 318361fe0..d50393f62 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_memory.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_memory.py @@ -8,7 +8,7 @@ import sensor, image, time N_FRAMES = 500 sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) # This frame size must match the image size passed to ImageIO diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_read.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_read.py index 430c2fe30..639ee86fd 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_read.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_read.py @@ -13,7 +13,7 @@ import sensor, image, time snapshot_source = False # Set to true once finished to pull data from sensor. sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_write.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_write.py index aa3f5bff0..2922f345f 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_write.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/imageio_write.py @@ -11,7 +11,7 @@ import sensor, image, pyb, time record_time = 10000 # 10 seconds in milliseconds sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg.py index 1e3f732e4..f961beca6 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg.py @@ -13,7 +13,7 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg_on_movement.py b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg_on_movement.py index 5f13363f2..cb6003da1 100644 --- a/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg_on_movement.py +++ b/scripts/examples/Arduino/Portenta-H7/06-Video-Recording/mjpeg_on_movement.py @@ -16,10 +16,9 @@ RED_LED_PIN = 1 BLUE_LED_PIN = 3 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_circles.py b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_circles.py index a208b4a5b..50fca976c 100644 --- a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_circles.py +++ b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_circles.py @@ -9,7 +9,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # grayscale is faster +sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_line_segments.py b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_line_segments.py index 4aa42cf17..836ab5bd5 100644 --- a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_line_segments.py +++ b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_line_segments.py @@ -11,7 +11,7 @@ enable_lens_corr = False # turn on for straighter lines... import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # grayscale is faster +sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_lines.py b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_lines.py index 6c45fcfbc..065e62a06 100644 --- a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_lines.py +++ b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_lines.py @@ -14,7 +14,7 @@ enable_lens_corr = False # turn on for straighter lines... import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # grayscale is faster +sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_rects.py b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_rects.py index 5fafba626..9a9890809 100644 --- a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_rects.py +++ b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/find_rects.py @@ -10,7 +10,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) # grayscale is faster (160x120 max on OpenMV-M7) +sensor.set_pixformat(sensor.GRAYSCALE) # grayscale is faster (160x120 max on OpenMV-M7) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 2000) clock = time.clock() diff --git a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/selective_search.py b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/selective_search.py index c44c931e9..3e3cca78c 100644 --- a/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/selective_search.py +++ b/scripts/examples/Arduino/Portenta-H7/09-Feature-Detection/selective_search.py @@ -4,7 +4,7 @@ import sensor, image, time from random import randint sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. sensor.set_auto_gain(False) diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_grayscale_color_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_grayscale_color_tracking.py index 51f8a0a91..d0251c212 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_grayscale_color_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_grayscale_color_tracking.py @@ -10,7 +10,6 @@ sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Capture the color thresholds for whatever was in the center of the image. diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_rgb565_color_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_rgb565_color_tracking.py index 50a3f4e6e..2a03a38e2 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_rgb565_color_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/automatic_rgb565_color_tracking.py @@ -6,11 +6,10 @@ import sensor, image, time print("Letting auto algorithms run. Don't put anything in front of the camera!") sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Capture the color thresholds for whatever was in the center of the image. diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/black_grayscale_line_following.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/black_grayscale_line_following.py index 6e0674b63..c1e83fb2b 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/black_grayscale_line_following.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/black_grayscale_line_following.py @@ -35,7 +35,6 @@ sensor.set_pixformat(sensor.GRAYSCALE) # use grayscale. sensor.set_framesize(sensor.QQVGA) # use QQVGA for speed. sensor.skip_frames(time = 2000) # Let new settings take affect. sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Tracks FPS. while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_histogram_info.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_histogram_info.py index 04b386b3e..a97ac899b 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_histogram_info.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_histogram_info.py @@ -9,7 +9,6 @@ sensor.set_pixformat(sensor.GRAYSCALE) # or RGB565. sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_statistics_info.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_statistics_info.py index 04f306109..c70042ee0 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_statistics_info.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/image_statistics_info.py @@ -9,7 +9,6 @@ sensor.set_pixformat(sensor.GRAYSCALE) # or RGB565. sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_grayscale_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_grayscale_tracking.py index 0a4d9e0b7..0d2184a6a 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_grayscale_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_grayscale_tracking.py @@ -12,7 +12,6 @@ sensor.set_framesize(sensor.VGA) sensor.set_windowing((240, 240)) # 240x240 center pixels of VGA sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_rgb565_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_rgb565_tracking.py index 033908131..da4366ca1 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_rgb565_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/ir_beacon_rgb565_tracking.py @@ -7,12 +7,11 @@ import sensor, image, time thresholds = (100, 100, 0, 0, 0, 0) # thresholds for bright white light from IR. sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((240, 240)) # 240x240 center pixels of VGA sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_blob_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_blob_tracking.py index bc94d257d..c287a4a7a 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_blob_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_blob_tracking.py @@ -13,11 +13,10 @@ thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds # scene with 16 thresholds before color thresholds start to overlap heavily. sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_code_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_code_tracking.py index 917fb5057..1fec3a140 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_code_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/multi_color_code_tracking.py @@ -15,11 +15,10 @@ thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds -> index is # Codes are or'ed together when "merge=True" for "find_blobs". sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_code_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_code_tracking.py index ed8fa651e..c95427545 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_code_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_code_tracking.py @@ -14,11 +14,10 @@ thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds -> index is # Codes are or'ed together when "merge=True" for "find_blobs". sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_grayscale_blob_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_grayscale_blob_tracking.py index 8f8b44d3b..2f200275e 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_grayscale_blob_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_grayscale_blob_tracking.py @@ -13,7 +13,6 @@ sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py index e7dc5bec1..70b539c26 100644 --- a/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py +++ b/scripts/examples/Arduino/Portenta-H7/10-Color-Tracking/single_color_rgb565_blob_tracking.py @@ -13,11 +13,10 @@ thresholds = [(30, 100, 15, 127, 15, 127), # generic_red_thresholds (0, 30, 0, 64, -128, 0)] # generic_blue_thresholds sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are diff --git a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_barcodes.py b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_barcodes.py index 07dee507c..5c6488ad1 100644 --- a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_barcodes.py +++ b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_barcodes.py @@ -11,7 +11,6 @@ sensor.set_framesize(sensor.VGA) # High Res! sensor.set_windowing((640, 80)) # V Res of 80 == less work (40 for 2X the speed). sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Barcode detection can run at the full 640x480 resolution of your OpenMV Cam's diff --git a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices.py b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices.py index 95d0fe38a..25ac857fa 100644 --- a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices.py +++ b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices.py @@ -6,11 +6,10 @@ import sensor, image, time, math sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices_w_lens_zoom.py b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices_w_lens_zoom.py index 889326df1..c62ff0453 100644 --- a/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices_w_lens_zoom.py +++ b/scripts/examples/Arduino/Portenta-H7/16-Codes/find_datamatrices_w_lens_zoom.py @@ -6,12 +6,11 @@ import sensor, image, time, math sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) # 2x Zoom sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/16-Codes/qrcodes_with_lens_corr.py b/scripts/examples/Arduino/Portenta-H7/16-Codes/qrcodes_with_lens_corr.py index 06b839f49..9ca0691ad 100644 --- a/scripts/examples/Arduino/Portenta-H7/16-Codes/qrcodes_with_lens_corr.py +++ b/scripts/examples/Arduino/Portenta-H7/16-Codes/qrcodes_with_lens_corr.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... diff --git a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_i2c_emulation.py b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_i2c_emulation.py index 35ed48a22..21d31fc87 100644 --- a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_i2c_emulation.py +++ b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_i2c_emulation.py @@ -65,11 +65,10 @@ import image, math, pyb, sensor, struct, time # Camera Setup sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) -sensor.set_auto_whitebal(False) # LED Setup diff --git a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_spi_emulation.py b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_spi_emulation.py index 57755845c..50c94e32a 100644 --- a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_spi_emulation.py +++ b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_spi_emulation.py @@ -71,11 +71,10 @@ import image, math, pyb, sensor, struct, time # Camera Setup sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) -sensor.set_auto_whitebal(False) # LED Setup diff --git a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_uart_emulation.py b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_uart_emulation.py index 7aa4b262a..e8ddf1542 100644 --- a/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_uart_emulation.py +++ b/scripts/examples/Arduino/Portenta-H7/17-Pixy-Emulation/pixy_uart_emulation.py @@ -65,11 +65,10 @@ import image, math, pyb, sensor, struct, time # Camera Setup sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) -sensor.set_auto_whitebal(False) # LED Setup diff --git a/scripts/examples/Arduino/Portenta-H7/18-MAVLink/mavlink_opticalflow.py b/scripts/examples/Arduino/Portenta-H7/18-MAVLink/mavlink_opticalflow.py index c16c2cd8a..835909ed5 100644 --- a/scripts/examples/Arduino/Portenta-H7/18-MAVLink/mavlink_opticalflow.py +++ b/scripts/examples/Arduino/Portenta-H7/18-MAVLink/mavlink_opticalflow.py @@ -82,7 +82,7 @@ def send_optical_flow_packet(x, y, c): update_led() sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.B64X32) # Set frame size to 64x32... (or 64x64)... sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -91,7 +91,7 @@ clock = time.clock() # Create a clock object to track the FPS. # There's a lot more RAM in the frame buffer than in the MicroPython heap. # However, after doing this you have a lot less RAM for some algorithms... # So, be aware that it's a lot easier to get out of RAM issues now. -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py b/scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py index ab5fec142..5dd595604 100644 --- a/scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py +++ b/scripts/examples/Arduino/Portenta-H7/19-Low-Power/deep_sleep.py @@ -15,15 +15,6 @@ print(rtc.datetime()) sensor.reset() -# Enable sensor softsleep -sensor.sleep(True) - -# Optionally bypass the regulator on OV7725 -# for the lowest possible power consumption. -if (sensor.get_id() == sensor.OV7725): - # Bypass internal regulator - sensor.__write_reg(0x4F, 0x18) - # Shutdown the sensor (pulls PWDN high). sensor.shutdown(True) diff --git a/scripts/examples/Arduino/Portenta-H7/19-Low-Power/sensor_sleep.py b/scripts/examples/Arduino/Portenta-H7/19-Low-Power/sensor_sleep.py index b5e381902..feaa0c633 100644 --- a/scripts/examples/Arduino/Portenta-H7/19-Low-Power/sensor_sleep.py +++ b/scripts/examples/Arduino/Portenta-H7/19-Low-Power/sensor_sleep.py @@ -5,7 +5,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 3000) # Capture frames for 3000ms. sensor.sleep(True) # Enable sensor sleep mode (saves about 40mA). diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_advanced_frame_differencing.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_advanced_frame_differencing.py index d130151a9..d8e340242 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_advanced_frame_differencing.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_advanced_frame_differencing.py @@ -12,10 +12,9 @@ BG_UPDATE_FRAMES = 50 # How many frames before blending. BG_UPDATE_BLEND = 128 # How much to blend by... ([0-256]==[0.0-1.0]). sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.RGB565 +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. # Take from the main frame buffer's RAM to allocate a second frame buffer. @@ -24,7 +23,7 @@ clock = time.clock() # Tracks FPS. # So, be aware that it's a lot easier to get out of RAM issues now. However, # frame differencing doesn't use a lot of the extra space in the frame buffer. # But, things like AprilTags do and won't work if you do this... -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) print("About to save background image...") sensor.skip_frames(time = 2000) # Give the user time to get ready. diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_basic_frame_differencing.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_basic_frame_differencing.py index cbe0daed2..1fb207bdf 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_basic_frame_differencing.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_basic_frame_differencing.py @@ -9,10 +9,9 @@ import sensor, image, pyb, os, time TRIGGER_THRESHOLD = 5 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. # Take from the main frame buffer's RAM to allocate a second frame buffer. @@ -21,7 +20,7 @@ clock = time.clock() # Tracks FPS. # So, be aware that it's a lot easier to get out of RAM issues now. However, # frame differencing doesn't use a lot of the extra space in the frame buffer. # But, things like AprilTags do and won't work if you do this... -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) print("About to save background image...") sensor.skip_frames(time = 2000) # Give the user time to get ready. diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_shadow_removal.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_shadow_removal.py index b1f65895f..69c507c61 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_shadow_removal.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_shadow_removal.py @@ -8,12 +8,11 @@ import sensor, image, pyb, os, time TRIGGER_THRESHOLD = 5 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) if sensor.get_id() == sensor.OV7725: # Reduce sensor PLL from 6x to 4x. sensor.__write_reg(0x0D, (sensor.__read_reg(0x0D) & 0x3F) | 0x40) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. sensor.set_auto_gain(False) # Turn this off too. clock = time.clock() # Tracks FPS. @@ -23,7 +22,7 @@ clock = time.clock() # Tracks FPS. # So, be aware that it's a lot easier to get out of RAM issues now. However, # frame differencing doesn't use a lot of the extra space in the frame buffer. # But, things like AprilTags do and won't work if you do this... -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) print("About to save background image...") sensor.skip_frames(time = 2000) # Give the user time to get ready. diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_structural_similarity.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_structural_similarity.py index 18762ff81..c2cce7c87 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_structural_similarity.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/in_memory_structural_similarity.py @@ -11,10 +11,9 @@ import sensor, image, pyb, os, time MIN_TRIGGER_THRESHOLD = -0.4 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. # Take from the main frame buffer's RAM to allocate a second frame buffer. @@ -23,7 +22,7 @@ clock = time.clock() # Tracks FPS. # So, be aware that it's a lot easier to get out of RAM issues now. However, # frame differencing doesn't use a lot of the extra space in the frame buffer. # But, things like AprilTags do and won't work if you do this... -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) print("About to save background image...") sensor.skip_frames(time = 2000) # Give the user time to get ready. diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_advanced_frame_differencing.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_advanced_frame_differencing.py index 503643d13..fcbac28a0 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_advanced_frame_differencing.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_advanced_frame_differencing.py @@ -14,10 +14,9 @@ BG_UPDATE_FRAMES = 50 # How many frames before blending. BG_UPDATE_BLEND = 128 # How much to blend by... ([0-256]==[0.0-1.0]). sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.RGB565 +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.RGB565 sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_basic_frame_differencing.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_basic_frame_differencing.py index 2b0b775e9..d1a41fbae 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_basic_frame_differencing.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_basic_frame_differencing.py @@ -11,10 +11,9 @@ import sensor, image, pyb, os, time TRIGGER_THRESHOLD = 5 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_shadow_removal.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_shadow_removal.py index a48677ae8..30d483e8e 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_shadow_removal.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_shadow_removal.py @@ -10,12 +10,11 @@ import sensor, image, pyb, os, time TRIGGER_THRESHOLD = 5 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QQVGA) # or sensor.QVGA (or others) if sensor.get_id() == sensor.OV7725: # Reduce sensor PLL from 6x to 4x. sensor.__write_reg(0x0D, (sensor.__read_reg(0x0D) & 0x3F) | 0x40) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. sensor.set_auto_gain(False) # Turn this off too. clock = time.clock() # Tracks FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_structural_similarity.py b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_structural_similarity.py index 4a1e73706..f7a2977fc 100644 --- a/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_structural_similarity.py +++ b/scripts/examples/Arduino/Portenta-H7/20-Frame-Differencing/on_disk_structural_similarity.py @@ -13,10 +13,9 @@ import sensor, image, pyb, os, time MIN_TRIGGER_THRESHOLD = -0.4 sensor.reset() # Initialize the camera sensor. -sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE +sensor.set_pixformat(sensor.GRAYSCALE) # or sensor.GRAYSCALE sensor.set_framesize(sensor.QVGA) # or sensor.QQVGA (or others) sensor.skip_frames(time = 2000) # Let new settings take affect. -sensor.set_auto_whitebal(False) # Turn off white balance. clock = time.clock() # Tracks FPS. if not "temp" in os.listdir(): os.mkdir("temp") # Make a temp directory diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_auto_gain_control.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_auto_gain_control.py index 3ecdc89d7..cf5d2d50e 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_auto_gain_control.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_auto_gain_control.py @@ -25,7 +25,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) # The gain db ceiling maxes out at about 24 db for the OV7725 sensor. diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_exposure_control.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_exposure_control.py index edc994c44..a68a0de61 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_exposure_control.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_exposure_control.py @@ -21,7 +21,7 @@ import sensor, image, time EXPOSURE_TIME_SCALE = 1.0 sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) # Print out the initial exposure time for comparison. @@ -34,7 +34,6 @@ clock = time.clock() # Create a clock object to track the FPS. # otherwise they will change the image gains to undo any exposure settings # that you put in place... sensor.set_auto_gain(False) -sensor.set_auto_whitebal(False) # Need to let the above settings get in... sensor.skip_frames(time = 500) diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_horizontal_mirror.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_horizontal_mirror.py index 467b46286..2099a1474 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_horizontal_mirror.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_horizontal_mirror.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_manual_whitebal_control.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_manual_whitebal_control.py index d9420ada3..a15fc6176 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_manual_whitebal_control.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_manual_whitebal_control.py @@ -16,7 +16,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -26,7 +26,6 @@ clock = time.clock() # Create a clock object to track the FPS. # # Uncomment the below line with gain values you like (get them from the print out). # -# sensor.set_auto_whitebal(False, rgb_gain_db = (0.0, 0.0, 0.0)) # Note: Putting (0.0, 0.0, 0.0) for the gain results in something close to zero # comming out. Do not expect the exact value going in to be equal to the value diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_vertical_flip.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_vertical_flip.py index 0470f27bf..3a9e18377 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_vertical_flip.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sensor_vertical_flip.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. diff --git a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sesnor_manual_gain_control.py b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sesnor_manual_gain_control.py index 01d7d3232..4991b3569 100644 --- a/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sesnor_manual_gain_control.py +++ b/scripts/examples/Arduino/Portenta-H7/21-Sensor-Control/sesnor_manual_gain_control.py @@ -21,7 +21,7 @@ import sensor, image, time GAIN_SCALE = 1.0 sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) # Print out the initial gain for comparison. @@ -34,7 +34,6 @@ clock = time.clock() # Create a clock object to track the FPS. # otherwise they will change the image exposure to undo any gain settings # that you put in place... sensor.set_auto_exposure(False) -sensor.set_auto_whitebal(False) # Need to let the above settings get in... sensor.skip_frames(time = 500) diff --git a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-rotation-scale.py b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-rotation-scale.py index 1dafa06ee..3163abd89 100644 --- a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-rotation-scale.py +++ b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-rotation-scale.py @@ -24,7 +24,7 @@ import sensor, image, time, math # it by doing "img.pool(2, 2)" on a 64x64 image. sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.B64X64) # Set frame size to 64x64... (or 64x32)... sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -33,7 +33,7 @@ clock = time.clock() # Create a clock object to track the FPS. # There's a lot more RAM in the frame buffer than in the MicroPython heap. # However, after doing this you have a lot less RAM for some algorithms... # So, be aware that it's a lot easier to get out of RAM issues now. -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-translation.py b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-translation.py index f4dd2e49f..685a7eb18 100644 --- a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-translation.py +++ b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/absolute-translation.py @@ -24,7 +24,7 @@ import sensor, image, time # it by doing "img.pool(2, 2)" on a 64x64 image. sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.B64X64) # Set frame size to 64x64... (or 64x32)... sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -33,7 +33,7 @@ clock = time.clock() # Create a clock object to track the FPS. # There's a lot more RAM in the frame buffer than in the MicroPython heap. # However, after doing this you have a lot less RAM for some algorithms... # So, be aware that it's a lot easier to get out of RAM issues now. -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-rotation-scale.py b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-rotation-scale.py index 8e1b54c64..f8d65f731 100644 --- a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-rotation-scale.py +++ b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-rotation-scale.py @@ -24,7 +24,7 @@ import sensor, image, time, math # it by doing "img.pool(2, 2)" on a 64x64 image. sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.B64X64) # Set frame size to 64x64... (or 64x32)... sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -33,7 +33,7 @@ clock = time.clock() # Create a clock object to track the FPS. # There's a lot more RAM in the frame buffer than in the MicroPython heap. # However, after doing this you have a lot less RAM for some algorithms... # So, be aware that it's a lot easier to get out of RAM issues now. -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-translation.py b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-translation.py index 04416cf09..fe01c242d 100644 --- a/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-translation.py +++ b/scripts/examples/Arduino/Portenta-H7/22-Optical-Flow/differential-translation.py @@ -24,7 +24,7 @@ import sensor, image, time # it by doing "img.pool(2, 2)" on a 64x64 image. sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.B64X64) # Set frame size to 64x64... (or 64x32)... sensor.skip_frames(time = 2000) # Wait for settings take effect. clock = time.clock() # Create a clock object to track the FPS. @@ -33,7 +33,7 @@ clock = time.clock() # Create a clock object to track the FPS. # There's a lot more RAM in the frame buffer than in the MicroPython heap. # However, after doing this you have a lot less RAM for some algorithms... # So, be aware that it's a lot easier to get out of RAM issues now. -extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.RGB565) +extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) while(True): diff --git a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_collection.py b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_collection.py index b8f7a5d26..7ae684ded 100644 --- a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_collection.py +++ b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_collection.py @@ -6,7 +6,7 @@ import sensor, image, time sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) diff --git a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_recognition.py b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_recognition.py index 6bf348e0e..b31bc16b9 100644 --- a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_recognition.py +++ b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_face_recognition.py @@ -6,7 +6,7 @@ import sensor, image, time, tf sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) diff --git a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_just_center.py b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_just_center.py index 0aec25b05..e8f12f924 100644 --- a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_just_center.py +++ b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_just_center.py @@ -21,7 +21,7 @@ import sensor, image, time, os, tf sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.set_windowing((240, 240)) # Set 240x240 window. sensor.skip_frames(time=2000) # Let the camera adjust. diff --git a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_whole_window.py b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_whole_window.py index 6b105ebf0..da7869c31 100644 --- a/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_whole_window.py +++ b/scripts/examples/Arduino/Portenta-H7/25-Machine-Learning/tf_mobilenet_search_whole_window.py @@ -21,7 +21,7 @@ import sensor, image, time, os, tf sensor.reset() # Reset and initialize the sensor. -sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) +sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240) sensor.set_windowing((240, 240)) # Set 240x240 window. sensor.skip_frames(time=2000) # Let the camera adjust. diff --git a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags.py b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags.py index 02409b0f0..33773cd8e 100644 --- a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags.py +++ b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags.py @@ -6,11 +6,10 @@ import sensor, image, time, math sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) # we run out of memory if the resolution is much bigger... sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work. diff --git a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_3d_pose.py b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_3d_pose.py index 64e763253..8b9c45e81 100644 --- a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_3d_pose.py +++ b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_3d_pose.py @@ -6,11 +6,10 @@ import sensor, image, time, math sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) # we run out of memory if the resolution is much bigger... sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work. diff --git a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_max_res.py b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_max_res.py index 82f05427c..ad4b83fab 100644 --- a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_max_res.py +++ b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_max_res.py @@ -14,7 +14,6 @@ elif omv.board_type() == "M7": sensor.set_windowing((200, 200)) else: raise Exception("You need a more powerful OpenMV Cam to run this script") sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work. diff --git a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_w_lens_zoom.py b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_w_lens_zoom.py index 3778ccb68..18b3248ae 100644 --- a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_w_lens_zoom.py +++ b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_apriltags_w_lens_zoom.py @@ -6,12 +6,11 @@ import sensor, image, time, math sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) # we run out of memory if the resolution is much bigger... sensor.set_windowing((160, 120)) # Look at center 160x120 pixels of the VGA resolution. sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must turn this off to prevent image washout... -sensor.set_auto_whitebal(False) # must turn this off to prevent image washout... clock = time.clock() # Note! Unlike find_qrcodes the find_apriltags method does not need lens correction on the image to work. diff --git a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_small_apriltags.py b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_small_apriltags.py index cbd54bf9e..b634bf9b9 100644 --- a/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_small_apriltags.py +++ b/scripts/examples/Arduino/Portenta-H7/26-April-Tags/find_small_apriltags.py @@ -21,7 +21,6 @@ elif omv.board_type() == "M7": sensor.set_framesize(sensor.QVGA) else: raise Exception("You need a more powerful OpenMV Cam to run this script") sensor.skip_frames(time = 200) # increase this to let the auto methods run for longer sensor.set_auto_gain(False) # must be turned off for color tracking -sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() # The apriltag code supports up to 6 tag families which can be processed at the same time. diff --git a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_as_the_remote_device_for_your_computer.py b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_as_the_remote_device_for_your_computer.py index cf6baa5d1..80f47b70a 100644 --- a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_as_the_remote_device_for_your_computer.py +++ b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_as_the_remote_device_for_your_computer.py @@ -7,7 +7,7 @@ import image, network, omv, rpc, sensor, struct sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) diff --git a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_streaming_as_the_remote_device_for_your_computer.py b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_streaming_as_the_remote_device_for_your_computer.py index 48f173b1c..686ba22fd 100644 --- a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_streaming_as_the_remote_device_for_your_computer.py +++ b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_jpg_streaming_as_the_remote_device_for_your_computer.py @@ -7,7 +7,7 @@ import network, omv, rpc, sensor sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) diff --git a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_raw_as_the_remote_device.py b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_raw_as_the_remote_device.py index 84d691dfc..5d2267370 100644 --- a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_raw_as_the_remote_device.py +++ b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/image_transfer_raw_as_the_remote_device.py @@ -7,7 +7,7 @@ import image, network, rpc, sensor, struct sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) diff --git a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/popular_features_as_the_remote_device.py b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/popular_features_as_the_remote_device.py index 5293c4150..45a4091f2 100644 --- a/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/popular_features_as_the_remote_device.py +++ b/scripts/examples/Arduino/Portenta-H7/34-Remote-Control/popular_features_as_the_remote_device.py @@ -9,7 +9,7 @@ import image, network, math, rpc, sensor, struct, tf sensor.reset() -sensor.set_pixformat(sensor.RGB565) +sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) @@ -116,7 +116,7 @@ def face_detection(data): # # data is unused def person_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) scores = tf.classify("person_detection", sensor.snapshot())[0].output() return ['unsure', 'person', 'no_person'][scores.index(max(scores))].encode() @@ -126,7 +126,7 @@ def person_detection(data): # # data is unused def qrcode_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) codes = sensor.snapshot().find_qrcodes() @@ -138,7 +138,7 @@ def qrcode_detection(data): # # data is unused def all_qrcode_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) codes = sensor.snapshot().find_qrcodes() @@ -151,7 +151,7 @@ def all_qrcode_detection(data): # # data is unused def apriltag_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) tags = sensor.snapshot().find_apriltags() if not tags: return bytes() # No detections. @@ -164,7 +164,7 @@ def apriltag_detection(data): # # data is unused def all_apriltag_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QQVGA) tags = sensor.snapshot().find_apriltags() if not tags: return bytes() # No detections. @@ -176,7 +176,7 @@ def all_apriltag_detection(data): # # data is unused def datamatrix_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) codes = sensor.snapshot().find_datamatrices() @@ -188,7 +188,7 @@ def datamatrix_detection(data): # # data is unused def all_datamatrix_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.VGA) sensor.set_windowing((320, 240)) codes = sensor.snapshot().find_datamatrices() @@ -224,7 +224,7 @@ def all_barcode_detection(data): # # data is the 6-byte color tracking threshold tuple of L_MIN, L_MAX, A_MIN, A_MAX, B_MIN, B_MAX. def color_detection(data): - sensor.set_pixformat(sensor.RGB565) + sensor.set_pixformat(sensor.GRAYSCALE) sensor.set_framesize(sensor.QVGA) thresholds = struct.unpack("