Go to Post I'd be more worried about getting struck by lightning right after winning the lottery. :p - evulish [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 06-02-2010, 15:03
buddyb's Avatar
buddyb buddyb is offline
Registered User
FRC #1885 (ILITE)
Team Role: Programmer
 
Join Date: Dec 2009
Rookie Year: 2008
Location: Haymarket, VA
Posts: 65
buddyb has a spectacular aura aboutbuddyb has a spectacular aura aboutbuddyb has a spectacular aura about
Camera ROI Usage?

Hello everyone,

In an attempt to speed up our camera code, I've played around a bit with contours and ROIs. Yet, searching for the target takes longer with an ROI than it does searching the whole image. This seems wrong, so I would like to solicit help on ROIs.

At the moment, my code looks like this:
Code:
//Initialization
const Rect areaOfInterest = {0, 0, 100, 100}; //A 100x100 square, within which the target resides.
ROI aoi;
imaqAddRectContour(&aoi, areaOfInterest);
vector<Target> results = luminancePlane->DetectEllipses(&targetEllipseDescriptor, &targetEllipseCurveOptions, &targetEllipseShapeOptions, &aoi);
What I want aoi to do is restrict the search area to the 100x100 square, but when I use &aoi instead of NULL in the search arguments, the searches take 2MS longer each time, which doesn't seem right, because I'm cutting off about 3/8ths of the image with the ROI.

Am I restricting the area correctly, and detectEllipses just taking extra time to check aoi to ensure it's within the area I want to search, or am I forgetting something that I have to add to the ROI to make it work?

All help appreciated.
~Buddy
__________________
FRC - Team 1885 - Programmer.

Last edited by buddyb : 06-02-2010 at 16:08.
Reply With Quote
  #2   Spotlight this post!  
Unread 06-02-2010, 20:19
Greg McKaskle Greg McKaskle is online now
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,748
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: Camera ROI Usage?

I'm curious how many timing samples were used to determine the effect of the ROI. Unlike most sensors, jpeg cameras aren't very realtime friendly. First off, the jpeg returned from the camera is a different size and will take a somewhat different time to decode. Secondly, the algorithm for finding contours takes many shortcuts if it can, so the timing is very dependent on what is in the image. This means that a slim 2ms difference is probably well within the noise of the timings.

To answer your question about the ROI, I would expect it to speed up the processing by some amount, but will have no affect on the jpeg decoding which is also a pretty big cost.

There is a white paper on the NI site about the vision code, and the primary thing to speed up the processing is the threshold. The paper doesn't go into using the ROI primarily because it is difficult to use unless you have an idea of where the robot is on the field and how big the target should be.

Greg McKaskle
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Altium Usage? EricVanWyk Electrical 15 19-03-2009 20:07
Electromagent usage robogeek753 Rules/Strategy 7 05-01-2008 22:36
Image Processing on mouth ROI tommy_chai Programming 0 20-11-2007 08:32
Camera Usage Jaime65 Technical Discussion 5 02-02-2007 21:39
Laptop Usage Goya General Forum 3 07-01-2003 08:25


All times are GMT -5. The time now is 10:04.

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