How to Detect Lanes with NXP Vision Toolbox

cancel
Showing results for 
Search instead for 
Did you mean: 

How to Detect Lanes with NXP Vision Toolbox

676 Views
NXP Employee
NXP Employee

Lane Detection

The following livescript uses MATLAB functionalities to simulate the lane detection application.
Read input image.
inImgPath = 'data/lane_detection.jpg';
inImgUMat = nxpvt.imread(inImgPath);
if isempty(inImgUMat)
    fprintf('Failed to open input image: %s.', inImgPath);
    return;
end
nxpvt.imshow(inImgUMat);
pastedImage_1.png
Create resize object.
ratio = 1;
resizeObj = nxpvt.apexcv.Resize();
Apply Lanemarking algorithm to grayscale image.
laneVerticesAlgorithm = lanemarking_Algorithm(inImgUMat);
Add results on to the original image.
laneImageAlgorithm = nxpvt.cv.insertLines(inImgUMat, laneVerticesAlgorithm);
laneImageAlgorithm = Process(resizeObj, laneImageAlgorithm, ratio);
nxpvt.imshow(laneImageAlgorithm);
pastedImage_2.png
Labels (1)
0 Replies