Search code examples
androidopencvimage-processingopengl-es

How to detect a room,s floor from an image in android


i am developing an android application and in this application i need to take the photo of a room and to get the size of this room in length and width.I also need to detect the floor of that room.I do not know where to start so provide me some guidance.


Solution

  • You cannot get the dimensions unless you have a reference measurement. For example, you can take the picture of a 30cm scale from a distance of 30cm and calculate the dimensions in terms of number of pixels. Now take the image of the room with the same 30cm scale placed somewhere (preferably, on the farthest wall). Make sure that the resolution of this image is same as that of the reference image. Now, take the number of pixels occupied by the 30cm scale in the reference picture and compare it with the number of pixels occupied by the same scale in the current picture. That will give you the scaling factor, which you can use to calculate the distance of the camera from the wall. Now, put some more formulae and you can easily get the dimensions of the whole wall.