Skip to content

Commit

Permalink
Samples: Fix transform_point_cloud_via_checkerboard.py
Browse files Browse the repository at this point in the history
Correctly index the projected points from the returned tuple of
`cv2.projectPoints()`.

Also removes temporary installation steps for SDK 2.13, as newest
version is uploaded to PyPI.
  • Loading branch information
csu-bot-zivid authored and andersfagerli committed Sep 3, 2024
1 parent 2c59c56 commit bd412eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
3 changes: 0 additions & 3 deletions continuous-integration/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ apt-yes dist-upgrade || exit

apt-yes install \
python3-pip \
cmake \
wget ||
exit $?

Expand All @@ -32,8 +31,6 @@ function install_www_deb {
install_www_deb "https://downloads.zivid.com/sdk/releases/2.13.1+18e79e79-1/u${VERSION_ID:0:2}/zivid_2.13.1+18e79e79-1_amd64.deb" || exit

python3 -m pip install --upgrade pip || exit
python3 -m pip install conan || exit
python3 -m pip install --requirement "$ROOT_DIR/requirements.txt" || exit
python3 -m pip install https://github.com/zivid/zivid-python/releases/download/v2.13.1.2.13.1/zivid-2.13.1.2.13.1.tar.gz || exit

echo Success! ["$(basename $0)"]
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ open3d
opencv-python
pyyaml
robodk
scipy
scipy
zivid
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,9 @@ def _get_coordinate_system_points(
z_axis_direction = _move_point(origin_position, np.array([0.0, 0.0, size_of_axis]), checkerboard_pose)

points_to_project = np.array([origin_position, x_axis_direction, y_axis_direction, z_axis_direction])
projected_points = cv2.projectPoints(points_to_project, np.zeros(3), np.zeros(3), cv_camera_matrix, cv_dist_coeffs)
projected_points = cv2.projectPoints(points_to_project, np.zeros(3), np.zeros(3), cv_camera_matrix, cv_dist_coeffs)[
0
]

projected_points = projected_points.reshape(-1, 2)
return {
Expand Down

0 comments on commit bd412eb

Please sign in to comment.