|
@@ -14,14 +14,13 @@
|
|
#include <core/vector/MatrixT.h>
|
|
#include <core/vector/MatrixT.h>
|
|
#include <core/vector/VectorT.h>
|
|
#include <core/vector/VectorT.h>
|
|
|
|
|
|
|
|
+#include "vislearning/cbaselib/Example.h"
|
|
|
|
|
|
// Interface for conversion between Matlab and C objects
|
|
// Interface for conversion between Matlab and C objects
|
|
#include "gp-hik-core/matlab/classHandleMtoC.h"
|
|
#include "gp-hik-core/matlab/classHandleMtoC.h"
|
|
#include "gp-hik-core/matlab/ConverterMatlabToNICE.h"
|
|
#include "gp-hik-core/matlab/ConverterMatlabToNICE.h"
|
|
#include "gp-hik-core/matlab/ConverterNICEToMatlab.h"
|
|
#include "gp-hik-core/matlab/ConverterNICEToMatlab.h"
|
|
|
|
|
|
-#include "HelperDataConversionMex.h"
|
|
|
|
-
|
|
|
|
using namespace std; //C basics
|
|
using namespace std; //C basics
|
|
using namespace NICE; // nice-core
|
|
using namespace NICE; // nice-core
|
|
|
|
|
|
@@ -65,9 +64,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
|
const mxArray *t_pArrTrainData = prhs[1];
|
|
const mxArray *t_pArrTrainData = prhs[1];
|
|
const mxArray *t_pArrTrainLabels = prhs[2];
|
|
const mxArray *t_pArrTrainLabels = prhs[2];
|
|
|
|
|
|
|
|
+ NICE::Vector t_vecLabelsTrain = MatlabConversion::convertDoubleVectorToNice( t_pArrTrainLabels );
|
|
|
|
+ NICE::Matrix t_matDataTrain = MatlabConversion::convertDoubleMatrixToNice( t_pArrTrainData );
|
|
|
|
+
|
|
OBJREC::Examples t_ExamplesTrain;
|
|
OBJREC::Examples t_ExamplesTrain;
|
|
|
|
|
|
- bool bConversionSuccess = MatlabConversion::convertDoubleRawPointersToExamples( t_pArrTrainData, t_pArrTrainLabels, t_ExamplesTrain );
|
|
|
|
|
|
+ bool bConversionSuccess = OBJREC::Examples::wrapExamplesAroundFeatureMatrix( t_matDataTrain, t_vecLabelsTrain, t_ExamplesTrain );
|
|
|
|
+ //wrapExamplesAroundFeatureMatrix
|
|
|
|
|
|
std::cerr << "Examples size: " << t_ExamplesTrain.size() << std::endl;
|
|
std::cerr << "Examples size: " << t_ExamplesTrain.size() << std::endl;
|
|
for(int i=0; i< t_ExamplesTrain.size(); i++)
|
|
for(int i=0; i< t_ExamplesTrain.size(); i++)
|
|
@@ -80,18 +83,7 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
|
|
}
|
|
}
|
|
|
|
|
|
// clean up
|
|
// clean up
|
|
- for(int i=0; i< t_ExamplesTrain.size(); i++)
|
|
|
|
- {
|
|
|
|
- OBJREC::Example &t_Example = t_ExamplesTrain[i].second;
|
|
|
|
-
|
|
|
|
- if (t_Example.vec != NULL )
|
|
|
|
- {
|
|
|
|
- delete t_Example.vec;
|
|
|
|
- t_Example.vec = NULL;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+ t_ExamplesTrain.clean();
|
|
|
|
|
|
// output
|
|
// output
|
|
plhs[0] = mxCreateLogicalScalar( bConversionSuccess );
|
|
plhs[0] = mxCreateLogicalScalar( bConversionSuccess );
|