utils: raspberrypi: ctt: Fix pycodestyle E128
E128 continuation line under-indented for visual indent Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
This commit is contained in:
parent
965cae72a7
commit
23f9f46c8a
2 changed files with 10 additions and 12 deletions
|
@ -363,9 +363,8 @@ def get_macbeth_chart(img, ref_data):
|
||||||
"""
|
"""
|
||||||
find Contours in image
|
find Contours in image
|
||||||
"""
|
"""
|
||||||
conts, _ = cv2.findContours(edges,
|
conts, _ = cv2.findContours(edges, cv2.RETR_TREE,
|
||||||
cv2.RETR_TREE,
|
cv2.CHAIN_APPROX_NONE)
|
||||||
cv2.CHAIN_APPROX_NONE)
|
|
||||||
if len(conts) == 0:
|
if len(conts) == 0:
|
||||||
raise MacbethError(
|
raise MacbethError(
|
||||||
'\nWARNING: No macbeth chart found!'
|
'\nWARNING: No macbeth chart found!'
|
||||||
|
@ -381,8 +380,7 @@ def get_macbeth_chart(img, ref_data):
|
||||||
conts_per = []
|
conts_per = []
|
||||||
for i in range(len(conts)):
|
for i in range(len(conts)):
|
||||||
per = cv2.arcLength(conts[i], True)
|
per = cv2.arcLength(conts[i], True)
|
||||||
poly = cv2.approxPolyDP(conts[i],
|
poly = cv2.approxPolyDP(conts[i], epsilon*per, True)
|
||||||
epsilon*per, True)
|
|
||||||
if len(poly) == 4 and cv2.isContourConvex(poly):
|
if len(poly) == 4 and cv2.isContourConvex(poly):
|
||||||
conts_per.append((poly, per))
|
conts_per.append((poly, per))
|
||||||
|
|
||||||
|
|
|
@ -29,11 +29,11 @@ def get_square_verts(c_err=0.05, scale=scale):
|
||||||
|
|
||||||
square_verts = []
|
square_verts = []
|
||||||
square_0 = np.array(((0, 0), (0, side),
|
square_0 = np.array(((0, 0), (0, side),
|
||||||
(side, side), (side, 0)), np.float32)
|
(side, side), (side, 0)), np.float32)
|
||||||
offset_0 = np.array((b_bord_x, b_bord_y), np.float32)
|
offset_0 = np.array((b_bord_x, b_bord_y), np.float32)
|
||||||
c_off = side * c_err
|
c_off = side * c_err
|
||||||
offset_cont = np.array(((c_off, c_off), (c_off, -c_off),
|
offset_cont = np.array(((c_off, c_off), (c_off, -c_off),
|
||||||
(-c_off, -c_off), (-c_off, c_off)), np.float32)
|
(-c_off, -c_off), (-c_off, c_off)), np.float32)
|
||||||
square_0 += offset_0
|
square_0 += offset_0
|
||||||
square_0 += offset_cont
|
square_0 += offset_cont
|
||||||
"""
|
"""
|
||||||
|
@ -41,16 +41,16 @@ def get_square_verts(c_err=0.05, scale=scale):
|
||||||
"""
|
"""
|
||||||
for i in range(6):
|
for i in range(6):
|
||||||
shift_i = np.array(((i*side, 0), (i*side, 0),
|
shift_i = np.array(((i*side, 0), (i*side, 0),
|
||||||
(i*side, 0), (i*side, 0)), np.float32)
|
(i*side, 0), (i*side, 0)), np.float32)
|
||||||
shift_bord =np.array(((i*s_bord, 0), (i*s_bord, 0),
|
shift_bord =np.array(((i*s_bord, 0), (i*s_bord, 0),
|
||||||
(i*s_bord, 0), (i*s_bord, 0)), np.float32)
|
(i*s_bord, 0), (i*s_bord, 0)), np.float32)
|
||||||
square_i = square_0 + shift_i + shift_bord
|
square_i = square_0 + shift_i + shift_bord
|
||||||
for j in range(4):
|
for j in range(4):
|
||||||
shift_j = np.array(((0, j*side), (0, j*side),
|
shift_j = np.array(((0, j*side), (0, j*side),
|
||||||
(0, j*side), (0, j*side)), np.float32)
|
(0, j*side), (0, j*side)), np.float32)
|
||||||
shift_bord = np.array(((0, j*s_bord),
|
shift_bord = np.array(((0, j*s_bord),
|
||||||
(0, j*s_bord), (0, j*s_bord),
|
(0, j*s_bord), (0, j*s_bord),
|
||||||
(0, j*s_bord)), np.float32)
|
(0, j*s_bord)), np.float32)
|
||||||
square_j = square_i + shift_j + shift_bord
|
square_j = square_i + shift_j + shift_bord
|
||||||
square_verts.append(square_j)
|
square_verts.append(square_j)
|
||||||
# print('square_verts')
|
# print('square_verts')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue