Skip to content

Commit f6be325

Browse files
authored
[PC-1807] Vision Shield Rev 2 - Tutorials Revamp with new camera (#2138)
* camera-to-bitmap updated * Getting Started updated * Format fix * Cameras info update * Cameras info update * Getting Started updated * minor update
1 parent d39d85b commit f6be325

File tree

2 files changed

+55
-11
lines changed
  • content/hardware/04.pro/shields/portenta-vision-shield/tutorials

2 files changed

+55
-11
lines changed

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md

+35-7
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,21 @@ Connect the Portenta Vision Shield to your Portenta H7 as shown in the figure. T
4444

4545
#### The Camera
4646

47-
You will be using the **Himax HM-01B0 camera module** which has a resolution of 320 by 240 and the output data its in grayscale with 8 bits per pixel (bpp). It is important to have this in mind as the `.bmp` (bitmap) format has some needed configuration depending on the data being used.
47+
The Vision Shield Rev.1 uses the **Himax HM-01B0 (320x240) camera module**, the Vision Shield Rev.2 uses the **Himax HM0360 (640x480) camera module**, both output data are grayscale with 8 bits per pixel (bpp). It is important to have this in mind as the `.bmp` (bitmap) format has some needed configuration depending on the data being used.
4848

4949
Inside the sketch, you can use these libraries to access the camera APIs, also compatible with the [Arduino Nicla Vision](https://docs.arduino.cc/hardware/nicla-vision)
5050
```cpp
5151
#include "camera.h" // Multi Media Card APIs
52-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
52+
53+
//For the Vision Shield Rev.1
54+
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
55+
56+
//For the Vision Shield Rev.2
57+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
5358
```
5459

60+
***Left uncommented the library of your Vision Shield version.***
61+
5562
#### Bitmap File Format
5663

5764
The bitmap binary file needs to contain some information in order to tell the computer for example the resolution of the picture and the bit-depth (bpp). Bit depth refers to the color information stored in the image. The higher the bit depth of an image, the more colors it can store. As the bit depth increases, the file size of the image also increases, because more color information has to be stored for each pixel in the image.
@@ -80,7 +87,12 @@ First you need to include the needed libraries
8087
#include "FATFileSystem.h" // Mbed API for portable and embedded systems
8188

8289
#include "camera.h" // Arduino Mbed Core Camera APIs
83-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
90+
91+
/*-----Uncomment the library and class for your specific hardware-----*/
92+
93+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
94+
// OR
95+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
8496
```
8597

8698
Then define the following objects with their respective constructor (`blockDevice` and `fileSystem` objects), needed for getting access to the SD Card and the file system.
@@ -92,8 +104,17 @@ SDMMCBlockDevice blockDevice;
92104
mbed::FATFileSystem fileSystem("fs");
93105

94106
#include "camera.h" // Arduino Mbed Core Camera APIs
95-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
96-
HM01B0 himax;
107+
108+
/*-----Uncomment the library and class for your specific hardware-----*/
109+
110+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
111+
//HM01B0 himax;
112+
113+
// OR
114+
115+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
116+
HM0360 himax;
117+
97118
Camera cam(himax);
98119

99120
FrameBuffer frameBuffer; // Buffer to save the camera stream
@@ -288,8 +309,15 @@ SDMMCBlockDevice blockDevice;
288309
mbed::FATFileSystem fileSystem("fs");
289310

290311
#include "camera.h" // Arduino Mbed Core Camera APIs
291-
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield
292-
HM01B0 himax;
312+
313+
/*-----Uncomment the library and class for your specific hardware-----*/
314+
315+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
316+
//HM01B0 himax;
317+
318+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
319+
HM0360 himax;
320+
293321
Camera cam(himax);
294322

295323
FrameBuffer frameBuffer; // Buffer to save the camera stream

content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md

+20-4
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,23 @@ To capture the frames you will need to use the functions contained in `camera.h`
4747

4848
```cpp
4949
#include "camera.h"
50-
#include "himax.h"
50+
//For the Vision Shield Rev.1
51+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
52+
53+
//For the Vision Shield Rev.2
54+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
5155
```
5256

57+
***Left uncommented the library of your Vision Shield version.***
58+
5359
Next, let's initialize a camera object and a frame buffer of the size 320*240 (76'800 bytes).
5460

5561
```cpp
56-
HM01B0 himax;
62+
63+
//HM01B0 himax; // for Vision Shield Rev.1
64+
65+
HM0360 himax; // for Vision Shield Rev.2
66+
5767
Camera cam(himax);
5868
#define IMAGE_MODE CAMERA_GRAYSCALE
5969
FrameBuffer fb(320,240,2);
@@ -268,9 +278,15 @@ The `CaptureRawBytes.ino` Sketch.
268278

269279
```cpp
270280
#include "camera.h"
271-
#include "himax.h"
272281

273-
HM01B0 himax;
282+
/*-----Uncomment the library and class for your specific hardware-----*/
283+
284+
//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
285+
//HM01B0 himax;
286+
287+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
288+
HM0360 himax;
289+
274290
Camera cam(himax);
275291
#define IMAGE_MODE CAMERA_GRAYSCALE
276292
FrameBuffer fb(320,240,2);

0 commit comments

Comments
 (0)