Intel® Distribution of OpenVINO™ Toolkit
Community support and discussions about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all things computer vision-related on Intel® platforms.
5535 Discussions

Adding a cv2.puttext but no show in window when do the multi camera multi person python demo

Lenard-Lim
Beginner
175 Views

Hi 

I am set up the multi camera demo and I am try to add the cv2.puttext for person counting purpose. Because I am not sure where can I add. So I put cv2.puttext in the def visualize_multicam_detections() and I am finding the person ID to show how many person in the screen. However, when I put in the def plot_timeline it won't show any cv2.puttext in the window. 

So, May I know that:

why I type the code below in the def visualize_multicam_detections(), it can show the Total person in the screen but in def plot_timeline not?
v2.putText(vis, f'Total Persons : {all_objs}', (40,70), cv2.FONT_HERSHEY_DUPLEX, 0.8, (255,0,0), 2) 

and which code is generate person ID? because I want to use it to count the person.

0 Kudos
2 Replies
IntelSupport
Community Manager
151 Views

Hi Lenard,

 

Thank you for reaching out to us. Please note that modifying the demo code/script is not recommended.

 

Please refer to line 168 on 'multi_camera_multi_target_tracking.py' :

vis = visualize_multicam_detections(prev_frames, tracked_objects, fps,**config['visualization_config'])
presenter.drawGraphs(vis)
if not params.no_show:
   cv.imshow(win_name, vis)

If you put cv2.puttext in the 'def visualize_multicam_detections()' function, then it will show due to cv.imshow() function.

 

Regarding the code to generate person ID, maybe you could refer to the 'label = obj.label' in the 'def draw_detections()' function on 'visualization.py' file.

 

Regards,

Aznie

 

 

IntelSupport
Community Manager
137 Views

Hi Lenard,

This thread will no longer be monitored since we have provided a solution. If you need any additional information from Intel, please submit a new question.


Regards,

Aznie


Reply