OCCRA
Go to Post "He who seeks originality will often find novelty, but not great design." - IKE [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-10-2012, 11:35 AM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Axis Camera Real-Time Vision Processing

Hi everyone,

I've written a small program to help with vision processing for FRC. Right now it only does the thresholding, but you can use it quickly see the results of thresholding ops in real time. The idea is that if you need to recalibrate your vision processing at competition, then all you have to do is plug your laptop in and you can get new values and see the result of the thresholding ops as you change the ranges. I've tried to make the thresholding as similar as I can to the cRIO's.

URL:
https://github.com/rbmj/axisviewer

Program:
axisviewer

Dependencies:
libcurl (not sure about the version)
gtkmm 3 (sorry, i'm working on getting a gtkmm >= 2.4 version)
cmake (to build)

Because it requires gtkmm 3 there's no currently stable way to build this on windows. However, gtkmm 3.4 is about to be released, and I just got info from the mailing list that this version should work well on windows. As far as the libcurl dependency, that's just there so that I don't have to deal with the http socket stuff. I plan to remove this dependency in the future.

TODOs:

Make the image processing stuff less crufty
Add more vision operations
Get a working gtkmm2 build
and other misc. stuff.

I'll put a screenshot up tomorrow.

If you want to use this with your own, just go to Config->Set Camera IP and use that. It should also *theoretically* work with other IP MJPEG cameras too, you just need to get the correct delimiter. Maybe I can add something to guess the delimiter in the future...

Any suggestions or patches are welcome!
  #2   Spotlight this post!  
Unread 04-10-2012, 01:36 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Axis Camera Real-Time Vision Processing

OK, so here's a screenshot. Should be self-explanatory.
Attached Thumbnails
Click image for larger version

Name:	axisviewer.png
Views:	204
Size:	244.2 KB
ID:	12568  
  #3   Spotlight this post!  
Unread 04-10-2012, 03:06 PM
techhelpbb's Avatar
techhelpbb techhelpbb is offline
Registered User
FRC #0011 (MORT - Team 11)
Team Role: Mentor
 
Join Date: Nov 2010
Rookie Year: 1997
Location: New Jersey
Posts: 904
techhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond reputetechhelpbb has a reputation beyond repute
Re: Axis Camera Real-Time Vision Processing

Very nice.
  #4   Spotlight this post!  
Unread 04-10-2012, 06:57 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Axis Camera Real-Time Vision Processing

I just pushed a revision that adds gtk2 compatibility. I'll see if I can get MinGW to cooperate (I *hate* developing on windows... or any OS without a package manager!)

CMake should now automatically try and find GTK and configure the project to use gtkmm-2.4 or gtkmm-3.0 depending on you installed libraries.
  #5   Spotlight this post!  
Unread 04-10-2012, 10:26 PM
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Axis Camera Real-Time Vision Processing

If anybody is using arch linux, here's a PKGBUILD. I don't have a camera with me, but it successfully builds and installs the program.
(remove the .txt extension; some people still think the extension matters)
Attached Files
File Type: txt PKGBUILD.txt (954 Bytes, 5 views)
  #6   Spotlight this post!  
Unread 04-11-2012, 09:21 AM
kenavt's Avatar
kenavt kenavt is offline
ex-FRC... for now
AKA: Colin S
FRC #2337 (EngiNERDs)
Team Role: Alumni
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Premier Tooling Systems
Posts: 252
kenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond reputekenavt has a reputation beyond repute
Re: Axis Camera Real-Time Vision Processing

That's a pretty sweet, simple, lightweight program. Yet, when I want to verify thresholds for our camera at competitions, I just use NI's Vision Assistant with a snapshot photo from the Axis (using the color threshold VI) which works just as simply, although the whole program is a bit clunky.

Are you hoping that this is a program for those who want to use Linux? I suppose I fail to understand the differences between this program and what FIRST and NI have given us.
__________________
University of Michigan Computer Engineering '17

Team 2337 GitHub
2013 Michigan State Chairman's Award
2013 Michigan State Finalist
  #7   Spotlight this post!  
Unread 04-11-2012, 01:33 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Axis Camera Real-Time Vision Processing

After going through DLL Hell and back, I have a prealpha build for win32 here: http://mason.homeunix.org/axisviewer...8b59d0e6df.zip

There's probably a bunch of bugs, so if someone would like to test it, that would be awesome

I'll work on cleaning up the build system on windows later as right now I have to hard-code things to get everything to build properly.

@kenavt: There were a few motivations for me making this program.

1. I don't like having to go into the web interface for the camera, grab a snapshot, open it up, process it, repeat the process to see if it works, etc. So of course the logical thing to save 30 seconds of time (for a programmer) is to spend hours on a program that grabs the stream from the camera and processes it in real time

2. Since the source code is available (and will be made more pretty soon) for the image processing, I'm hoping that anyone who wants to look at the calculations for HSL and the thresholding (and maybe more algorithms in the future) can just open the file and learn from that. You can't do that with NIVision.out (unless you use objdump! - no random NI person who's reading this, I did not disassemble your proprietary code)

3. I like having applications that are crossplatform and lightweight. I personally use linux for all of my development, robotics included, and I prefer to have native builds of my toolchain and development tools.

So, in essence, convenience, open source, and portability provided the reason for writing the program.
  #8   Spotlight this post!  
Unread 04-11-2012, 07:16 PM
Greg McKaskle Greg McKaskle is offline
Registered User
no team (Team NI)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 3,952
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Axis Camera Real-Time Vision Processing

Did you just call me random???

But seriously, I am happy to see you creating your own implementation of the algorithms and making your own tools. Feel free to compare them to the NI results, and if you want to disassemble the NI stuff to see how it does its thing, I'll back you all the way.

I did my own HSL implementation last year and based it on the Foley and VanDam implementation. I know, I know, reinventing the wheel, but as long as you don't fool yourself, building wheels is not a bad hobby. I implemented my HSL algorithm in LV just to see what the performance and implementation would look like. Again, let me know if I can help.

Greg McKaskle
  #9   Spotlight this post!  
Unread 04-11-2012, 08:28 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Axis Camera Real-Time Vision Processing

Quote:
Originally Posted by Greg McKaskle View Post
Did you just call me random???
I know you read the forum a lot, but I don't know if you're the only one.

Quote:
But seriously, I am happy to see you creating your own implementation of the algorithms and making your own tools. Feel free to compare them to the NI results, and if you want to disassemble the NI stuff to see how it does its thing, I'll back you all the way.
Sounds awesome!

Quote:
I did my own HSL implementation last year and based it on the Foley and VanDam implementation. I know, I know, reinventing the wheel, but as long as you don't fool yourself, building wheels is not a bad hobby. I implemented my HSL algorithm in LV just to see what the performance and implementation would look like. Again, let me know if I can help.
I'm the king of wheel building; i even have my own kernel (it doesn't work though )!
  #10   Spotlight this post!  
Unread 04-11-2012, 08:42 PM
rbmj rbmj is offline
Registered User
FRC #0612 (Chantilly Robotics)
Team Role: Alumni
 
Join Date: Apr 2011
Rookie Year: 2011
Location: DC Area/Fairfax County
Posts: 192
rbmj is a jewel in the roughrbmj is a jewel in the roughrbmj is a jewel in the rough
Re: Axis Camera Real-Time Vision Processing

Ok, so an update:
The latest code sould work with both gtkmm 2 and 3. I was able to get a working build with version 2.22 on mingw32. I haven't tested it much since the revision i originally posted, though.

Im hoping to develop a bunch of tools - though you arent supposed to reuse robot code year to year, tools dont fall under that requirement. Im still a team member (till June at least) so i dont see any conflict with the spirit of the competition.

Shameless plug: working on build scripts for gcc 4 with rvalue references, lambdas, enhanced libraries, and more fun stuff (see WindRiver C++ forum- busy testing that out).
Closed Thread


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 03:45 AM.

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


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