The Wave application, a graphical user interface (GUI) program built using Python. The Wave application provides functionality related to computer vision, webcam control, and menu settings.
wave_demo.1.mp4
Before running the Wave application, ensure you have the dependencies as specified in the requirements.txt
file
To install the required dependencies, you can use the following command:
pip install -r requirements.txt
Make sure you have pip installed before running the above command.
To use the Wave application, follow these steps:
-
Import the required modules:
import customtkinter as ctk from appsettings import * from menu import Menu from vid_nd_control import WebCamView from appsettings import *
-
Create an instance of the
App
class:if __name__ == '__main__': App()
-
Run the application.
The App
class is the main class of the Wave application. It inherits from customtkinter.CTk
and initializes the GUI, layout, and various settings.
- Initializes
customtkinter.CTk
settings. - Sets the window size and title.
- Configures the layout of the application.
- Configures the layout using the
columnconfigure
androwconfigure
methods.
- Initializes and sets up the
WebCamView
class for computer vision and webcam control.
- Initializes and sets up the
Menu
class for handling menu settings.
- Runs the main event loop using
self.mainloop()
.
- Initializes Tkinter variables for video control, hand landmark recognition, PC control, and mouse smoothness.
- Initializes Tkinter variables for the application.
This is the README file for the ComponentFrame
, SliderPanel
, and OnOffSwitchPanel
classes. These components are part of a Python application built using the customtkinter
library. The components provide a user interface for sliders and on/off switches with customizable styles.
To use the ComponentFrame
, SliderPanel
, and OnOffSwitchPanel
classes, follow these steps:
-
Import the required modules:
import customtkinter as ctk from appsettings import *
-
Create an instance of the desired component:
# Example for SliderPanel slider_panel = SliderPanel(parent, text, data_var, min_value, max_value)
# Example for OnOffSwitchPanel on_off_panel = OnOffSwitchPanel(parent, text, showVideo, showHandlandmarks, control_pc)
-
Use the component instance in your application.
The ComponentFrame
class is a customized frame based on customtkinter.CTkFrame
. It provides a consistent look for the components.
The SliderPanel
class extends ComponentFrame
and is designed to create a panel with a slider and corresponding numerical display.
- Initializes the layout and sets up the slider and labels.
- Updates the numerical display based on the slider value.
The OnOffSwitchPanel
class extends ComponentFrame
and creates a panel with on/off switches for various functionalities.
- Initializes the layout and sets up on/off switches for webcam, hand landmarks, and PC control.
This is the README file for the Menu
, ControlsFrame
, and HelpFrame
classes. These classes are part of a Python application built using the customtkinter
library. The components provide a menu structure, controls frame, and a help frame for the application.
To use the Menu
, ControlsFrame
, and HelpFrame
classes, follow these steps:
-
Import the required modules:
import customtkinter as ctk from components import *
-
Create an instance of the
Menu
class:menu = Menu(parent, mouse_smoothness, video_on_off, show_handlandmarks, pccontrol)
-
Use the menu instance in your application.
The Menu
class extends customtkinter.CTkTabview
and provides a tabbed menu structure for the application.
- Initializes the menu with two tabs: 'Controls' and 'Help'.
- Sets up the
ControlsFrame
andHelpFrame
as content for the respective tabs.
The ControlsFrame
class extends customtkinter.CTkFrame
and creates a frame containing on/off switches, a slider, and a theme change option.
- Initializes the layout and sets up on/off switches and sliders for controlling video, hand landmarks, and PC control.
- Adds a theme change option.
The HelpFrame
class extends customtkinter.CTkFrame
and creates a frame for displaying help-related content.
- Initializes the layout with a red background (for illustration purposes).
This is the README file for the WebCamView
class. This class is part of a Python application using the customtkinter
, cv2
, mediapipe
, PIL
, keyboard
, and other libraries. It provides a webcam view with hand landmark detection, gesture recognition, and PC control functionalities.
To use the WebCamView
class, follow these steps:
-
Import the required modules:
from tkinter import Canvas import cv2 as cv from appsettings import * import mediapipe as mp import pickle import numpy as np from PIL import Image, ImageTk import keyboard import time
-
Create an instance of the
WebCamView
class:webcam_view = WebCamView(parent, mouse_smoothness, video_on_off, handlandmarks_on_off, pccontrol_on_off)
-
Use the
webcam_view
instance in your application.
The WebCamView
class extends the Canvas
widget and provides a webcam view with hand landmark detection, gesture recognition, and PC control functionalities.
- Initializes the webcam view with specified parameters such as
mouse_smoothness
,video_on_off
,handlandmarks_on_off
, andpccontrol_on_off
.
- Continuously updates the webcam frame, performs hand landmark detection, and recognizes gestures.
- Controls the visibility of the webcam view based on the
video_on_off
variable.
- Uses the
mediapipe
library to process the webcam frame and detect hand landmarks. - Performs gesture recognition and PC control based on the detected hand landmarks.
- Placeholder method for performing actions based on the predicted hand sign.
This is the README file for the application settings module. The settings include configuration parameters for the application, such as window dimensions, mouse control options, themes, and gesture recognition mappings.
SHOW_VIDEO
: Determines whether the webcam video is displayed (True/False).SHOW_HANDLANDMARKS
: Determines whether hand landmarks are shown on the video (True/False).FUNCTIONING_ON
: Indicates whether the application's functionalities are turned on or off (True/False).
WINDOW_HEIGHT
: Height of the application window.WINDOW_WIDTH
: Width of the application window.SCREEN_WIDTH
: Width of the user's screen.SCREEN_HEIGHT
: Height of the user's screen.
THEME
: Dictionary containing theme options, including 'Dark' and 'Light'.
DEFAULT_MOUSE_SMOOTHNESS
: Default smoothness factor for mouse movement.
HANDSIGN
: Dictionary mapping gesture labels to corresponding actions.
FRAME_REDUCTION
: Value used for frame reduction during calculations.
BACKGROUND_COLOR
: Background color of the application.WHITE
: White color.GRAY
: Gray color.BLUE
: Blue color.DARK_GREY
: Dark grey color.CLOSE_RED
: Close red color.SLIDER_BG
: Slider background color.FONT_1
: Font family for certain components.FONT_2
: Another font family.BUTTON_FONT_SIZE
: Font size for buttons.
plocX, plocY
: Previous (X, Y) coordinates of the mouse pointer.clocX, clocY
: Current (X, Y) coordinates of the mouse pointer.
This project is licensed under the MIT License.