After getting the video live feed of the storm glass from the webcam, the pixel value from the feed (RGB vectors) is analysed to generate a mean grayscale value (this data is closest to the relative opacity of the content inside the storm glass).
The mean values of RGB planes are added together, the value is used to decide which set of pre-recorded clips to play, higher values play clips about severe weather condition.
For values below 176, the videos for LIGHT will be used
For values between 176-250, the videos for HAZE will be used
For values between 256-325, the videos for RAIN will be used
For values above 326, the videos for WIND will be used