This application is designed to detect finger joints in real-time using a webcam, video file, or IP camera. It utilizes the MediaPipe library for hand tracking and OpenCV for image processing. The application provides a graphical user interface (GUI) built with Tkinter, allowing users to interact with the detection process, adjust settings, and save images.
- Real-time Detection: Detects finger joints and counts the number of fingers up.
- Multiple Input Sources: Supports webcam, video files, and IP cameras.
- User-friendly Interface: Provides a GUI for easy interaction.
- Image Saving: Allows users to save the current frame as an image.
- Hand Tracking: Tracks up to two hands simultaneously.
- Python 3.x
- OpenCV (
cv2) - MediaPipe (
mediapipe) - Tkinter (
tkinter) - Pillow (
PIL)
- Clone the repository or download the
main.pyfile. - Install the required libraries using pip:
pip install opencv-python mediapipe tkinter pillow
- Run the application:
python main.py
- Select Input Source: Choose between webcam, video file, or IP camera.
- Start Detection: Click the "Start" button to begin the detection process.
- Stop Detection: Click the "Stop" button to halt the detection.
- Save Image: Click the "Save Image" button to save the current frame.
- Exit: Click the "Exit" button to close the application.
- FingerDetectionApp Class: Manages the GUI and detection process.
__init__: Initializes the application and sets up the GUI.create_widgets: Creates the GUI components.start_detection: Starts the finger joint detection.stop_detection: Stops the detection process.save_image: Saves the current frame as an image.detect_finger_joints: Processes the video feed and detects finger joints.
Contributions are welcome! Please fork the repository and submit a pull request with your changes.
This project is licensed under the MIT License. See the LICENSE file for details.
این برنامه برای تشخیص مفاصل انگشتان در زمان واقعی با استفاده از وبکم، فایل ویدیویی یا دوربین IP طراحی شده است. این برنامه از کتابخانه MediaPipe برای ردیابی دست و OpenCV برای پردازش تصویر استفاده میکند. برنامه یک رابط کاربری گرافیکی (GUI) با استفاده از Tkinter ارائه میدهد که به کاربران امکان تعامل با فرآیند تشخیص، تنظیمات و ذخیره تصاویر را میدهد.
- تشخیص در زمان واقعی: مفاصل انگشتان را تشخیص داده و تعداد انگشتان بالا را میشمارد.
- چندین منبع ورودی: از وبکم، فایلهای ویدیویی و دوربینهای IP پشتیبانی میکند.
- رابط کاربری آسان: یک GUI برای تعامل آسان ارائه میدهد.
- ذخیره تصویر: به کاربران امکان ذخیره فریم فعلی به عنوان تصویر را میدهد.
- ردیابی دست: تا دو دست را به طور همزمان ردیابی میکند.
- Python 3.13
- OpenCV (
cv2) - MediaPipe (
mediapipe) - Tkinter (
tkinter) - Pillow (
PIL)
- مخزن را کلون کنید یا فایل
main.pyرا دانلود کنید. - کتابخانههای مورد نیاز را با استفاده از pip نصب کنید:
pip install opencv-python mediapipe tkinter pillow
- برنامه را اجرا کنید:
python main.py
- انتخاب منبع ورودی: بین وبکم، فایل ویدیویی یا دوربین IP انتخاب کنید.
- شروع تشخیص: دکمه "Start" را کلیک کنید تا فرآیند تشخیص شروع شود.
- توقف تشخیص: دکمه "Stop" را کلیک کنید تا تشخیص متوقف شود.
- ذخیره تصویر: دکمه "Save Image" را کلیک کنید تا فریم فعلی ذخیره شود.
- خروج: دکمه "Exit" را کلیک کنید تا برنامه بسته شود.
- کلاس FingerDetectionApp: مدیریت رابط کاربری و فرآیند تشخیص.
__init__: برنامه را مقداردهی اولیه کرده و GUI را تنظیم میکند.create_widgets: اجزای GUI را ایجاد میکند.start_detection: فرآیند تشخیص مفاصل انگشتان را شروع میکند.stop_detection: فرآیند تشخیص را متوقف میکند.save_image: فریم فعلی را به عنوان تصویر ذخیره میکند.detect_finger_joints: ویدیو را پردازش کرده و مفاصل انگشتان را تشخیص میدهد.
مشارکتها مورد استقبال هستند! لطفاً مخزن را فورک کرده و یک درخواست pull با تغییرات خود ارسال کنید.
این پروژه تحت مجوز MIT منتشر شده است. برای جزئیات بیشتر به فایل LICENSE مراجعه کنید.