Development of mathematical morphology and pattern recognition algorithms to characterize solar activity