Detecting Traffic lights using machine learning

5 次查看(过去 30 天)
Hello everyone. I am new matlab learner and working on a project to detect traffic lights using machine learning. In the first portion of my code i have this line "pkg load image". When i execute the code, matlab showing me error in this line and as a new learner i don't understand what is it. Please help me with this. here i am attaching the code below-
  1 个评论
Shahrin Islam
Shahrin Islam 2018-10-19
%% This script will detect traffic ligth's color %% in an infinitive loop. %% %% Author: Tomasz Ceszke 2017
%% ----------- init clear ; close all; more off pkg load image;
source('conf/settings.m'); source('lib/features.m'); source('lib/log_reg.m');
%% ----------- load learned factors load 'theta.mat';
%% ----------- settings live_image_path = strcat(datasource_path_prefix,'live/scene.png');
%% fprintf('Path to detect: %s \n\n',live_image_path); while 1 pause(1); try live_image = imread(live_image_path); catch disp('No image'); continue; end
X = zeros(1,numel(live_image));
X = reshape(double(rgb2gray(live_image)),1,[]);
if normalization
X = normalize(X,0);
end
[r h] = recognize(theta,X);
if r==1
color = 'GREEN';
else
color = 'RED';
end
fprintf('%s h(x)=%.2f\n',color,h)
end

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Automated Driving Toolbox 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by