ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

perr0's profile - activity

2013-03-20 08:40:03 -0500 received badge  Taxonomist
2012-09-27 01:19:38 -0500 received badge  Famous Question (source)
2012-09-06 03:40:28 -0500 received badge  Notable Question (source)
2012-09-03 09:08:04 -0500 received badge  Famous Question (source)
2012-08-28 07:33:50 -0500 received badge  Famous Question (source)
2012-08-28 02:53:30 -0500 commented question cvblob and cvBlobsLib

That's why I was trying to use cvBlob, as it has "Basic blob tracking" out of the box.

2012-08-28 02:52:31 -0500 commented question cvblob and cvBlobsLib

@pgorczak, does this SimpleBlobDetector have tracking capabilities? As far as I could understand reading the link you provided, it does not, but maybe you have seen something in this regard.

2012-08-28 02:49:48 -0500 commented question cvblob and cvBlobsLib

Well, I was able to find the blobs using this code: http://nghiaho.com/?p=1102. But then I need to track them and I'm having a hard time trying to make ir. I can find their centroids, but I loose track of which is which during program execution.

2012-08-28 02:48:12 -0500 received badge  Popular Question (source)
2012-08-27 16:31:27 -0500 received badge  Notable Question (source)
2012-08-27 12:19:24 -0500 received badge  Popular Question (source)
2012-08-27 09:21:40 -0500 asked a question Visual servoing with ROS

I'm trying to develop a visual servoing application using ROS, AR.Drone and ardrone_autonomy package. For that I'm planning on tracking a four red dots target to use as reference for the error function but I'm having some trouble tracking those targets. Here's what I tried so far:

1 - Use cv::HoughCircles and track dots' centroid. 2 - Using some blob detection.

I can segment the dots using both methods but I can't track the dots correctly. Let me explain: As the AR.Drone moves, the image changes (obviously) and the reference dots change position on the image. Then I loose track of which dot is which. This way the error functions eventually won't work throughout servoing.

I want to focus on control problems and not on programming and computer vision right now. So I'd like to know if you have any suggestions for a different approach or even some advice I may be missing on the approach I'm using. Is there any out of the shelf solution for this so I can focus on control at once?

Thank you.

2012-08-24 15:58:38 -0500 asked a question cvblob and cvBlobsLib

Is it possible to use cvblob or cvBlobsLib with ROS?

If yes, how can I do it?

2012-08-23 13:38:00 -0500 received badge  Notable Question (source)
2012-08-23 06:46:52 -0500 received badge  Scholar (source)
2012-08-23 06:46:44 -0500 received badge  Supporter (source)
2012-08-23 03:49:37 -0500 commented question Using cvGetSize and cvSplit

SivamPillai, thanks again for the help. As you can see, I'm not used to C++ programming and it is far more difficult than Matlab. :/ Could you please take a look at the "Update on error" I added to the question?

2012-08-23 03:07:28 -0500 received badge  Popular Question (source)
2012-08-23 01:56:47 -0500 commented question Using cvGetSize and cvSplit

The error I get with your suggestions is: ‘cv_bridge::CvImagePtr’ has no member named ‘create’, ‘size’ is not a member of ‘cv’ and suggested alternative: /usr/include/boost/mpl/size_fwd.hpp:20:38: note: ‘boost::mpl::size’

2012-08-23 01:41:14 -0500 commented question Using cvGetSize and cvSplit

I will add more of the code and maybe it makes it easier to help me.

2012-08-23 01:39:24 -0500 commented question Using cvGetSize and cvSplit

SivamPillai, thank you very much for your help. Unfortunately, it did not work for me though. It seems it can't find cv:create and cv:size member functions. Yes, I believe my OpenCV is the new one which creates cv:Mat types form cv_bridge (I had this include, but it was not listed previously).

2012-08-22 23:26:37 -0500 commented question Using cvGetSize and cvSplit

What do you mean by older version of openCV? I installed everything, both ROS and openCV, about four days ago. My includes are: #include <opencv2/opencv.hpp>,

include <opencv2/imgproc/imgproc.hpp> and #include <opencv2/highgui/highgui.hpp>. openCV version is stock version that came with ROS.

2012-08-22 14:02:17 -0500 received badge  Editor (source)
2012-08-22 14:00:35 -0500 asked a question Using cvGetSize and cvSplit

I'm trying to find centroids of four green circles in image_transport video. I'm planning to convert to OpenCV image with cv_bridge. Then, with OpenCV, extract green channel (with cv::Split) and apply a threshold.

For this I need cvCreateImage, cvGetSize and cvSplit, like this:

cv_ptr = cv_bridge::toCvCopy(original_image, enc::BGR8); this works

cv_ptr_red = cvCreateImage( cvGetSize(cv_ptr), 8, 1); this does not work

cv_ptr_green = cvCreateImage( cvGetSize(cv_ptr), 8, 1); this does not work

cv_ptr_blue = cvCreateImage( cvGetSize(cv_ptr), 8, 1); this does not work

These lines that doesn't work give me the following error:

cannot convert ‘cv_bridge::CvImage’ to ‘const CvArr* {aka const void*}’ for argument ‘1’ to ‘CvSize cvGetSize(const CvArr*)’

What am I missing?

Update on error

I'm sorry for so many basic questions, but this C++ is way more complicated then Matlab.

It does compile using the cv_ptr_green->image but the it gives me an error when running it. I reduced the code to try to find out where it was happening and now my code only has:

cv_bridge::CvImagePtr cv_ptr_green;
cv_ptr = cv_bridge::toCvCopy(original_image, enc::BGR8);
cv_ptr_green->image.create(cv_ptr->image.size(), CV_8UC1);

And the error I get when running (compiling is OK):

ardrone_visualservo: /usr/include/boost/smart_ptr/shared_ptr.hpp:418: T* boost::shared_ptr<t>::operator->() const [with T = cv_bridge::CvImage]: Assertion `px != 0' failed.

Aborted (core dumped)

If I understood what it tried to say, it's complaining about the -> operator usage with cv_bridge::CvImage (which is the type of my cv_ptr_green object).

Any ideas how to fix this?

Updating using alternative function cv::mixChannels

I found that maybe I can use cv::mixChannels() to extract only the green channel (as I actually need) with

    // cv_ptr[1] -> cv_ptr_green[1]
    int from_to[] = {1,1};
    cv::mixChannels( cv_ptr, 1, cv_ptr_green, 1, from_to, 1);

but it also gives me an error

path/to/cpp/file.cpp: In function ‘void imageCallback(const ImageConstPtr&)’:

path/to/cpp/file.cpp:62:58: error: no matching function for call to ‘mixChannels(cv_bridge::CvImagePtr&, int, cv_bridge::CvImagePtr&, int, int [2], int)’

path/to/cpp/file.cpp:62:58: note: candidates are: /opt/ros/fuerte/include/opencv2/core/core.hpp:2137:17: note: void cv::mixChannels(const cv::Mat, size_t, cv::Mat, size_t, const int*, size_t)

/opt/ros/fuerte/include/opencv2/core/core.hpp:2137:17: note: no known conversion for argument 1 from ‘cv_bridge::CvImagePtr {aka boost::shared_ptr<cv_bridge::cvimage>}’ to ‘const cv::Mat*’

/opt/ros/fuerte/include/opencv2/core/core.hpp:2139:17: note: void cv::mixChannels(const std::vector<cv::mat>&, std::vector<cv::mat>&, const int*, size_t)

/opt/ros/fuerte/include/opencv2/core/core.hpp:2139:17: note: candidate expects 4 arguments, 6 provided

/opt/ros/fuerte/include/opencv2/core/core.hpp:2141:19: note: void cv::mixChannels(cv::InputArrayOfArrays, cv::InputArrayOfArrays, const std::vector<int>&)


Complete code

    #include <ros/ros.h>
    //Use image_transport for publishing and subscribing to images in ROS
    #include <image_transport/image_transport.h>
    //Use cv_bridge to convert between ROS and OpenCV Image formats
    #include <cv_bridge ...
(more)