So, why do we use JavaScript? We have already addressed this in the preface. Now, you can probably answer it by yourself.
When it comes to practical Computer Vision, many people mention the OpenCV library (http://opencv.org). Yes, it does provide the outstanding functionality for people who do not know much about Computer Vision. Unfortunately, it is written in C++ and does not provide an interface for JavaScript. And if it does, a user needs to install the OpenCV package on their computer, which is not good for the end user, as they would want to use your websites without installing anything.
If you just install the backend library on your side and do the whole computation on your servers, then you will need a ton of clusters to support your website. Even a small portion of Computer Vision algorithms can slow down computer performance significantly. This is probably why you will prefer to use the client-side scripting.
It is now time for JavaScript to show...