implemented feature extraction for each patch