Time of Update: 2018-12-06
close all;clc;H=1; %索引pix中第一個元素,即高度W=2; %索引pix中第二個元素,即寬度left_right=0.3; %抬起左邊或右邊時值為0-1之間,不抬起時為0up_down=0; %抬起上邊或下邊時值為0-1之間,不抬起時為0img=imread('lena.jpg');
Time of Update: 2018-12-06
#include <iostream>#include <windows.h>int main(int argc, char* argv[]){ char VolumeInfo[100]; DWORD VolNameSize=100; DWORD VolSerialNumber; DWORD VolMaxComponentLength; DWORD
Time of Update: 2018-12-06
send.cpp:#include <WinSock2.h>#include <stdio.h>#include <Windows.h>#pragma comment(lib,"ws2_32.lib")int main(){ unsigned long ip; ip=inet_addr("127.0.0.1"); short port; port=8000; printf("Connecting to 127.0.0.1:8000
Time of Update: 2018-12-06
#include <windows.h>#include <process.h> /* _beginthread, _endthread */#include <iostream>#include <fstream>#include <string>using namespace std;ofstream out("out.txt");void ThreadFunc1(PVOID param){ while(1) {
Time of Update: 2018-12-06
clear all;close all;clc;img=imread('saber9.jpg');img2=imread('saber2.jpg');imshow(img)figure,imshow(img2);tmp=rgb2gray(img);tmp2=rgb2gray(img2);img_re=imresize(tmp,[8 8]);img_re2=imresize(tmp2,[8
Time of Update: 2018-12-06
zseven.mfunction out=zseven(nbhd) s=sum(nbhd(:))-nbhd(5); temp1=(2<=s)&(s<=6); p=[nbhd(1) nbhd(4) nbhd(7) nbhd(8) nbhd(9) nbhd(6) nbhd(3) nbhd(2)]; pp=[p(2:8) p(1)]; xp=sum((1-p).*pp); temp2=(xp==1); prod1=nbhd(4)*nbhd(
Time of Update: 2018-12-06
%LMS演算法示範(matlab)%設定參數,N為採樣個數,u為步長clear,clc;N=16;u=0.1;%設定迭代次數kk=1000;%pha為隨機雜訊的平均功率rk=randn(1,k)/2;%%常態分佈的隨機矩陣pha=mean(rk);%%求元素平均值%設定起始權值wk(1,:)=[0 0];%用LMS演算法迭代求最佳權值for i=1:k xk(i,:)=[sin(2*pi*i/N) sin(2*pi*(i-1)/N)]+rk(i);%輸入訊號 yk(i)=xk(i,:
Time of Update: 2018-12-06
clear all;close all;clc;randn('seed',0);%%一維高斯函數mu=0;sigma=1;x=-6:0.1:6;y=normpdf(x,mu,sigma);plot(x,y);figure;%%二維或多維高斯函數mu=[0 0];sigma=[0.3 0;0 0.35];[x y]=meshgrid(linspace(-8,8,80)',linspace(-8,8,80)');X=[x(:) y(:)];z=mvnpdf(X,mu,sigma);surf(x,y,
Time of Update: 2018-12-06
clear all;close
Time of Update: 2018-12-06
clear all;close all;clc;im=imread('2.png');im2=im;im1=rgb2ycbcr(im);%將圖片的RGB值轉換成YCbCr值%Lu=im1(:,:,1);Cb=im1(:,:,2);Cr=im1(:,:,3);[x y
Time of Update: 2018-12-06
clear all;close all;clc;img=imread('lena.jpg');imshow(img);phi=pi/2;theta=2;sigma=0.65*theta;filterSize=6;G=zeros(filterSize);for i=(0:filterSize-1)/filterSize for j=(0:filterSize-1)/filterSize xprime=j*cos(phi); yprime=i*sin(phi);
Time of Update: 2018-12-06
clear all;close all;clc;num=4; %元素數量k=180; %迭代次數step=0.1; %迭代步長w(1,:)=[-0.5 1 1]; %權值x=[1 0 0; %輸入的值,每行為一組 1 1 0; 1 0 1; 1 1 1];d=[1 0 1 0]; %實際輸出的值y=zeros(1,num); %迭代輸出的值 y=w0+w1x1+w2x2e=zeros(1
Time of Update: 2018-12-06
clear all;close all;clc;step=0.1; %迭代步長num=15; %資料個數k=100; %迭代次數set=[ 0.4 0.05 1; - 0.2 0.75 1; 0.5 0.1 1; - 0.1 0.7 1; 0.3 0.2 1; - 0.15 0.9 1; 0 0.8 1;
Time of Update: 2018-12-06
clear all;close all;clc;img1=imread('Corner.png');img2=imread('Corner1.png');img3=imread('Corner2.png');img1=imresize(img1,[35 90]); %Matlab的svd不支援太大的資料,我把資料變小了.img2=imresize(img2,[35 90]);img3=imresize(img3,[35 90]);[height
Time of Update: 2018-12-06
clear all;close all;clc;img=imread('lena.jpg');img=im2bw(img,graythresh(img));imshow(img)[height width]=size(img);img_re=zeros(height,width);temp=[];for i=2:height-1 %腐蝕 for j=2:width-1 temp=img(i-1:i+1,j-1:j+1); img_
Time of Update: 2018-12-06
clear all;close all;clc;randn('seed',0);mu1=[0 0];S1=[0.3 0;0 0.35];cls1_data=mvnrnd(mu1,S1,1000);plot(cls1_data(:,1),cls1_data(:,2),'+');hold on;mu2=[4 0];S2=[1.2 0;0 1.85];cls2_data=mvnrnd(mu2,S2,1000);plot(cls2_data(:,1),cls2_data(:,2),'r+');axis(
Time of Update: 2018-12-06
HSoptflow.mfunction [us,vs] = HSoptflow(Xrgb,n)%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Author: Gregory Power gregory.power@wpafb.af.mil% This MATLAB code shows a Motion Estimation map created by% using a Horn and Schunck
Time of Update: 2018-12-06
#include <iostream>#include <string>#include <boost/program_options.hpp>int main(int argc,char **argv){ namespace po = boost::program_options; po::option_description desc("allowed options"); desc.add_options()
Time of Update: 2018-12-06
#include <iostream>#include <string>#include <set>using namespace std;int main(){ string name[]={"tian","dsp","su","chu"}; set<string> setname; for (int i=0;i<4;i++) setname.insert(name[i]);
Time of Update: 2018-12-06
#include <iostream>using namespace std;int main(){ double **a; a=new double *[3]; //初始一個三行二列的矩陣 for (int i=0;i<3;i++) { a[i]=new double[2]; } a[0][0]=1; a[0][1]=2; a[1][0]=4; a[1][1]=5;