maodun1978sohu / jpegcam

Automatically exported from code.google.com/p/jpegcam
GNU Lesser General Public License v3.0
0 stars 0 forks source link

making images with max resolution #62

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
i want to make images in the maximum resolution of the cam. If you create the 
cam:
  camera.setMode( Math.max(video_width, server_width), Math.max(video_height, server_height), 30);

and you set a very hight resolution you may only "zoom"/upscale the image... 
this my not makes very sense (and is bad for CPU): may you can do something 
like this:
my cam e.g. suports (1920 x 1200) (1920 x 1080) (1920 x 1440) 

  maxWidth=1024*10; //- set a resolution that is much to heigh!
  //- check 4:3 aspect ratio
  camera.setMode(maxWidth,maxWidth*3/4);
  pixel1 = (Camera.width*Camera.height);

  //- check 16:9 aspect ratio
  camera.setMode(maxWidth,maxWidth*9/16);
  pixel2 = (Camera.width*Camera.height);

  //- check 16:10 aspect ratio
  camera.setMode(maxWidth,maxWidth*10/16);
  pixel3 = (Camera.width*Camera.height);
now use the max of pixel1, pixel2 or pixel3 to set the resolution 

and prevent upscaling by:
  server_width=min(server_width,Camera.width);
  server_height=min(server_height,Camera.height);

Why I need this ;-)
=> i'm bulding a company webapp that have to make pictures of A4-Letters ( 
bills ) to archive them on a server.

Regards Thomas

Original issue reported on code.google.com by hallo123...@gmail.com on 2 Feb 2013 at 2:27