Go to Post Sleep well Chief Delphi, because for the next 6 weeks, sleep is only for the weak. :D - ttldomination [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 Rating: Thread Rating: 2 votes, 5.00 average. Display Modes
  #1   Spotlight this post!  
Unread 11-02-2012, 20:14
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
BoundingRect Height

Hello, does anyone know how to get the BoundingRect Height data for a particle in the vision analysis. My team used a vector<particleanalysisreport> but all we could find was boundingRect which did not tell us anything.
Reply With Quote
  #2   Spotlight this post!  
Unread 11-02-2012, 23:33
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: BoundingRect Height

Sure thing. When you get the vector back, I'll assume (for the moment) that you can iterate through the vector and get the ParticleAnalysisReport objects back...

Code:
ParticleAnalysisReport& par = (*vPAR)[i];

int h = par.boundingRect.Height;
I am doing this a bit from memory earlier today - but basically there is a "Rect" structure which is what boundingRect is within the Report class. It has Top/Left/Width/Height.

That's the ticket.

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #3   Spotlight this post!  
Unread 13-02-2012, 06:58
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: BoundingRect Height

The definition of Rect is in WPILib\nivision.h
Code:
typedef struct Rect_struct {
    int top;    //Location of the top edge of the rectangle.
    int left;   //Location of the left edge of the rectangle.
    int height; //Height of the rectangle.
    int width;  //Width of the rectangle.
} Rect;
__________________
Reply With Quote
  #4   Spotlight this post!  
Unread 13-02-2012, 11:41
bob.wolff68's Avatar
bob.wolff68 bob.wolff68 is offline
Da' Mentor Man
FRC #1967
Team Role: Mentor
 
Join Date: Jan 2012
Rookie Year: 2007
Location: United States
Posts: 157
bob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nicebob.wolff68 is just really nice
Re: BoundingRect Height

Thanks Mike for the official word. :-)

bob
__________________
~~~~~~~~~~~~~~~~~~~
Bob Wolff - Software from the old-school
Mentor / C / C++ guy
Team 1967 - The Janksters - San Jose, CA
Reply With Quote
  #5   Spotlight this post!  
Unread 15-02-2012, 08:31
Stonemotmot Stonemotmot is offline
Registered User
FRC #0486
 
Join Date: Sep 2011
Location: United States, Pa
Posts: 53
Stonemotmot is an unknown quantity at this point
Re: BoundingRect Height

Thanks for the help. If I know a particle location in the vector like
int particle
vector->at(particle); //particle is the particle number i want
is the correct sysntax to get the boundingrect height

ParticleAnalysisReport& par = (*vector)[particle];
int h= par.boundingRect.height;
Reply With Quote
  #6   Spotlight this post!  
Unread 15-02-2012, 14:16
mikets's Avatar
mikets mikets is offline
Software Engineer
FRC #0492 (Titan Robotics)
Team Role: Mentor
 
Join Date: Jan 2010
Rookie Year: 2008
Location: Bellevue, WA
Posts: 667
mikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of lightmikets is a glorious beacon of light
Re: BoundingRect Height

Code:
ParticleAnalysisReport *p;
int rectWidth;
int rectHeight;
for (unsigned i = 0; i < particles->size(); i++)
{
    p = &(particles->at(i));
    rectWidth = p->boundingRect.width;
    rectHeight = p->boundingRect.height;
}
__________________

Last edited by mikets : 15-02-2012 at 14:21.
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 13:06.

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