detect objects in only specific region of the frame-yolo-opencv
i'm doing a similar thing...
if your product is going to be fixed on like a light poll then clearly you can either detect the road and zebra crossing by training a model.
or
manually enter these values...
later run your object detection and object tracking on only these parts of the frames i.e, use
frame[ymax:ymin, xmax:xmin]
This reduces the image size so your processing speed increases.
but why do you need the full image again after your work? still if you do need it then you just have to add the values of xmin and ymin of your object detection box on the road to the bounding box of the vehicle detected in that object detection box to get its bounding box values in uncropped image.
I am counting the total no. of vehicles in a video, but I want to detect only the vehicles which are travelling up(roads have a divider) so my point is, Can i use yolo only on a rectangle where vehicles are moving up? I dont want to detect vehicles that are on the other side of the road.
is there a way like i can draw a rectangle and only detect objects on that specific rectangle?
The best I can think of is for every frame, i'll have to crop the frame, perform all the operations and stitch it back to the original frame. I am expecting an easier alternative for the same
Any help is appreciated. Thanks