penghou620 / ros_object_detection

0 stars 2 forks source link

Can this code be used to detect a specific object of interest in the scene ? #1

Open ktiwari9 opened 10 years ago

ktiwari9 commented 10 years ago

I am trying to write a object detection code for a Baxter on ROS Hydro that can detect a printed circuit board in a computer chassis. Please advise, how can i replicate your code to detect a PCB ?

penghou620 commented 10 years ago

You can change the detecting colors to make it detecting PCB. My code detect a red color ball. These are the parameter you need to change: int LowerH = 160; int LowerS = 52; int LowerV = 139; int UpperH = 180; int UpperS = 196; int UpperV = 170;

ktiwari9 commented 10 years ago

So you are simply detecting the HSV values ? If I set the upper and lower values of HSV to match the green color it can simply detect a PCB ?

ktiwari9 commented 10 years ago

Also is this code compatible with ROS Hydro ?

penghou620 commented 10 years ago

You can give it a shot. I'm not 100% sure. You can use trackerbar to adjust the HSV and inspect the result.

And I'm not sure if it's compatible with Hydro. I have never used it on hydro before.

On Sun, Jun 1, 2014 at 6:27 AM, Kshitij Tiwari notifications@github.com wrote:

Also is this code compatible with ROS Hydro ?

— Reply to this email directly or view it on GitHub https://github.com/dustsnow/ros_object_detection/issues/1#issuecomment-44775330 .

ktiwari9 commented 10 years ago

Which version of ROS did you use ?

penghou620 commented 10 years ago

Groovy.

On Sun, Jun 1, 2014 at 8:12 AM, Kshitij Tiwari notifications@github.com wrote:

Which version of ROS did you use ?

— Reply to this email directly or view it on GitHub https://github.com/dustsnow/ros_object_detection/issues/1#issuecomment-44777428 .

ktiwari9 commented 10 years ago

Okay. One quick question, you detect red circles in this code. If I were to detect a PCB which is a green rectangle, I can change the HSV values to match a green color but how do i change from a circle detection to a rectangle detection ?

penghou620 commented 10 years ago

Unfortunate, there's no rectangle detection. The thing you can do is filter out color in the image, then detect lines in the image. Using these information, you can find a colored rectangle

On Sun, Jun 1, 2014 at 8:15 AM, Kshitij Tiwari notifications@github.com wrote:

Okay. One quick question, you detect red circles in this code. If I were to detect a PCB which is a green rectangle, I can change the HSV values to match a green color but how do i change from a circle detection to a rectangle detection ?

— Reply to this email directly or view it on GitHub https://github.com/dustsnow/ros_object_detection/issues/1#issuecomment-44777478 .