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/user-manual/content.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,3 +126,71 @@ If you overwrite the __main.py__ script on your Portenta H7, then it will run wh
126
126
⚪ **Blinking White:** Your Portenta H7 firmware is panicking because of a hardware failure. Please check that your Vision Shield's camera module is installed securely.
127
127
128
128
***If you tap the Portenta H7 reset button once, the board resets. If you tap it twice, the board enters Device Firmware Upgrade (DFU) mode and its green LED starts blinking and fading.***
Working with camera modules, the `Hello World` classic example is not an LED blink but the simplest sketch to capture images. We will use this example to verify the board's connection to the IDEs and that the Vision Shield itself is working as expected.
162
+
163
+
The following example script can be found on **File > Examples > HelloWorld > helloworld.py** in the OpenMV IDE.
164
+
165
+
```python
166
+
import sensor
167
+
import time
168
+
169
+
sensor.reset() # Reset and initialize the sensor.
170
+
sensor.set_pixformat(sensor.GRAYSCALE) # Set pixel format to RGB565 (or GRAYSCALE)
171
+
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
172
+
sensor.skip_frames(time=2000) # Wait for settings take effect.
173
+
clock = time.clock() # Create a clock object to track the FPS.
174
+
175
+
whileTrue:
176
+
clock.tick() # Update the FPS clock.
177
+
img = sensor.snapshot() # Take a picture and return the image.
178
+
print(clock.fps()) # Note: OpenMV Cam runs about half as fast when connected
179
+
# to the IDE. The FPS should increase once disconnected.
180
+
```
181
+
182
+

183
+
184
+
From the above example script, we can highlight the main functions:
185
+
186
+
-`sensor.set_pixformat(<Sensor>)` lets you set the pixel format for the camera sensor. The Vision Shield is compatible with these: `sensor.GRAYSCALE`, and `sensor.BAYER`.
187
+
188
+
To define the pixel format to any of the supported ones, just add it to the `set_pixformat` function argument.
189
+
190
+
-`sensor.set_framesize(<Resolution>)` lets you define the image frame size in terms of pixels. [Here](https://docs.openmv.io/library/omv.sensor.html#sensor.set_framesize) you can find all the different options.
191
+
192
+
To leverage full sensor resolution with the Vision Shield camera module `HM01B0`, use `sensor.B320X320`.
0 commit comments