matiasandina / python_camera

Code for different python camera apps
MIT License
0 stars 0 forks source link

Text does not scale with resolution #9

Open matiasandina opened 6 months ago

matiasandina commented 6 months ago

Both size and location of the timestamp are not scaling as they should

https://github.com/matiasandina/python_camera/blob/c321f4e032e297c214c4a11b2dfcbe0a6d3ce2d5/camera/camera.py#L154-L155

This should change to adjust given the resolution. The size is more problematic than the xy coords. The font scale parameter is double in PutText so it should be able to scale....maybe we should also scale thickness?

There might be something worth trying in this stackoverflow answer

matiasandina commented 6 months ago

It turns out that self.vs.read().shape was not obeying resolution. See this PR. The class constructor totally disregards resolution and will always be set to (640x240). So we could also not get higher resolution and that's why we have to hack it by cv2.resize() later. This repo is old and imutils is also old...So nothing but patching is worth the time for now.

I will leave this open as:

[!IMPORTANT]
ANY NEW INSTALLS SHOULD BE DONE FOR THAT PULL REQUEST

For GLOBAL install (not recommended!!)

sudo pip3 install git+https://github.com/karjanme/imutils.git@master

Inside environment

# conda activate  // source bin activate
(env-name)$ pip3 install git+https://github.com/karjanme/imutils.git@master