【发布时间】:2020-10-14 12:45:42
【问题描述】:
我正在为小型无人机编写程序。我正在计算每一帧平台的距离和坐标。无人机根据边界框的坐标顺时针或逆时针旋转,直到边界框居中。
maxBoxes=1 #max boxes to draw
vis_util.visualize_boxes_and_labels_on_image_array(
image,
np.squeeze(boxes),
np.squeeze(classes).astype(np.int32),
np.squeeze(scores),
category_index,
max_boxes_to_draw=maxBoxes,
min_score_thresh=0.5,
use_normalized_coordinates=True,
line_thickness=4)
#if here, to check whether there is a detected object and then calculate
ymin = int((boxes[0][0][0]*imageHeight))
xmin = int((boxes[0][0][1]*imageWidth))
ymax = int((boxes[0][0][2]*imageHeight))
xmax = int((boxes[0][0][3]*imageWidth))
boxWidth=xmax-xmin
boxHeight=ymax-ymax
#Distance calculation
distance=round(W*F/boxWidth,2) #distance from the object
我的问题是如何检查给定帧是否存在检测到的对象(边界框),因为有时它无法找到对象但仍沿随机方向旋转。
【问题讨论】:
标签: tensorflow deep-learning object-detection object-detection-api bounding-box