摘要: cl;img=imread('1.bmp');[m n]=size(img);imshow(img)imgn=img;temp=[];%开操作for i=2:m-1 %腐蚀 for j=2:n-1 temp=img(i-1:i+1,j-1:j+1); imgn(i,j)=min(temp(:)); endendfor i=2:m-1 %膨胀 for j=2:n-1 temp=img(i-1:i+1,j-1:j+1); imgn(i,j)=max(... 阅读全文
posted @ 2012-02-05 19:45 Dsp Tian 阅读(2270) 评论(0) 推荐(0) 编辑
摘要: cl;img_gray=imread('fupeng.jpg');img_erzhi=imread('erzhi_fupeng.jpg');imshow(img_gray)figure,imshow(img_erzhi)[m n]=size(img_gray);img_gray_fu=zeros(m,n);img_gray_peng=zeros(m,n);img_erzhi_fu=zeros(m,n);img_erzhi_peng=zeros(m,n);for i=2:m-1 for j=2:n-1 img_gray_fu(i,j)=min(min(img_gr 阅读全文
posted @ 2012-02-05 16:02 Dsp Tian 阅读(11963) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <stdlib.h>#include <time.h>using namespace std;#define NUM 30 //区间个数typedef struct { int min; //区间中最小值 int max; //区间中最大值 int diff; //区间的大小}extent;int Max(int a,int b){ if (a>=b) { return a... 阅读全文
posted @ 2012-02-03 15:17 Dsp Tian 阅读(1234) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;int main(){ int a[9]={2,8,1,7,5,6,9,3,0}; int b[10]; int i; for (i=0;i<10;i++) { b[i]=-1; } for (i=0;i<9;i++) { b[a[i]]=a[i]; } for (i=0;i<10;i++) { if (b[i]==-1) { cout<<i<<endl; ... 阅读全文
posted @ 2012-02-03 13:33 Dsp Tian 阅读(505) 评论(0) 推荐(0) 编辑
摘要: cl;img=imread('1.bmp');img=double(img);imshow(mat2gray(img));[m n]=size(img);imgn=zeros(m-3,n-3);temp=[];for i=1:m-3 for j=1:n-3 temp=img(i:i+3,j:j+3); imgn(i,j)=median(temp(:)); endendfigure,imshow(mat2gray(imgn))imgn=img(1:m-3,1:n-3)-imgn;figure,imshow(mat2gray(imgn))imgn=i... 阅读全文
posted @ 2012-02-02 13:09 Dsp Tian 阅读(2085) 评论(2) 推荐(0) 编辑
摘要: #include <iostream>#include <string>#include <fstream>#include <iomanip>using namespace std;int main(){ ofstream fs("123.txt",ios::app); fs<<setw(7)<<"234234"<<setw(3)<<"12"<<endl; system("pause"); return 0 阅读全文
posted @ 2012-02-01 17:24 Dsp Tian 阅读(533) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <string>using namespace std;int main(){ string a,b; a="Dsp"; b="Tian"; char temp[5]; string ab; for(int i=0;i<13;i++) { sprintf(temp,"%d",i); ab=temp; cout<<a+ab+b<<endl; } system("pause"); return 0;} 阅读全文
posted @ 2012-01-30 16:47 Dsp Tian 阅读(671) 评论(0) 推荐(0) 编辑
摘要: clear;clc;width=3;xwidth=(width-1)/2;imgn=imread('1.bmp');imshow(imgn,[]);imgn=double(imgn);[m n]=size(imgn);imgn1=imgn;z=zeros(4,width);tem=1;for i=1+xwidth:1:m-xwidth for j=1+xwidth:1:n-xwidth for k=-xwidth:1:xwidth z(1,tem)=imgn(i,j+k); z(2,tem)=imgn(i+k,j)... 阅读全文
posted @ 2012-01-28 23:18 Dsp Tian 阅读(4555) 评论(0) 推荐(0) 编辑
摘要: clear;clc;width=3;xwidth=(width-1)/2;imgn=imread('1.bmp');imshow(imgn,[]);imgn=double(imgn);[m n]=size(imgn);imgn1=imgn;z=zeros(4,width);tem=1;for i=1+xwidth:1:m-xwidth for j=1+xwidth:1:n-xwidth for k=-xwidth:1:xwidth z(1,tem)=imgn(i,j+k); z(2,tem)=imgn(i+k,j)... 阅读全文
posted @ 2012-01-28 23:15 Dsp Tian 阅读(2773) 评论(0) 推荐(0) 编辑
摘要: #include <windows.h> // Windows的头文件#include <stdio.h>#include <gl\gl.h> // OpenGL32库的头文件#include <gl\glu.h> // GLu32库的头文件#include <gl\glaux.h> // GLaux库的头文件//#include <gl\glut.h> // Glut库头文件#pragma comment( lib, "opengl32.lib") // OpenGL32连接库#pragma comm 阅读全文
posted @ 2012-01-23 22:45 Dsp Tian 阅读(7056) 评论(0) 推荐(0) 编辑