摘要: #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 阅读(1242) 评论(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 阅读(521) 评论(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 阅读(2100) 评论(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 阅读(544) 评论(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 阅读(686) 评论(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 阅读(4573) 评论(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 阅读(2802) 评论(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 阅读(7078) 评论(0) 推荐(0)
摘要: bool blend; // 是否混合?bool bp; // B 键按下了么?InitGL: glColor4f(1.0f,1.0f,1.0f,0.5f); // 全亮度, 50% Alpha 混合 glBlendFunc(GL_SRC_ALPHA,GL_ONE); // 基于源象素alpha通道值的半透明混合函数Winmain: if (keys['B'] && !bp) // B 健按下... 阅读全文
posted @ 2012-01-23 22:39 Dsp Tian 阅读(3095) 评论(0) 推荐(0)
摘要: BOOL light; // 光源的开/关BOOL lp; // L键按下了么?BOOL fp; // F键按下了么? GLfloat xrot; // X 旋转GLfloat yrot; // ... 阅读全文
posted @ 2012-01-23 22:25 Dsp Tian 阅读(1120) 评论(0) 推荐(0)