Giter Club home page Giter Club logo

Comments (3)

meekys avatar meekys commented on August 26, 2024

Currently there's no configuration for this, but if you edit the x/y values in screenQuad and overlayQuad in cam_overlay.c you should be able to adjust the position on screen.

https://github.com/meekys/cam_overlay/blob/master/cam_overlay.c#L264

Values are x, y, z, u, v for each line and the x/y values range from -1.0 for far left/top to 1.0 for far right/bottom

ie. This should display an image half the size in the middle of the screen
static GLfloat screenQuad[4][5] = { // x, y, z, u, v
{-0.5f, 0.5f, 0.0f, 0.0f, 0.0f}, // Top left
{-0.5f, -0.5f, 0.0f, 0.0f, 1.0f}, // Bottom left
{ 0.5f, 0.5f, 0.0f, 1.0f, 0.0f}, // Top right
{ 0.5f, -0.5f, 0.0f, 1.0f, 1.0f} // Bottom right
};

After these changes you will need to re-run make

from cam_overlay.

maskaz avatar maskaz commented on August 26, 2024

Thanks I had tried this before and by change resolution of input but problem is somewhere else.
Picture looks like stretched to 4:3 format and bottom part is cutted from picture.
Ratio change in the code did not help too.

from cam_overlay.

meekys avatar meekys commented on August 26, 2024

What resolutions are shown on startup for the cam/display?

Dimensions: 720 x 480 Pixel Format: YUYV
Opened screen 0 @ 1920 x 1200

What resolutions are available?
v4l2-ctl --list-formats-ext

Does capturing an image using fswebcam or any other v4l2 capable software you've got installed also crop the image?
fswebcam --no-banner -S 100 image.jpg

You might also be able to fiddle with this line to adjust the display ratio, but it sounds like you've already tried this? By default it should stretch the image to the screen dimensions. If you set this to 1, it should appear as a square image.
https://github.com/meekys/cam_overlay/blob/master/cam_overlay.c#L290

from cam_overlay.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.