summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/focus.hpp
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2021-06-08 12:03:33 +0100
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-06-08 23:56:15 +0300
commitcaa753179c039a0ecbfef595c3179aac4bf044d5 (patch)
tree8e20435d6aa6cfe597ccdbaf859f50192eec095d /src/ipa/raspberrypi/controller/rpi/focus.hpp
parent5055ca747c4c0d635ed8f2ab272f493748c2f50a (diff)
ipa: raspberrypi: Switch ipa and cam_helper to use utils::Duration
Switch the ipa and cam_helper code to use libcamera::utils::Duration for all time based variables. This improves code readability and avoids possible errors when converting between time bases. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/focus.hpp')
0 files changed, 0 insertions, 0 deletions
/span>*b_bord_y c1 = (0, 0) c2 = (0, y_max) c3 = (x_max, y_max) c4 = (x_max, 0) mac_norm = np.array((c1, c2, c3, c4), np.float32) mac_norm = np.array([mac_norm]) square_verts = [] square_0 = np.array(((0, 0), (0, side), (side, side), (side, 0)), np.float32) offset_0 = np.array((b_bord_x, b_bord_y), np.float32) c_off = side * c_err offset_cont = np.array(((c_off, c_off), (c_off, -c_off), (-c_off, -c_off), (-c_off, c_off)), np.float32) square_0 += offset_0 square_0 += offset_cont """ define macbeth square corners """ for i in range(6): shift_i = np.array(((i*side, 0), (i*side, 0), (i*side, 0), (i*side, 0)), np.float32) shift_bord = np.array(((i*s_bord, 0), (i*s_bord, 0), (i*s_bord, 0), (i*s_bord, 0)), np.float32) square_i = square_0 + shift_i + shift_bord for j in range(4): shift_j = np.array(((0, j*side), (0, j*side), (0, j*side), (0, j*side)), np.float32) shift_bord = np.array(((0, j*s_bord), (0, j*s_bord), (0, j*s_bord), (0, j*s_bord)), np.float32) square_j = square_i + shift_j + shift_bord square_verts.append(square_j) # print('square_verts') # print(square_verts) return np.array(square_verts, np.float32), mac_norm def get_square_centres(c_err=0.05, scale=scale): """ define macbeth square centres """ verts, mac_norm = get_square_verts(c_err, scale=scale) centres = np.mean(verts, axis=1) # print('centres') # print(centres) return np.array(centres, np.float32)