Intel® Distribution of OpenVINO™ Toolkit
Community assistance about the Intel® Distribution of OpenVINO™ toolkit, OpenCV, and all aspects of computer vision-related on Intel® platforms.
6480 Discussions

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

Lenard-Lim
Beginner
2,449 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
2,425 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

 

 

0 Kudos
IntelSupport
Community Manager
2,411 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


0 Kudos
Reply