Can you help me out by rectifying the code?

2 次查看(过去 30 天)
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 个评论
Image Analyst
Image Analyst 2022-5-16
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 个)

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by