|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools |
Rating:
|
Display Modes |
|
#1
|
|||
|
|||
|
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.
|
|
#2
|
||||
|
||||
|
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; That's the ticket. bob |
|
#3
|
||||
|
||||
|
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;
|
|
#4
|
||||
|
||||
|
Re: BoundingRect Height
Thanks Mike for the official word. :-)
bob |
|
#5
|
|||
|
|||
|
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; |
|
#6
|
||||
|
||||
|
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. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|