getting error in lane detection

2 views (last 30 days)
mustafa wala
mustafa wala on 8 Aug 2015
Commented: Image Analyst on 24 Apr 2016
I am not familiar with matlab. i had used your tutorial video no 6 and getting error in following statement
lanes=findlanes(B,h,stats);
hold off;
and i am getting following error
??? Undefined function or variable
'stats'.
can you help me resolving following error

Answers (2)

Walter Roberson
Walter Roberson on 8 Aug 2015
and see the lines of code there:
% Extract statistics
stats = regionprops(L,'MajorAxisLength','MinorAxisLength');
You do not appear to have done that before calling findlanes()
  3 Comments
Walter Roberson
Walter Roberson on 9 Aug 2015
I will need to see the complete traceback of the error message. Your Question refers to a line which invokes findlanes() but your code here refers to find_lanes(), a different routine. Possibly you are using a find_lanes() that invokes findlanes() so the problem might be in your find_lanes() routine, whatever content it might happen to have.
Please show the output of
which -all find_lanes
which -all findlanes
Image Analyst
Image Analyst on 22 Apr 2016
I'm not satisfied with your comment, mustafa. Please attach 'street1.jpg' so people can actually run your code.

Sign in to comment.


Image Analyst
Image Analyst on 9 Aug 2015
You say that it's saying stats is undefined. So change this code
% Extract statistics
stats = regionprops(L,'MajorAxisLength','MinorAxisLength');
%%Find lanes and delete non-lane objects
lanes=find_lanes(B,h,stats);
to this code:
% Extract statistics
stats = regionprops(L,'MajorAxisLength','MinorAxisLength');
whos stats
which find_lanes
whos find_lanes
%%Find lanes and delete non-lane objects
lanes=find_lanes(B,h,stats);
and tell me what it says in the command window.
  7 Comments
Oghenemine Henry
Oghenemine Henry on 24 Apr 2016
whos binary Name Size Bytes Class Attributes
binary 568x962x3 1639248 logical
Image Analyst
Image Analyst on 24 Apr 2016
binary is a 3-D volumetric image, like you're dealing with CT or MRI images or something. I don't think this should be. You should convert street to a grayscale image before you threshold it at 211.
From street, or street1, whatever you called the variable, which color channel do you want to use? Or do you want to take a weighted average?
if ndims(street)
street = rgb2gray(street);
end

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!