Commit c382395d authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #518 from patricksnape:msvc09_python_fixes

parents f8205a7d 0900a86b
...@@ -566,7 +566,7 @@ OCRBeamSearchClassifierCNN::OCRBeamSearchClassifierCNN (const string& filename) ...@@ -566,7 +566,7 @@ OCRBeamSearchClassifierCNN::OCRBeamSearchClassifierCNN (const string& filename)
nr_feature = weights.rows; nr_feature = weights.rows;
nr_class = weights.cols; nr_class = weights.cols;
patch_size = (int)sqrt(kernels.cols); patch_size = (int)sqrt((float)kernels.cols);
window_size = 4*patch_size; window_size = 4*patch_size;
step_size = 4; step_size = 4;
quad_size = 12; quad_size = 12;
......
...@@ -982,7 +982,7 @@ OCRHMMClassifierCNN::OCRHMMClassifierCNN (const string& filename) ...@@ -982,7 +982,7 @@ OCRHMMClassifierCNN::OCRHMMClassifierCNN (const string& filename)
nr_feature = weights.rows; nr_feature = weights.rows;
nr_class = weights.cols; nr_class = weights.cols;
patch_size = (int)sqrt(kernels.cols); patch_size = (int)sqrt((float)kernels.cols);
// algorithm internal parameters // algorithm internal parameters
window_size = 32; window_size = 32;
num_quads = 25; num_quads = 25;
......
...@@ -666,7 +666,7 @@ namespace cv{ ...@@ -666,7 +666,7 @@ namespace cv{
for(int i=0;i<patch_data.rows;i++){ for(int i=0;i<patch_data.rows;i++){
for(int j=0;j<patch_data.cols;j++){ for(int j=0;j<patch_data.cols;j++){
pixel=patch_data.at<Vec3b>(i,j); pixel=patch_data.at<Vec3b>(i,j);
index=(unsigned)(floor(pixel[2]/8)+32*floor(pixel[1]/8)+32*32*floor(pixel[0]/8)); index=(unsigned)(floor((float)pixel[2]/8)+32*floor((float)pixel[1]/8)+32*32*floor((float)pixel[0]/8));
//copy the values //copy the values
for(int _k=0;_k<10;_k++){ for(int _k=0;_k<10;_k++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment