dumitru-daniel.popa

How to Detect Lanes with NXP Vision Toolbox

Discussion created by dumitru-daniel.popa Employee on Jun 20, 2018

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);
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);

Outcomes