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

Camera pixel positions should always start from 0 #294

Open
iandobbie opened this issue Nov 1, 2023 · 2 comments
Open

Camera pixel positions should always start from 0 #294

iandobbie opened this issue Nov 1, 2023 · 2 comments

Comments

@iandobbie
Copy link
Collaborator

A recent discussion brought up that some cameras start counting pixels at 0,0 (eg ximea cameras) and some start from pixel 1,1 (eg Andor cameras).

I propose we should specify that camera pixel positions eg for ROI definitions, should always start at 0,0. This is expected behavior in Python. If the lower level interface expects counting to start at 1,1 then the hardware specific microscope code should deal with the translation of this to 0,0.

@juliomateoslangerak
Copy link
Contributor

Looking at abc camera code, it seems that the ROI is specified as:

  • left and top values are specified in sensor-pixels
  • width and height is in binned pixels (size of the image data received)

So roi.left + (roi.width * binning.h) =< sensor.width. This logic is implemented as a validation in some cameras. We could move it to abc.

Is this how it is supposed to be? If so:

  • Ximea camera is doing the right thing
  • Andor camera just has correct the indexing of the left and top (1 based)
  • Hamamatsu camera (working on this now) provides width and height in sensor pixels so a correction has to be applied

@juliomateoslangerak
Copy link
Contributor

juliomateoslangerak commented Nov 3, 2023

I pushed some of the changes discussed here to this branch. Can you have a look?
https://github.com/juliomateoslangerak/microscope/tree/add_hahamatsu_roi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants