quantize.m

来自「车牌识别的matlab程序。十分新颖的程序。有兴趣可以」· M 代码 · 共 20 行

M
20
字号
function [grayImage, quantImage, bw] = quantizeImage(rgbImage);
% quantizeImage: Quantizes the supplied gray image, and returns the
% quantized gray image, and a black and white image determined using an
% adaptive threshold.

grayImage = rgb2gray(rgbImage);

% First adjust the image intensity values: 
% calculates the histogram of the image and determines the adjustment limits 
% low_in and high_in then, maps the values in the supplied intensity image 
% to new values such that values between low_in and high_in map to values between 0 and 1, 
% values below low_in map to 0, and those above high_in map to 1.
quantImage = imadjust(grayImage, stretchlim(grayImage), [0 1]);

% Adaptive threshold Black and White image:
quantImage = im2double(quantImage);
op = find_optimal_threshold(quantImage);
bw = im2bw(quantImage, op);

return;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?