soyersoyer / cameractrls

Camera controls for Linux
Other
590 stars 24 forks source link

[Feature Request] Pixel rotation #22

Closed vanarebane closed 1 year ago

vanarebane commented 1 year ago

Hi,

I have a tiny USB type-c thermal camera, with no wire, sits on the usb slot and unfortunately the camera preview is on a 90° angle from the screen.

Would it be possible to add option/feature to rotate the preview by 0°, 90°, 180° and 270° ? And while at it, also mirror the preview horizontal and vertical?

Thanks! Great app!

soyersoyer commented 1 year ago

Hi, Good to hear, that this works with a thermal camera as well. I've added option to rotate or mirror the preview image. In the preview app you can rotate by pressing the r key, or mirror with the m key. Or you can also set these with the cli, in case if you want to make a runner for them. It will be available in the next version. Or immediately if you clone the repo. What pixel formats does your camera support? Which one works?

soyersoyer commented 1 year ago

In v0.5.2 I also added colormaps, if your camera uses GRAY format. Feel free to reopen this, if you have more questions.

vanarebane commented 1 year ago

Hi, sorry for long wait for reply. It was a long vacation. Thanks for implementing the changes. I updated my app to version 5.6. Your app gives only YUYV pixel format option for the thermal camera. There is not GRAY format. Rotation works, but it seems to be not resizing the preview window. So if the video is rotated to portrait and the video is bigger than the preview screen (top and bottom is cut off and left and right sides are black) and the video appears to be square.

I'm not sure if I know how to clone the repo, to test out new features faster. On Steam Deck it's a bit limited.

I made some hasty pictures of the Steam Deck using a thermal camera. I can try later to get better pictures if you like to use some to show off your app. https://1drv.ms/f/s!ApRLRqw9UoyuutUkTrQ9hbqpJRFiJA?e=86ae9f

soyersoyer commented 1 year ago

Looks hot! :) Infiray P2 pro is your camera? Is there a virtual keyboard or how to change the rotation in steam deck? The rotation bug was fixed in v0.5.7. Going to flathub soon. I'll figure out how to add some color to the YUYV thermal stream also.

vanarebane commented 1 year ago

Yes, Infiray P2 pro camera! I use the Steam Decks own virtual keyboard yes.

soyersoyer commented 1 year ago

Use 'c' button to change the colormap to better show the hot fields. In the future I will add a minimal GUI for the preview.