maxruby / OpenCV.jl

The OpenCV (C++) interface for Julia
Other
105 stars 28 forks source link

Change julia array to C++ vector #27

Open kvmanohar22 opened 7 years ago

kvmanohar22 commented 7 years ago

Encountered this bug while testing the test case 6. With the earlier implementation of conversion of julia array to C++, I used to get the following error :

test 6: Conversion of images from Images.jl to OpenCV Mat
:1:1: error: no matching function for call to 'at_u'
^
__cxxjl_45.cpp:6:6: note: candidate function not viable: no known conversion from 'std::vector<double, std::allocator<double> >' to 'double' for 4th argument
void at_u(cv::Mat &img, int row, int col, double val)
     ^
__cxxjl_45.cpp:1:5: note: candidate function not viable: requires 3 arguments, but 4 were provided
int at_u(cv::Mat &img, int row, int col)
    ^
:1:1: error: no matching function for call to 'at_s'
^
__cxxjl_45.cpp:17:6: note: candidate function not viable: no known conversion from 'std::vector<double, std::allocator<double> >' to 'double' for 4th argument
void at_s(cv::Mat &img, int row, int col, double val)
     ^
__cxxjl_45.cpp:12:5: note: candidate function not viable: requires 3 arguments, but 4 were provided
int at_s(cv::Mat &img, int row, int col)
    ^
:1:1: error: no matching function for call to 'at_us'
^
__cxxjl_45.cpp:28:6: note: candidate function not viable: no known conversion from 'std::vector<double, std::allocator<double> >' to 'double' for 4th argument
void at_us(cv::Mat &img, int row, int col, double val)
     ^
__cxxjl_45.cpp:23:5: note: candidate function not viable: requires 3 arguments, but 4 were provided
int at_us(cv::Mat &img, int row, int col)
    ^
:1:1: error: no matching function for call to 'at_f'
^
__cxxjl_45.cpp:39:6: note: candidate function not viable: no known conversion from 'std::vector<double, std::allocator<double> >' to 'double' for 4th argument
void at_f(cv::Mat &img, int row, int col, double val)
     ^
__cxxjl_45.cpp:34:7: note: candidate function not viable: requires 3 arguments, but 4 were provided
float at_f(cv::Mat &img, int row, int col)
      ^
:1:1: error: no matching function for call to 'at_d'
^
__cxxjl_45.cpp:50:6: note: candidate function not viable: no known conversion from 'std::vector<double, std::allocator<double> >' to 'double' for 4th argument
void at_d(cv::Mat &img, int row, int col, double val)
     ^
__cxxjl_45.cpp:45:8: note: candidate function not viable: requires 3 arguments, but 4 were provided
double at_d(cv::Mat &img, int row, int col)
       ^

The present implementation solves the problem.