Giter Club home page Giter Club logo

color_picker's Introduction

Color picker GUI

How to use

Firstly make sure that you have installed the packages from the requirements.txt file, you can do it by this:

pip install -r requirements.txt

The basics setup is provided via launch/gui.launch file. You need to specify your image_in topic, the rest topics are for the gui, so you don't need to change them. You need to supply also a path were you want the saved files to be - save_dir param.

Also, to make your life easier prepare a color config file, you can see an example in this git repo called balloon_config.yaml - it provides names of the colors, so you don't need to write the names by yourself, just click the button. For this needs there is a config_path param.

To launch computation into the drone terminal ( the realsense, or any camera that is specified in launch file should be working ):

export $UAV_NAME=uav1; roslaunch balloon_color_picker compute.launch

To launch gui type into your terminal, and you will have the gui to select colors:

export $UAV_NAME=uav1; roslaunch balloon_color_picker gui.launch

To select color you can use:

  • Capture - will capture all the colors that are in the circle
  • Select - you can use your mouse to select area of interest on the picture
  • Freeze - freezes the image, so you can select area of interest Feel free to use hotkeys for this, and submit bug report into issues, I'll try to fix them as soon as possible

The GUI elements:

  • Video stream - a live video stream from a camera topic and the segmentation result using the selected color values.
  • Clear colors(N) - a button for deleting the current color data. Can also be triggered by pressing "N" on the keyboard.
  • HSV(1) - a button that changes current video stream from colorful image to the segmented image by the HSV color space. Can also be triggered by pressing "1" on the keyboard.
  • Lab(2) - a button that changes current video stream from colorful image to the segmented image by LAB. Can also be triggered by pressing "2" on the keyboard.
  • Object Detect(3) - a button that changes current video stream from colorful image to the debug image from Object Detect. Can also be triggered by pressing "3" on the keyboard.
  • Freeze(F) - a button that freezes the video stream. Can also be triggered by pressing "F" on the keyboard.
  • Update Object Detect(U) - a button that sends the picked color LUT to the Object Detect package. Can also be triggered by pressing "U" on the keyboard.
  • The current number of taken samples of the color.
  • Save(S) - a button that saves the current picked color LUT to a file. Can also be triggered by pressing "S" on the keyboard..
  • A group of sliders for the H, S, V channels respectively. These sliders serve to change the allowed color range in the respective dimensions of the HSV color space.`k
  • A group of sliders for L,A,B channels correspondingly. These sliders serve to change the allowed color range in the respective dimensions of the LAB color space.
  • Input bar for the destination of the file that will contain the resulting color data.
  • Input bar for the diameter of the tracked object (expressed in centimeters).
  • A list of predefined color naming buttons. By pressing them, user can change the name of the resulting file. Can by also triggered by a combination of "Ctrl"+number of the desired color.
  • Buttons that change the current color space view.
  • The load method - buttons that specify what type of color data is send to Object Detect.
  • The histogram block - a group of three histograms charts for each channel - H, S, V for HSV view and L, A, B for LAB view.
  • 2D histogram of H,S channels in case of HSV view and A,B channels for LAB view. This area is used to select the color ranges for the LUT.
  • A log message - verbose output of the last action.

Usage example

color_picker's People

Contributors

matemat13 avatar wingrs avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

larsdb98

color_picker's Issues

KeyError due to UAV_NAME

Hello, when trying to run a couple of launchfiles (including gui.launch), this node crashes and the following Python error shows up:

PluginManager._load_plugin() could not load plugin "balloon_color_picker/Color Picker Plugin":
Traceback (most recent call last):
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/plugin_handler.py", line 102, in load
    self._load()
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/plugin_handler_direct.py", line 55, in _load
    self._plugin = self._plugin_provider.load(self._instance_id.plugin_id, self._context)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/composite_plugin_provider.py", line 72, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/composite_plugin_provider.py", line 72, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui_py/ros_py_plugin_provider.py", line 61, in load
    return super(RosPyPluginProvider, self).load(plugin_id, plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/qt_gui/composite_plugin_provider.py", line 72, in load
    instance = plugin_provider.load(plugin_id, plugin_context)
  File "/opt/ros/noetic/lib/python3/dist-packages/rqt_gui/ros_plugin_provider.py", line 106, in load
    return class_ref(plugin_context)
  File "/root/moma_ws/src/mapping_pipeline_packages/color_picker/src/balloon_color_picker/plugin_module.py", line 79, in __init__
    new_wdg = MyWidget.MyWidget()
  File "/root/moma_ws/src/mapping_pipeline_packages/color_picker/src/balloon_color_picker/MyWidget.py", line 110, in __init__
    self.uav_name = os.environ['UAV_NAME']
  File "/usr/lib/python3.8/os.py", line 675, in __getitem__
    raise KeyError(key) from None
KeyError: 'UAV_NAME'

[uav/balloon_color_picker_gui-3] process has died [pid 150250, exit code 1, cmd /root/moma_ws/src/mapping_pipeline_packages/color_picker/scripts/plugin.py __name:=balloon_color_picker_gui __log:=/root/.ros/log/32a03072-9807-11ee-999a-8cf8c5004c27/uav-balloon_color_picker_gui-3.log].
log file: /root/.ros/log/32a03072-9807-11ee-999a-8cf8c5004c27/uav-balloon_color_picker_gui-3*.log

This error persists even with the launch command lines you have provided in the README.

I ran this on a ROS Noetic environment (Ubuntu 20.04).

I need this package in order to figure out the right detection parameters in order to use your "object_detect" ROS package to detect certain items from an image stream.

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.