Skip to content

Conversation

@Jason-Y000
Copy link
Collaborator

No description provided.

Copy link
Collaborator

@thedavidchu thedavidchu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jason, just leaving some comments!

import time

img_pth = '/Users/jasonyuan/Desktop/Test9.png'
img_pth = '/Users/jasonyuan/Desktop/Test2.png'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please upload your test images so that we can run it out of the box!

If you know the path relative to the script, but not the cwd, then this may help

y_width = abs(sorted_points_y[-1][0] - sorted_points_y[0][0])

if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe
if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the outer brackets

y_width = abs(sorted_points_y[-1][0] - sorted_points_y[0][0])

if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe
if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need the outer brackets


if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe
if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe
print(y_width)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the print statements?


if (x_width < 15) or (y_width < 15): # Hard-coded parameter, update maybe
if (y_width < 15) or ((x_width < 15) and (y_width < 15)): # Hard-coded parameter, update maybe
print(y_width)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need the print statements?

print(x_width)
return [[],[]]

# print(sorted_points)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

tck,u = interpolate.splprep([x,y],k=3,s=32)
# print(u)
u = np.linspace(u[0]-0.25,u[-1]+0.25,500)
# print(tck)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

tck,u = interpolate.splprep([x,y],k=3,s=32)
# print(u)
u = np.linspace(u[0]-0.25,u[-1]+0.25,500)
# print(tck)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove dead code

import cv2
import numpy as np

def project_2D_to_3D_camera(x_array, y_array, depth_to_y_map, f_x, f_y, o_x, o_y):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if you could add type hints to these, that would be amazing! tbh idk if this is rly necessary if you just call it all in a specific pipeline and don't expect anyone else to use it.

import cv2
import numpy as np

def project_2D_to_3D_camera(x_array, y_array, depth_to_y_map, f_x, f_y, o_x, o_y):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: if you could add type hints to these, that would be amazing! tbh idk if this is rly necessary if you just call it all in a specific pipeline

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants