Realtime Object’s Size Measurement from Distance using OpenCV and LiDAR

In this paper, we are proposing a method to estimating the object’s size from distance using computer vision and LiDAR Sensor. The paper contains steps to gain the solution, training dataset with formulas, and its limitations. Proposed methods are to be implemented in robotics engineering, self-driving drone, car, and many more. This proposed algorithm aims to measure the size of an object from distance using the LiDAR sensor, Camera, and OpenCV Algorithm. This paper also includes a brief introduction of OpenCV, LiDAR Sensor, Realtime Object Detection methods. KeywordsLiDAR Sensor, OpenCV, Object Detection, Height and Width of Object from Distance, Realtime Object Measurement, Size of Object, Limitations, Algorithm.


I. INTRODUCTION
Many of the researchers have done tremendous efforts to increase the performance of students using various machine learning techniques like Object Detection, Face Recognition, and courses. By using this technique researchers can detect and measure the objects literature review using machine learning techniques and also improves the performance of an algorithm.
Nowadays autonomous technology has gained so much popularity as robots are heavily dependent upon various sensors and cameras. It requires too much automation to run robots. And there is a challenge to measure an object's position, height, and width. We figured out how to measure the distance of an object using the LiDAR sensor and its height and width using OpenCV.
This research paper is divided into various sections: First is the Introductory part of Realtime Object Detection and its terms. The second section describes the methods of real-time object detection. The third section is the implementation of algorithms using machine learning concepts. The last section describes the limitations and the conclusion of the research.

II. Literature Review
Currently, much of the research has been done related to this topic and published their work related to this concept.
Joseph Redmon et. al. have introduced the YOLO algorithm which detects the Real-time object and also uses CNNbased image processing. Its algorithm is very fast and easy to implements based on various parameters. [1] M. Naveen Kumar et. al. has presented the interface of OpenCV which is based on Python, Java, and MATLAB. This research is based on a CUDA-based GPU Interface. Currently, OpenCV is working on Windows, Android, etc. Now this research introduces OpenCV Robotic techniques. [2] Santiago Royo et. al. has introduced LiDAR Imaging System which is working on 2D and 3D Environment, this research has described the various configurations of LiDAR systems available for autonomous vehicles. The main strategy of this to evolve various imaging techniques, scanners, and detector arrays. [3] Zaarane Abdelmoghit et. al. has to work on various methods of Realtime Object detection. They utilized the method which is based on the stereo camera. This method measures the distance of an object and detects it. [4] III. Realtime Object Detection The real-Time Object Detection method detects movable, immovable, living, non-living things in the known and unknown environment when an object is presented in the real scenario. An Object can be anything like a cat, person, elephant, cell phone, Golden fish, watch, books, etc.
Real-time Object Detection systems are trained to detect an object as fast as the human eye and brain can detect. In the Real-time object Detection system eye is a camera whereas the brain is the pre-trained model. Some of the wellknown and widely used pre-trained models are YOLOv3 [1], Tiny YOLO, COCO SSD MobileNet v1, etc. And the one who helps to detect an object is OpenCV [2].

OpenCV
OpenCV is an open-source library for Computer vision and Machine Learning algorithms [2]. It detects objects using Haar Cascades (for face, eye, mouth, leg, person, etc.). Its library contains image processing methods, Motion detection, edge detection, and gaussian algorithm, etc.

LiDAR
LiDAR stands for Light Detection and Ranging sensor; It is used to measure the distance between sensor and object. Its fundamental principle is to measure the depth of time taken by the receiver to catch the light emitted by the transmitter. There are mainly three use cases of LiDAR sensor Airborne, Terrestrial, and Mobile Application. [3]

IV. Real Time Object Detection Methods
Object Detection is the concept of computer vision. For static camera view, Object Detection is easier as we just need to subtract the background, but not in the case of Real-Time Object Detection as the object and camera are moving. Here are some methods to Detect Object in Real-Time.
There are mainly two types of Object Detection Methods. One with Machine Learning and another one is with deep learning. In this, the Selection of the method is based upon how much accuracy and speed are required.
Here is the list of some methods to estimate an object's size: 1. Using 2 cameras, we can measure the object's size with the help of the object's angel of both cameras. [4] 2. We can measure object size when we know one object's size in the same picture. 3. When we know the object's shape and camera is calibrated.

Algorithm to Detect and Measure Object's Size
Following are the steps to find the solution: 1. First, we need to fix the camera and sensor in the same position. 2. Click the photos and record the respective object's height, width, and distance between object and camera. 3. For prediction, we need to use a simple linear regression algorithm of Machine learning, which will prepare the dataset by performing step 2 for 30 to 40 times. 4. Record data in CSV format and find out per pixel centimeter by following steps: Convert the whole image into centimeter as we know the object's height and width in cm: • independent variable's value(x) is the distance in centimeter and the dependent variable's value is the object's height in per pixel centimeter. b. For width: • independent variable's value(x) is the distance in centimeter and the dependent variable's value is the object's width in per pixel centimeter. 7. Dataset will look like this:  8. Validate the model to measure the accuracy and then implement it. 9. In real-time camera and object's distance will be provided by the LiDAR sensor. 10. OpenCV's object detection algorithm will provide the height and width of an object in pixel.