基于Yolov5的车牌检测和识别(完整版,可直接运行),运行效果满足日常使用。可以作为练手项目和课程作业。 导入Pycharm,下载好相应的依赖包就可直接运行,进行推力测试。 也可以在此基础上进行再一次的训练和提升。
现有训练集数据,1000 × 7,如下: xxxxxxxxxxxxxxxxxxxx 有测试集数据,100 × 7,如下: xxxxxxxxxxxxxxxxxxxx 以上数据分别是从某系统采集的数据,  训练数据集中,分别是采集的数据和标注结果,其中1、2分别表示该系统有无故障;  测试数据集中,分别是采集的数据和真实结果,其中1、2分别表示该系统有无故障; 现在需要使用训练数据集训练BP神经网络,然后用训练好的神经网络对测试数据集进行测试,并与真实结果进行对比,最终分析出神经网络的性能。 % --- Executes on button press in pushbutton6. function pushbutton6_Callback(hObject, eventdata, handles) % hObject handle to pushbutton6 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) global output_test inputn_train outputn_train inputn_test ... outputps BPoutput_test xunlian_num Error input_train output_train %创建网络 %获得gui_set中值 num_yinhan=str2num(get(findobj('tag','edit_yinhan'),'string')); TF=get(findobj('tag','transfer'),'string'); %传递函数 valueTF=get(findobj('tag','transfer'),'value'); TF=TF{valueTF}; BTF=get(findobj('tag','train'),'string'); %训练函数 valueBTF=get(findobj('tag','train'),'value'); BTF=BTF{valueBTF}; BLF=get(findobj('tag','learn'),'string'); %学习函数 valueBLF=get(findobj('tag','learn'),'value'); BLF=BLF{valueBLF}; tic;%启动一个定时器 net=newff(inputn_train,outputn_train,num_yinhan,{TF},BTF,BLF); net.trainParam.epochs=str2num(get(findobj('tag','cishu'),'string')); net.trainParam.goal=str2num(get(findobj('tag','goal'),'string')); net.trainParam.lr=str2num(get(findobj('tag','rate'),'string')); net=train(net,inputn_train,outputn_train); an=sim(net,inputn_test); t=toc;%关闭定时器,获取程序运行时间 %网络输出反归一化
function mainfun() Wp=0.2*pi; Ws=0.4*pi; tr_width=Ws-Wp; %过渡带宽度 N=ceil(6.6*pi/tr_width)+1 %滤波器长度 n=0:1:N-1; Wc=(Ws+Wp)/2; %理想低通滤波器的截至频率 hd=ideal_lp(Wc,N)'; %理想低通滤波器的单位冲激响应 w_ham=(hamming(N)) %海明窗 h=hd.*w_ham; %截取得到实际的单位脉冲响应 [db,mag,pha,w]=freqz_m4(h,[1]); %计算实际滤波器的幅度响应 delta_w=2*pi/1000; Ap=-(min(db(1:1:Wp/delta_w+1))) %实际通带纹波 As=-round(max(db(Ws/delta_w+1:1:501))) %实际阻带纹波
2022-01-02 18:02:19 955B MATLAB 滤波器 单位脉冲响应 幅度响应
function varargout = ganshe(varargin) % GANSHE M-file for ganshe.fig % GANSHE, by itself, creates a new GANSHE or raises the existing % singleton*. % % H = GANSHE returns the handle to a new GANSHE or the handle to % the existing singleton*. % % GANSHE('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in GANSHE.M with the given input arguments. % % GANSHE('Property','Value',...) creates a new GANSHE or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before ganshe_OpeningFcn gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to ganshe_OpeningFcn via varargin. % % *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one % instance to run (singleton)". % % See also: GUIDE, GUIDATA, GUIHANDLES % Edit the above text to modify the response to help ganshe % Last Modified by GUIDE v2.5 21-Jun-2014 11:31:04 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @ganshe_OpeningFcn, ... 'gui_OutputFcn', @ganshe_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin && ischar(varargin{1}) gui_State.gui_Callback = str2func(varargin{1}); end if nargout [varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:}); else gui_mainfcn(gui_State, varargin{:}); end % End initialization code - DO NOT EDIT % --- Executes just before ganshe is made visible. function ganshe_OpeningFcn(hObject, eventdata, handles, varargin) % This function has no output args, see OutputFcn. % hObject handle to figure % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user d
% trafficObj1 = mmreader('traffic.avi'); trafficObj1 = VideoReader('traffic.avi'); mplay('traffic.avi'); darkCarValue=70; darkCar=rgb2gray(read(trafficObj1,71)); %noDarkCar=imextendedmax(darkCar,darkCarValue); %imshow(darkCar); %figure,imshow(noDarkCar); sedisk=strel('disk',2); %noSmallStructures=imopen(noDarkCar,sedisk); %imshow(noSmallStructures); nframes=get(trafficObj1,'NumberOfFrames'); %帧数 I=read(trafficObj1,1); %读取第一帧 taggedCars=zeros([size(I,1) size(I,2) 3 nframes],class(I)); %定义一个4维数组存放每一帧 for k=1:nframes singleFrame = read(trafficObj1,k); %读取第k帧 I=rgb2gray(singleFrame); %转换为灰度图像
clear;clc size=512; block=8; blockno=size/block; LENGTH=size*size/64; Alpha1=0.02; Alpha2=0.02; T1=100; I=zeros(size,size); D=zeros(size,size); BW=zeros(size,size); block_dct1=zeros(block,block); i=imread('watermark64by64.png'); mark=reshape(i,1,LENGTH); figure;imshow(i);title('水印'); %subplot(3,2,1);plot(mark);title('水印'); %显示原图 figure;I=imread('lena512512.jpg'); I0=I; imshow(I);title('原始图像'); % BW=edge(I,'canny');figure;;imshow(BW); % title('edge of origine image'); %嵌入水印 k=1; for m=1:blockno for n=1:blockno x=(m-1)*block+1; y=(n-1)*block+1; block_dct1=I(x:x+block-1,y:y+block-1); block_dct1=dct2(block_dct1); BW_8_8=BW(x:x+block-1,y:y+block-1); if m<=1|nT1 Alpha=Alpha2; else Alpha=Alpha1; end block_dct1(1,1)=block_dct1(1,1)*(1+Alpha*mark(k)); block_dct1=idct2(block_dct1); D(x:x+block-1,y:y+block-1)=block_dct1; k=k+1; end end figure;imshow(D,[]);title('嵌入水印后的图像'); %提取水印 k=1; mark1=[];
2022-01-02 09:03:34 45KB MATLAB DCT 添加水印 水印提取
clear syms x; num=3*x^2+6*x-1; denom=x^2+x-3; f=num/denom; ezplot(f) hold on inf_ans=limit(f,inf); %x趋于正无穷时,函数的极限 roots=solve(denom); %返回分母的解,求出垂直渐近线 %水平渐近线 plot([-8,8],[double(inf_ans),double(inf_ans)],'g') %垂直渐近线 plot([double(roots(1)),double(roots(1))],[-10,10],'r') plot([double(roots(2)),double(roots(2))],[-10,10],'r') title('函数的渐近线') %极值点 f1=diff(f); max_point=solve(f1); figure
2022-01-02 09:03:32 872B MATLAB 符号计算 最值点 渐近线
function optics_prism close all figure('position',[78 276 792 402]); xp=[-0.2,0.2,0];yp=[0.2,0.2,0.5];B=pi/14; ZZ=[xp;yp]'*[cos(B),sin(B);-sin(B),cos(B)]; fill(ZZ(:,1),ZZ(:,2),[0.2,0.4,0.6]); axis([-1,1,0,1]);hold on;set(gca,'color','k'); t=0;A=pi/8;set(gcf,'doublebuffer','on'); x=[-1,-1];y=[0,0]; H=plot(x,y,'w','linewidth',6); while t<0.8; pause(0.1); t=t+0.1; x(2)=-1+t*cos(A); y(2)=t*sin(A); set(H,'xdata',x,'ydata',y); end x1=[x(2),x(2)];y1=[y(2),y(2)];H1=plot(x1,y1,'r'); H2=plot(x1,y1,'color',[1,1,0]);x2=x1;y2=y1; H3=plot(x1,y1,'y');x3=x1;y3=y1; H4=plot(x1,y1,'g');x4=x1;y4=y1; H5=plot(x1,y1,'color',[0,1,1]);x5=x1;y5=y1; H6=plot(x1,y1,'b');x6=x1;y6=y1; H7=plot(x1,y1,'color',[1,0,1]);x7=x1;y7=y1; t=0; C=linspace(pi/16,0,7); s=linspace(1,1.2,7); while t<0.165; pause(0.1);
2022-01-02 09:03:32 1KB MATLAB 三稜镜 色散 折射