Detecting Traffic lights using machine learning

조회 수: 5 (최근 30일)
Shahrin Islam
Shahrin Islam 2018년 10월 19일
댓글: Shahrin Islam 2018년 10월 19일
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