Giter VIP home page Giter VIP logo

opencv-python-camera-settings's Introduction

Set your Camera settings using Python and OpenCV

Here is the shortest python project to change your camera settings (focus, exposure, contrast, brightness) using OpenCV. It will let you play with all the values to find the right one for your camera model.

Note:

  • Based on OpenCV implementation and the camera/webcam driver for your operating system, some settings (called Capabilities) may not be available and adjustable.
  • Settings values (direction and range) are highly dependant of the camera manufacturer and model.
    So you will have to use a trial/error strategy to find the right values for your camera.
    • ie: Higher brightness value could mean brigher or darker image on another camera.
    • ie: contrast=0 could be mean 'normal' contrast or 'very low' contrast on another camera.

Installation

pip install opencv-python==4.4.0.40

#Usage

Start opencv-camera_settings.py All settings values are shown is the console for you to reuse in other OpenCV project.

Keyboard shortcuts

Shortcut Action
S Open DirectShow Camera settings
B Increase brightness
b Decrease brightness
E Increase exposure
e Decrease exposure
C Increase contrast
c Decrease contrast
F Increase focus
f Decrease focus
0 - N Switch camera (0 is the default main camera)
L Enable live view (Camera will be reserved by this script)
l Disable live view (Camera will be usable by other apps while still allowing settings)

Samples value

Camera model Brightness Exposure Contrast Focus
Surface book 2
Front camera -130 to +130 -2 to 11 -130 to +130 Not available
Surface book 2
Rear camera -130 to +130 -9 to -3.5 -130 to +130 600 (close) to 0 (far)
Logitech C270 0 to 255 0 to -6 0 to 255 Not available

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.