Go to Post Brace yourselves, reality check incoming. - EmileH [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 17-01-2013, 20:14
Rainfur Rainfur is offline
Programmer
AKA: Erik Melton
FRC #3189 (Circuit Breakers)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2010
Location: California
Posts: 4
Rainfur is an unknown quantity at this point
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?
Reply With Quote
  #2   Spotlight this post!  
Unread 18-01-2013, 00:39
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Using JavaCV to detect Rectangles

OpenCV refers to CvArr as "metatype", "used only as a function parameter". 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 code stuff.
Reply With Quote
  #3   Spotlight this post!  
Unread 18-01-2013, 00:49
Rainfur Rainfur is offline
Programmer
AKA: Erik Melton
FRC #3189 (Circuit Breakers)
Team Role: Programmer
 
Join Date: Jan 2013
Rookie Year: 2010
Location: California
Posts: 4
Rainfur is an unknown quantity at this point
Re: Using JavaCV to detect Rectangles

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.
Reply With Quote
  #4   Spotlight this post!  
Unread 18-01-2013, 19:00
Ginto8's Avatar
Ginto8 Ginto8 is offline
Programming Lead
AKA: Joe Doyle
FRC #2729 (Storm)
Team Role: Programmer
 
Join Date: Oct 2010
Rookie Year: 2010
Location: Marlton, NJ
Posts: 174
Ginto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of lightGinto8 is a glorious beacon of light
Re: Using JavaCV to detect Rectangles

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 code stuff.
Reply With Quote
  #5   Spotlight this post!  
Unread 22-01-2013, 15:58
divixsoft's Avatar
divixsoft divixsoft is offline
Registered User
FRC #0835
 
Join Date: Feb 2011
Location: MI
Posts: 29
divixsoft is an unknown quantity at this point
Re: Using JavaCV to detect Rectangles

I have that problem as well, when I try this code, it compiles but when I use it I get errors.
Code:
    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);
    }
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:48.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi