-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image projection with screen markers #108
Image projection with screen markers #108
Conversation
braden6521
commented
May 29, 2024
- Added an Aruco marker screen calibration image function to ImageProjection. This is used for Sofast calibrations where an LCD screen is used (not a projector).
- Added buttons to GUIs and updated unit tests where necessary.
- Transitioned the "display_data" dictionary within ImageProjection to be a data class. This makes development easier and improves the saving/loading of data.
- Updated all places that touched ImageProjection to use this new data structure.
Please rebase on-top of develop. |
684b70a
to
5174476
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change makes everything so much better! Thank you!
Please add some comments as per my suggestion, and then I'll approve.
@@ -206,7 +204,9 @@ def _create_mask_images_to_display(self) -> None: | |||
array = np.array(image_projection.get_black_array_active_area()) | |||
self._mask_images_to_display.append(array) | |||
# Create white image | |||
array = np.array(image_projection.get_black_array_active_area()) + image_projection.max_int | |||
array = ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh black, you make things so much easier to read.
FYI, what I've done in these situations is to split out the line into several smaller calls by using variables. For example:
black_image = np.array(image_projection.get_black_array_active_area())
white_image = np.array(black_image + image_projection.display_data.projector_max_int)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice comment!
class ImageProjectionData(hdf5_tools.HDF5_IO_Abstract): | ||
"""Dataclass containting ImageProjection parameters. All position/size units are screen pixels""" | ||
|
||
name: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind including descriptions of each of these parameters? For example:
name: str
""" Experiment name associated with these image projection configuration parameters. """
main_window_size_x: int
"""
Width of the display GUI (pixels). This will typically be the same as
active_area_size_x, but could be different in the case that the window isn't
full screen.
"""
As you can probably tell, this will be really helpful for when someone such as myself tries to understand the difference between "main_window_size" and "active_area_size".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this definitely needed some doc strings! Thanks for pointing this out. I added some docs, let me know what you think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These docs are great. Thank you!
3ab9067
to
ded3a3c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome stuff, as always. Approved!
class ImageProjectionData(hdf5_tools.HDF5_IO_Abstract): | ||
"""Dataclass containting ImageProjection parameters. All position/size units are screen pixels""" | ||
|
||
name: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These docs are great. Thank you!