Go to Post IYou might get it all changed over and discover your robot has trouble moving from a dead stop, can no longer turn without playing morse code on the breakers... - KenWittlief [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Spotlight this post!  
Unread 31-03-2012, 20:01
jviolette123 jviolette123 is offline
Registered User
FRC #1318
 
Join Date: Feb 2012
Location: Issaquah, WA
Posts: 10
jviolette123 is on a distinguished road
Re: Rectangle corner extraction in JavaCV with source

This is great.

Here is our latest version. It has gone through a number of iterations.
We now have a full system that can run on an on-board co-processor. The algorithm needs some fine tuning, so your post came at a great time.

Launch using VisionSystem.main().

We have hard-coded values such as team name, resolution, camera ip address, and frames per second.

The system includes
- a batch file that can launch from a startup folder. We have a windows service wrapper that works on a laptop, but does not work on the embedded coprocessor, due to dll loading issues.
- an auto-reconnect feature, so that the program can re-establish connection to the camera automatically.
- a frame grabber from the on-board camera (mjpeg).
- configurable resolution and frames per second settings. These are hard coded in the constructor calls, but could be externalized.
- integration with the network table, so results can be sent back to the cRio. Note: the NetworkTable has a subtable feature, but we found that the internal table id assignment approach lead to runtime errors. We only use the top level table, named 'SmartDashboard'.
- Auto-sharpen feature, which changes the HSV settings if the system does not detect a rectangle. We found the reflection SV values changed significantly as the robot moved from 8 feet to 21 feet.
- Auto-viewport feature to handle multiple rectangles in the view. We pull in the sharpened bits, find the x-center of mass, and find the vertical bars within +/- 167 pixels. The vertical bars are reliable indicators for the backboard. Then we find the tops of the middle 4 vertical bars, which give us a bounding box for the actual top rectangle and run our rectangle detection code on that.
- An http server in the application, so we can use a browser to view internal status values.

We ended up moving away from the internal cv* functions because the hoop got in the way of the bottom bar. This kept the system from detecting the full rectangle. It may be that the approach we followed is too slow, so we may end up using your approach.
Attached Files
File Type: zip VisionSystem.zip (4.90 MB, 177 views)
Reply With Quote
 


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 11:40.

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