Verify your installation
- Python: confirm your environment is active and your IDE uses the same interpreter.
- C++: verify that your project includes OpenCV headers and links the right libraries (x64, Release/Debug consistency).
- Restart your terminal/IDE after installation to pick up updated PATH variables.
Open a camera on Windows
- Close other apps that might be using the webcam.
- Try device index 0 first; if it fails, test 1 or higher (multiple cameras change indices).
- Allow camera access in Windows privacy settings.
- Use a minimal capture script or sample to confirm the camera opens and returns frames.
Read and display an image
- Place an image file (e.g., PNG/JPG) in your project folder.
- Load the image and verify its dimensions before displaying or processing.
- If the image fails to load, check the path and filename, avoiding non-ASCII characters when possible.
Open a video file
- Use a common codec/container (e.g., MP4/H.264) for compatibility with prebuilt binaries.
- If a video fails to open, try another file or re-encode; verify that your build includes FFmpeg support.
- Process frames in a loop and handle end-of-file conditions gracefully.
Basic operations to try
- Resize and rotate an image, then save the result to a new file.
- Convert to grayscale and apply edge detection to visualize contours.
- Draw simple overlays (lines, rectangles, text) to annotate frames.