I have pictures like that one below.
Here is a car from the back and some background.
How can I adjust rect to fit car better, without free space around? It can be very approximate solution, main thing here is that car can vary a lot, as well as background. I've tried many methods from OpenCV, like active counters (nothing good at all), thresholding, sobel and canny operators, etc. Any ideas?
Here is 2670 examples, if someone is interested in deeper understanding of problem. In archive there are also front rear cars, but that is not necessary to adjust them too, main goal is cars from behind.
