This repository contains a hybrid testbed project for image segmentation control, utilizing various tools and techniques for open loop control and ROS implementation.
- Hybrid-Testbed
- Open Loop Control
- Contains scripts and resources for open loop control implementation.
- ROS Implementation
- Contains scripts and resources for ROS (Robot Operating System) implementation.
- Open Loop Control
- Live Video Feed: Start and stop live video feed from a Basler camera.
- Display Options: Choose between different image segmentation techniques including lines, blobs, color, edges, contours, shapes, or both lines and blobs.
- Graphical Display: Real-time plots of line and blob detection counts.
- Save Data: Save the processed image data (timestamp, line count, blob count) to a CSV file.
- Python 3.x
tkinter
pypylon
opencv-python
numpy
matplotlib
Pillow
- ROS (for ROS implementation)
-
Clone the repository:
git clone https://github.com/yourusername/hybrid-testbed.git cd hybrid-testbed
-
Install dependencies:
pip install tkinter pypylon opencv-python numpy matplotlib Pillow
-
ROS Installation: Follow the official ROS installation guide for your operating system. ROS Installation Guide
-
Navigate to the Open Loop Control directory:
cd Hybrid-Testbed/Open Loop Control
-
Run the application:
python open_loop_control.py
-
Control the application through the GUI:
- Click "Start Video Feed" to begin the live video feed.
- Select the desired image segmentation technique from the display options.
- Click "Stop Video Feed" to stop the live video feed.
- Click "Save Data" to open a file dialog and choose where to save the CSV file with the processed image data.
-
Navigate to the ROS Implementation directory:
cd Hybrid-Testbed/ROS Implementation
-
Follow the instructions in the README within the ROS Implementation directory to set up and run the ROS nodes.
- Video Feed Label: Displays the live video feed from the camera.
- Start/Stop Video Buttons: Control the live video feed.
- Display Options: Radio buttons to choose the type of image segmentation.
- Save Data Button: Opens a file dialog to save the CSV file.
- Real-time Plots: Displays plots of line and blob detection counts.
- initialize_gui(): Sets up the GUI elements.
- setup_camera(): Configures the Basler camera.
- start_video_feed() / stop_video_feed(): Starts and stops the live video feed.
- update_camera_feed(): Continuously retrieves images from the camera.
- process_image(): Processes each frame from the camera according to the selected display option.
- save_data(): Saves the collected image data to a CSV file.
- detect_lines() / detect_blobs() / color_segmentation() / edge_detection() / contour_detection() / shape_detection(): Image segmentation methods.
Contributions are welcome! Please fork this repository and submit pull requests for any enhancements or bug fixes.
This project is licensed under the MIT License.
- pypylon - Python bindings for the pylon Camera Software Suite.
- OpenCV - Open Source Computer Vision Library.
- tkinter - Python's de-facto standard GUI package.
- matplotlib - Comprehensive library for creating static, animated, and interactive visualizations in Python.
- Pillow - Python Imaging Library (PIL) fork.
- ROS - Robot Operating System.