@@ -13,22 +13,22 @@ using namespace std;
13
13
const size_t width = 300 ;
14
14
const size_t height = 300 ;
15
15
16
- Mat getMean (const size_t & imageHeight, const size_t & imageWidth)
16
+ static Mat getMean (const size_t & imageHeight, const size_t & imageWidth)
17
17
{
18
18
Mat mean;
19
19
20
20
const int meanValues[3 ] = {104 , 117 , 123 };
21
21
vector<Mat> meanChannels;
22
- for (size_t i = 0 ; i < 3 ; i++)
22
+ for (int i = 0 ; i < 3 ; i++)
23
23
{
24
- Mat channel (imageHeight, imageWidth, CV_32F, Scalar (meanValues[i]));
24
+ Mat channel (( int ) imageHeight, ( int ) imageWidth, CV_32F, Scalar (meanValues[i]));
25
25
meanChannels.push_back (channel);
26
26
}
27
27
cv::merge (meanChannels, mean);
28
28
return mean;
29
29
}
30
30
31
- Mat preprocess (const Mat& frame)
31
+ static Mat preprocess (const Mat& frame)
32
32
{
33
33
Mat preprocessed;
34
34
frame.convertTo (preprocessed, CV_32F);
@@ -124,7 +124,7 @@ int main(int argc, char** argv)
124
124
125
125
if (confidence > confidenceThreshold)
126
126
{
127
- size_t objectClass = detectionMat.at <float >(i, 1 );
127
+ size_t objectClass = ( size_t )( detectionMat.at <float >(i, 1 ) );
128
128
129
129
float xLeftBottom = detectionMat.at <float >(i, 3 ) * frame.cols ;
130
130
float yLeftBottom = detectionMat.at <float >(i, 4 ) * frame.rows ;
@@ -139,9 +139,9 @@ int main(int argc, char** argv)
139
139
<< " " << xRightTop
140
140
<< " " << yRightTop << std::endl;
141
141
142
- Rect object (xLeftBottom, yLeftBottom,
143
- xRightTop - xLeftBottom,
144
- yRightTop - yLeftBottom);
142
+ Rect object (( int ) xLeftBottom, ( int ) yLeftBottom,
143
+ ( int )( xRightTop - xLeftBottom) ,
144
+ ( int )( yRightTop - yLeftBottom) );
145
145
146
146
rectangle (frame, object, Scalar (0 , 255 , 0 ));
147
147
}
0 commit comments