If you're working with a Raspberry Pi for computer vision or AI projects, getting everything set up can be confusingβespecially with newer devices like the Raspberry Pi 5.
This guide compiles all essential commands used for:
- Setting up your Raspberry Pi
- Configuring network access
- Enabling remote control
- Troubleshooting camera issues
- Capturing images
π§ 1. System Setup & Updates
Before doing anything, your system should be updated:
sudo apt update
sudo apt upgrade
π 2. Network & IP Configuration
Check IP address
hostname -I
π This is needed for:
- SSH connection
- VNC connection
π 3. Remote Access Setup
Enable SSH and VNC
sudo raspi-config
Then navigate:
Interface Options β Enable SSH
Interface Options β Enable VNC
Connect via SSH
ssh pi@<IP_ADDRESS>
Example:
ssh pi@192.168.43.25
π₯οΈ 4. VNC (Remote Desktop Access)
Used when you want full GUI access from your laptop.
Steps:
- Enable VNC (see above)
- Install VNC Viewer on your laptop
- Connect using:
<IP_ADDRESS>
πΈ 5. Camera System (Important Update)
On modern Raspberry Pi OS:
Camera is enabled by default (libcamera system)
π You will NOT see "Camera" in raspi-config anymore.
π§ͺ 6. Test Camera
Preview camera
rpicam-hello
π Works only on GUI (monitor or VNC)
Capture image
rpicam-still -o test.jpg
Record video
rpicam-vid -t 5000 -o video.h264
π 7. File Management Commands
List files
ls
Create folder
mkdir dataset
cd dataset
π 8. Capture Multiple Images
for i in {1..10}; do rpicam-still -o img_$i.jpg; sleep 2; done
πΌοΈ 9. Open Image (on Raspberry Pi GUI)
xdg-open test.jpg
π§ͺ 10. Python + OpenCV Setup
Start Python
python3
Import OpenCV
import cv2
Load image
img = cv2.imread("test.jpg")
Resize image
resized = cv2.resize(img, (224, 224))
cv2.imwrite("resized.jpg", resized)
Convert to grayscale
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
cv2.imwrite("gray.jpg", gray)
Convert to HSV
hsv = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
cv2.imwrite("hsv.jpg", hsv)
Exit Python
exit()
β οΈ 11. Common Troubleshooting
Camera not working?
Check:
- Cable orientation
- Proper connection
- Correct port (Pi 5 has 2 ports)
No preview?
SSH = No preview
VNC/Monitor = Preview works
Restart system
sudo reboot
π§ Key Takeaways
β Raspberry Pi OS now uses libcamera
β No manual camera enable needed
β rpicam-* commands replace raspistill
β SSH is for control, not display
β VNC gives full desktop access
π― Final Thoughts
Once your Raspberry Pi and camera are set up:
π You are ready to:
- Collect image datasets
- Train AI models
- Deploy computer vision applications
π₯ If you found this useful
- Drop a β€οΈ
- Share with someone learning Raspberry Pi
- Follow for more AI + Embedded Systems content
Top comments (0)