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

overlapping role of camera constructor and 'open!' #7

Closed
ehgus opened this issue Feb 9, 2023 · 3 comments
Closed

overlapping role of camera constructor and 'open!' #7

ehgus opened this issue Feb 9, 2023 · 3 comments

Comments

@ehgus
Copy link

ehgus commented Feb 9, 2023

Hi, I faced some problem while distinguishing the role of camera constructor and open! function. For the best of my knowledge, the lifecycle of the camera is as follows:

open camera ---> (some setting such as roi, exposure...) ---> start camera ---> take images ---> stop camera ---> close camera

According to the logic, the initialization and opening camera are coupled so that camera constructor and open! function cannot be decoupled logically to me. Could you give an opinion to handle this issue?

@stemann
Copy link
Owner

stemann commented May 14, 2023

The camera constructor should give you an object (a value) that you can then call open! on, and subsequently configure - the concepts of opening and configuring should be separate (but configuring requires first opening the camera).

@ehgus
Copy link
Author

ehgus commented May 15, 2023

Thank you for your suggestion. Then I can summarize the roles of each step in the following way:

  1. struct initialization: configuration
  2. open camera: connect the camera according to the configuration
  3. start camera: do acquisition / ready for acquisition
  4. stop camera: stop the acquisition
  5. close camera: disconnect the camera

Some configurations must be determined in the initialization.
Other configurations are set to default at the initialization and customized later.

Now it looks clear to me. I will close the issue if you agree with my summary.
Thank you!

@stemann
Copy link
Owner

stemann commented May 15, 2023

I would actually say that construction/struct initialization will yield some level of configuration (e.g. the device ID/address), opening will put the camera in an open state that allows for further configuration, e.g. setting exposure time.

Feel free to close this issue.

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

No branches or pull requests

2 participants