I’m converting the image to gray. For the best selection of canny, I use the adaptive threshold method. Next, I select canny and use them to search for external contours.
My purpose is to draw a human contour. Initially, I used this to search for a person on a monochrome background and I was satisfied with the result. Now my background has various noises, how can I better find a human contour in this case?
I would add that, while the approach you are using might not be the best way to detect people in an image, it is a good way to learn. So depending on your goals, you might want to keep playing around with the image processing steps and seeing how different steps and different ordering affects the results.
if you don’t feel ready to use neural networks yet, pedestrians can be detected with a classifier that uses Histogram of Oriented Gradients as the underlying feature map. OpenCV comes with a HOG model for pedestrians, if I remember correctly. I don’t know how well it’ll work.