Ola, tenho este codigo onde faço um resize e pretendo copiar apos este copiar novamente as imagens para o mesmo vector (m_VectorImagesCaptured) mas estou com problemas, este carrega-me sempre a mesma imagem (a ultima que foi utilizada na função resize) podem ajudar-me
// img_neural_auxView=m_VectorAux[i]; cvWaitKey(5); cvShowImage("imagem ",img_neural_auxView);//carrega a imagem coma estrutura // cvShowImage("imagem a treinar na rede1",m_VectorAux[i]);//carrega a imagem coma estrutura cvWaitKey(100); }
1) You should post your questions in english. 2) This is not a Visual C++ language question, it is an OpenCV question.
The problem you have is that you are doing push_back of a pointer. In your first for loop you change the content of this pointer and not the pointer itself. I you use the debugger to watch the elements of m_VectorAux you'll see that you have the same value on each position.
You should change,
m_VectorAux.push_back(img_neural_aux);
to
m_VectorAux.push_back(aux);
Other useful things: You shoud release your images in order to avoid memory leaks.
Marked as answer byRong-Chun ZhangWednesday, November 26, 2008 10:44 AM