microscope-cockpit / cockpit

Cockpit is a microscope graphical user interface. It is a flexible and easy to extend platform aimed at life scientists using bespoke microscopes.
https://microscope-cockpit.org
GNU General Public License v3.0
35 stars 26 forks source link

Interactive ROI setting fails if image is scaled. #871

Closed iandobbie closed 1 year ago

iandobbie commented 1 year ago

The picam returns an image that is 2592x1944 and it is downscaled to display in the camera view window. The interactive ROI setting in this situation doesn't work properly, presumably because it is not taking account of the image scaling in the display.

iandobbie commented 1 year ago

Could quite see where my logic was wrong but there was duplicated code in the shift for square region which worked so I just tidied it up so it used this code for all cases and this works now.