亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? extract_lp.m

?? 車牌定位的源代碼
?? M
字號:
function [bw, crop] = extract_LP(pic1);
% extract_LP: Extracts the License Plate from the supplied picture. Returns
% a binary image which contains the normalized LP, and the rgb picture of
% the LP precisely cropped from the image given in parameter.

load global_var.mat;

% chosen size for the normalized LP.
XSIZE = 50;
YSIZE = 150;

% Yellow region extraction:
yellow_pic = extract_yellow_region(pic1);
display_picture(yellow_pic, debug1 + debug2, 'Yellow Regions Filter:', 3);

% Fixing the LP Region:
[x, x2, y, y2] = detect_lp_area(yellow_pic, 50);
lp_area = pic1(y:y2, x:x2, :);
display_picture(lp_area, debug1 + debug2, 'License Plate Region:', 3);

% Fixing the LP angle and rotating the ROI accordingly:
[angle, lines] = find_angle(lp_area);
if(debug1 + debug2 ~= 0)
    load global_var.mat;
    if is_killed == 1
        close all;
        return;
    end;
    subplot(2,2,3), imshow(pic1(y:y2, x:x2, :)); draw_lines(lines); title('Determining the angle of the plate using the Radon transform:');
    pause(speed);
end;
pic = imrotate(yellow_pic(y:y2, x:x2), angle, 'bilinear'); % Used to show the rotation on the GUI only..
display_picture(pic, debug1 + debug2, 'Yellow Region Rotated:', 3);

% improving the LP region on the smaller rotated region obtained before:
[small_pic, xx, xx2, yy, yy2] =  improved_lp_area(pic, angle);
display_picture(small_pic, debug2, 'Improved License Plate region:', 4);
display_picture('internal_images/black.jpg', debug2, '', 4, 0);
display_picture(small_pic, debug1 + debug2, 'Improved License Plate region:', 3, 0);
display_picture('internal_images/black.jpg', debug2, '', 2, 0);
    
% cropping the LP:
[image, RECTx, RECTy] = crop_lp(small_pic, lp_area, xx, xx2, yy, yy2, angle);
display_picture('internal_images/black.jpg', debug2, '', 2, 0);
crop = image; % output...
display_picture(image, debug2, 'LP Crop:', 4);
display_picture('internal_images/black.jpg', debug2, '', 4, 0);
display_picture(image, 1, 'LP Crop:', 3);

% Image quantization:
[grayImage, quantImage, bw] = quantizeImage(image);
display_picture(grayImage, debug1 + debug2, 'Gray Scale LP:', 3);
display_picture(quantImage, debug2, 'LP Quantisation and Equalization:', 4);
display_picture('internal_images/black.jpg', debug2, '', 4, 0);
display_picture(quantImage, debug1 + debug2, 'LP Quantisation and Equalization:', 3);
display_picture(bw, debug1 + debug2, 'Binary LP:', 3);

% Normalized LP:
bw = normalized_lp(bw, RECTx, RECTy, XSIZE, YSIZE);
display_picture(imcomplement(bw), debug2, 'Normalized LP:', 4);
display_picture('internal_images/black.jpg', debug2, '', 4, 0);
display_picture(imcomplement(bw), debug1 + debug2, 'Normalized LP:', 3);

% Adjusting the LP horizontal contours: (the vertical contours are not
% adjusted in order not to cut digits: this will be done transparently by
% the segmentation machine.
bw = normalized_lp_contour(bw, [XSIZE, YSIZE]);
display_picture(bw, debug2, 'LP Horizontal Contours Adjusted:', 4);
display_picture('internal_images/black.jpg', debug2, '', 4, 0);
display_picture(bw, debug1 + debug2, 'LP Horizontal Contours Adjusted:', 3);

return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% detect_lp_area
% Finds the License Plate region in a RGB picture with the supplied safety
% spacing around the plate, and returns the coordinates of the found region.
function  [x, x2, y, y2] = detect_lp_area (yellow_pic, spacing);
    LP_MIN_AREA = 2670;
    LP_MAX_RATIO = 0.67;
    LP_MIN_RATIO = 0.16;
    
    % Dilating the yellow regions:
    dilated_pic = imdilate(yellow_pic, strel('diamond', 5));
    load global_var.mat;
    display_picture(dilated_pic, debug1 + debug2, 'Yellow Region Dilated:', 3);

    % Separating the pictures into connected components:
    stat = imfeature(bwlabel(dilated_pic));
    % Selecting the license plates from the candidates in stat.
    % The chosen area is the deepest region in the frame which has the
    % following properties:
    %   area > LP_MIN_AREA
    %   LP_MIN_RATIO <= height/width <= LP_MAX_RATIO 
    %   area >= max(areas of the candidates)/3.5
    depth = -1;
    for i = 1 : length([stat.Area])
        if stat(i).BoundingBox(2) >= depth & stat(i).Area > LP_MIN_AREA & ...
           stat(i).BoundingBox(4) <= LP_MAX_RATIO*stat(i).BoundingBox(3) & ...
           stat(i).BoundingBox(4) >= (LP_MIN_RATIO)*stat(i).BoundingBox(3) & stat(i).Area >= max([stat.Area])/3.5
           depth = stat(i).BoundingBox(2);
        end;
    end;
    % finding the components which are at the depth "depth":
    r = [];
    for i = 1 : length([stat.Area])
        if stat(i).BoundingBox(2) == depth & stat(i).Area > LP_MIN_AREA & ...
           stat(i).BoundingBox(4) <= LP_MAX_RATIO*stat(i).BoundingBox(3) & ...
           stat(i).BoundingBox(4) >= (LP_MIN_RATIO)*stat(i).BoundingBox(3) & stat(i).Area >= max([stat.Area])/3.5
            r = [r stat(i).Area];
        end;
    end;
    % if we did not find any region with the above criterion, taking the
    % candidate of maximum area.
    if(length(r) == 0)
        index = (find([stat.Area] == max([stat.Area])));
    else
        % otherwise, taking the candidate with maximum area from the
        % filtered candidates:
        index = (find([stat.Area] == max(r)));
    end;
    
    % set the coordinates of the supposed license plate region:
    x = max(floor(stat(index).BoundingBox(1) - spacing), 1);
    y = max(floor(stat(index).BoundingBox(2) - spacing), 1);
    width = ceil(stat(index).BoundingBox(3) + 2*spacing);
    height = ceil(stat(index).BoundingBox(4) + 2*spacing);
    y2 = min(y + height, size(yellow_pic, 1));
    x2 = min(x + width, size(yellow_pic, 2));
        
return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Returns an improved LP area running again the algorithm in the function 
% detect_lp_area with zero spacing and on the smaller rotated pictures
% given as parameter.
function [pic, x1, x2, y1, y2] =  improved_lp_area(image, angle);
[x1,x2,y1,y2] = detect_lp_area(image, 0);
pic = image(y1:y2, x1:x2);
return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function [image, RECTx, RECTy] = crop_lp(pic, lp_area, x1, x2, y1, y2, angle);
rec = find_lp_location(pic);
image = imrotate(lp_area, angle, 'bilinear');
image = image(y1:y2, x1:x2, :);
RECTy = [rec(2), rec(2), rec(2) + rec(4), rec(2) + rec(4)];
RECTx = [rec(1), rec(1) + rec(3), rec(1) + rec(3), rec(1)];
image = imcrop(image, rec);
return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% find_lp_location: Returns the coordinates of the LP rectangle inside the
% supplied small picture: uses "find_contours" for the sum of the lines and of the 
% columns in the picture. 
function [rec] = find_lp_location(im);
load global_var.mat;

p1 = sum(im);
plot_vector(p1, 4, 'Adjusting the LP Vertical Contours - Columns Sum Graph:', debug2);
[x1, x2] = find_contours(p1);

p2 = sum(im');
plot_vector(p2, 2, 'Adjusting the LP Horizontal Contours - Lines Sum Graph:', debug2);
[y1, y2] = find_contours(p2);

rec = [x1, y1, x2-x1, y2-y1];
return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% find_contours: Returns the x-coordinates respectively of the first point at 
% the left and the first point at the right of the vector which is superior 
% or equal to the average of the vector. This permits to delimit the plate
% eliminating noises around it.
function [index1, index2] = find_contours(vec);
avg = mean(vec);
% left side:
for j = 1 : length(vec)
    if(vec(1,j) <= avg)
        continue;
    end;
    index1 = j - 1;
    break;
end;
% right side:
for j = length(vec) : -1 : 1
    if(vec(1,j) <= avg)
        continue;
    end;
    index2 = j + 1;
    break;
end;
return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
function pic = normalized_lp(bw, rectx, recty, xsize, ysize);
% Make a rectange matrix (by turning and stretching) of an image, 
% using points p1(x(1),y(1)) p2(x(2),y(2)) p3(x(3),y(3)) p4(x(4),y(4))
% pic - bw or gray image
% x, y - vectors of point coordinates in 'pic'
% xSize - The number of lines
% ySize - The number of columns
% assuming given     p1          p2
%                    p4          p3
x = recty - min(recty) + 1;
y = rectx - min(rectx) + 1;
for xindex = 1:1:xsize
   xxPos1 = round(x(1) + xindex / xsize * (x(4) - x(1)));
   xyPos1 = round(y(1) + xindex / xsize * (y(4) - y(1)));
   xxPos2 = round(x(2) + xindex / xsize * (x(3) - x(2)));
   xyPos2 = round(y(2) + xindex / xsize * (y(3) - y(2)));
   for yindex = 1:1:ysize
      xPos = round(xxPos1 + yindex / ysize * (xxPos2 - xxPos1));
      yPos = round(xyPos1 + yindex / ysize * (xyPos2 - xyPos1));
      pic(xindex,yindex) = bw(xPos, yPos);
   end
end

return;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% normalized_lp_contour: Determines the LP horizontal contours by computing
% the sum of the lines in the supplied image, and using the function
% "horizontal_crop" with noise, minimum height and maximum height which are
% defined in this function. Then it cuts some noise from the resulting
% picture in both directions using the function "cut_bw_img". Finally, the
% image is resized to the normalized dimensions given in parameter.
function [im] = normalized_lp_contour(bwImage, dimension);
load global_var.mat;
NOISE = 20;
MIN_HEIGHT = 26;
MAX_HEIGHT = 48;
VERTICAL_NOISE = 6;
HORIZONTAL_NOISE = 1;

hist = sum((imcomplement(bwImage))');
plot_vector(hist, 4, 'Determining LP Horizontal Contours - Lines Sum Graph:', debug2);

bwImage = horizontal_crop(imcomplement(bwImage), MIN_HEIGHT, MAX_HEIGHT, NOISE);
bwImage = cut_bw_img(bwImage, HORIZONTAL_NOISE, 1);
bwImage = cut_bw_img(bwImage, VERTICAL_NOISE, 0);

im = bwImage;
im = imresize(im, dimension);

return;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av一区二区在线免费观看| 国产拍欧美日韩视频二区| 国产一区二区精品久久91| 日韩精品一级中文字幕精品视频免费观看 | 国产呦精品一区二区三区网站| 性做久久久久久久免费看| 亚洲一区二区欧美激情| 亚洲国产一区在线观看| 午夜激情久久久| 美女国产一区二区三区| 国产在线精品一区二区不卡了| 国产米奇在线777精品观看| 国产精品一区一区三区| 国产成人av电影在线| 本田岬高潮一区二区三区| 97se亚洲国产综合在线| 在线观看欧美精品| 欧美精品自拍偷拍动漫精品| 91麻豆精品91久久久久同性| 精品福利一区二区三区| 国产精品三级av| 亚洲精品高清视频在线观看| 亚洲成av人影院在线观看网| 久久99精品国产麻豆不卡| 国产激情91久久精品导航| 99久久国产综合精品女不卡| 欧美欧美午夜aⅴ在线观看| 欧美变态tickling挠脚心| 国产肉丝袜一区二区| 亚洲欧美一区二区三区孕妇| 天天色天天操综合| 成人一区二区三区中文字幕| 欧美性生活影院| 久久久亚洲精品一区二区三区 | 亚洲国产色一区| 加勒比av一区二区| 色狠狠一区二区| 欧美电影免费观看高清完整版在线观看| 久久精品人人做| 亚洲成av人片在线| 高潮精品一区videoshd| 欧美日韩一区久久| 亚洲欧洲av在线| 激情综合一区二区三区| 欧美色老头old∨ideo| 国产亚洲欧美色| 蜜桃一区二区三区在线观看| 91免费视频网| 国产精品入口麻豆原神| 久久国产精品99久久人人澡| 欧美亚洲综合网| 国产精品国产成人国产三级| 国精产品一区一区三区mba桃花 | 欧美日韩专区在线| 欧美国产乱子伦| 看国产成人h片视频| 欧美日韩一区二区三区不卡| 亚洲婷婷综合色高清在线| 国产精品主播直播| 日韩欧美在线观看一区二区三区| 一区二区三区高清不卡| 成人sese在线| 中文一区二区完整视频在线观看| 日韩成人午夜电影| 欧美丰满少妇xxxxx高潮对白| 国产精品麻豆欧美日韩ww| 国产精品一区二区久久精品爱涩 | 国产一区二区在线影院| 日韩视频123| 国产精品一区二区男女羞羞无遮挡| 欧美性受极品xxxx喷水| 亚洲欧美另类久久久精品| proumb性欧美在线观看| 中文字幕不卡一区| 不卡电影免费在线播放一区| 久久久精品欧美丰满| 国产麻豆成人精品| 久久亚洲精精品中文字幕早川悠里| 免费在线观看一区二区三区| 8x福利精品第一导航| 秋霞成人午夜伦在线观看| 欧美一区二区福利在线| 久久国内精品视频| 精品国产不卡一区二区三区| 国产一区二区三区免费在线观看| 久久一区二区视频| 豆国产96在线|亚洲| 亚洲欧洲av另类| 欧美中文字幕一区二区三区| 亚洲电影第三页| 欧美一区二区免费观在线| 国内欧美视频一区二区| 久久精品一区二区| 91在线无精精品入口| 亚洲综合免费观看高清完整版在线 | 亚洲一线二线三线久久久| 欧美日韩国产成人在线免费| 蜜桃久久久久久久| 欧美国产精品专区| 欧美日韩中文字幕一区二区| 久久精品久久99精品久久| 国产亚洲欧美中文| 欧美亚洲日本国产| 久久99精品久久久久久动态图 | 精品剧情在线观看| 成人免费视频免费观看| 首页国产欧美久久| 久久午夜羞羞影院免费观看| 99久久伊人网影院| 亚洲va欧美va人人爽| 久久综合狠狠综合| 91久久一区二区| 国产一区欧美二区| 亚洲综合视频网| 国产婷婷色一区二区三区四区| 91美女福利视频| 国产美女在线观看一区| 亚洲福利视频一区| 日本一区二区三级电影在线观看| 欧美亚州韩日在线看免费版国语版| 国产资源在线一区| 亚洲成人午夜电影| 综合久久久久久| 久久精品免视看| 欧美一卡2卡3卡4卡| 欧美羞羞免费网站| 99久久婷婷国产综合精品| 精品中文字幕一区二区小辣椒| 亚洲精品一二三区| 国产精品久久久久7777按摩| 精品国产乱码久久久久久老虎| 精品视频1区2区| 91天堂素人约啪| 成人免费黄色在线| 国产一区二区三区免费| 麻豆久久一区二区| 日韩在线播放一区二区| 亚洲动漫第一页| 亚洲精品视频在线看| 国产精品免费av| 国产欧美综合在线观看第十页| 日韩精品中文字幕在线不卡尤物| 欧美三区免费完整视频在线观看| 91免费视频观看| 91免费版在线看| 欧美老人xxxx18| 91福利视频网站| 成人免费高清视频| 国产高清精品在线| 国产一区 二区 三区一级| 卡一卡二国产精品| 精品一区二区三区在线观看 | 中文字幕av在线一区二区三区| 精品99一区二区三区| 欧美成人a在线| 日韩精品一区二区三区在线观看 | 波多野结衣视频一区| 国产精品99久久不卡二区| 狠狠色丁香久久婷婷综合丁香| 久久99精品久久只有精品| 久久99精品久久久久婷婷| 国产美女精品一区二区三区| 国产一区二区三区不卡在线观看 | 麻豆精品在线看| 久久99精品国产.久久久久| 久久av中文字幕片| 国产不卡高清在线观看视频| 成人福利视频网站| 在线观看区一区二| 日韩欧美视频在线| 国产亚洲精品超碰| 最新不卡av在线| 视频在线观看国产精品| 看国产成人h片视频| 国产99精品视频| 欧美在线你懂得| 欧美成人精品二区三区99精品| 国产欧美在线观看一区| 亚洲色图19p| 蜜桃一区二区三区四区| 成人深夜在线观看| 欧美日韩国产在线播放网站| 欧美成人一区二区三区在线观看| 中文无字幕一区二区三区| 亚洲啪啪综合av一区二区三区| 日韩国产欧美在线视频| 国产成人精品一区二| 欧美三级一区二区| 久久精品免费在线观看| 亚洲午夜久久久| 国产成人小视频| 在线不卡的av| 国产精品剧情在线亚洲| 免费观看91视频大全| 波多野结衣在线一区| 日韩欧美国产系列| 亚洲欧美日韩中文播放 | 91视频在线观看免费| 日韩欧美不卡在线观看视频| 亚洲欧美日本在线|