Skip to content
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

Merged
merged 36 commits into from
Jun 3, 2024

Conversation

braden6521
Copy link
Collaborator

  • 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.

@e10harvey
Copy link
Collaborator

Please rebase on-top of develop.

@braden6521 braden6521 force-pushed the image_proj_screen_markers branch 2 times, most recently from 684b70a to 5174476 Compare May 29, 2024 19:46
Copy link
Collaborator

@bbean23 bbean23 left a 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 = (
Copy link
Collaborator

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)

Copy link
Collaborator Author

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
Copy link
Collaborator

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".

Copy link
Collaborator Author

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.

Copy link
Collaborator

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!

Copy link
Collaborator

@bbean23 bbean23 left a 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
Copy link
Collaborator

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!

@braden6521 braden6521 merged commit 850ad7e into sandialabs:develop Jun 3, 2024
4 checks passed
@braden6521 braden6521 deleted the image_proj_screen_markers branch June 3, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants