Skip to content

Commit

Permalink
int types
Browse files Browse the repository at this point in the history
  • Loading branch information
Ishaan-Datta committed Nov 14, 2024
1 parent f69249e commit 0e797a6
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def __init__(self):

self.declare_parameter('camera_side', 'left')
self.declare_parameter('shift_constant', 0)
self.declare_parameter('roi_dimensions', [0, 0, 100, 100])
self.declare_parameter('roi_dimensions', (0, 0, 100, 100))

self.camera_side = self.get_parameter('camera_side').get_parameter_value().string_value
self.shift_constant = self.get_parameter('shift_constant').get_parameter_value().integer_value
Expand Down Expand Up @@ -94,12 +94,10 @@ def publish_zed_frames(self):
def preprocess_image(self, image):
tic = time.perf_counter_ns()
roi_x1, roi_y1, roi_x2, roi_y2 = self.roi_dimensions
shifted_x1 = roi_x1 + abs(self.velocity[0]) * self.shift_constant
shifted_x2 = roi_x2 + abs(self.velocity[0]) * self.shift_constant
shifted_x1 = int(roi_x1 + abs(self.velocity[0]) * self.shift_constant)
shifted_x2 = int(roi_x2 + abs(self.velocity[0]) * self.shift_constant)

# replace with util...

preprocessed_img = image[roi_y1:roi_y2, shifted_x1:shifted_x2, :3]
preprocessed_img = image[int(roi_y1):int(roi_y2), shifted_x1:shifted_x2, :3] # replace w/ util
preprocessed_img = cv2.resize(preprocessed_img, self.model_dimensions) # check if necessary?
preprocessed_img_msg = self.bridge.cv2_to_imgmsg(preprocessed_img, encoding='rgb8')

Expand Down

0 comments on commit 0e797a6

Please sign in to comment.