You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md
+35-7
Original file line number
Diff line number
Diff line change
@@ -44,14 +44,21 @@ Connect the Portenta Vision Shield to your Portenta H7 as shown in the figure. T
44
44
45
45
#### The Camera
46
46
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.
48
48
49
49
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)
50
50
```cpp
51
51
#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
53
58
```
54
59
60
+
***Left uncommented the library of your Vision Shield version.***
61
+
55
62
#### Bitmap File Format
56
63
57
64
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
80
87
#include"FATFileSystem.h"// Mbed API for portable and embedded systems
81
88
82
89
#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
84
96
```
85
97
86
98
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;
92
104
mbed::FATFileSystem fileSystem("fs");
93
105
94
106
#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
+
97
118
Camera cam(himax);
98
119
99
120
FrameBuffer frameBuffer; // Buffer to save the camera stream
0 commit comments