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

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