實驗源代碼
//Warshall.cpp #include<stdio.h> void warshall(int k,int n) { int i , j, t; int temp[20][20]; for(int a=0;a<k;a++) { printf("請輸入矩陣第%d 行元素:",a); for(int b=0;b<n;b++) { scanf ("%d",&temp[a][b]); } } for(i=0;i<k;i++){ for( j=0;j<k;j++){ if(temp[ j][i]==1) { for(t=0;t<n;t++) { temp[ j][t]=temp[i][t]||temp[ j][t]; } } } } printf("可傳遞閉包關系矩陣是:\n"); for(i=0;i<k;i++) { for( j=0;j<n;j++) { printf("%d", temp[i][ j]); } printf("\n"); } } void main() { printf("利用 Warshall 算法求二元關系的可傳遞閉包\n"); void warshall(int,int); int k , n; printf("請輸入矩陣的行數 i: "); scanf("%d",&k);
四川大學實驗報告 printf("請輸入矩陣的列數 j: "); scanf("%d",&n); warshall(k,n); }
標簽:
warshall
離散
實驗
上傳時間:
2016-06-27
上傳用戶:梁雪文以
The idea for this book was born during one of my project-related trips to the beautiful city
of Hangzhou in China, where in the role of Chief Architect I had to guide a team of very
young, very smart and extremely dedicated software developers and verification engineers.
Soon it became clear that as eager as the team was to jump into the coding, it did not have
any experience in system architecture and design and if I did not want to spend all my time in
constant travel between San Francisco and Hangzhou, the only option was to groom a number
of local junior architects. Logically, one of the first questions being asked by these carefully
selected future architects was whether I could recommend a book or other learning material
that could speed up the learning cycle. I could not. Of course, there were many books on
various related topics, but many of them were too old and most of the updated information
was either somewhere on the Internet dispersed between many sites and online magazines, or
buried in my brain along with many years of experience of system architecture.
標簽:
Telecommunication
Gateways
System
Design
for
上傳時間:
2020-06-01
上傳用戶:shancjb
車牌定位---VC++源代碼程序
1.24位真彩色->256色灰度圖。
2.預處理:中值濾波。
3.二值化:用一個初始閾值T對圖像A進行二值化得到二值化圖像B。
初始閾值T的確定方法是:選擇閾值T=Gmax-(Gmax-Gmin)/3,Gmax和Gmin分別是最高、最低灰度值。
該閾值對不同牌照有一定的適應性,能夠保證背景基本被置為0,以突出牌照區(qū)域。
4.削弱背景干擾。對圖像B做簡單的相鄰像素灰度值相減,得到新的圖像G,即Gi,j=|Pi,j-Pi,j-1|i=0,1,…,439 j=0,1,…,639Gi,0=Pi,0,左邊緣直接賦值,不會影響整體效果。
5.用自定義模板進行中值濾波
區(qū)域灰度基本被賦值為0。考慮到文字是由許多短豎線組成,而背景噪聲有一大部分是孤立噪聲,用模板(1,1,1,1,1)T對G進行中值濾波,能夠得到除掉了大部分干擾的圖像C。
6.牌照搜索:利用水平投影法檢測車牌水平位置,利用垂直投影法檢測車牌垂直位置。
7.區(qū)域裁剪,截取車牌圖像。
標簽:
1.24
256
圖像
閾值
上傳時間:
2013-11-26
上傳用戶:懶龍1988