Can you help me out by rectifying the code?

currently I am working on my project to detect vechile on road using MATLAB and ip webcam. So my first work is to detect the vehicle from a video then interface ip webcam. I download a video from internet.to do the first part.But it gives some error ..I cannot find the mistake....so please anybody help me....I put my code and the errors......Thank you in advanced...
vidObj = VideoReader('C:\Users\User\Desktop\vehicles\cars.mp4');
vidObj.CurrentTime = 0.1;
I = readFrame(vidObj);
data = load('FCWDemoMonoCameraSensor.mat', 'sensor');
sensor = data.sensor;
detector = vehicleDetectorACF();
vehicleWidth = [1.5, 2.5];
detector = configureDetectorMonoCamera(detector, sensor, vehicleWidth);
[bboxes, ~] = detect(detector, I);
Iout = insertShape(I, 'rectangle', bboxes);
figure;
imshow(Iout)
title('Detected Vehicles')
ERRORS:
Error using vision.internal.inputValidation.checkImageSize (line 14)
Image size is not consistent with camera intrinsics. It is likely that the image is not generated by the specified
camera.
Error in acfObjectDetectorMonoCamera/detect (line 170)
vision.internal.inputValidation.checkImageSize(I, this.Camera.Intrinsics.ImageSize);
Error in giant (line 21)
[bboxes, ~] = detect(detector, I);

댓글 수: 1

Not sure what rectifying means in this context. Do you mean "correcting" or "fixing"?
Anyway it's saying that your camera did not acquire the info stored in your .mat file. Is that the case? If so, make sure the camera parameters used to save the data match your camera.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Computer Vision Toolbox에 대해 자세히 알아보기

제품

릴리스

R2018b

질문:

2022년 5월 16일

댓글:

2022년 5월 16일

Community Treasure Hunt

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

Start Hunting!

Translated by