I'm writing an algorithm using lstlisting :
\lstset{language=C++}
\begin{lstlisting}[frame=single,caption=Algorithme de la méthode "HOG+SVM"]
HOGDescriptor hog;\\
hog.setSVMDetector(HOGDescriptor::getDefaultPeopleDetector());\\
while(1)
{
Mat image=imread("image.jpg");
vecor<Rect> detected_persons;
hog.detectMultiScale(image,detected_persons, 0, Size(8,8), Size(32,32), 1.05, 2);
for(int i=0;i<detected_persons.size();i++)
{
rectangle(image, detected_persons[i], cv::Scalar(0,255,0),1,8,0);
}
imshow("image",image);
}
\end{lstlisting}
But I got such output this algorithm: display How to fix that?

listingsis meant for typesetting code listings, not for algorithms itself, that's why there are packages likealgorithmandalgorithm2eetc. made for – Jun 09 '16 at 13:44