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

Revision history [back]

click to hide/show revision 1
initial version

Ah... I was hoping to find something to create it automatically through code. I think there might be a way in by using cv.EncodeImage, but I haven't been able to get the code working the way I want yet. Found an example used here

As for my OpenCV circle problem, I was able to get cv.HoughCircles to work without crashing... basically by just drawing a circle in a corner of the ROS camera and making sure the camera feed was not moving to fast for opencv by using rospy.sleep(1.0), I posted the code here... might be useful for anyone using a camera feed in ROS and opencv.

    cv_image = self.convert_image(data)
    rospy.sleep(1.0)
    cv.Circle(cv_image, (100,100), 100, 255, 3, 8, 0)
    gray = cv.CreateImage(cv.GetSize(cv_image), 8, 1)
    #edges = cv.CreateImage(cv.GetSize(cv_image), 8, 1)
    cvSize = cv.GetSize(cv_image)
    cv.CvtColor(cv_image, gray, cv.CV_BGR2GRAY)
    cv.Canny(gray, gray, 50, 200, 3)
    cv.Smooth(gray, gray, cv.CV_GAUSSIAN, 7, 7)

    storage = cv.CreateMat(cv_image.rows, 1, cv.CV_32FC3)

    cv.HoughCircles(gray, storage, cv.CV_HOUGH_GRADIENT, 2, cvSize[0]/4, 100, 250)