Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jsk_perception] Add invert_mask_image nodelet #2726

Merged
merged 4 commits into from Nov 8, 2023

Conversation

iory
Copy link
Member

@iory iory commented Sep 16, 2022

What is this?

This is PR for #2706 .

InvertMaskImage

image

Inverts the input mask image.

Subscribing Topic

  • ~input (sensor_msgs/Image)

    Input mask image.

Publishing Topic

  • ~output (sensor_msgs/Image)

    Inverted mask image.

Parameters

  • ~queue_size (Int, default: 1)

    How many messages you allow about the subscriber to keep in the queue.

Sample

roslaunch jsk_perception sample_invert_mask_image.launch

@Affonso-Gui
Copy link
Member

Nice! I will test as soon as I can.

@k-okada
Copy link
Member

k-okada commented Sep 18, 2022 via email

Copy link
Member

@Affonso-Gui Affonso-Gui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. Works perfectly!

The sample is a bit too complicated for my taste but works great as well.

@k-okada The opencv_apps adding_images didn't work for me. It seems like the offset is only added after the image has already been zeroed out.
What does serve as a work around is using the negative flag in ApplyMaskImage.

  <node name="invert_lmask"
        pkg="nodelet" type="nodelet"
        args="load jsk_perception/ApplyMaskImage $(arg MANAGER)">
    <remap from="~input" to="$(arg INPUT_IMAGE)" />
    <remap from="~input/mask" to="/robot/left/mask" />
    <remap from="~output/mask" to="/robot/left/mask_inverted" />
    <rosparam>
      negative: true
      clip: false
    </rosparam>
  </node>

However, I think having this as a dedicated node is better both for efficiency and understandability.

@k-okada k-okada self-assigned this Jan 25, 2023
@k-okada k-okada merged commit 437d5f1 into jsk-ros-pkg:master Nov 8, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants