Sony IMX219
Sony IMX219
Up to 3280 x 2464 pixels
6mm focal length, wide-angle lens
160
Up to 1080p at 30fps
Yes
Fixed
Powered directly from Raspberry Pi board
0C to 50C
25mm x 25mm x 12mm
Applications
The Raspberry Pi 6mm High Quality Camera Wide Angle Lens is ideal for a wide range of applications, including |
Computer vision and machine learning projects
Robotics and autonomous systems
Surveillance and security systems
Multimedia and video streaming projects
IoT and smart home devices
Conclusion
The Raspberry Pi 6mm High Quality Camera Wide Angle Lens is a high-performance camera module that offers exceptional image quality, wide-angle vision, and ease of use. Its compact design, auto focus functionality, and power management features make it an ideal choice for a wide range of projects and applications.
Raspberry Pi 6mm High Quality Camera Wide Angle Lens Documentation
Overview
The Raspberry Pi 6mm High Quality Camera Wide Angle Lens is a high-quality camera module designed for the Raspberry Pi single-board computer. It features a 6mm wide-angle lens, allowing for a wider field of view and increased image quality. This camera module is ideal for various IoT applications, such as computer vision, robotics, and surveillance.
Technical Specifications
Sensor: Sony IMX219
Resolution: 8 megapixels
Lens: 6mm wide-angle lens
Field of view: 72 degrees
Interface: CSI-2 (Camera Serial Interface)
Compatibility: Raspberry Pi 3, 3+, 4, and Zero series
Code Examples
### Example 1: Capturing an Image using Python
This example demonstrates how to use the Raspberry Pi 6mm High Quality Camera Wide Angle Lens to capture an image using Python.
Code:
```python
import picamera
# Create a camera object
camera = picamera.PiCamera()
# Set the camera resolution to 640x480
camera.resolution = (640, 480)
# Capture an image and save it to a file
camera.capture('image.jpg')
# Release the camera resources
camera.close()
```
Note: Make sure to install the `picamera` library by running `sudo apt-get install python-picamera` on your Raspberry Pi.
### Example 2: Streaming Video using OpenCV and Python
This example demonstrates how to use the Raspberry Pi 6mm High Quality Camera Wide Angle Lens to stream video using OpenCV and Python.
Code:
```python
import cv2
# Create a video capture object
cap = cv2.VideoCapture(0)
while True:
# Read a frame from the camera
ret, frame = cap.read()
# Display the frame
cv2.imshow('Frame', frame)
# Exit on key press
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Release the video capture resources
cap.release()
cv2.destroyAllWindows()
```
Note: Make sure to install the `opencv-python` library by running `sudo apt-get install python-opencv` on your Raspberry Pi.
### Example 3: Motion Detection using Python and OpenCV
This example demonstrates how to use the Raspberry Pi 6mm High Quality Camera Wide Angle Lens to detect motion using Python and OpenCV.
Code:
```python
import cv2
# Create a video capture object
cap = cv2.VideoCapture(0)
while True:
# Read a frame from the camera
ret, frame = cap.read()
# Convert the frame to grayscale
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
# Apply Gaussian blur to reduce noise
blurred = cv2.GaussianBlur(gray, (21, 21), 0)
# Calculate the absolute difference between the current frame and the previous frame
frame_delta = cv2.absdiff(blurred, cv2.imread('previous_frame.jpg'))
# Threshold the difference image to detect motion
thresh = cv2.threshold(frame_delta, 25, 255, cv2.THRESH_BINARY)[1]
# Find contours in the thresholded image
contours, _ = cv2.findContours(thresh, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
# Iterate through the contours and draw a rectangle around the motion area
for contour in contours:
if cv2.contourArea(contour) > 1000:
x, y, w, h = cv2.boundingRect(contour)
cv2.rectangle(frame, (x, y), (x + w, y + h), (0, 255, 0), 2)
# Display the output
cv2.imshow('Motion Detection', frame)
# Save the current frame as the previous frame
cv2.imwrite('previous_frame.jpg', blurred)
# Exit on key press
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# Release the video capture resources
cap.release()
cv2.destroyAllWindows()
```
Note: This example saves the previous frame to a file and compares it with the current frame to detect motion. You may need to adjust the threshold value and contour area threshold to suit your specific use case.