maxruby / OpenCV.jl

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

Spurious error messages when using pixset #33

Open mbeltagy opened 7 years ago

mbeltagy commented 7 years ago

I finally got OpenCV.jl to work on my ubuntu 14.04.

In the example on Getting and setting selected pixel values using method 1, I get the following I run pixset.

 # turn random pixels yellow
       for i=1:1000
           pixset(img, Int(round(rand()*rows(img))), Int(round(rand()*cols(img))), red)  
       end
: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)
       ^

Overall, the example seems to work, but the errors are alarming.

maxruby commented 7 years ago

I assume that you are using the master branch. In that case, the errors are not exactly alarming because recently these functions had to be changed due to deprecations/updates in Julia v0.6. I will have a look at this tonight.

There is a completely new implementation of the cv::Mat constructors in OpenCV.jl using template cv::Mat_<T> in branch mat_templates. You are welcome to try it but it is a WIP.