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
+27-5Lines changed: 27 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,9 +49,16 @@ You will be using the **Himax HM-01B0 camera module** which has a resolution of
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,10 @@ 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
+
#include"himax.h"// API to read from the Himax camera found on the Portenta Vision Shield Rev.1
92
+
// OR
93
+
#include"hm0360.h"// API to read from the Himax camera found on the Portenta Vision Shield Rev.2
84
94
```
85
95
86
96
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 +102,13 @@ SDMMCBlockDevice blockDevice;
92
102
mbed::FATFileSystem fileSystem("fs");
93
103
94
104
#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
105
+
106
+
#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1
96
107
HM01B0 himax;
108
+
// OR
109
+
#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2
110
+
HM0360 himax;
111
+
97
112
Camera cam(himax);
98
113
99
114
FrameBuffer frameBuffer; // Buffer to save the camera stream
0 commit comments