上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 75 下一页
摘要: cl;img=imread('TestDatabase/1.bmp');imshow(img);img=double(img);figure,imshow(mat2gray(img))ma=double(max(max(img)));mi=double(min(min(img)));img=(255/(ma-mi))*img-(255*mi)/(ma-mi);img=uint8(img);figure,imshow(img) 阅读全文
posted @ 2012-03-04 11:58 Dsp Tian 阅读(9899) 评论(0) 推荐(0) 编辑
摘要: cl;m=31;n=31;img=zeros(m+1,n+1);img=double(img);pi=3.1415926;sigma=10;for i=-(m/2):m/2 for j=-(n/2):n/2 img(i+m/2+1,j+n/2+1)=(1/(2*pi*sigma*sigma))*exp(-(i*i+j*j)/(2*sigma*sigma)); endendimg=mat2gray(img);imshow(img);imwrite(img,'pic.bmp');%一个更好的实现,2012.12.18修改h=5;w=2;[x y]=meshgrid(-w... 阅读全文
posted @ 2012-02-26 12:53 Dsp Tian 阅读(8850) 评论(3) 推荐(1) 编辑
摘要: cl;raw=zeros(200,256,30);for i=1:30 filename=strcat('F:\算法实验\data\seq3\',int2str(i),'.bmp'); raw(:,:,i)=imread(filename);end方法二:cl;img=cell(1,30);for i=1:30 filename=strcat('F:\算法实验\data\seq3\',int2str(i),'.bmp'); img{i}=imread(filename);end 阅读全文
posted @ 2012-02-23 15:57 Dsp Tian 阅读(6169) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <time.h>#include <stdlib.h>using namespace std;int random(int a,int b){ srand(NULL); return rand()%(b-a)+a;}void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}int partition(int *a,int p,int r){ int x=a[r]; int i=p-1; for (int j=p;j<r 阅读全文
posted @ 2012-02-20 14:07 Dsp Tian 阅读(644) 评论(0) 推荐(0) 编辑
摘要: //元素只能为正整数#include <iostream>using namespace std;int Max(int *a,int length){ int temp=-1000; for (int i=0;i<length;i++) if (temp<a[i]) temp=a[i]; return temp;}void counting_sort(int *a,int *b,int k,int length){ int *c; c=(int*)malloc(sizeof(int)*(k+1)); for (int i... 阅读全文
posted @ 2012-02-19 14:03 Dsp Tian 阅读(451) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>#include <time.h>#include <stdlib.h>using namespace std;int random(int a,int b){ srand(NULL); return rand()%(b-a)+a;}void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}int partition(int *a,int p,int r){ int x=a[r]; int i=p-1; for (int j=p;j<r 阅读全文
posted @ 2012-02-18 21:31 Dsp Tian 阅读(579) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}int partition(int *a,int p,int r){ int x=a[r]; int i=p-1; for (int j=p;j<r;j++) { if (a[j]<=x) { i=i+1; exchange(a[i],a[j]); } } ... 阅读全文
posted @ 2012-02-18 21:14 Dsp Tian 阅读(599) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;int parent(int i){ return i/2;}int left(int i){ return 2*i;}int right(int i){ return 2*i+1;}void exchange(int &a,int &b){ int temp; temp=a; a=b; b=temp;}//但就算法来看,heap_size(堆的大小)设为全局变量也许会好一些void max_heapify(int *a,int i,int heap_size){ in... 阅读全文
posted @ 2012-02-17 21:46 Dsp Tian 阅读(446) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;int main(){ int b[]={1,2,3}; int *a; a=(int*)malloc(sizeof(int)*3); memcpy(a,b,sizeof(int)*3); for (int i=0;i<3;i++) cout<<a[i]<<""; cout<<endl; system("pause"); free(a); return 0;} 阅读全文
posted @ 2012-02-17 21:36 Dsp Tian 阅读(493) 评论(0) 推荐(0) 编辑
摘要: #include <iostream>using namespace std;void process(int *a){ a=(int*)realloc(a,sizeof(int)*4); a[3]=3;}int main(){ int *a; a=(int*)malloc(sizeof(int)*3); a[0]=0; a[1]=1; a[2]=2; process(a); for (int i=0;i<4;i++) cout<<a[i]<<""; cout<<endl; system("pause" 阅读全文
posted @ 2012-02-17 21:17 Dsp Tian 阅读(488) 评论(0) 推荐(0) 编辑
上一页 1 ··· 65 66 67 68 69 70 71 72 73 ··· 75 下一页