⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 normalize.m

📁 该程序实现了一个简单的运动目标识别程序,这是主程序文件
💻 M
字号:
picture_name = 'E:\recognition_mobile\visual_jeep\12.tif';
jeep_order = [15 45 70 78 85 90 94 96 97 98 99 100 101 103 104 105 106 107 108 110 115 117 121 128 142 148 151 158 163 166 168 171 176 179 182 186 188 191 195 202 209 230];
pk_order = [30 70 80 83 86 90 92 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 111 115 125 135 142 147 153 156 159 162 166 169 171 175 178 182 185 188 192 198 ];
mianbao_order = [18 45 58 65 68 70 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 90 94 100 110 118 122 125 129 133 135 138 141 143 146 150 153 156 159 162 165 170 ];
taxi_order = [30 55 62 66 70 73 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 95 100 108 120 128 133 140 144 147 151 155 158 162 166 169 172 174 176 185];
% figure

for num_picture = 1:9
    picture_name = sprintf('E:\\recognition_mobile\\visual_taxi\\area_%d.tif' , taxi_order(num_picture));  %%% 可见光
    %picture_name = sprintf('E:\\recognition_mobile\\ir_manu_taxi\\%d.tif' , num_picture); %%% 红外

picture = double(imread(picture_name));
% subplot(3,3,num_picture)
% imshow(picture)
% figure
% subplot(2,2,1)
% imshow(uint8(picture));

% % % picture = edgefill(picture); % 改变图像灰度分布,以便于提取边缘(主要针对红外) -------------> 此操作不可取,采用运动区域二值图边缘和原图边缘的异和运算来去除外边缘(二值图边缘)
% % % figure
% % % imshow(uint8(picture));
% % % %%%%%% imwrite(mat2gray(picture) , 'e:\picture.bmp'); % 保存矩阵值为图像

target_picture = pretreatment(picture); % 预处理:归一化为固定大小,用canny算子提取内外边缘轮廓  ------>  将图像的较小边规范为固定大小
                                        % 由于摄像机和汽车均水平不倾斜,可不需要方向调整 
                                        % 如果汽车换成飞机,则需要进行方向调整
% subplot(3,3,num_picture)
% imshow((target_picture));
end
%******提取特征
num_picture
feature_vector = getfeature(target_picture)

feature_file_name ='data_visual_compoundfeature(jeep42pk42mianbao44taxi42).bin'; %%%%% 可见光
% feature_file_name = 'data_ir_compoundfeature(jeep43pk45mianbao41taxi43).bin';  %%%%% 红外
write_feature(feature_file_name , feature_vector);

%end



% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 神经网络 %%%%%%%%%%%%%%%%%%%%%%%%%%
% [n_feature , num_feature] = size(feature_vector); % 特征向量长度,一般地feature_vector是1*num_feature的一维向量
% num_class = 8; % 类别数
% num_swatch = 1; % 每类样本数
% n_in = num_feature;
% n_out = num_class;
% num_hidden = round( (n_out*n_in + 0.5*n_out*(n_in^2 + n_in) - 1) / (n_out + n_in) *0.5); % "*0.5"的意思是不使隐含层的单元数过大
% 
% %******代入神经网络进行训练,并产生网络系数
% %[input_hidden_weights , hidden_out_weights] = training(feature_file_name , num_feature , num_hidden , num_class , num_swatch);
% 
% %******将产生的特征向量代入分类器*********%(此处的分类器是根据待识样本与样本库进行搜索匹配实现,而搜索的根据是各特征方差的有序搜索)
% %classifier_search();
% %output = classify_search(feature_vector);
% 
% %******代入特征矢量,用网络进行计算识别结果
% weights_file_name = '03_BPdata_vh_0(05).bin';
% [input_hidden_weights , hidden_out_weights] = read_weights(weights_file_name);
% input_units = [0 , feature_vector];
% [hidden_units , output_units] = bpnn_feedforward(input_units , input_hidden_weights , hidden_out_weights , num_feature , num_hidden , num_class);
% output_units


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -