3D point cloud
이전 댓글 표시
output_dir = 'C:\Users\HITESH\Desktop\Matlab';
objects = imaqfind;
%%set up webcam
leftCam = imaq.VideoDevice('winvideo', 2, 'YUY2_640x480');
rightCam = imaq.VideoDevice('winvideo', 1, 'YUY2_640x480');
%%load stereo parameters if required
if ~exist('stereoParams', 'var')
load stereocalibration
end
ax = axes;
maxDepth = 5;
while true
imageLeft = step(rightCam);
imageRight = step(leftCam);
[J1, J2] = rectifyStereoImages(imageLeft, imageRight, stereoParams);
disp = disparity(rgb2gray(J1), rgb2gray(J2), 'DisparityRange', [0, 112]);
pointCloud = reconstructScene(disp, stereoParams) ./1000;
z = pointCloud(:,:,3);
z(z<0) = NaN;
z(z>maxDepth) = NaN;
pointCloud(:,:,3) = z;
if ~ishandle(ax)
break;
else
pcshow(pointCloud, J1, 'VerticalAxis', 'Y', 'VerticalAxisDir', 'Down', 'Parent', ax);
xlabel('X (m)');
ylabel('Y (m)');
zlable('Z (m)');
xlim(ax, [-.8, .8]);
ylim(ax, [-.8, .8]);
zlim([ax, maxDepth]);
drawnow;
end
end
release(leftCam);
release(rightCam);
Trying to create 3d point cloud from live feed using two calibrated usb camera, but the following error occurs:
Error using load
Unable to read file 'stereocalibration'. No such file or directory.
matlab R2015a
댓글 수: 2
Walter Roberson
2019년 2월 15일
run stereoCameraCalibrator . save from the menu . Assign stereoParameters to stereoParams . Save that into stereocalibration.mat
KALYAN ACHARJYA
2019년 2월 15일
Read the error, what does it say
Unable to read file 'stereocalibration'. No such file or directory.
Ensure that, the file stereocalibration is avaliable in current working directory.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Point Cloud Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!