The way to generate 3D Point Cloud from webcam or 2D image

Dear WebGL developer with THREE.js
I am making solution for AR
Is it possible to generate point cloud from webcam or 2D image in three.js?
Here is a similar contents: https://stackoverflow.com/questions/39059352/camera-properties-from-blender-to-generate-point-cloud
On stackoverflow questions, the images seems to get 3D point cloud from 2D data.
Using three.js, could we implement it?

There is no algorithm in three.js that could help you in doing this task. Meaning you have to developing a solution from scratch.

heres what i have so far.
needs completing. cant clear the points rendered from previous frames

`VideoA2.html (7.3 KB)