#include <iostream>using namespace std;#include <Windows.h>#include "MSR_NuiApi.h"//#include "highgui.h"int main(int argc,char **argv){// IplImage *img;// CvScalar s;// img=cvCreateImage(cvSize(640,480),IPL_DEPTH_8U,3);
#include <iostream>#include <vector>#include <algorithm>using namespace std;int testscore[] = {67, 56, 24, 78, 99, 87, 56}; void main(){ vector<int> score(testscore,testscore+sizeof(testscore)/sizeof(int));
#include <string>#include <iostream>#include <algorithm>#include <vector>#include <fstream>using namespace std;int main(){ ifstream in("data.txt");string strtmp; vector<string> vect;while (getline(in,strtmp,'
int DrawGLScene(GLvoid) // 從這裡開始進行所有的繪製{ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // 清除螢幕和深度緩衝 glLoadIdentity(); // 重設當前的模型觀察矩陣 glTranslatef(-1.5f,0.0f,-6.0f);
#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 main(){int a[
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-1for j=2:n-
cl;img=imread('15.bmp');%img=double(img);f=fft2(img); %傅裡葉變換f=fftshift(f); %使映像對稱r=real(f); %映像頻域實部i=imag(f); %映像頻域虛部margin=log(abs(f)); %映像幅度譜,加log便於顯示phase=log(angle(f)*180/pi); %映像相位譜l=log(f);
trayDlg.h:afx_msg LRESULT onShowTask(WPARAM wParam,LPARAM lParam);void Tdehide();void dehide();trayDlg.cpp:#define WM_SHOWTASK WM_USERBEGIN_MESSAGE_MAP(CtrayDlg, CDialogEx) ON_MESSAGE(WM_SHOWTASK,onShowTask)END_MESSAGE_MAP()void
#pragma warning (disable:4786)#include <iostream>#include <map>#include <algorithm>#include <string>#include <vector>using namespace std;typedef struct {string first;int second;}res;bool less_first(res tmp1,res
cl;img=imread('fupeng.jpg');z=3;[x y]=size(img);imshow(img);img=double(img);img_cai=zeros(x,y,z);Max=max(max(img));Min=min(min(img));img=(255/(Max-Min))*img-(255*Min)/(Max-Min);figure,imshow(uint8(img));r=1;g=2;b=3;for i=1:xfor j=1:y
cl;bw=[eye(3) eye(3);eye(3) eye(3)]; %要處理的矩陣f=eye(3); %模板矩陣,其實是需要使用到的邏輯lut=makelut(@(nbood) isequal(nbood,f),3); %產生查表向量,將f矩陣這樣的邏輯應用程式到3*3的nbood上bw1=applylut(bw,lut);
#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
#include <Windows.h>#include <tchar.h>#include "resource.h"TCHAR DlgName[]=TEXT("MyDialog");TCHAR AppName[]=TEXT("Dialog");;//TCHAR TestString[]=TEXT("hello world");TCHAR buffer1[512];TCHAR buffer2[512];TCHAR *buffer3=NULL;int a=0,b=0,c=0
#include <iostream>#include <stdlib.h>#include <time.h>using namespace std;#define NUM 30 //區間個數typedef struct {int min; //區間中最小值 int max; //區間中最大值 int diff;
lianDlg.cpp#include "lmain.h"void ClianDlg::OnBnClickedButton1(){// TODO: 在此添加控制項通知處理常式代碼 CWinThread *m_edit; m_edit=AfxBeginThread(lmain,&(m_hWnd),THREAD_PRIORITY_NORMAL,0,CREATE_SUSPENDED,NULL); m_edit->m_bAutoDelete=TRUE;
#include <string.h>#include <vector>#include <algorithm>#include <string>#include <iostream>using namespace std;void main(){string m("----------asdfas--------------dfgdf---------");string::iterator it; vector<char&
#include <windows.h> // Windows的標頭檔#include <gl\gl.h> // OpenGL32庫的標頭檔#include <gl\glu.h> // GLu32庫的標頭檔#include <gl\glaux.h> // GLaux庫的標頭檔#include <gl\glut.h> // Glut庫標頭檔#pragma comment( lib,
GLfloat xtri; GLfloat ytri;GLfloat ztri;int DrawGLScene(GLvoid) // 從這裡開始進行所有的繪製{ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // 清除螢幕及深度緩衝 glLoadIdentity();
#include <windows.h> // Windows的標頭檔#include <gl\gl.h> // OpenGL32庫的標頭檔#include <gl\glu.h> // GLu32庫的標頭檔#include <gl\glaux.h> // GLaux庫的標頭檔#include <gl\glut.h> // Glut庫標頭檔#include
cl;img=imread('3.17.tif');imgn=imnoise(img,'salt & pepper',0.02);[m n]=size(img);%h=fspecial('average',[3 3]); % 3*3的均值濾波%imgn1=imfilter(imgn,h,'replicate');%imgn=medfilt2(imgn,[3 3]); % 3*3的中值濾波%%%%自己編寫3*3均值濾波%{tem=0;for i=2:1:m-1