ros-perception / opencv_apps

http://wiki.ros.org/opencv_apps
64 stars 70 forks source link

Add color_filter #48

Closed iory closed 7 years ago

iory commented 7 years ago

add rgb_color_filter rgb_color_filter

and hsi_color_filter

hsi_color_filter

k-okada commented 7 years ago

2016-12-09 19:09 GMT+09:00 Masaki Murooka notifications@github.com:

default should be "/image_publisher/output" to subscribe image_publisher topic in default.

What does this mean? also look at https://github.com/ros-perception/opencv_apps/blob/indigo/src/node/standalone_nodelet_exec.cpp.in#L41

-- ◉ Kei Okada

mmurooka commented 7 years ago

What does this mean?

In this launch file, image_publisher node is run: https://github.com/ros-perception/opencv_apps/pull/48/files#diff-e102ca2ed99024189fade3737992c127R16 So, I thought that this launch file intends to connect from image_publisher to color_filter.

I talked with @iory offline, and he said that this is not sample file so image_publisher should be removed from this launch file.

mmurooka commented 7 years ago

+1 for merge this. Use case: https://github.com/mmurooka/euslib/blob/murooka-branch/demo/murooka/wholebody_manipulation_planner/object_motion_learning/launch/generate_mask_image_for_real_cube.launch#L13-L24

k-okada commented 7 years ago

could you update images at -> https://github.com/ros-perception/opencv_apps/pull/48#issue-184543025 so that everyone can understand the benefit of this node?

iory commented 7 years ago

image

k-okada commented 7 years ago

need better one, which we can use in wiki

-- ◉ Kei Okada

2016-12-14 12:37 GMT+09:00 iory notifications@github.com:

[image: image] https://cloud.githubusercontent.com/assets/4690682/21168775/212a77ca-c1fa-11e6-9b5c-139cff542666.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-266934059, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3IO8ZHBRSGecI9iX4suUbkxti57Qks5rH2SXgaJpZM4KdeWt .

mmurooka commented 7 years ago

Images of my use case. before after

k-okada commented 7 years ago

sorry i think original input is ok, because every one can get that rosbag image, I just want to understand that what who created sample image want to extract. Human face? cloth? floor????

-- ◉ Kei Okada

2016-12-14 14:23 GMT+09:00 Masaki Murooka notifications@github.com:

Images of my use case. [image: before] https://cloud.githubusercontent.com/assets/6636600/21170488/cece7918-c208-11e6-8d6a-7909c607dd90.png [image: after] https://cloud.githubusercontent.com/assets/6636600/21170489/cfb41716-c208-11e6-97d7-8b63c796481d.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-266945744, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3OZn4EqP9l1TZJ9xoGJMHT6yX9Hlks5rH31cgaJpZM4KdeWt .

iory commented 7 years ago

human's blue cloth. Sample program's parameter updated. hsi_color_filter hsi_color_filter rgb_color_filter rgb_color_filter

mmurooka commented 7 years ago

@iory , can I see original image? It is difficult to imagine where human's blue cloth is? Are target regions of filtering same for the examples of hsi_color_filter and rgb_color_filter? They are quite different.

iory commented 7 years ago

Original image is here. src

It is difficult for me to separate colors clearly in RGB color spaces. I think this is advantage of HSI color filter over RGB color filter.

mmurooka commented 7 years ago

I see. @k-okada , are images in https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-267241077 good enough for wiki document? Or do you have any good idea to make good sample images? (now cloth is target for filtering. should we filter other region?)

k-okada commented 7 years ago

Can we show only human skins?

2016年12月20日(火) 10:38 Masaki Murooka notifications@github.com:

I see. @k-okada https://github.com/k-okada , are images in #48 (comment) https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-267241077 good enough for wiki document? Or do you have any good idea to make good sample images? (now cloth is target for filtering. should we filter other region?)

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-268129712, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3CkdrrVSz-Kdgq2fCj5D4wPo-4NSks5rJzGjgaJpZM4KdeWt .

iory commented 7 years ago

OK.

hsi_color_filter

k-okada commented 7 years ago

input_color hsi_color_filter

input_color hsi_color_filter

input_color hsi_color_filter

i agree this is very difficult to find good example (this means that we do not have good application for this node?), but we have to try as hard as possible.

k-okada commented 7 years ago

range should be 0-256, since inRange() function lower <= src < uppder, H shoulde be 0-360 and divide by 2?...

k-okada commented 7 years ago

and you also need something like

    if ( lower_color_range_[0] < upper_color_range_[0] ) {
      cv::inRange(hsv_image, lower_color_range_, upper_color_range_,
                  output_image);
    }else {
      cv::Scalar lower_color_range_0 = cv::Scalar(       0, s_min_, i_min_, 0);
      cv::Scalar upper_color_range_0 = cv::Scalar(h_max_/2, s_max_, i_max_, 0);
      cv::Scalar lower_color_range_360 = cv::Scalar(h_min_/2, s_min_, i_min_, 0);
      cv::Scalar upper_color_range_360 = cv::Scalar(   360/2, s_max_, i_max_, 0);
      cv::Mat output_image_0, output_image_360;
      cv::inRange(hsv_image, lower_color_range_0, upper_color_range_0, output_image_0);
      cv::inRange(hsv_image, lower_color_range_360, upper_color_range_360, output_image_360);
      output_image = output_image_0 | output_image_360;
    }
iory commented 7 years ago

Thanks to the k-okada's PR (https://github.com/iory/opencv_apps/pull/1), hsv and hls color filter were added into color_filter.

hsv_color filter hsv_color_filter

hls_color filter hls_color_filter

mmurooka commented 7 years ago

Cloud you merge this?

k-okada commented 7 years ago

@iory @mmurooka please update doc at http://wiki.ros.org/opencv_apps note that do not forget to add New feature as of version 1.11.15

iory commented 7 years ago

OK

iory commented 7 years ago

Updated docs

mmurooka commented 7 years ago

Thank you!

k-okada commented 7 years ago

thank you

-- ◉ Kei Okada

2017-03-07 18:32 GMT+09:00 iory notifications@github.com:

Updated docs

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/ros-perception/opencv_apps/pull/48#issuecomment-284668865, or mute the thread https://github.com/notifications/unsubscribe-auth/AAeG3Fw1KxCFuhnqcU2SScGE6CwXC9cUks5rjSQwgaJpZM4KdeWt .