The ratio of flocs to filaments in activated sludge wastewater treatment plants is of extreme importance for the overall performance of the plant. In order to control this ratio the individual concentrations of flocs and filaments need to be measurable. However, no sensors which can measure these concentrations are currently available. In this paper it is outlined how a distinction can be made between flocs and filaments by means of image analysis techniques. Combination of this information with the total biomass concentration results in the individual floc and filament concentrations. The distinction of objects of interest from the background is a crucial step in the image analysis procedure. An automatic thresholding algorithm is proposed which selects two thresholds in images with one fraction darker than the background and the other fraction brighter than the background. Once the objects are separated from the background, they are classified as either flocs or filaments by means of the reduced radius of gyration.