From a6a9cb95a4787e233b210d93b0bfb0636c0dc1d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:52:19 -0400 Subject: [PATCH 1/7] camera-to-bitmap updated --- .../camera-to-bitmap-sd-card/content.md | 32 ++++++++++++++++--- 1 file changed, 27 insertions(+), 5 deletions(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index fa4646c4e4..8b52ffd4b2 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -49,9 +49,16 @@ You will be using the **Himax HM-01B0 camera module** which has a resolution of 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) ```cpp #include "camera.h" // Multi Media Card APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield + +//For the Vision Shield Rev.1 +#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 + +//For the Vision Shield Rev.2 +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 ``` +***Left uncommented the library of your Vision Shield version.*** + #### Bitmap File Format 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 #include "FATFileSystem.h" // Mbed API for portable and embedded systems #include "camera.h" // Arduino Mbed Core Camera APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield + +#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +// OR +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 ``` 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; mbed::FATFileSystem fileSystem("fs"); #include "camera.h" // Arduino Mbed Core Camera APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield + +#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 HM01B0 himax; +// OR +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 +HM0360 himax; + Camera cam(himax); FrameBuffer frameBuffer; // Buffer to save the camera stream @@ -288,8 +303,15 @@ SDMMCBlockDevice blockDevice; mbed::FATFileSystem fileSystem("fs"); #include "camera.h" // Arduino Mbed Core Camera APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield -HM01B0 himax; + +/*-----Uncomment the library and class for your specific hardware-----*/ + +//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +//HM01B0 himax; + +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 +HM0360 himax; + Camera cam(himax); FrameBuffer frameBuffer; // Buffer to save the camera stream From 0ffc88d1259949b7c01a4925962ec0142ecbe044 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Tue, 27 Aug 2024 09:58:14 -0400 Subject: [PATCH 2/7] Getting Started updated --- .../getting-started-camera/content.md | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md index e62d43efca..969aaf5175 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md @@ -47,13 +47,23 @@ To capture the frames you will need to use the functions contained in `camera.h` ```cpp #include "camera.h" -#include "himax.h" +//For the Vision Shield Rev.1 +#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 + +//For the Vision Shield Rev.2 +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 ``` +***Left uncommented the library of your Vision Shield version.*** + Next, let's initialize a camera object and a frame buffer of the size 320*240 (76'800 bytes). ```cpp -HM01B0 himax; + +HM01B0 himax; // for Vision Shield Rev.1 + +HM0360 himax; // for Vision Shield Rev.2 + Camera cam(himax); #define IMAGE_MODE CAMERA_GRAYSCALE FrameBuffer fb(320,240,2); @@ -268,9 +278,15 @@ The `CaptureRawBytes.ino` Sketch. ```cpp #include "camera.h" -#include "himax.h" -HM01B0 himax; +/*-----Uncomment the library and class for your specific hardware-----*/ + +//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +//HM01B0 himax; + +#include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 +HM0360 himax; + Camera cam(himax); #define IMAGE_MODE CAMERA_GRAYSCALE FrameBuffer fb(320,240,2); From 356cc460fcd53495259441a9a9d21cdf7c3c2a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:01:05 -0400 Subject: [PATCH 3/7] Format fix --- .../tutorials/camera-to-bitmap-sd-card/content.md | 8 ++++++-- .../tutorials/getting-started-camera/content.md | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index 8b52ffd4b2..2743dc13ce 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -103,9 +103,13 @@ mbed::FATFileSystem fileSystem("fs"); #include "camera.h" // Arduino Mbed Core Camera APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 -HM01B0 himax; +/*-----Uncomment the library and class for your specific hardware-----*/ + +//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +//HM01B0 himax; + // OR + #include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 HM0360 himax; diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md index 969aaf5175..ec492040f9 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md @@ -60,7 +60,7 @@ Next, let's initialize a camera object and a frame buffer of the size 320*240 (7 ```cpp -HM01B0 himax; // for Vision Shield Rev.1 +//HM01B0 himax; // for Vision Shield Rev.1 HM0360 himax; // for Vision Shield Rev.2 From 8a6f152a72128454d3857da483bcb2c57f5c5e04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:39:38 -0400 Subject: [PATCH 4/7] Cameras info update --- .../tutorials/camera-to-bitmap-sd-card/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index 2743dc13ce..aa582e48ce 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -44,7 +44,7 @@ Connect the Portenta Vision Shield to your Portenta H7 as shown in the figure. T #### The Camera -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. +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 it's 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. 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) ```cpp From 1a1a5b9d5aa906c8ce553c3ff6105ad8dc590a0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:44:25 -0400 Subject: [PATCH 5/7] Cameras info update --- .../tutorials/camera-to-bitmap-sd-card/content.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index aa582e48ce..07e88bfbe2 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -44,7 +44,7 @@ Connect the Portenta Vision Shield to your Portenta H7 as shown in the figure. T #### The Camera -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 it's 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. +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. 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) ```cpp From 5e2ed4dd52348a9bf9a2147cd61051b66f3fe785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:47:37 -0400 Subject: [PATCH 6/7] Getting Started updated --- .../tutorials/camera-to-bitmap-sd-card/content.md | 2 +- .../tutorials/getting-started-camera/content.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index 07e88bfbe2..09fce49b43 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -88,7 +88,7 @@ First you need to include the needed libraries #include "camera.h" // Arduino Mbed Core Camera APIs -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 // OR #include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 ``` diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md index ec492040f9..d842eb86c9 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/getting-started-camera/content.md @@ -48,7 +48,7 @@ To capture the frames you will need to use the functions contained in `camera.h` ```cpp #include "camera.h" //For the Vision Shield Rev.1 -#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 +//#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 //For the Vision Shield Rev.2 #include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2 From 226b242fd2ac0cdbbcaf76133bff8e8036a93d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christopher=20M=C3=A9ndez?= <49886387+mcmchris@users.noreply.github.com> Date: Mon, 16 Sep 2024 11:53:37 -0400 Subject: [PATCH 7/7] minor update --- .../tutorials/camera-to-bitmap-sd-card/content.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md index 09fce49b43..02c71097c7 100644 --- a/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md +++ b/content/hardware/04.pro/shields/portenta-vision-shield/tutorials/camera-to-bitmap-sd-card/content.md @@ -88,6 +88,8 @@ First you need to include the needed libraries #include "camera.h" // Arduino Mbed Core Camera APIs +/*-----Uncomment the library and class for your specific hardware-----*/ + //#include "himax.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.1 // OR #include "hm0360.h" // API to read from the Himax camera found on the Portenta Vision Shield Rev.2