91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

一個比較簡單的文字定位程序:由用戶在圖像上選擇一個點,這個點應當在文字上,然后與這個點的顏色相近的連通域被選出,經過文本驗證,得到顏色相近的文字區域。可以多次選擇取樣點,按回車結束選擇最后在結果圖中去掉錯誤的連通域。

資源截圖

代碼片段和文件信息

function?[bb?imgT]?=?estimateTextRegion(imgxiyi)
%?估測灰度圖img在(xiyi)附近文本的范圍
%???x軸寬度估測根據的是邊界出現的頻率,y軸高度估測根據的是投影值變化,
% 估測范圍很可能比實際范圍小。
% 但此范圍只被用來選取二值化閾值,類似一個局域二值化的意思,
% 因為文本的亮度肯定很高,但文本局部的背景不一定亮度低,全局閾值很可能將兩者一起算入前景。
% 函數中多次用到了Otsu法選閾值,實際是不知道應該怎么選…
% imgT是選出的區域,bb是該區域的bounding?box.

[M?N]?=?size(img);
imgE?=?imfilter(img[-1?1]‘rep‘);
line?=?(mean(imgE(max(yi-11):min(yi+1M):)));
levelUp?=?graythresh(line(line>0));
upEdges?=?find(line>levelUp);?%?選出對比足夠大的由黑->白的邊界
upIntv?=?[upEdges?N]-[1?upEdges];?%?這些邊界的x軸向間隔
%?這些間隔可能有大有小,一般情況下,字符之間的邊界間隔應該較小,較大的間隔應該是字符與非字符之間的
upIntvLevel?=?graythresh(upIntv/max(upIntv))*max(upIntv)*.8;

%?找出xi左側的較大的間隔,當作文本區域的左邊界left
if?upEdges(1)>xi?left?=?1;
else
left?=?upEdges(1);
for?p?=?2:length(upEdges)
temp?=?upEdges(p);
if?temp?>?xi?break;?end
if?upIntv(p)?>?upIntvLevel left?=?upEdges(p);?end
end
end

%?找文本區域的右邊界right,方法類似
levelDown?=?-graythresh(-line(line<0));
downEdges?=?find(linelen?=?length(downEdges);
downIntv?=?[downEdges?N]-[1?downEdges];
downIntvLevel?=?graythresh(downIntv/max(downIntv))*max(downIntv);
%?figurehist(downIntv)
if?downEdges(len)else
right?=?downEdges(len);
for?p?=?len-1:-1:1
temp?=?downEdges(p);
if?temp? if?downIntv(p+1)?>?downIntvLevel
right?=?downEdges(p);?
end
end
end
%?figureplot(line>levelUp‘r‘)
%?hold?onplot(-(line
%?向y軸作投影,投影值變化(由大變小)很大時,就找到了上、下邊界
line?=?mean(img(:left:right)2);
line?=?line(2:M)-line(1:M-1);
lineLeft?=?line(1:yi-1);
lineLeft1?=?lineLeft(lineLeft>0);
vertLevel?=?graythresh(lineLeft1)*1.3;
up?=?max(find(lineLeft>vertLevel));

lineRight?=?-line(yi+1:M-1);
lineRight1?=?lineRight(lineRight>0);
vertLevel?=?graythresh(lineRight1)*1.3;
down?=?yi+min(find(lineRight>vertLevel));

%?figureplot(line)hold?onplot(yi0‘b*‘)
bb?=?[left?up?right-left?down-up];
imgT?=?img(up:downleft:right);
%?plot(xi0‘g*‘)
%?plot(left0‘c*‘)
%?plot(right0‘m*‘)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----

?????文件???????2228??2010-02-03?11:10??code\estimateTextRegion.m

?????文件??????82430??2010-01-31?19:23??code\fire.jpg

?????文件????????300??2010-02-03?16:08??code\hsvDis.m

?????文件???????2661??2010-02-03?21:02??code\main.m

?????文件????????691??2010-01-29?22:57??code\manualSelectCC.m

?????文件????????457??2010-01-29?22:58??code\showTrainHist.m

?????文件????????574??2010-02-03?18:18??code\splitByColor.m

?????文件????????253??2010-01-28?14:34??code\structArrayMerge.m

?????文件???????2868??2010-02-03?17:48??code\textVeri.m

?????文件???????1502??2010-01-29?22:59??code\trainTextCC.m

?????目錄??????????0??2010-02-03?21:07??code

-----------?---------??----------?-----??----

????????????????93964????????????????????11


評論

共有 條評論