Using JavaCV to detect Rectangles

I’m currently using JavaCV to detect rectangles. However, I cannot get CvArr to work, and because of this, I cannot get cvConvexHull to work.

Is there any source for something like this? Could I get some assistance?

OpenCV refers to CvArr as “metatype”, “used only as a function parameter”](http://opencv.willowgarage.com/documentation/basic_structures.html#cvarr). JavaCV implements this by making CvArr the superclass of the types it stands in for, like IplImage and CvSeq. It’s not really supposed to be used on its own. What issues are you having exactly?

http://opencv.willowgarage.com/documentation/index.html is a must-have site for OpenCV programming if you’re looking for reference material.

I’m specifically having problems with detecting corners and drawing lines between them.

I have it threshholded right now, however any and all methods I try to use to detect the corners have yet to work.

What methods are you using? What are they doing instead of working? I don’t think I can help you properly without more information.

I have that problem as well, when I try this code, it compiles but when I use it I get errors.

    public static WPIContour] findConvexContours(WPIBinaryImage image)
    {
        image.validateDisposed();

        IplImage tempImage = IplImage.create(image.image.cvSize(), image.image.depth(), 1);

        opencv_core.cvCopy(image.image, tempImage);

        CvSeq contours = new CvSeq();
        opencv_imgproc.cvFindContours(tempImage, storage, contours, 256, opencv_imgproc.CV_RETR_LIST, opencv_imgproc.CV_CHAIN_APPROX_TC89_KCOS);
        ArrayList<WPIContour> results = new ArrayList();
        while (!WPIDisposable.isNull(contours)) {
            CvSeq convexContour = opencv_imgproc.cvConvexHull2(contours, storage, opencv_imgproc.CV_CLOCKWISE, 1);
            WPIContour contour = new WPIContour(opencv_core.cvCloneSeq(convexContour, storage));
            results.add(contour);
            contours = contours.h_next();
            
            
        }

        tempImage.release();
        WPIContour] array = new WPIContour[results.size()];
        return results.toArray(array);
    }