@@ -271,9 +271,9 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
271
271
// Size outputGeometry_;//= Size(1,1);
272
272
// int channelCount_;
273
273
// int inputChannel_ ;//=1;
274
- int _inputHeight;
275
- int _inputWidth ;
276
- int _inputChannel ;
274
+ // int _inputHeight;
275
+ // int _inputWidth ;
276
+ // int _inputChannel ;
277
277
public:
278
278
DeepCNNOpenCvDNNImpl (const DeepCNNOpenCvDNNImpl& dn):
279
279
minibatchSz_ (dn.minibatchSz_),outputSize_(dn.outputSize_){
@@ -300,8 +300,8 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
300
300
// Implemented to supress Visual Studio warning "assignment operator could not be generated"
301
301
}
302
302
303
- DeepCNNOpenCvDNNImpl (String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth = 100 ,int inputHeight = 32 ,int inputChannel = 1 )
304
- :minibatchSz_(maxMinibatchSz),_inputWidth(inputWidth),_inputHeight(inputHeight),_inputChannel(inputChannel)
303
+ DeepCNNOpenCvDNNImpl (String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth ,int inputHeight ,int inputChannel )
304
+ :minibatchSz_(maxMinibatchSz)
305
305
{
306
306
307
307
CV_Assert (this ->minibatchSz_ >0 );
@@ -326,8 +326,8 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
326
326
}
327
327
328
328
329
- this ->inputGeometry_ =Size (_inputWidth,_inputHeight );// Size(inputLayer->width(), inputLayer->height());
330
- this ->channelCount_ = _inputChannel ;// inputLayer->channels();
329
+ this ->inputGeometry_ =Size (inputWidth,inputHeight );// Size(inputLayer->width(), inputLayer->height());
330
+ this ->channelCount_ = inputChannel ;// inputLayer->channels();
331
331
332
332
// inputLayer->Reshape(this->minibatchSz_,this->channelCount_,this->inputGeometry_.height, this->inputGeometry_.width);
333
333
Ptr< Layer > outLayer= net_->getLayer (net_->getLayerId (net_->getLayerNames ()[net_->getLayerNames ().size ()-2 ]));
@@ -408,7 +408,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
408
408
return Ptr<DeepCNN>(new DeepCNNCaffeImpl (archFilename, weightsFilename,preprocessor, minibatchSz));
409
409
410
410
#elif defined(HAVE_DNN)
411
- return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, minibatchSz));
411
+ return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, minibatchSz, 100 , 32 , 1 ));
412
412
#else
413
413
CV_Error (Error::StsError," DeepCNN::create backend not implemented" );
414
414
return Ptr<DeepCNN>();
@@ -419,7 +419,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
419
419
return Ptr<DeepCNN>(new DeepCNNCaffeImpl (archFilename, weightsFilename,preprocessor, minibatchSz));
420
420
break ;
421
421
case OCR_HOLISTIC_BACKEND_DNN:
422
- return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, minibatchSz));
422
+ return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, minibatchSz, 100 , 32 , 1 ));
423
423
break ;
424
424
case OCR_HOLISTIC_BACKEND_NONE:
425
425
default :
@@ -440,7 +440,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
440
440
return Ptr<DeepCNN>(new DeepCNNCaffeImpl (archFilename, weightsFilename,preprocessor, 100 ));
441
441
442
442
#elif defined(HAVE_DNN)
443
- return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, 100 ));
443
+ return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, 100 , 100 , 32 , 1 ));
444
444
#else
445
445
CV_Error (Error::StsError," DeepCNN::create backend not implemented" );
446
446
return Ptr<DeepCNN>();
@@ -451,7 +451,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
451
451
return Ptr<DeepCNN>(new DeepCNNCaffeImpl (archFilename, weightsFilename,preprocessor, 100 ));
452
452
break ;
453
453
case OCR_HOLISTIC_BACKEND_DNN:
454
- return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, 100 ));
454
+ return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl (archFilename, weightsFilename,preprocessor, 100 , 100 , 32 , 1 ));
455
455
break ;
456
456
case OCR_HOLISTIC_BACKEND_NONE:
457
457
default :
0 commit comments