资源简介
一个完整的matlab带gui的demo,可以识别很多车型(具体到汽车品牌和型号),并且会在图片中标明车型
代码片段和文件信息
classdef CarProphet
properties(Access = ‘public‘)
% object for recognize
Mat;
Video;
%%
STATE=-1;% Attention: STATE is the program‘s status. 0 represents image 1 represents video.
%%
END=false;% Attention: END is an instruction to play or stop the video
%%
RealRegion; % [x y width height] or a matrix of it.
%%
Threshold=0.5; % judge the bbox by this value. (is car or not??)
end
%%
% our model :RCNNModel ClassifyModel. “class_array“ is the index of car type.
properties(Access = ‘private‘)
RCNNModel;
ClassifyModel;
class_array;
end
%%
methods(Access = ‘public‘)
% Constructor of the class
function Predictor = CarProphet(RCNNModelRoadClassifyModelRoadClassNameRoad)
Predictor.RCNNModel=load(RCNNModelRoad);
Predictor.ClassifyModel=load(ClassifyModelRoad);
Predictor.class_array=load(ClassNameRoad);
end
% Function of load model
function LoadRCNN(PredictorRCNNModelRoad)
Predictor.RCNNModel=load(RCNNModelRoad);
end
function LoadClassifyModel(PredictorClassifyModelRoad)
Predictor.ClassifyModel=load(ClassifyModelRoad);
end
%%
% 4 steps:load pic->selective_search(proposal)-> rcnn_forward -> classify
% Attention: selective_search and rcnn_forward are not directly
% linked here because a large number of proposals but you can find
% a way to link it in draw.m
function [ProposalScores]=selective_search(Predictor)
[ProposalScores]=Predictor.RCNNModel.cifar10NetRCNN.RegionProposalFcn(Predictor.Mat);
end
function RealRegion=rcnn_forward(Predictor)
[bboxes scores ~]= Predictor.RCNNModel.cifar10NetRCNN.detect(Predictor.Mat);
CarScores=scores(:1);
HighProbROI_Index=find(CarScores>Predictor.Threshold);
RealRegion=bboxes(HighProbROI_Index:);
end
function [roisclasses]=classify(Predictor)
size_=size(Predictor.RealRegion);
length_=size_(1);
img_batch4d=zeros(2272273length_);
for i=1:length_
crop_roi=Predictor.RealRegion(i:);
img_single=imcrop(Predictor.Matcrop_roi);
img_single=imresize(img_single[227 227]);
img_batch4d(:::i)=img_single; % Constructing 4d-array images
end
if(~isempty(img_batch4d))
label_nums=Predictor.ClassifyModel.AlexNet_New.classify(img_batch4d);
%draw labels in picture
classes=Predictor.class_array.class_names(label_nums);
rois=Predictor.RealRegion;
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-03-31 01:12 Vehicle_Detection_Recognition-master\
文件 3201 2017-03-31 01:12 Vehicle_Detection_Recognition-master\CarProphet.m
目录 0 2017-03-31 01:12 Vehicle_Detection_Recognition-master\GUI\
文件 70136 2017-03-31 01:12 Vehicle_Detection_Recognition-master\GUI\MainWindow.fig
文件 8785 2017-03-31 01:12 Vehicle_Detection_Recognition-master\GUI\MainWindow.m
目录 0 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Model\
文件 250 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Model\Download.txt
目录 0 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Old\
文件 765 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Old\Pic_Detect_Recognition.m
文件 302 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Old\Start.m
文件 960 2017-03-31 01:12 Vehicle_Detection_Recognition-master\Old\Video_Detect_Recognition.m
文件 3156 2017-03-31 01:12 Vehicle_Detection_Recognition-master\README.md
目录 0 2017-03-31 01:12 Vehicle_Detection_Recognition-master\core_func\
文件 391 2017-03-31 01:12 Vehicle_Detection_Recognition-master\core_func\draw.m
文件 358 2017-03-31 01:12 Vehicle_Detection_Recognition-master\core_func\draw_roi_class.m
文件 277 2017-03-31 01:12 Vehicle_Detection_Recognition-master\core_func\get_highscore_proposals.m
文件 187 2017-03-31 01:12 Vehicle_Detection_Recognition-master\start.m
相关资源
- Bezier曲线_Bezier曲面_Matlab
- 基于matlab-GUI简易计算器的设计
- 基于matlab-GUI实时人脸检测系统
- matlab中的db小波
- dwt代码,不用matlab自带的dwt
- 曲线测设程序用MATLAB语言编写
- MATLAB图像倾斜校正
- MATLAB实现马赫带
- 基于matlab的图像增强—空域变换增强
- 基于matlab的线性锐化滤波图像增强并
- MVDR 算法及相关文献
- 数字滤波器的Matlab仿真设计
- 使用matlab画ORBSLAM2运行保存的轨迹文件
- RRT路径规划
- 循环码性能的MATLAB
- GS算法的MATLAB代码
- SINS捷联惯导解算程序
- MATLAB观测器
- 直线阵和圆阵数字波束形成MatlAB程序
- 模拟电压波动与闪变的Matlab文件
- 粒子滤波算法 matlab
- OFDM调制程序 MATLAB
- 简单的声音滤波 matlab
- 基于栅格地图的Dijkstra算法路径规划
- Matlab一维FDTD卷积边界条件CPML
- SMOTE结合SVM算法matlab实现
- MATLAB文字识别程序解析
- 基于MATLAB的血管三维重建
- Allan方差计算程序Matlab版
- Goldstein_Filter
评论
共有 条评论