mirror of
https://github.com/introlab/rtabmap.git
synced 2026-09-02 01:20:25 +08:00
Changed SMState interface (how the ownership of the image is transferred)
git-svn-id: http://rtabmap.googlecode.com/svn/branches/0.3/rtabmap@70 f169173b-cf89-36c8-b27e-44dbe73f0c83
This commit is contained in:
@@ -36,13 +36,10 @@
|
||||
namespace rtabmap
|
||||
{
|
||||
|
||||
SMState * CamPostTreatment::process(IplImage * image)
|
||||
SMState * CamPostTreatment::process(const IplImage * image) const
|
||||
{
|
||||
if(image)
|
||||
{
|
||||
return new SMState(image);
|
||||
}
|
||||
return 0;
|
||||
//no threatment...
|
||||
return new SMState();
|
||||
}
|
||||
|
||||
CamKeypointTreatment::~CamKeypointTreatment()
|
||||
@@ -56,13 +53,14 @@ CamKeypointTreatment::~CamKeypointTreatment()
|
||||
delete _keypointDescriptor;
|
||||
}
|
||||
}
|
||||
SMState * CamKeypointTreatment::process(IplImage * image)
|
||||
SMState * CamKeypointTreatment::process(const IplImage * image) const
|
||||
{
|
||||
if(image)
|
||||
{
|
||||
std::list<cv::KeyPoint> keypoints = _keypointDetector->generateKeypoints(image);
|
||||
std::list<std::vector<float> > descriptors = _keypointDescriptor->generateDescriptors(image, keypoints);
|
||||
SMState * smState = new SMState(descriptors, std::list<std::vector<float> >(), image, keypoints);
|
||||
SMState * smState = new SMState(descriptors, std::list<std::vector<float> >());
|
||||
smState->setKeypoints(keypoints);
|
||||
return smState;
|
||||
}
|
||||
return 0;
|
||||
@@ -292,6 +290,7 @@ void Camera::process()
|
||||
SMState * smState = _postThreatement->process(image);
|
||||
if(smState)
|
||||
{
|
||||
smState->setImage(image);
|
||||
this->post(new SMStateEvent(smState));
|
||||
}
|
||||
double elapsed = timer.ticks();
|
||||
|
||||
@@ -1243,6 +1243,7 @@ void Rtabmap::process()
|
||||
delete smState;
|
||||
}
|
||||
|
||||
// ownership is transferred
|
||||
void Rtabmap::addSMState(SMState * data)
|
||||
{
|
||||
ULOGGER_DEBUG("");
|
||||
@@ -1361,6 +1362,7 @@ void Rtabmap::setWorkingDirectory(std::string path)
|
||||
}
|
||||
}
|
||||
|
||||
// ownership is transferred
|
||||
void Rtabmap::process(SMState * data)
|
||||
{
|
||||
if(!this->isRunning())
|
||||
|
||||
Reference in New Issue
Block a user