Problem with push_back
if (tecla==102) cap >> frame;
if (tecla==32 and capturado==true)
{
//Aqui calculo los objectPoints
for (int t=0; t<6; ++t)
{
for (int e=0; e<5; ++e)
{
objectPoints.push_back(cv::Point3f(e*0.04,t*0.04,0));
}
}
//Aqui calculamos cada objectPoints para cada imagen procesada.
for (int n=0; n<total_img.size(); n++)
{
arrayObjectPoints[n].push_back( objectPoints );
}
capturado=false;
}
}
cap.release();
}
}
This is my code. The problem is, where do push_back in line arrayObjectPoints[n].push_back( objectPoints ); The error is this.
i32romer@BIBSL016:~/Desktop/FSIV/Practica 5$ make
Scanning dependencies of target prueba
[ 50%] Building CXX object CMakeFiles/prueba.dir/prueba.cpp.o
/home/i32romer/Desktop/FSIV/Practica 5/prueba.cpp: En la función ‘int main(int, char**)’:
/home/i32romer/Desktop/FSIV/Practica 5/prueba.cpp:175:50: error: no se encontró una función coincidente para la llamada a ‘std::vector<cv::Vec<float, 3> >::push_back(std::vector<cv::Point3_<float> >&)’
arrayObjectPoints[n].push_back( objectPoints );
^
In file included from /usr/local/opt/gcc-5.3.0-32/include/c++/5.3.0/vector:64:0,
from /usr/local/include/opencv2/core/types.hpp:53,
from /usr/local/include/opencv2/core.hpp:58,
from /usr/local/include/opencv2/core/core.hpp:48,
from /home/i32romer/Desktop/FSIV/Practica 5/prueba.cpp:8:
/usr/local/opt/gcc-5.3.0-32/include/c++/5.3.0/bits/stl_vector.h:913:7: nota: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = cv::Vec<float, 3>; _Alloc = std::allocator<cv::Vec<float, 3> >; std::vector<_Tp, _Alloc>::value_type = cv::Vec<float, 3>]
push_back(const value_type& __x)
^
/usr/local/opt/gcc-5.3.0-32/include/c++/5.3.0/bits/stl_vector.h:913:7: nota: no hay una conversión conocida para el argumento 1 de ‘std::vector<cv::Point3_<float> >’ a ‘const value_type& {aka const cv::Vec<float, 3>&}’
CMakeFiles/prueba.dir/build.make:62: fallo en las instrucciones para el objetivo 'CMakeFiles/prueba.dir/prueba.cpp.o'
make[2]: *** [CMakeFiles/prueba.dir/prueba.cpp.o] Error 1
CMakeFiles/Makefile2:67: fallo en las instrucciones para el objetivo 'CMakeFiles/prueba.dir/all'
make[1]: *** [CMakeFiles/prueba.dir/all] Error 2
Makefile:83: fallo en las instrucciones para el objetivo 'all'
make: *** [all] Error 2
i32romer@BIBSL016:~/Desktop/FSIV/Practica 5$
pro tip: NEVER use your native language for variable names, or comments. also, translate any error messages to english, before posting.
Adding to what berak said, next time just post the portion of your program with the problem. Dumping your entire program; especially if it is this long, is a great way to discourage people from helping.