arduino / arduino/ArduinoCore-mbed

[AE-49] Colour mode mismatch between CameraCaptureRawBytes.ino and CameraRawBytesVisualizer.pde

Open
#662 3 comments 1 reaction 0 assignees View on GitHub
bug Camera nicla Video
Dominant language
C
Stars
411
Forks
225
PR merge metrics
No merged PRs in 30d

Description

# Problem
:disappointed: This is what happens when `useGreyScale` is set to `true` for the Nicla Vision:
![image](https://user-images.githubusercontent.com/75624145/231757535-786e7471-955b-4c65-88f0-8b37422d2ed5.png)
:smile: This is what is observed, when `userGreyScale` is set to `false` for the Nicla Vision
![image](https://user-images.githubusercontent.com/75624145/231758074-99bb1b13-7319-4ad5-ba8e-72e3dbe59df2.png)

This creates three problems:
- The header comment and code in CameraRawBytesVisualizer conflict in what the default colour mode is
- From a UX perspective (cc @sebromero ) the User can face additional hurdles in testing out a basic function (e.g [this forum post](https://forum.arduino.cc/t/giga-r1-camera-example-problem/1112691/2))
- There is no clear pathway for users to realise the problem, upon seeing the corrupt image.

# Details
The [CameraCaptureRawBytes](https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/libraries/Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino) sketch is used to send a video stream over Serial to the computer. Which can then be displayed with the [CameraRawBytesVisualizer](https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/libraries/Camera/extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde#L19) Processing sketch.

A series of pre-directives, configures the `IMAGE_MODE` to be either `CAMERA_RGB` (Nicla Vision and GIGA boards) or `CAMERA-GREYSCALE` (Portenta H7 family).
https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/libraries/Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino#L3-L19

In the default configuration, the accompanying CameraRawBytesVisualizer sketch is configured to be compatible with `CAMERA_GREYSCLE`, even though the header comment states that the Processing sketch is for RGB.
https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/libraries/Camera/extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde#L1-L7
https://github.com/arduino/ArduinoCore-mbed/blob/0504d34ada3d5aac69eacb481bcdc64860aebca9/libraries/Camera/extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde#L19-L20

---
Thanks @marqdevx , @Hannes7eicher and @jacobhylen for letting me pick your brains :brain:

Contributor guide

No contributing guide indexed for this repository

Research direction

Compare libraries/Camera/examples/CameraCaptureRawBytes/CameraCaptureRawBytes.ino with libraries/Camera/extras/CameraRawBytesVisualizer/CameraRawBytesVisualizer.pde, especially the preprocessor configuration and the visualizer header and mode setting. Run the CameraCaptureRawBytes example with a Nicla Vision or GIGA and view it in Processing. Done means the documented default mode, sketch configuration, and resulting image agree without producing a corrupt stream.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.