The following Python code uses the OpenCV library to capture live video from a webcam and applies various image filters in real-time using a GUI created with Tkinter. The code also allows the user to adjust several image properties such as brightness, contrast, sharpness, and more. 🎥✨ It provides an intuitive interface to adjust properties like brightness, contrast, and color balance directly through Python code. Some filters can be buggy if placed together
Created using Python 3.12.2, CV2 Libary and Tkinter Library
cv2: OpenCV library for image processing.numpy: Library for numerical computations.tkinter: Standard GUI library in Python.datetime: Module to work with dates and times.PIL: Python Imaging Library for image processing.
These functions adjust various image properties.
Adjusts the brightness of the image.
Adjusts the contrast of the image.
Adjusts the sharpness of the image.
Applies a Laplacian filter for edge detection.
Applies Gaussian blur to the image.
Adjusts the hue of the image.
Adjusts the saturation of the image.
Applies chromatic aberration to the image.
Applies conservative smoothing to the image.
Applies edge detection using the Canny algorithm.
Applies a sepia filter to the image.
Applies mean blur to the image.
Applies median blur to the image.
Applies a bilateral filter to the image.
Converts the image to grayscale.
Converts the image to a negative.
Adjusts the color balance of the image.
Applies a Sobel filter for edge detection.
Applies a Roberts filter for edge detection.
actualizaImagen: Captures a frame from the webcam, applies selected filters and adjustments, and updates the image in the GUI.
Creates the main window for the application.
Creates the label to display the video and initializes the filter options.
Creates a dropdown menu for selecting filters.
Creates scales (sliders) for adjusting brightness, contrast, sharpness, blur, hue, saturation, mean blur, median blur, bilateral filter, and color balance.
This setup allows the user to interactively adjust these properties and see the results in real-time on their webcam feed.
Download the code and execute on Visual Studio Code (you may need to install all the libraries)
= Luciano Valentino Achin Angeles