相机类型识别根据相机拍摄到的照片对相机型号和品牌进行SVM识别,matlab仿真
Posted fpga&matlab
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了相机类型识别根据相机拍摄到的照片对相机型号和品牌进行SVM识别,matlab仿真相关的知识,希望对你有一定的参考价值。
1.软件版本
MATLAB2013b
2.本算法理论知识
3.部分核心代码
function varargout = maingui(varargin)
% MAINGUI MATLAB code for maingui.fig
% MAINGUI, by itself, creates a new MAINGUI or raises the existing
% singleton*.
%
% H = MAINGUI returns the handle to a new MAINGUI or the handle to
% the existing singleton*.
%
% MAINGUI('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MAINGUI.M with the given input arguments.
%
% MAINGUI('Property','Value',...) creates a new MAINGUI or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before maingui_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to maingui_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 maingui
% Last Modified by GUIDE v2.5 09-Apr-2011 11:41:44
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @maingui_OpeningFcn, ...
'gui_OutputFcn', @maingui_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin1)
gui_State.gui_Callback = str2func(varargin1);
end
if nargout
[varargout1:nargout] = gui_mainfcn(gui_State, varargin:);
else
gui_mainfcn(gui_State, varargin:);
end
% End initialization code - DO NOT EDIT
% --- Executes just before maingui is made visible.
function maingui_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 maingui (see VARARGIN)
% Choose default command line output for maingui
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes maingui wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = maingui_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
varargout1 = handles.output;
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% 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)
global b;
[filename,pathname]=uigetfile( ...
'*.*','All Files(*.*)';,...
'选择文件');
%
if isequal([filename,pathname],[0,0])
return
else
%读取图片
pic = fullfile(pathname,filename);
b = imread(pic);
axes(handles.axes1);
imshow(b);
end
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
load F1_train.mat
load F2_train.mat
global b;
global F_test;
F_test = func_memont(b);
error = func_classifier(F1_train,F2_train,F_test);
if error <0.1
set(handles.text2,'String','canon');
end
if error >=0.1
set(handles.text2,'String','iphone4');
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)
clc;
clear;
close all;
4.仿真结论
打开:
运行这个代码;
点击
点击
5.参考文献
A09-12
6.完整源码获得方式
方式1:微信或者QQ联系博主
方式2:订阅MATLAB/FPGA教程,免费获得教程案例以及任意2份完整源码
创作挑战赛 新人创作奖励来咯,坚持创作打卡瓜分现金大奖以上是关于相机类型识别根据相机拍摄到的照片对相机型号和品牌进行SVM识别,matlab仿真的主要内容,如果未能解决你的问题,请参考以下文章
web获取照片EXIF信息(例如:拍照方向相机设备型号拍摄时间ISO 感光度GPS 地理位置等数据)
web获取照片EXIF信息(例如:拍照方向相机设备型号拍摄时间ISO 感光度GPS 地理位置等数据)