% ******************************************************
%
% time : 2021/05/26 17:12
% tip : 车牌识别
% change:
% *******************************************************
function varargout = CarId(varargin)
% CARID MATLAB code for CarId.fig
% CARID, by itself, creates a new CARID or raises the existing
% singleton*.
%
% H = CARID returns the handle to a new CARID or the handle to
% the existing singleton*.
%
% CARID('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in CARID.M with the given input arguments.
%
% CARID('Property','Value',...) creates a new CARID or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before CarId_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to CarId_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 CarId
% Last Modified by GUIDE v2.5 26-May-2021 20:30:44
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @CarId_OpeningFcn, ...
'gui_OutputFcn', @CarId_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 CarId is made visible.
function CarId_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 data (see GUIDATA)
% varargin command line arguments to CarId (see VARARGIN)
% Choose default command line output for CarId
handles.output = hObject;
%隐藏坐标轴
set(handles.axes1,'visible','off');
set(handles.axes2,'visible','off');
set(handles.axes3,'visible','off');
set(handles.axes4,'visible','off');
set(handles.axes5,'visible','off');
set(handles.axes6,'visible','off');
set(handles.axes7,'visible','off');
set(handles.axes8,'visible','off');
set(handles.axes9,'visible','off');
set(handles.axes10,'visible','off');
set(handles.axes11,'visible','off');
set(handles.axes12,'visible','off');
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes CarId wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = CarId_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
%======================my code========================%
% tip : 被删除的callback自己手动添加一下...55555.....
function openLocal_Callback(hObject,eventdata,handles)
[filename, pathname]=uigetfile({'*.jpg; *.png; *.bmp; *.tif';'*.png';'All Image Files';'*.*'},'请选择图片路径');
if pathname==0
return;
end
I=imread([pathname filename]);
%显示原图
axes(handles.axes1) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('原图');
handles.I=I; %更新图像
% Update handles structure
guidata(hObject, handles);
function openCamera_Callback(hObject,eventdata,handles)
imaqhwinfo
vid = videoinput('winvideo',1);
usbVidRes1=get(vid,'videoResolution');%获取视频的尺寸
nBands1=get(vid,'NumberOfBands');%采集视频的颜色通道
axes(handles.axes1);
hImage1=imshow(zeros(usbVidRes1(2),usbVidRes1(1),nBands1));
preview(vid,hImage1);
handles.vid=vid;
% Update handles structure
guidata(hObject, handles);
function btnTakePhoto_Callback(hObject,eventdata,handles)
vid=handles.vid;
frame = getsnapshot(vid);
axes(handles.axes1);
imwrite(frame,'I.png');
I=imread('I.png');
axes(handles.axes1) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('拍摄完成');
handles.I=I; %更新原图
% Update handles structure
guidata(hObject, handles);
%下面在使用原图方法: handles.I
% --- Executes on button press in btnGray2.
function btnGray2_Callback(hObject, eventdata, handles)
% hObject handle to btnGray2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=handles.Cut;
I = rgb2gray(I);
axes(handles.axes8) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('灰度处理');
handles.gray2=I; %更新原图
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in btnBalance.
function btnBalance_Callback(hObject, eventdata, handles)
% hObject handle to btnBalance (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=handles.gray2;
I = histeq(I);
axes(handles.axes9) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('直方图均衡化');
handles.balance=I; %更新原图
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in btnDouble.
function btnDouble_Callback(hObject, eventdata, handles)
% hObject handle to btnDouble (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=handles.balance;
I = im2bw(I, 0.76);
axes(handles.axes10) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('图像二值化');
handles.double=I; %更新原图
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in btnMid.
function btnMid_Callback(hObject, eventdata, handles)
% hObject handle to btnMid (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=handles.double;
I = medfilt2(I);
axes(handles.axes11) %将Tag值为axes1的坐标轴置为当前
imshow(I,[]); %解决图像太大无法显示的问题.why?貌似会自动缩放
title('中值滤波');
handles.Mid=I; %更新原图
% Update handles structure
guidata(hObject, handles);
% --- Executes on button press in btnCut2.
function btnCut2_Callback(hObject, eventdata, handles)
% hObject handle to btnCut2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
I=handles.Mid;
I = my_imsplit(I); %切割图像
[m, n] = size(I);
s = sum(I); %sum(x)就是竖向相加,求每列的和,结果是行向量;
j = 1;
k1 = 1;
k2 = 1;
while j ~= n
while s(j) == 0
j = j + 1;
end
k1 = j;
while s(j) ~= 0 && j <= n-1
j = j + 1;
end
k2 = j + 1;
if k2 - k1 > round(n / 6.5)
[val, num] = min(sum(I(:, [k1+5:k2-5])));
I(:, k1+num+5) = 0;
end
end
y1 = 10;
y2 = 0.25;
flag = 0;
word1 = [];
while flag == 0
[m, n] = size(I);
left = 1;
width = 0;
while sum(I(:, width+1)) ~= 0
width = width + 1;
end
if width < y1
I(:, [1:width]) = 0;
I = my_imsplit(I)


海神之光
- 粉丝: 5w+
- 资源: 7136
最新资源
- CVPR2023:新型注意力机制助力YOLOv5至v8实现创新暴涨点体验,CVPR2023创新:全新注意力机制助力YOLOv5、v7、v8实现暴力涨点,cvpr2023全新注意力机制加入到YOLOv5
- 基于STM32G474的微型逆变器设计方案:源代码、原理图及PCB布局解析,基于STM32G474的微型逆变器设计方案,附源代码原理图与PCB设计参考图,400w微型逆变器, 基于stm32g474实
- Ollama 本地GUI客户端:为DeepSeek用户量身定制的智能模型管理与交互工具
- Deep Seek R1 Windows AI 助手 APP
- 基于栅格地图的人工势场法与A*、RRT融合的动态路径规划算法:自由设定起点目标点及地图,基于珊格地图的动态路径规划算法:人工势场法与A*、RRT融合实现,基于珊格地图的人工势场法 动态路径规划 路径规
- 基于JavaWeb(JSP)+MySQL图书销售管理系统(网上书店)项目源码
- 基于Comsol的变压器铁心磁致伸缩振动仿真技术研究,Comsol多物理场仿真技术下的变压器铁心磁致伸缩振动研究,Comsol 变压器铁心磁致伸缩振动仿真 ,Comsol; 变压器铁心; 磁致伸缩振
- VSCode安装包v-1.97.2
- 爱奇艺用户画像以及用户行为数据.zip
- 西门子S7-1500 PLC程序案例:制药厂洁净空调精准控温控湿解决方案,采用SCL编程,附详细注释,博图V16版本 ,西门子S7-1500 PLC程序案例:制药厂洁净空调精准控温与湿度调节方案,采用
- 数理逻辑与图论-考证必备题目+题解.zip
- 此资源为暂存文件用于学习使用
- DOTween Pro1.0.244
- 管家婆普及版TOP12.9.zip
- 管家婆普及版TOP12.51.zip
- 管家婆普及版TOP12.71.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈


