Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Determining Camera Resolution (i.e. Megapixels) Programmatically in Android

Tags:

I am developing an Android application in 2.2, which uses Camera. Now Can anyone tell me that "Is it possible to programmatically determine the Camera Resolution in Megapixels in Android"

like image 760
YuDroid Avatar asked Aug 05 '11 06:08

YuDroid


People also ask

How do I check the megapixels on my Android phone?

Checking megapixel count on an Android phone Just open the camera app, click the settings icon (the small cog) and you should find the megapixel information listed under the heading "Photo size".

How is MP of camera calculated?

You need to multiply the width by the height and then divide by 1,000,000. For instance, if you wanted to calculate the megapixels in a 1920x1080 screen, you would multiply 1920 by 1080 to get 2,073,600. When you divide that by 1,000,000, you get 2.07 megapixels.

How do you measure camera resolution?

Measuring the Resolution Resolution can be identified by the measurement of pixels in dimensions of height and width. For example, a camera manufacturer can describe the resolution of the camera as 3904×2598 (W x H) pixels, which again can be termed as 3904×2598=10,142,592 pixels.

How many megapixels is 1920x1080 pixels?

Image sizes There are two main resolutions for the HD specification, 720p (1280×720, just less than 1-megapixel) and 1080p (1920×1080, 2.1-megapixel).


2 Answers

if you've got the camera object, try:

android.hardware.Camera.Parameters parameters = camera.getParameters(); android.hardware.Camera.Size size = parameters.getPictureSize();   int height = size.height; int width = size.width; 
like image 88
wAroXxX Avatar answered Sep 23 '22 02:09

wAroXxX


What does image resolution mean?

Resolution refers to the number of pixels in an image. Resolution is sometimes identified by the width and height of the image as well as the total number of pixels in the image. For example, an image that is 2048 pixels wide and 1536 pixels high (2048X1536) contains (multiply) 3,145,728 pixels (or 3.1 Megapixels). You could call it a 2048X1536 or a 3.1 Megapixel image. As the megapixels in the pickup device in your camera increase so does the possible maximum size image you can produce. This means that a 5 megapixel camera is capable of capturing a larger image than a 3 megapixel camera.

Example: 1936 x 1552 / 1024000 = 3 Mega Pixels

like image 25
Heather McVay Avatar answered Sep 25 '22 02:09

Heather McVay