Open hasantha-nirmal opened 3 years ago
Hello, I was passing by and I saw your comment. In order to crop a detected object (to then save it), what you can do is :
1) get the bounding box :
bbox = track.to_tlbr()
2) Get the cropped picture :
cropped_picture = img[ (int(bbox[1])):(int(bbox[3])), (int(bbox[0])):(int(bbox[2])) ]
3) Save it:
cv2.imwrite('result.jpg', cropped_picture)
Hello, I was passing by and I saw your comment. In order to crop a detected object (to then save it), what you can do is :
1) get the bounding box :
bbox = track.to_tlbr()
2) Get the cropped picture :
cropped_picture = img[ (int(bbox[1])):(int(bbox[3])), (int(bbox[0])):(int(bbox[2])) ]
3) Save it:
cv2.imwrite('result.jpg', cropped_picture)
Thank you very much, really appreciate it.🙏🙏
How to save the detections of each frame? For an example all the frames generated by one tracker object?