Measure the height and width of an object using the camera

I have an ionic 4 application, and I need to add a functionality that allows the measurement of height and width of an object using the camera, which can you suggest how to do it or what technology to incorporate in my application