A novel optical monitoring device was used for imaging an activated sludge process in situ during a period of over one year. In this study, the dependencies between the results of image analysis and the process measurements were studied, and the optical monitoring results were utilized to predict the important quality parameters for the wastewater treatment process efficiency: suspended solids, biological oxygen demand, chemical oxygen demand, total nitrogen and total phosphorous in biologically treated wastewater. The optimal subsets of variables for each model were searched using five variable selection methods. It was shown that online optical analysis results have clear dependencies on some process variables and the purification result. The model based on optical monitoring and process variables from the early stage of the treatment process can be used to predict the levels of important quality parameters, and to show the quality of the biologically treated wastewater hours in advance. This study confirms that the optical monitoring method is a valuable tool for monitoring a wastewater treatment process and receiving new information in real time. Combined with predictive modelling, it has the potential to be used in process control, keeping the process in a stable operating condition and avoiding environmental risks.