Skip to content

Commit

Permalink
Changed max distance threshold
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahrivera21 committed Jun 3, 2024
1 parent 4e1323f commit 923fae3
Showing 1 changed file with 6 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ def __init__(self, display=True):
init_params.depth_minimum_distance = 1
init_params.depth_mode = sl.DEPTH_MODE.PERFORMANCE
init_params.depth_stabilization = 500


init_params.depth_maximum_distance = 10
init_params.depth_maximum_distance = 2000

status = self.cam.open(init_params)
if status != sl.ERROR_CODE.SUCCESS:
Expand All @@ -45,9 +44,6 @@ def __init__(self, display=True):
# self.runtime.enable_fill_mode

def init_model(self):
image_size = (
self.cam.get_camera_information().camera_configuration.resolution
)

self.image_left_tmp = sl.Mat(
self.cam.get_camera_information().camera_configuration.resolution.width,
Expand Down Expand Up @@ -127,12 +123,12 @@ def distance_to_objects(self, box):
err, centers[i] = self.point_cloud.get_value(
round(center_x), round(box[1] + i * stepy)
)
# centers = np.nan_to_num(centers,nan=0,posinf=0,neginf=0)
# np.where(centers < 0, centers, np.inf).argmax()
# centers = np.nan_to_num(centers,nan=0,posinf=0,neginf=0)
# np.where(centers < 0, centers, np.inf).argmax()

x_p = np.nanmean(centers[5,0])
y_p = np.nanmean(centers[5,1])
z_p = np.nanmean(centers[5,2])
x_p = np.nanmean(centers[5, 0])
y_p = np.nanmean(centers[5, 1])
z_p = np.nanmean(centers[5, 2])

# x_p = np.nan_to_num(x_p,nan=-1,posinf=-1,neginf=-1)
# y_p = np.nan_to_num(y_p,nan=-1,posinf=-1,neginf=-1)
Expand Down Expand Up @@ -181,7 +177,6 @@ def objectDetection(self):
image_net = self.image_left_tmp.get_data()
self.img = cv2.cvtColor(image_net, cv2.COLOR_RGBA2RGB)
self.ocr(self.img)
cvPoint = self.point_cloud.get_data()

# # Crops the current image to view 1/3 of the frame
# center = self.img.shape
Expand Down

0 comments on commit 923fae3

Please sign in to comment.