资源简介
利用Matlab进行车辆检测与车型识别,包含详细的代码,
代码片段和文件信息
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 2018-07-10 15:28 车辆检测识别\
目录 0 2018-07-10 15:27 车辆检测识别\车辆检测与识别\
文件 3201 2017-03-31 09:12 车辆检测识别\车辆检测与识别\CarProphet.m
目录 0 2018-07-10 15:27 车辆检测识别\车辆检测与识别\core_func\
文件 391 2017-03-31 09:12 车辆检测识别\车辆检测与识别\core_func\draw.m
文件 358 2017-03-31 09:12 车辆检测识别\车辆检测与识别\core_func\draw_roi_class.m
文件 277 2017-03-31 09:12 车辆检测识别\车辆检测与识别\core_func\get_highscore_proposals.m
目录 0 2018-07-10 15:27 车辆检测识别\车辆检测与识别\GUI\
文件 70136 2017-03-31 09:12 车辆检测识别\车辆检测与识别\GUI\MainWindow.fig
文件 8785 2017-03-31 09:12 车辆检测识别\车辆检测与识别\GUI\MainWindow.m
目录 0 2018-07-10 15:27 车辆检测识别\车辆检测与识别\Model\
文件 250 2017-03-31 09:12 车辆检测识别\车辆检测与识别\Model\Download.txt
目录 0 2018-07-10 15:27 车辆检测识别\车辆检测与识别\Old\
文件 765 2017-03-31 09:12 车辆检测识别\车辆检测与识别\Old\Pic_Detect_Recognition.m
文件 302 2017-03-31 09:12 车辆检测识别\车辆检测与识别\Old\Start.m
文件 960 2017-03-31 09:12 车辆检测识别\车辆检测与识别\Old\Video_Detect_Recognition.m
文件 3156 2017-03-31 09:12 车辆检测识别\车辆检测与识别\README.md
文件 187 2017-03-31 09:12 车辆检测识别\车辆检测与识别\start.m
相关资源
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
- 神经网络分类matlab程序
- matlab正弦信号发生器的设计
评论
共有 条评论