Skip to content

Commit 7c7ecd7

Browse files
committed
Fixing warnings
1 parent 551d1e6 commit 7c7ecd7

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

modules/text/src/ocr_holistic.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,9 @@ class DictNetCaffeImpl: public DictNet{
6060

6161
void classifyMiniBatch(std::vector<Mat> inputImageList, Mat outputMat){
6262
//Classifies a list of images containing at most minibatchSz_ images
63-
CV_Assert(inputImageList.size()<=this->minibatchSz_);
63+
CV_Assert(int(inputImageList.size())<=this->minibatchSz_);
6464
CV_Assert(outputMat.isContinuous());
65-
float* ouputPtr= (float*)(outputMat.data);
65+
#ifdef HAVE_CAFFE
6666
net_->input_blobs()[0]->Reshape(inputImageList.size(), 1,this->inputGeometry_.height,this->inputGeometry_.width);
6767
net_->Reshape();
6868
float* inputBuffer=net_->input_blobs()[0]->mutable_cpu_data();
@@ -78,6 +78,7 @@ class DictNetCaffeImpl: public DictNet{
7878
const float* outputNetData=net_->output_blobs()[0]->cpu_data();
7979
float*outputMatData=(float*)(outputMat.data);
8080
memcpy(outputMatData,outputNetData,sizeof(float)*this->outputSize_*inputImageList.size());
81+
#endif
8182
}
8283

8384
#ifdef HAVE_CAFFE
@@ -129,7 +130,7 @@ class DictNetCaffeImpl: public DictNet{
129130
inputImageList.getMatVector(allImageVector);
130131
classProbabilities.create(Size(this->outputSize_,allImageVector.size()),CV_32F);
131132
Mat outputMat = classProbabilities.getMat();
132-
for(int imgNum=0;imgNum<allImageVector.size();imgNum+=this->minibatchSz_){
133+
for(int imgNum=0;imgNum<int(allImageVector.size());imgNum+=this->minibatchSz_){
133134
int rangeEnd=imgNum+std::min<int>(allImageVector.size()-imgNum,this->minibatchSz_);
134135
std::vector<Mat>::const_iterator from=allImageVector.begin()+imgNum;
135136
std::vector<Mat>::const_iterator to=allImageVector.begin()+rangeEnd;
@@ -208,7 +209,7 @@ class OCRHolisticWordRecognizerImpl: public OCRHolisticWordRecognizer{
208209
while (std::getline(labelsFile, line)){
209210
labels_.push_back(std::string(line));
210211
}
211-
CV_Assert(this->classifier_->getOutputSize()==this->labels_.size());
212+
CV_Assert(this->classifier_->getOutputSize()==int(this->labels_.size()));
212213
}
213214

214215
void recogniseImage(InputArray inputImage,CV_OUT String& transcription,CV_OUT double& confidence){

0 commit comments

Comments
 (0)