How to filter the background of an image?

I am working on a project about image retrieval, to retrieve similar images from a folder containing 1000 images.

I have an image like this:

I tried to detect the edges first by using the Canny edge detector :

bus_img = cv.imread(“bus.jpg”)
bus_img_gray = cv.cvtColor(bus_img, cv.COLOR_BGR2GRAY)
edges = cv.Canny(bus_img_gray, 100, 10)

However, it contains lots of edges from the buildings behind.
Is there a possible way I can filter them out?

big field of study: Content-based image retrieval - Wikipedia

ditch Canny. that will only make things worse.

also forget about “filtering”. wrong approach. the only viable ways to do that would involve DL/AI.

instead of just using DL/AI for preprocessing, you should use DL/AI to get features describing the picture directly.