Normalizes an image
img_out = normalize(img, alpha, beta, normType)
normalize
normalizes an image or a histogram, so that the image or histogram has a specified norm or range.
There are two modes of normalization, depending on normType argument:
NORM_1
, NORM_2
or NORM_INF
, the norm (1, 2, inf) of the image is normalized to alpha.NORM_MINMAX
the range of the pixel values are normalized to minimal value alpha and maximal value beta.scicv_Init(); img = imread(getSampleImage("puffins.png")); img_template = imread(getSampleImage("puffin_pattern.png")); img_result = matchTemplate(img, img_template, CV_TM_SQDIFF_NORMED); gcf().color_map = graycolormap(255); colorbar(0, 255); // Normalize the match template result img_out = normalize(img_result, 0, 255, NORM_MINMAX); matplot(img_out); delete_Mat(img); delete_Mat(img_template); delete_Mat(img_result); | ![]() | ![]() |