Master thesis: Real-time image analysis for identification of defects in metal products