資源簡介
撲克牌數字花色識別,基于Matlab。可實現對數字以及花色的識別,運行速度快,準確率高。

代碼片段和文件信息
function?BW?=?CutImage(?Left_Top?)
%?Left_Top為大致的信息區域,BW為返回的最小二值化區域
%?功能:?截取最小的信息區域(數字,形狀)
%?圖像二值化反色
Left_Top_BW?=?~im2bw(rgb2gray(Left_Top)0.5);
%?中值濾波去除椒鹽噪聲,[33]為窗口大小
Left_Top_BW?=?medfilt2(Left_Top_BW[33]);
[L_xL_yL_z]?=?size(Left_Top_BW);
%?自定義白色像素點個數用于統計,確定邊緣
WhiteDot?=?8;
%?上邊緣
top?=?0;
for?i=1?:?L_x
????count?=?sum(sum(Left_Top_BW(i?:?i:)));
????if?count?>?WhiteDot
????????top=i;
????????break;
????end
end
%?下邊緣
bottom?=?0;
for?i=L_x?:?-1?:?1
????count?=?sum(sum(Left_Top_BW(i?:?i:)));
????if?count?>?WhiteDot
????????bottom=i;
????????break;
????end
end
%?左邊緣
left?=?0;
for?i=1?:?L_y
????count?=?sum(sum(Left_Top_BW(:i?:?i)));
????if?count?>?WhiteDot
????????left=i;
????????break;
????end
end
%?右邊緣
right?=?0;
for?i=L_y?:?-1?:?1
????count?=?sum(sum(Left_Top_BW(:i?:?i)));
????if?count?>?WhiteDot
????????right=i;
????????break;
????end
end
BW?=?Left_Top_BW(top?:?bottom?left?:?right);
end
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????858240??2016-12-21?10:31??撲克牌識別實驗報告.docx
?????文件?????????13??2016-12-01?14:43??PuKe\.git\COMMIT_EDITMSG
?????文件????????327??2016-11-30?23:51??PuKe\.git\config
?????文件?????????73??2016-11-30?23:48??PuKe\.git\desc
?????文件?????????23??2016-11-30?23:48??PuKe\.git\HEAD
?????文件????????478??2016-11-30?23:48??PuKe\.git\hooks\applypatch-msg.sample
?????文件????????896??2016-11-30?23:48??PuKe\.git\hooks\commit-msg.sample
?????文件????????189??2016-11-30?23:48??PuKe\.git\hooks\post-update.sample
?????文件????????424??2016-11-30?23:48??PuKe\.git\hooks\pre-applypatch.sample
?????文件???????1642??2016-11-30?23:48??PuKe\.git\hooks\pre-commit.sample
?????文件???????1348??2016-11-30?23:48??PuKe\.git\hooks\pre-push.sample
?????文件???????4951??2016-11-30?23:48??PuKe\.git\hooks\pre-reba
?????文件???????1239??2016-11-30?23:48??PuKe\.git\hooks\prepare-commit-msg.sample
?????文件???????3611??2016-11-30?23:48??PuKe\.git\hooks\update.sample
?????文件???????3504??2016-12-01?14:43??PuKe\.git\index
?????文件????????240??2016-11-30?23:48??PuKe\.git\info\exclude
?????文件????????659??2016-12-01?14:43??PuKe\.git\logs\HEAD
?????文件????????659??2016-12-01?14:43??PuKe\.git\logs\refs\heads\master
?????文件????????576??2016-12-01?14:44??PuKe\.git\logs\refs\remotes\origin\master
?????文件??????39429??2016-11-30?23:48??PuKe\.git\ob
?????文件??????44151??2016-11-30?23:48??PuKe\.git\ob
?????文件??????73776??2016-11-30?23:48??PuKe\.git\ob
?????文件????????212??2016-12-01?14:43??PuKe\.git\ob
?????文件??????71413??2016-11-30?23:48??PuKe\.git\ob
?????文件??????38811??2016-11-30?23:48??PuKe\.git\ob
?????文件??????34545??2016-11-30?23:48??PuKe\.git\ob
?????文件???????1454??2016-12-01?12:52??PuKe\.git\ob
?????文件??????25604??2016-11-30?23:48??PuKe\.git\ob
?????文件?????????76??2016-12-01?14:43??PuKe\.git\ob
?????文件????????510??2016-12-01?12:52??PuKe\.git\ob
............此處省略169個文件信息
評論
共有 條評論