VLTIF
CS426FinalProject
|
#include <SiftType.h>
Public Member Functions | |
SiftType () | |
SiftType (const bool &lc, SIFT::CommonParams const &cp, SIFT::DetectorParams const &detp, SIFT::DescriptorParams const &desp) | |
SiftType (const SiftType &orig) | |
virtual | ~SiftType () |
virtual string | isType () const |
virtual void | compute_frame (const Mat &img, vector< KeyPoint > &keypoints, vector< Lane >const &lanes) const |
virtual void | reset_detector () |
Private Attributes | |
SIFT | sift |
bool | crop_lanes |
SIFT::CommonParams | commonParams |
SIFT::DescriptorParams | descriptorParams |
SIFT::DetectorParams | detectorParams |
Definition at line 26 of file SiftType.h.
SiftType::SiftType | ( | ) |
Definition at line 10 of file SiftType.cpp.
References commonParams, descriptorParams, detectorParams, and sift.
{ commonParams = sift.getCommonParams(); detectorParams = sift.getDetectorParams(); descriptorParams = sift.getDescriptorParams(); }
SiftType::SiftType | ( | const bool & | lc, |
SIFT::CommonParams const & | cp, | ||
SIFT::DetectorParams const & | detp, | ||
SIFT::DescriptorParams const & | desp | ||
) |
Definition at line 18 of file SiftType.cpp.
: crop_lanes(lc), detectorParams(detp), descriptorParams(desp){ }
SiftType::SiftType | ( | const SiftType & | orig | ) |
Definition at line 25 of file SiftType.cpp.
{ }
SiftType::~SiftType | ( | ) | [virtual] |
Definition at line 28 of file SiftType.cpp.
{ }
void SiftType::compute_frame | ( | const Mat & | img, |
vector< KeyPoint > & | keypoints, | ||
vector< Lane >const & | lanes | ||
) | const [virtual] |
Run sift on the current frame and output the keypoints and their descriptors
[in] | img | Image to be evaluated |
[out] | keypoints | Keypoints to be shown |
Implements DetectorType.
Definition at line 35 of file SiftType.cpp.
References crop_lanes, cropSubImage(), expandRect(), insideLane(), pointsEqual(), and sift.
{ keypoints.clear(); vector<KeyPoint> points, tpoints; //crop lane image if( crop_lanes == true ){ Rect bbox; Mat subImg; //iterate over each crop, computing the sub-image, then sift for( size_t i=0; i<lanes.size(); i++){ tpoints.clear(); bbox = expandRect(lanes[i].bbox(), 50, Size(img.cols, img.rows)); subImg = cropSubImage(img, bbox); sift(subImg, Mat(), tpoints); //append points to list for(size_t k=0; k<tpoints.size(); k++){ Point2f tp = Point2f(tpoints[k].pt.x+bbox.x, tpoints[k].pt.y+bbox.y); tpoints[k].pt = tp; points.push_back(tpoints[k]); } } //remove unique points unique(points.begin(), points.end(), pointsEqual); } else{ sift(img, Mat(), points); } for( size_t i=0; i<points.size(); i++) if( insideLane(points[i].pt, lanes) == true ){ keypoints.push_back(points[i]); } }
string SiftType::isType | ( | ) | const [virtual] |
void SiftType::reset_detector | ( | ) | [virtual] |
Implements DetectorType.
Definition at line 80 of file SiftType.cpp.
References commonParams, descriptorParams, detectorParams, and sift.
{ sift = SIFT(commonParams, detectorParams, descriptorParams ); }
SIFT::CommonParams SiftType::commonParams [private] |
Definition at line 52 of file SiftType.h.
Referenced by reset_detector(), and SiftType().
bool SiftType::crop_lanes [private] |
Definition at line 51 of file SiftType.h.
Referenced by compute_frame().
SIFT::DescriptorParams SiftType::descriptorParams [private] |
Definition at line 53 of file SiftType.h.
Referenced by reset_detector(), and SiftType().
SIFT::DetectorParams SiftType::detectorParams [private] |
Definition at line 54 of file SiftType.h.
Referenced by reset_detector(), and SiftType().
SIFT SiftType::sift [private] |
Definition at line 49 of file SiftType.h.
Referenced by compute_frame(), reset_detector(), and SiftType().