Sensors module¶
- class sensors.Camera[source]¶
Bases:
object
A class to groups functions related to OpenMV Cam
More infos: https://openmv.io/products/openmv-cam-h7
- width¶
the screen width in pixels
- height¶
the screen height in pixels
- BALL_DIAMETER = 45¶
- FOCAL_LENGTH = 2.8¶
- HFOV = 70.8¶
- REAL_SIZE = 7¶
- THRESHOLDS = [(0, 100, 127, 42, -128, 127)]¶
- VFOV = 55.6¶
- static ball_blob()[source]¶
Takes a snapshot and find pixels area matching with thresholds . :returns: returns a blob object if visible. :rtype: image.blob | None
- Additionnal informations can be found here about the blob object:
- static distance_to(blob) float [source]¶
Calculate real distance between camera and object.
- Parameters
blob – a blob object (you can get one with ball_blob())
- Returns
The distance in millimeters.