I am making a bit of progress on the field dissection microscope. Based on the best way to run the ribbon cable the image on the screen is 180 degree rotated from the object in reality. Which seeing as you are moving it by hand, it is pretty confusing.
Is there a way to adjust this setting in the UI (I really need to upgrade) or if not is there a way I can modify the settings by hand?
ping @r.w.bowman?
2 Likes
I donât think there is a setting in our software, but Iâm pretty sure you can tell the camera to flip the image when you set it up. If you edit the PiCameraStreamer class, thatâs where the PiCamera object gets initialised, so that would bodge it in for now. If youâre using raspistill/raspivid and friends, I think thereâs a command line flag to flip the image.
I I do the streamer class will that also do the live preview on the microscope itself? Focussing by hand it is important to have the live preview
Iâm fairly sure PiCamera.hflip and .vflip apply to both the stream and the live preview - flipping happens quite early in the cameraâs ISP. Iâm assuming here that youâre using the current release, i.e. picamera v1 (though I suspect picamera2 has similar behaviour).
1 Like
I fully second that! :- ) So I beg your pardon to revive such an old thread.
In Raspberryâs âCoding projects for kids and teensâ (sic!) I found in Getting started with the Camera Module that it âonlyâ takes one python command to rotate the stream:
camera = PiCamera()
camera.rotation = 180
But looking at the serverâs python code in openflexure_microscope/camera/pi.py I couldnât locate a section where I could patch in this rotation snippet. Obviously it isnât that simple as I thought.
Unfortunately my python knowledge is by far too limited to be able to do such a task myselfâŚ
Line 80 of openflexure_microscope/camera/pi.py
Is where we get the PiCamera object.
You could see what happens if you add
self.picamera.rotation = 180
on line 81. Its pretty hacky, but may get yours working. If it does it should be a possible to add a config option for it at a later date.
3 Likes
That does the trick! - THANKS!
No more confusion :- ))
3 Likes