第一个问题。不是等待答案,而是关于如何解决问题或阅读文档的一点指导
我正在学习Tensorflow,我正在使用实时摄像机objet检测的基本示例,并希望在其他软件(GIS)中输入输出
我可以改变来自相机的最终图像吗?或者甚至关闭来自相机的图像,只留下正方形和标签
这是绘制矩形的代码
input_tensor = tf.convert_to_tensor(np.expand_dims(image_np, 0), dtype=tf.float32)
detections, predictions_dict, shapes = detect_fn(input_tensor)
label_id_offset = 1
image_np_with_detections = image_np.copy()
viz_utils.visualize_boxes_and_labels_on_image_array(
image_np_with_detections,
detections['detection_boxes'][0].numpy(),
(detections['detection_classes'][0].numpy() + label_id_offset).astype(int),
detections['detection_scores'][0].numpy(),
category_index,
use_normalized_coordinates=True,
max_boxes_to_draw=200,
min_score_thresh=.30,
agnostic_mode=False)
# Display output
cv2.imshow('object detection', cv2.resize(image_np_with_detections, (800, 600)))
函数visualize_box_和_labels_on_image_数组是Tensorflow models/research/object_detection/utils/visualize_utils.py的一部分
我的第一个猜测是将带有检测的图像\u np\u修改为空白图像,但它不起作用。我曾试图直接修改可视化UTIL,但在使用图像处理检测时,它会产生错误
另一个选择是深入研究opencv文档
有线索吗
提前谢谢
在这里,您将看到如何一步一步地向原始图像中添加内容(如您的问题中的可视化中的对象检测),但如何仅将添加的项目提取到结果图像中
在实践中,它看起来是这样的:
相关问题 更多 >
编程相关推荐