python box2d例子_Python cv2.line方法代码示例

本文整理汇总了Python中cv2.line方法的典型用法代码示例。如果您正苦于以下问题:Python cv2.line方法的具体用法?Python cv2.line怎么用?Python cv2.line使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块cv2的用法示例。

在下文中一共展示了cv2.line方法的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: __init__

​点赞 7

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def __init__(self, line):

data = line.split(' ')

data[1:] = [float(x) for x in data[1:]]

self.classname = data[0]

self.xmin = data[1]

self.ymin = data[2]

self.xmax = data[1]+data[3]

self.ymax = data[2]+data[4]

self.box2d = np.array([self.xmin,self.ymin,self.xmax,self.ymax])

self.centroid = np.array([data[5],data[6],data[7]])

self.unused_dimension = np.array([data[8],data[9],data[10]])

self.w = data[8]

self.l = data[9]

self.h = data[10]

self.orientation = np.zeros((3,))

self.orientation[0] = data[11]

self.orientation[1] = data[12]

self.heading_angle = -1 * np.arctan2(self.orientation[1], self.orientation[0])

开发者ID:zaiweizhang,项目名称:H3DNet,代码行数:20,

示例2: draw_projected_box3d

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def draw_projected_box3d(image, qs, color=(255,255,255), thickness=2):

''' Draw 3d bounding box in image

qs: (8,2) array of vertices for the 3d box in following order:

1 -------- 0

/| /|

2 -------- 3 .

| | | |

. 5 -------- 4

|/ |/

6 -------- 7

'''

qs = qs.astype(np.int32)

for k in range(0,4):

#http://docs.enthought.com/mayavi/mayavi/auto/mlab_helper_functions.html

i,j=k,(k+1)%4

cv2.line(image, (qs[i,0],qs[i,1]), (qs[j,0],qs[j,1]), color, thickness, cv2.CV_AA) # use LINE_AA for opencv3

i,j=k+4,(k+1)%4 + 4

cv2.line(image, (qs[i,0],qs[i,1]), (qs[j,0],qs[j,1]), color, thickness, cv2.CV_AA)

i,j=k,k+4

cv2.line(image, (qs[i,0],qs[i,1]), (qs[j,0],qs[j,1]), color, thickness, cv2.CV_AA)

return image

开发者ID:zaiweizhang,项目名称:H3DNet,代码行数:25,

示例3: get_curve

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def get_curve(self):

L = 200

canvas = np.ones((L, L, 3)) * 0.851

curve_step = 16

xs = np.linspace(0.0, 1.0, curve_step + 1)[:, None, None]

xs = np.concatenate([xs] * 3, axis=2)

ys = self.apply(xs.copy())

ys = np.clip(ys, 0.01, 1.0)

for i in range(curve_step):

for j in range(3):

x, y = xs[i, 0, j], ys[i, 0, j]

xx, yy = xs[i + 1, 0, j], ys[i + 1, 0, j]

color = [0, 0, 0]

color[j] = 0.7

color = tuple(color)

cv2.line(canvas, (int(L * x), int(L - L * y)), (int(L * xx), int(L - L * yy)), color, 1)

return canvas

开发者ID:yuanming-hu,项目名称:exposure,代码行数:19,

示例4: visualize_filter

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def visualize_filter(self, debug_info, canvas):

curve = debug_info['filter_parameters']

height, width = canvas.shape[:2]

for i in range(self.channels):

values = np.array([0] + list(curve[0][0][i]))

values /= sum(values) + 1e-30

scale = 1

values *= scale

for j in range(0, self.cfg.curve_steps):

values[j + 1] += values[j]

for j in range(self.cfg.curve_steps):

p1 = tuple(

map(int, (width / self.cfg.curve_steps * j, height - 1 -

values[j] * height)))

p2 = tuple(

map(int, (width / self.cfg.curve_steps * (j + 1), height - 1 -

values[j + 1] * height)))

color = []

for t in range(self.channels):

color.append(1 if t == i else 0)

cv2.line(canvas, p1, p2, tuple(color), thickness=1)

开发者ID:yuanming-hu,项目名称:exposure,代码行数:23,

示例5: update

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def update(self, radarData):

self.img = np.zeros((self.height, self.width, self.channels), np.uint8)

cv2.line(self.img, (10, 0), (self.width/2 - 5, self.height), (100, 255, 255))

cv2.line(self.img, (self.width - 10, 0), (self.width/2 + 5, self.height), (100, 255, 255))

for track_number in range(1, 65):

if str(track_number)+'_track_range' in radarData:

track_range = radarData[str(track_number)+'_track_range']

track_angle = (float(radarData[str(track_number)+'_track_angle'])+90.0)*math.pi/180

x_pos = math.cos(track_angle)*track_range*4

y_pos = math.sin(track_angle)*track_range*4

cv2.circle(self.img, (self.width/2 + int(x_pos), self.height - int(y_pos) - 10), 5, (255, 255, 255))

#cv2.putText(self.img, str(track_number),

# (self.width/2 + int(x_pos)-2, self.height - int(y_pos) - 10), self.font, 1, (255,255,255), 2)

cv2.imshow("Radar", self.img)

cv2.waitKey(2)

开发者ID:diyjac,项目名称:Udacity-SDC-Radar-Driver-Micro-Challenge,代码行数:21,

示例6: func1

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def func1(k=None):

if not k:

k=randint(0, 20)

print('image is',k)

for i, (img, heatmap,vecmap,depthmap,kpt_3d) in enumerate(train_loader):

if i==k:

# test_heatmaps(heatmap,img,i)

# test_vecmaps(vecmap,img,i)

# edges = [[0, 1], [1, 2], [2, 6], [6, 3], [3, 4], [4, 5], [10, 11], [11, 12], [12, 8], [8, 13], [13, 14], [14, 15], [6, 8], [8, 9]]

# ppl=kpt_3d.shape[0]

# for i in range(ppl):

# for edge in edges:

# cv2.line(img,(int(kpt_3d[i][edge[0]][0]),int(kpt_3d[i][edge[0]][1])),(int(kpt_3d[i][edge[1]][0]),int(kpt_3d[i][edge[1]][1])),(0,255,0))

# cv2.imwrite('outside3dfinal.png',img)

return img,heatmap,vecmap,depthmap,kpt_3d

开发者ID:Naman-ntc,项目名称:3D-HourGlass-Network,代码行数:18,代码来源:my.py

示例7: draw_humans

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def draw_humans(npimg, humans, imgcopy=False):

if imgcopy:

npimg = np.copy(npimg)

image_h, image_w = npimg.shape[:2]

centers = {}

for human in humans:

# draw point

for i in range(common.CocoPart.Background.value):

if i not in human.body_parts.keys():

continue

body_part = human.body_parts[i]

center = (int(body_part.x * image_w + 0.5), int(body_part.y * image_h + 0.5))

centers[i] = center

cv2.circle(npimg, center, 3, common.CocoColors[i], thickness=3, lineType=8, shift=0)

# draw line

for pair_order, pair in enumerate(common.CocoPairsRender):

if pair[0] not in human.body_parts.keys() or pair[1] not in human.body_parts.keys():

continue

npimg = cv2.line(npimg, centers[pair[0]], centers[pair[1]], common.CocoColors[pair_order], 3)

return npimg

开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:26,

示例8: draw_limbs

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def draw_limbs(image, pose_2d, visible):

"""Draw the 2D pose without the occluded/not visible joints."""

_COLORS = [

[0, 0, 255], [0, 170, 255], [0, 255, 170], [0, 255, 0],

[170, 255, 0], [255, 170, 0], [255, 0, 0], [255, 0, 170],

[170, 0, 255]

]

_LIMBS = np.array([0, 1, 2, 3, 3, 4, 5, 6, 6, 7, 8, 9,

9, 10, 11, 12, 12, 13]).reshape((-1, 2))

_NORMALISATION_FACTOR = int(math.floor(math.sqrt(image.shape[0] * image.shape[1] / NORMALISATION_COEFFICIENT)))

for oid in range(pose_2d.shape[0]):

for lid, (p0, p1) in enumerate(_LIMBS):

if not (visible[oid][p0] and visible[oid][p1]):

continue

y0, x0 = pose_2d[oid][p0]

y1, x1 = pose_2d[oid][p1]

cv2.circle(image, (x0, y0), JOINT_DRAW_SIZE *_NORMALISATION_FACTOR , _COLORS[lid], -1)

cv2.circle(image, (x1, y1), JOINT_DRAW_SIZE*_NORMALISATION_FACTOR , _COLORS[lid], -1)

cv2.line(image, (x0, y0), (x1, y1),

_COLORS[lid], LIMB_DRAW_SIZE*_NORMALISATION_FACTOR , 16)

开发者ID:SrikanthVelpuri,项目名称:tf-pose,代码行数:25,

示例9: on_mouse

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def on_mouse(self, event, x, y, flags, param):

pt = (x, y)

if event == cv2.EVENT_LBUTTONDOWN:

self.prev_pt = pt

elif event == cv2.EVENT_LBUTTONUP:

self.prev_pt = None

if self.prev_pt and flags & cv2.EVENT_FLAG_LBUTTON:

for dst, color in zip(self.dests, self.colors_func()):

cv2.line(dst, self.prev_pt, pt, color, 5)

self.dirty = True

self.prev_pt = pt

self.show()

# palette data from matplotlib/_cm.py

开发者ID:makelove,项目名称:OpenCV-Python-Tutorial,代码行数:18,

示例10: drawMatch

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def drawMatch(img0,img1,src,tgt,color='b'):

if len(img0.shape)==2:

img0=np.expand_dims(img0,2)

if len(img1.shape)==2:

img1=np.expand_dims(img1,2)

h,w = img0.shape[0],img0.shape[1]

img = np.zeros([2*h,w,3])

img[:h,:,:] = img0

img[h:,:,:] = img1

n = len(src)

if color == 'b':

color=(255,0,0)

else:

color=(0,255,0)

for i in range(n):

cv2.circle(img, (int(src[i,0]), int(src[i,1])), 3,color,-1)

cv2.circle(img, (int(tgt[i,0]), int(tgt[i,1])+h), 3,color,-1)

cv2.line(img, (int(src[i,0]),int(src[i,1])),(int(tgt[i,0]),int(tgt[i,1])+h),color,1)

return img

开发者ID:zhenpeiyang,项目名称:RelativePose,代码行数:21,

示例11: visualize_joints

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def visualize_joints(bone_list, focus):

m = np.zeros((424, 600, 3))

m.astype(np.uint8)

for bone in bone_list:

p1x = bone[0][0]

p1y = bone[0][1]

p1z = bone[0][2] + 400

p2x = bone[1][0]

p2y = bone[1][1]

p2z = bone[1][2] + 400

p1 = (

int(p1x * focus / p1z + 300.0), int(-p1y * focus / p1z + 204.0))

p2 = (int(p2x * focus / p2z + 300.0), int(-p2y * focus / p2z + 204.0))

if inside_image(p1[0], p1[1]) and inside_image(p2[0], p2[1]):

cv.line(m, p1, p2, (255, 0, 0), 2)

cv.circle(m, p1, 2, (0, 255, 255), -1)

cv.circle(m, p2, 2, (0, 255, 255), -1)

return m

开发者ID:papagina,项目名称:Auto_Conditioned_RNN_motion,代码行数:21,

示例12: visualize_joints2

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def visualize_joints2(bone_list, focus):

m = np.zeros((424, 600, 3))

m.astype(np.uint8)

for bone in bone_list:

p1x = bone[0][0]

p1y = bone[0][1]

p1z = bone[0][2] + 400

p2x = bone[1][0]

p2y = bone[1][1]

p2z = bone[1][2] + 400

p1 = (

int(p1x * focus / p1z + 300.0), int(-p1y * focus / p1z + 204.0))

p2 = (int(p2x * focus / p2z + 300.0), int(-p2y * focus / p2z + 204.0))

if inside_image(p1[0], p1[1]) and inside_image(p2[0], p2[1]):

cv.line(m, p1, p2, (255, 0, 0), 2)

cv.circle(m, p1, 2, (0, 255, 255), -1)

cv.circle(m, p2, 2, (0, 255, 255), -1)

return m

开发者ID:papagina,项目名称:Auto_Conditioned_RNN_motion,代码行数:21,

示例13: plot_kpt

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def plot_kpt(image, kpt):

''' Draw 68 key points

Args:

image: the input image

kpt: (68, 3).

'''

image = image.copy()

kpt = np.round(kpt).astype(np.int32)

for i in range(kpt.shape[0]):

st = kpt[i, :2]

image = cv2.circle(image,(st[0], st[1]), 1, (0,0,255), 2)

if i in end_list:

continue

ed = kpt[i + 1, :2]

image = cv2.line(image, (st[0], st[1]), (ed[0], ed[1]), (255, 255, 255), 1)

return image

开发者ID:joseph-zhong,项目名称:LipReading,代码行数:18,

示例14: plot_kpt

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def plot_kpt(image, kpt):

''' Draw 68 key points

Args:

image: the input image

kpt: (68, 3).

'''

image = image.copy()

kpt = np.round(kpt).astype(np.int32)

for i in range(kpt.shape[0]):

st = kpt[i, :2]

image = cv2.circle(image, (st[0], st[1]), 1, (0, 0, 255), 2)

if i in end_list:

continue

ed = kpt[i + 1, :2]

image = cv2.line(image, (st[0], st[1]), (ed[0], ed[1]), (255, 255, 255), 1)

return image

开发者ID:tensorboy,项目名称:centerpose,代码行数:18,

示例15: apply_keypoint

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def apply_keypoint(image, keypoint, num_joints=17):

image = image.astype(np.uint8)

edges = [[0, 1], [0, 2], [1, 3], [2, 4],

[3, 5], [4, 6], [5, 6],

[5, 7], [7, 9], [6, 8], [8, 10],

[5, 11], [6, 12], [11, 12],

[11, 13], [13, 15], [12, 14], [14, 16]]

for j in range(num_joints):

if keypoint[j][2]>0.:

cv2.circle(image,

(keypoint[j, 0], keypoint[j, 1]), 3, (255,255,255), 2)

stickwidth = 2

for j, e in enumerate(edges):

if keypoint[e[0],2] > 0. and keypoint[e[1],2] > 0.:

centerA = keypoint[e[0],:2]

centerB = keypoint[e[1],:2]

cv2.line(image,(centerA[0], centerA[1]),(centerB[0], centerB[1]),(255, 255,255),2)

return image

开发者ID:tensorboy,项目名称:centerpose,代码行数:24,

示例16: save_result

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def save_result(img, img_name, text_lines, result_dir):

dst = img

color = (0, 150, 0)

for bbox in text_lines:

bbox = [int(x) for x in bbox]

p1 = (bbox[0], bbox[1])

p2 = (bbox[2], bbox[3])

p3 = (bbox[6], bbox[7])

p4 = (bbox[4], bbox[5])

dst = cv2.line(dst, p1, p2, color, 2)

dst = cv2.line(dst, p2, p3, color, 2)

dst = cv2.line(dst, p3, p4, color, 2)

dst = cv2.line(dst, p4, p1, color, 2)

img_path = os.path.join(result_dir, img_name[0:-4] + '.jpg')

cv2.imwrite(img_path, dst)

开发者ID:Sanster,项目名称:tf_ctpn,代码行数:18,

示例17: clip_line

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def clip_line(line, size):

"""

:param line: (xmin, ymin, xmax, ymax)

:param size: (height, width)

:return: (xmin, ymin, xmax, ymax)

"""

xmin, ymin, xmax, ymax = line

if xmin < 0:

xmin = 0

if xmax > size[1] - 1:

xmax = size[1] - 1

if ymin < 0:

ymin = 0

if ymax > size[0] - 1:

ymax = size[0] - 1

return xmin, ymin, xmax, ymax

开发者ID:Sanster,项目名称:tf_ctpn,代码行数:20,

示例18: split_text_line

​点赞 6

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def split_text_line(line, step):

"""

按照 Bounding box 对文字进行划分

:param line: (xmin, ymin, xmax, ymax)

:return: [(anchor_xmin, anchor_ymin, anchor_xmax, anchor_ymax)]

"""

xmin, ymin, xmax, ymax = line

width = xmax - xmin

anchor_count = int(math.ceil(width / step))

splited_lines = []

for i in range(anchor_count):

anchor_xmin = i * step + xmin

anchor_ymin = ymin

anchor_xmax = anchor_xmin + step - 1

anchor_ymax = ymax

splited_lines.append((anchor_xmin, anchor_ymin, anchor_xmax, anchor_ymax))

return splited_lines

开发者ID:Sanster,项目名称:tf_ctpn,代码行数:24,

示例19: read_sunrgbd_label

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def read_sunrgbd_label(label_filename):

lines = [line.rstrip() for line in open(label_filename)]

objects = [SUNObject3d(line) for line in lines]

return objects

开发者ID:zaiweizhang,项目名称:H3DNet,代码行数:6,

示例20: histogram_of_image

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def histogram_of_image(image):

image = np.clip(rgb2lum(image) * 255.0, 0, 255).astype(np.uint8).ravel()

hist, _ = np.histogram(image, 255, (0, 255))

hist = hist * 1.0 / len(image)

hist /= hist.max() * 1.10

H = 200

canvas = np.ones((H, 255, 3)) * 0.851

for i in range(255):

h = int(hist[i] * H)

cv2.line(canvas, (i, H - 0), (i, H - h), (155, 155, 155), 2)

return canvas

开发者ID:yuanming-hu,项目名称:exposure,代码行数:13,

示例21: draw_datches

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def draw_datches(img1, kp1, img2, kp2, matches, color=None, kp_radius=5,

thickness=2, margin=20):

# Create frame

if len(img1.shape) == 3:

new_shape = (max(img1.shape[0], img2.shape[0]),

img1.shape[1]+img2.shape[1]+margin,

img1.shape[2])

elif len(img1.shape) == 2:

new_shape = (max(img1.shape[0],

img2.shape[0]),

img1.shape[1]+img2.shape[1]+margin)

new_img = np.ones(new_shape, type(img1.flat[0]))*255

# Place original images

new_img[0:img1.shape[0], 0:img1.shape[1]] = img1

new_img[0:img2.shape[0],

img1.shape[1]+margin:img1.shape[1]+img2.shape[1]+margin] = img2

# Draw lines between matches

if color:

c = color

for m in matches:

# Generate random color for RGB/BGR and grayscale images as needed.

if not color:

if len(img1.shape) == 3:

c = np.random.randint(0, 256, 3)

else:

c = np.random.randint(0, 256)

c = (int(c[0]), int(c[1]), int(c[2]))

end1 = tuple(np.round(kp1[m.trainIdx].pt).astype(int))

end2 = tuple(np.round(kp2[m.queryIdx].pt).astype(int)

+ np.array([img1.shape[1]+margin, 0]))

cv2.line(new_img, end1, end2, c, thickness, lineType=cv2.LINE_AA)

cv2.circle(new_img, end1, kp_radius, c, thickness, lineType=cv2.LINE_AA)

cv2.circle(new_img, end2, kp_radius, c, thickness, lineType=cv2.LINE_AA)

return new_img

开发者ID:ethz-asl,项目名称:hierarchical_loc,代码行数:39,

示例22: drawHolesOnImage

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def drawHolesOnImage(holes, color, im, pc, image_scale):

for h in holes:

# Get the shape of this spline and draw it on the image

waypoints = []

for wp in h["waypoints"]:

waypoints.append(pc.tgcToCV2(wp["x"], wp["z"], image_scale))

tees = []

for t in h["teePositions"]:

tees.append(pc.tgcToCV2(t["x"], t["z"], image_scale))

# Going to skip drawing pinPositions due to low resolution

# Uses points and not image pixels, so flip the x and y

waypoints = np.array(waypoints)

waypoints[:,[0, 1]] = waypoints[:,[1, 0]]

tees = np.array(tees)

tees[:,[0, 1]] = tees[:,[1, 0]]

# Draw a line between each waypoint

thickness = 5

for i in range(0, len(waypoints)-1):

first_point = tuple(waypoints[i])

second_point = tuple(waypoints[i+1])

cv2.line(im, first_point, second_point, color, thickness=thickness, lineType=cv2.LINE_AA)

# Draw a line between each tee and the second waypoint

first_waypoint = tuple(waypoints[1])

for tee in tees:

t = tuple(tee)

cv2.line(im, t, first_waypoint, color, thickness=thickness, lineType=cv2.LINE_AA)

开发者ID:chadrockey,项目名称:TGC-Designer-Tools,代码行数:33,

示例23: show_2d

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def show_2d(img, points, c = 'g'):

points = points.reshape(J, 2)

for j in range(J):

cv2.circle(img, (int(points[j, 0]), int(points[j, 1])), 3, c, -1)

for e in edges:

cv2.line(img, (int(points[e[0], 0]), int(points[e[0], 1])),

(int(points[e[1], 0]), int(points[e[1], 1])), c, 2)

开发者ID:Naman-ntc,项目名称:3D-HourGlass-Network,代码行数:9,

示例24: draw_poly_detections

​点赞 5

# 需要导入模块: import cv2 [as 别名]

# 或者: from cv2 import line [as 别名]

def draw_poly_detections(img, detections, class_names, scale, threshold=0.2):

"""

:param img:

:param detections:

:param class_names:

:param scale:

:param cfg:

:param threshold:

:return:

"""

import pdb

import cv2

import random

assert isinstance(class_names, (tuple, list))

img = mmcv.imread(img)

color_white = (255, 255, 255)

for j, name in enumerate(class_names):

color = (random.randint(0, 256), random.randint(0, 256), random.randint(0, 256))

try:

dets = detections[j]

except:

pdb.set_trace()

for det in dets:

bbox = det[:8] * scale

score = det[-1]

if score < threshold:

continue

bbox = list(map(int, bbox))

cv2.circle(img, (bbox[0], bbox[1]), 3, (0, 0, 255), -1)

for i in range(3):

cv2.line(img, (bbox[i * 2], bbox[i * 2 + 1]), (bbox[(i+1) * 2], bbox[(i+1) * 2 + 1]), color=color, thickness=2)

cv2.line(img, (bbox[6], bbox[7]), (bbox[0], bbox[1]), color=color, thickness=2)

cv2.putText(img, '%s %.3f' % (class_names[j], score), (bbox[0], bbox[1] + 10),

color=color_white, fontFace=cv2.FONT_HERSHEY_COMPLEX, fontScale=0.5)

return img

开发者ID:dingjiansw101,项目名称:AerialDetection,代码行数:40,

注:本文中的cv2.line方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值