1

I am Calculating the camera Megapixel by using the maximum resolution of camera picture is always NOT giving the correct result.

i.e Micromax Bolt A35 device specification shows 2MP(Mega Pixel) but it gives 2592 x 1936 resolution picture. ((2592x1936)/102400)= approximate 5MP.

eg: My Mobile Phone model is Samsung galaxy star pro GT-S7262. and this mobile specification details shows Samsung website/user manual/purchased box having printed only 2MP, but when i am getting max resolution of this mobile is 2048x1536. so it gives approximately 3.072MP by following the below code. so finally i said that below procedure is Not always gives correct result. please help me to find out correct megapixes in android mobile.

private int getCameraMinPixels(Camera.Parameters parameters) { 
        float cameraMegaPixel = 0;
        if(parameters!=null)
        {
            Camera.Size size =parameters.getPictureSize();
            cameraMegaPixel = (float) (size.height * size.width) / 1024000f;
        }
        return (int) cameraMegaPixel;
    }

Please help me to find camera megapixel.

and i use getall supported picture sizes is

private List<Camera.Size> getSortedCameraSupportedPictureSizes(Camera.Parameters parameters)
{
    List<Camera.Size> supportedPreviewSizes = new ArrayList<Camera.Size>(
            parameters.getSupportedPictureSizes());

    Collections.sort(supportedPreviewSizes, new Comparator<Camera.Size>() {
        @Override
        public int compare(Camera.Size a, Camera.Size b) {
            int aPixels = a.height * a.width;
            int bPixels = b.height * b.width;
            if (bPixels < aPixels) {
                return -1;
            }
            if (bPixels > aPixels) {
                return 1;
            }
            return 0;
        }
    });
    return supportedPreviewSizes;
}
  • @ManishDubey, your posted link and above code both are doing same procedure, but the main problem is **it will not always give correct result.** – challa sathish kumar Feb 26 '14 at 05:14
  • I can only ask, *"Is it the correct model?"*, since Micromax A68 Bolt has 5 MP camera. I think it's a hard fact that it's 5 MP given the picture size. I couldn't find any information that A35 has 5 MP camera though. – Andrew T. Feb 26 '14 at 05:33
  • Hi @Andrew T. My Mobile Phone model is Samsung galaxy star pro GT-S7262. and this mobile specification details shows [Samsung website](http://www.samsung.com/in/consumer/mobile-phone/mobile-phone/smartphone/GT-S7262MKAINU-spec?subsubtype=android-mobiles)/user manual/purchased box having printed only 2MP, but when i am getting max resolution of this mobile is 2048x1536. so it gives approximately 3.072MP by following the above link/ above code. so finally i said that above procedure is Not always gives correct result. please help me to find out correct megapixes in android mobile. – challa sathish kumar Feb 26 '14 at 06:02
  • Can you test when taking a picture, is your highest resolution also 2048x1536 (3MP) or 2MP? – Andrew T. Feb 26 '14 at 06:15
  • (2048X1536)/1024000=3.072 in my testing i got max resolution image having 2048X1536 in Samsung GT-S7262 mobile. – challa sathish kumar Feb 26 '14 at 06:17
  • @sathishkumar.challa you return the int value so float convert into int so your value get less as per your consideration. like i have use the Samsung SIII Front camera Max resolution is (1937664/1000000.00) = 1.937664 and print this answer you get 1.9 – V.P. Apr 24 '14 at 07:25
  • @sathishkumar.challa Did you finally manage to get it working? – Shobhit Puri Oct 07 '14 at 16:51

0 Answers0