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

Text does not scale with resolution #9

Open
matiasandina opened this issue Apr 3, 2024 · 1 comment
Open

Text does not scale with resolution #9

matiasandina opened this issue Apr 3, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@matiasandina
Copy link
Owner

matiasandina commented Apr 3, 2024

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

if self.record_timestamp:
cv2.putText(frame, timestamp.isoformat(timespec='seconds'), (10, 50), cv2.FONT_HERSHEY_SIMPLEX, self.font_size, (255, 255, 255), 1)

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
Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant