1

I want to measure the object height and width using android mobile camera. referred lot many links but still I am not able to get any point from that I can start my development.Can anyone give me/suggest me the right way or any example so that I can get more idea about this requirement.

Thanks in advance.

amsaraj
  • 49
  • 7
  • http://stackoverflow.com/questions/8698889/how-to-measure-height-width-and-distance-of-object-using-camera – Frink Aug 28 '15 at 04:33
  • Hi @Frink Thanks for giving me the link. I tried to understand all those concept given in that stackoverflow. yet i'm unable to get a point. can you help me with some example source code that gives the object size. – amsaraj Aug 28 '15 at 05:27
  • @amsaraj did you found any solution for that? i – Rajakumar Feb 23 '18 at 07:13

1 Answers1

0
 Camera.Parameters params = mCamera.getParameters(); // mCamera is a Camera object
 List<Camera.Size> sizes = params.getSupportedPreviewSizes();

 // position: variable where you choose between different supported resolutions, 
// this varies from phone to phone, even the order can be different, 
// ex. ascending or descending order.

int  mFrameWidth = (int) sizes.get(position).width;
int mFrameHeight = (int) sizes.get(position).height;

//you you need width,height print this mFrameWidth ,mFrameHeight 

 params.setPreviewSize(mFrameWidth, mFrameHeight);
 mCamera.setParameters(params);
sasikumar
  • 12,540
  • 3
  • 28
  • 48