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
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ from the camera can be used.
- [get\_checkerboard\_pose\_from\_zdf](https://github.com/zivid/zivid-python-samples/tree/master/source/applications/advanced/get_checkerboard_pose_from_zdf.py) - Read point cloud data of a Zivid calibration board from a
ZDF file, estimate the
- [hand\_eye\_calibration](https://github.com/zivid/zivid-python-samples/tree/master/source/applications/advanced/hand_eye_calibration/hand_eye_calibration.py) - Perform Hand-Eye calibration.
- [mask\_point\_cloud](https://github.com/zivid/zivid-python-samples/tree/master/source/applications/advanced/mask_point_cloud.py) - Read point cloud data from a ZDF file, apply a binary
mask, and visualize it.
- [project\_and\_find\_marker](https://github.com/zivid/zivid-python-samples/tree/master/source/applications/advanced/project_and_find_marker.py) - Show a marker using the projector, capture a set of 2D
images to find the marker coordinates (2D and 3D).
- [read\_project\_and\_capture\_image](https://github.com/zivid/zivid-python-samples/tree/master/source/applications/advanced/read_project_and_capture_image.py) - Read a 2D image from file and project it using the camera
Expand Down Expand Up @@ -205,10 +203,10 @@ Note that Open3D is not available for Python 3.13 and later.
-----

1. [Install Zivid
Software](https://support.zivid.com/latest//getting-started/software-installation.html).
Software](https://support.zivid.com/en/latest//camera/getting-started/software-installation.html).

2. [Download Zivid Sample
Data](https://support.zivid.com/latest//api-reference/samples/sample-data.html).
Data](https://support.zivid.com/en/latest//camera/api-reference/samples/sample-data.html).

3. Check out the Zivid Python samples repository:

Expand Down Expand Up @@ -252,9 +250,9 @@ Note that Open3D is not available for Python 3.13 and later.
## Support

For more information about the Zivid cameras, please visit our
[Knowledge Base](https://support.zivid.com/latest). If you run into any
issues please check out
[Troubleshooting](https://support.zivid.com/latest/support/troubleshooting.html).
[Knowledge Base](https://support.zivid.com/en/latest). If you run into
any issues please check out
[Troubleshooting](https://support.zivid.com/en/latest/camera/support/troubleshooting.html).

## License

Expand Down
22 changes: 15 additions & 7 deletions modules/zividsamples/gui/preparation/warmup_gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,16 +292,24 @@ def rate_of_change_data(self) -> NDArray[Shape["N"], Float32]: # type: ignore
return self.df["average_rate_of_change"].to_numpy()

def temperature_is_stable(self) -> bool:
if not self.has_enough_data_to_analyze():
return False

# Ensure minimum warmup time of 1 minute has passed
now = self.df["timestamp"].iloc[-1]
warmup_start_time = self.df["timestamp"].iloc[0]
elapsed_time = now - warmup_start_time
if elapsed_time < timedelta(minutes=1):
return False

one_minute_ago = now - timedelta(minutes=1)
last_minute_of_data = self.df[self.df["timestamp"] >= one_minute_ago]
max_rate_of_change_in_the_last_minute = last_minute_of_data["average_rate_of_change"].max()
if self.has_enough_data_to_analyze():
return (
self.df["average_rate_of_change"].iloc[-1] is not None
and max_rate_of_change_in_the_last_minute <= self.temperature_change_threshold_degrees_per_minute
)
return False
max_rate_of_change_in_the_last_minute = float(last_minute_of_data["average_rate_of_change"].max())

return (
self.df["average_rate_of_change"].iloc[-1] is not None
and max_rate_of_change_in_the_last_minute <= self.temperature_change_threshold_degrees_per_minute
)

def temperature_is_changing_fast(self) -> bool:
return self.df["average_rate_of_change"].iloc[-1] > 2 * self.temperature_change_threshold_degrees_per_minute
Expand Down
4 changes: 2 additions & 2 deletions modules/zividsamples/gui/widgets/live_2d_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def update_exposure_based_on_relative_brightness(self, settings_2d: zivid.Settin
rgba_with_projector = self.capture_function(settings_2d).image_srgb().copy_data()
grayscale_with_projector = self.rgb_to_grayscale(rgba_with_projector)
for acquisition in settings_2d.acquisitions:
acquisition.brightness = 0.0
acquisition.brightness = 0.1
rgba_without_projector = self.capture_function(settings_2d).image_srgb().copy_data()
grayscale_without_projector = self.rgb_to_grayscale(rgba_without_projector)
grayscale_without_projector[grayscale_without_projector == 0] = np.nan
Expand All @@ -82,7 +82,7 @@ def update_exposure_based_on_relative_brightness(self, settings_2d: zivid.Settin
else relative_brightness / (exposure_increase / current_exposure_time)
)
acquisition.gain = max(1.0, min(acquisition.gain * remaining_relative_brightness, 16.0))
acquisition.brightness = 0.0
acquisition.brightness = 0.1
return settings_2d

def update_settings_2d(self, settings_2d: zivid.Settings2D, camera_model: str):
Expand Down
117 changes: 0 additions & 117 deletions source/applications/advanced/mask_point_cloud.py

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def _options() -> argparse.Namespace:
parser.add_argument(
"--full-resolution",
action="store_true",
default=False,
help="Use full resolution for stitching. If not set, downsampling is applied.",
)

Expand All @@ -77,8 +78,8 @@ def _stitch_point_clouds(directory: Path, full_resolution: bool) -> zivid.Unorga
ValueError: If the number of ZDF files and robot pose files do not match.

"""
zdf_files = list(directory.rglob("capture_*.zdf"))
pose_files = list(directory.rglob("robot_pose_*.yaml"))
zdf_files = sorted(list(directory.rglob("capture_*.zdf")))
pose_files = sorted(list(directory.rglob("robot_pose_*.yaml")))

if not zdf_files or not pose_files or not (directory / "hand_eye_transform.yaml").exists():
raise FileNotFoundError("Required files are missing in the directory.")
Expand Down
Loading
Loading