#!/usr/bin/env python3
# Show image with detected ArUco markers
 
import rospy
from sensor_msgs.msg import Image
import cv2
from cv_bridge import CvBridge
 
def callback(data):
 
  br = CvBridge()
  current_frame = br.imgmsg_to_cv2(data)

  cv2.imshow("camera", current_frame)
  cv2.waitKey(1)
      
def display_img():

  rospy.init_node('yolov5_show_py', anonymous=True)
  rospy.Subscriber('detected_objects_img', Image, callback)
  rospy.spin()

  cv2.destroyAllWindows()
  
if __name__ == '__main__':
  display_img()