Skip to content

Commit 878258b

Browse files
committed
modified initializers
1 parent 887e6e5 commit 878258b

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

modules/text/src/ocr_holistic.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -271,9 +271,9 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
271271
//Size outputGeometry_;//= Size(1,1);
272272
//int channelCount_;
273273
// int inputChannel_ ;//=1;
274-
int _inputHeight;
275-
int _inputWidth ;
276-
int _inputChannel ;
274+
// int _inputHeight;
275+
//int _inputWidth ;
276+
//int _inputChannel ;
277277
public:
278278
DeepCNNOpenCvDNNImpl(const DeepCNNOpenCvDNNImpl& dn):
279279
minibatchSz_(dn.minibatchSz_),outputSize_(dn.outputSize_){
@@ -300,8 +300,8 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
300300
//Implemented to supress Visual Studio warning "assignment operator could not be generated"
301301
}
302302

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)
305305
{
306306

307307
CV_Assert(this->minibatchSz_>0);
@@ -326,8 +326,8 @@ class DeepCNNOpenCvDNNImpl: public DeepCNN{
326326
}
327327

328328

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();
331331

332332
//inputLayer->Reshape(this->minibatchSz_,this->channelCount_,this->inputGeometry_.height, this->inputGeometry_.width);
333333
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
408408
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
409409

410410
#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));
412412
#else
413413
CV_Error(Error::StsError,"DeepCNN::create backend not implemented");
414414
return Ptr<DeepCNN>();
@@ -419,7 +419,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
419419
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
420420
break;
421421
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));
423423
break;
424424
case OCR_HOLISTIC_BACKEND_NONE:
425425
default:
@@ -440,7 +440,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
440440
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100));
441441

442442
#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));
444444
#else
445445
CV_Error(Error::StsError,"DeepCNN::create backend not implemented");
446446
return Ptr<DeepCNN>();
@@ -451,7 +451,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
451451
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100));
452452
break;
453453
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));
455455
break;
456456
case OCR_HOLISTIC_BACKEND_NONE:
457457
default:

modules/text/src/text_detectorCNN.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
376376
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
377377

378378
#elif defined(HAVE_DNN)
379-
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
379+
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,700,700,3));
380380
#else
381381
CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented");
382382
return Ptr<DeepCNNTextDetector>();
@@ -387,7 +387,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
387387
break;
388388

389389
case OCR_HOLISTIC_BACKEND_DNN:
390-
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
390+
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,700,700,3));
391391
break;
392392

393393
case OCR_HOLISTIC_BACKEND_NONE:
@@ -420,7 +420,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
420420
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1));
421421

422422
#elif defined(HAVE_DNN)
423-
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1));
423+
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1,700,700,3));
424424
#else
425425
CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented");
426426
return Ptr<DeepCNNTextDetector>();
@@ -430,7 +430,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
430430
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1));
431431
break;
432432
case OCR_HOLISTIC_BACKEND_DNN:
433-
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1));
433+
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1,700,700,3));
434434
break;
435435
case OCR_HOLISTIC_BACKEND_NONE:
436436
default:

0 commit comments

Comments
 (0)