def get_persons_srv_call(self, roi_image): """ Method that calls the GetPersons.srv :param roi_image: Selected roi_image by the user """ try: result = self._srv(image=self.bridge.cv2_to_imgmsg(roi_image, "bgr8")) except Exception as e: warning_dialog("Service Exception", str(e)) return print result info_dialog("Persons", str(result))
def get_face_properties_srv_call(self, roi_image): """ Method that calls the GetFaceProperties.srv :param roi_image: Selected roi_image by the user """ try: result = self._srv(face_image_array=[self.bridge.cv2_to_imgmsg(roi_image, "bgr8")]) except Exception as e: warning_dialog("Service Exception", str(e)) return msg = "" for properties in result.properties_array: msg += "- FaceProperties(gender=%s, age=%s)" % \ ("male" if properties.gender == FaceProperties.MALE else "female", properties.age) info_dialog("Face Properties array", msg)