Go to Post My wife just looked over my shoulder, shook her head, and said "Only engineers...." - Tom Line [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-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 07-12-2011, 17:45
moopydoopy moopydoopy is offline
Registered User
no team
 
Join Date: Dec 2011
Location: USA
Posts: 2
moopydoopy is an unknown quantity at this point
Re: Camera Tracking

To get images from the camera, I would suggest writing your own code. In my experience the C++ WPILib functionality of getting images from the camera (the AxisCamera class, if I recall), was sketchy, slow, and didn't always work last time I tried to use it.

To get images yourself, you can do exactly what your browser (firefox, IE, chrome, etc) does and use HTTP Requests. The format is pretty simple and you can even use wireshark to see what firefox sends and just send that exact request if you like. All you need to do is make a new thread, open a TCP socket to the camera, and in a loop just send a packet containing your HTTP request, then read the response which will be an image from the camera.

You then feed the image into the NI Vision functions of your desire as Greg mentioned. NI Vision Assistant is an excellent tool for testing out some functions. You can even generate C code with it that you can use. The code is makes is inefficient and clunky (because it has to be for the modularity required in its case..) but you can rip out all the excess and see exactly what function calls it is doing.

This method allows you complete control over timing, memory, etc.
  #2   Spotlight this post!  
Unread 07-12-2011, 20:20
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Camera Tracking

Quote:
Originally Posted by moopydoopy View Post
To get images from the camera, I would suggest writing your own code.
Keeping in mind the apparent skill set of the original poster, I don't think that's a very helpful suggestion. If there are indeed problems with the provided library functions, it would seem best to find appropriate fixes for those problems.

Given that many teams had great success using the camera, I'm reluctant to accept that the problems you encountered were inherent in the WPIlib functions.

Quote:
In my experience...
Would you care to give us some information about your experience, so we have a basis for evaluating your viewpoint? It's hard to take an anonymous first-time poster named "moopydoopy" seriously, no matter how reasonable the message appears.
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 23:29.

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