How To Detect Pedestrians with NXP Vision Toolbox

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

How To Detect Pedestrians with NXP Vision Toolbox

2,019 次查看
dumitru-daniel_
NXP Employee
NXP Employee

Pedestrian detection

The following livescript uses MATLAB functionalities to simulate the pedestrian detection application. The pedestrian detection algorithm is implemented using Histogram of Oriented Gradients (HOG) and a linear Support Vector Machine (SVM).
Create a People Detector object with general Classification Model.
detector = vision.PeopleDetector('ClassificationModel', 'UprightPeople_96x48', 'ClassificationThreshold', 2.5);
Read the input image which can be RGB or grayscale.
inImgUMat = nxpvt.imread('data/img_sdk.png');
if isempty(inImgUMat)
    fprintf('Failed to open input image: %s.', inImgPath);
    return;
end
nxpvt.imshow(inImgUMat);
pastedImage_3.png
If the input image if RGB transform if to grayscale.
inImgUMatGray = nxpvt.apexcv.rgb2gray(inImgUMat);
nxpvt.imshow(inImgUMatGray);
pastedImage_4.png
Run the pedestrian detector on the grayscale image.
bboxes = step(detector, inImgUMatGray.getData());
Add the resulted information on the original image.
outImgUMat = nxpvt.cv.rectangle(inImgUMat, bboxes, [255, 0 ,0], 5);
nxpvt.imshow(outImgUMat);
pastedImage_5.png
标签 (1)
0 回复数