function varargout = shiping(varargin)
% SHIPING MATLAB code for shiping.fig
% SHIPING, by itself, creates a new SHIPING or raises the existing
% singleton*.
%
% H = SHIPING returns the handle to a new SHIPING or the handle to
% the existing singleton*.
%
% SHIPING('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in SHIPING.M with the given input arguments.
%
% SHIPING('Property','Value',...) creates a new SHIPING or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before shiping_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to shiping_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 shiping
% Last Modified by GUIDE v2.5 24-Apr-2021 11:27:42
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @shiping_OpeningFcn, ...
'gui_OutputFcn', @shiping_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 shiping is made visible.
function shiping_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 shiping (see VARARGIN)
% Choose default command line output for shiping
axes(handles.axes5);
imshow([255]);
axes(handles.axes7);
imshow([255]);
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes shiping wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = shiping_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;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
global shiping;
global filename;
global mov;
global numFrames;
global framerate;
axes(handles.axes5)%声明图片一显示
[filename,pathname]=uigetfile({ ...
'*.*','All Files(*.*)';},...
'选择文件');%调用打开图片对话框
%
if isequal([filename,pathname],[0,0])%判断文件名是否为空
return
else
videoname = fullfile(pathname,filename);%获取选取图片的完整路径
% mov=imread(videoname);%读取图片
readerobj = VideoReader(videoname, 'tag', 'myreader1');
filename = videoname;
% Read in all video frames.
vidFrames = read(readerobj);
% Get the number of frames.
numFrames = get(readerobj, 'NumberOfFrames');
% Create a MATLAB movie struct from the video frames.
mov = [];
for k = 1 : numFrames
mov(k).cdata = vidFrames(:,:,:,k);
mov(k).colormap = [];
imshow(mov(k).cdata);
title(num2str(k));
pause(0.01);
end
set(handles.text2,'String',readerobj.Name);
set(handles.text4,'String',readerobj.NumberOfFrames);
set(handles.text6,'String',readerobj.Width);
set(handles.text8,'String',readerobj.Height);
% Playback movie once at the video's frame rate
framerate = readerobj.FrameRate;
% movie(handles.axes5, mov, 1, readerobj.FrameRate);
%handle.axes1=b;
end
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit1_Callback(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit1 as text
% str2double(get(hObject,'String')) returns contents of edit1 as a double
% --- Executes during object creation, after setting all properties.
function edit1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton3.
function pushbutton3_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton3 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton4.
function pushbutton4_Callback(hObject, eventdata, handles)
global filename;
start = str2num(get(handles.edit1,'String'));
genzong(filename,start);
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- 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)
% --- Executes on button press in pushbutton7.
function pushbutton7_Callback(hObject, eventdata, handles)
global mov;
global numFrames;
LEN = numFrames;%得到视频的帧数
axes(handles.axes5);
[chang,kuan,gao] = size(mov(1).cdata);
for x = 1 : LEN
pic = mov(x).cdata;%读入一张图片
pic1 = pic;%pic1中存放的是处理过后的彩色图像
pic_hsv = rgb2hsv(pic);
s = size(pic1);
bw_pic = zeros(s(1), s(2));
for i = 1 : s(1)
for j = 1 : s(2)
if pic_hsv(i, j, 1) > 0.35 && pic_hsv(i, j, 1) < 0.65 && ...
pic_hsv
基于matlab的火灾视频图像检测研究
版权申诉
104 浏览量
2024-02-01
13:54:52
上传
评论
收藏 6.23MB ZIP 举报
code.song
- 粉丝: 366
- 资源: 916
最新资源
- Picasso_v3.1 2.ipa
- chromedriver-mac-arm64.zip
- 蓝zapro.apk
- chromedriver-linux64.zip
- UCAS研一深度学习实验-MNIST手写数字识别python源码+详细注释(高分项目)
- 基于Python和PyTorch框架完成的一个手写数字识别实验源码(带MINIST手写数字数据集)+详细注释(高分项目)
- 基于Matlab在MNIST数据集上利用CNN完成手写体数字识别任务,并实现单层CNN反向传播算法+源代码+文档说明(高分项目)
- NVIDIA驱动、CUDA和Pytorch及其依赖
- 基于SVM多特征融合的微表情识别python源码+项目说明+详细注释(高分课程设计)
- html动态爱心代码一(附源码)
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈