Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error accumulate #8

Open
Ahmetcanucarli opened this issue Dec 29, 2021 · 8 comments
Open

Error accumulate #8

Ahmetcanucarli opened this issue Dec 29, 2021 · 8 comments

Comments

@Ahmetcanucarli
Copy link

Hi ,
I am getting the following error while doing the Make process.
error: invalid initialization of reference of type ‘cv::InputArray {aka const cv::_InputArray&}’ from expression of type ‘std::vector::iterator {aka __gnu_cxx::__normal_iterator<float*, std::vector >}’
ave[i][j] = (0.001 + accumulate(begin(matrixi[i][j]), end(matrixi[i][j]), 0.0)) / matrixi[i][j].size();

@949081642
Copy link

Hi , I am getting the following error while doing the Make process. error: invalid initialization of reference of type ‘cv::InputArray {aka const cv::_InputArray&}’ from expression of type ‘std::vector::iterator {aka __gnu_cxx::__normal_iterator<float*, std::vector >}’ ave[i][j] = (0.001 + accumulate(begin(matrixi[i][j]), end(matrixi[i][j]), 0.0)) / matrixi[i][j].size();

i have the same error,opencv version ?

@949081642
Copy link

add
#include
it works

@ShutongJIN
Copy link

I got the same problem, may I ask how did you solve it? Thanks a lot:)

@crankler
Copy link

add #include it works

add what? could you tell me the details, thank you a lot

@libing64
Copy link

libing64 commented Mar 30, 2022

@crankler @ShutongJIN

#include <numeric> 

and use std::accumulate to replace accumulate

@crankler
Copy link

Yes, thank you @libing64, It work

@duongtran11
Copy link

@crankler @ShutongJIN

#include <numeric> 

and use std::accumulate to replace accumulate

really helpful, thank you!

@limeiqiang
Copy link

the place is RoadMarkingExtraction/src/imageprocess.cpp and add #include in second line and use std::accumulate to replace accumulate

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants