Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -162,3 +162,8 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Vim stuff
*.swp
*.swn
*.swo
13 changes: 13 additions & 0 deletions send_d405_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ def autoAdjustments_with_convertScaleAbs(img):
return new_img
###########################


def adjust_gamma(image, gamma=1.0):
# build a lookup table mapping the pixel values [0, 255] to
# their adjusted gamma values
# NOTE: this code is from perplexity
invGamma = 1.0 / gamma
table = np.array([((i / 255.0) ** invGamma) * 255 for i in np.arange(0, 256)]).astype("uint8")

# apply gamma correction using the lookup table
return cv2.LUT(image, table)


def main(use_remote_computer, exposure):
try:
Expand Down Expand Up @@ -95,6 +106,8 @@ def main(use_remote_computer, exposure):
depth_image = np.asanyarray(depth_frame.get_data())
color_image = np.asanyarray(color_frame.get_data())

color_image = adjust_gamma(color_image, 2)

brighten_image = False
if brighten_image:
color_image = autoAdjustments_with_convertScaleAbs(color_image)
Expand Down
6 changes: 4 additions & 2 deletions yolo_networking.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@

# Set these values for your network
robot_ip = 'stretch-se3-####'
remote_computer_ip = 'MACHINE_NAME_HERE'
#robot_ip = 'stretch-se3-####'
#remote_computer_ip = 'MACHINE_NAME_HERE'
robot_ip = '192.168.1.15'
remote_computer_ip = '192.168.1.10'

# Set these to your preferred port numbers
# hello d405 => 4ello d405 => 4405
Expand Down