source: GTP/trunk/Lib/Vis/Preprocessing/src/BoundingBoxConverter.h @ 2655

Revision 2655, 1.1 KB checked in by mattausch, 16 years ago (diff)
RevLine 
[939]1#ifndef _BoundingBoxConverter_H__
2#define _BoundingBoxConverter_H__
[2643]3
4
[2655]5//#include <vector>
[939]6#include "AxisAlignedBox3.h"
7
8namespace GtpVisibilityPreprocessor {
9
[1006]10/** helper struct used to identify objects with similar bounding boxes.
[939]11*/
12struct IndexedBoundingBox: public std::pair<int, AxisAlignedBox3>
13{
14        typedef std::pair<int, AxisAlignedBox3> IndexedBoundingBoxParent;
15
16        IndexedBoundingBox(int idx, const AxisAlignedBox3 &box): IndexedBoundingBoxParent(idx, box)
[1545]17        {}
[939]18};
19
[2111]20/** This class assigns unique indices to objects by
21    comparing bounding boxes.
[939]22*/
23class BoundingBoxConverter
24{
25public:
[2066]26        /** Takes a vector of indexed bounding boxes and uses it to
27                identify objects with a similar bounding box
28                and assigns them the proper index (id).
[939]29                The objects are returned in the object container.
30               
31                @returns true if conversion was successful
32        */
33        virtual bool IdentifyObjects(const IndexedBoundingBoxContainer &iboxes,
34                                                                 ObjectContainer &objects) const
35        {
[2066]36                // default: do nothing as we assume that a unique id is
37                // already assigned to the objects.
[939]38                return true;
39        }
40};
41
42}
43
44#endif // _BoundingBoxConverter_H__
Note: See TracBrowser for help on using the repository browser.