Problem with updateLimitsAndDirection function
Good afternoon,
I’m using MATLAB’s Visual SLAM with RGB-D Camera example (https://uk.mathworks.com/help/vision/ug/visual-slam-with-an-rgbd-camera.html), and I got this error message:
"Error using worldpointset/updateLimitsAndDirection
Invalid location for world point 1. It coincides with one of the views that observes the world point."
When I am exercuting this line of code:
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In:
% Create an empty imageviewset object to store key frames
vSetKeyFrames = imageviewset;
% Create an empty worldpointset object to store 3-D map points
mapPointSet = worldpointset;
% Add the first key frame
vSetKeyFrames = addView(vSetKeyFrames, currKeyFrameId, initialPose, Points=currPoints,…
Features=currFeatures.Features);
% Add 3-D map points
[mapPointSet, rgbdMapPointsIdx] = addWorldPoints(mapPointSet, xyzPoints);
% Add observations of the map points
mapPointSet = addCorrespondences(mapPointSet, currKeyFrameId, rgbdMapPointsIdx, validIndex);
% Update view direction and depth
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In the example code, I’ve just modified the download and browse part of the input image sequence.
The code I’ve added is as follows:
% Select the synchronized image data
Path_RGB = ‘C:Documents2.5RGB cameraImage for bad of wordsRGB’;
Path_Grey = ‘C:Documents2.5RGB cameraImage for bad of wordsDepth’;
imdsColor = imageDatastore(Path_RGB);
imdsDepth = imageDatastore(Path_Grey);
% imdsColor = subset(imdsColor, indexPairs(:, 1));
% imdsDepth = subset(imdsDepth, indexPairs(:, 2));
% Inspect the first RGB-D image
currFrameIdx = 1;
currIcolor = readimage(imdsColor, currFrameIdx);
currIdepth = readimage(imdsDepth, currFrameIdx);
currIdepth = rgb2gray(currIdepth);
[rows, colums] = size(currIdepth);
currIcolor = imresize(currIcolor, [rows colums]);
imshowpair(currIcolor, currIdepth, "montage");
I am using MATLAB R2023b, and I’ve done some research on the Internet, but I haven’t found a solution. Can you help me?
Thank you very much.Good afternoon,
I’m using MATLAB’s Visual SLAM with RGB-D Camera example (https://uk.mathworks.com/help/vision/ug/visual-slam-with-an-rgbd-camera.html), and I got this error message:
"Error using worldpointset/updateLimitsAndDirection
Invalid location for world point 1. It coincides with one of the views that observes the world point."
When I am exercuting this line of code:
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In:
% Create an empty imageviewset object to store key frames
vSetKeyFrames = imageviewset;
% Create an empty worldpointset object to store 3-D map points
mapPointSet = worldpointset;
% Add the first key frame
vSetKeyFrames = addView(vSetKeyFrames, currKeyFrameId, initialPose, Points=currPoints,…
Features=currFeatures.Features);
% Add 3-D map points
[mapPointSet, rgbdMapPointsIdx] = addWorldPoints(mapPointSet, xyzPoints);
% Add observations of the map points
mapPointSet = addCorrespondences(mapPointSet, currKeyFrameId, rgbdMapPointsIdx, validIndex);
% Update view direction and depth
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In the example code, I’ve just modified the download and browse part of the input image sequence.
The code I’ve added is as follows:
% Select the synchronized image data
Path_RGB = ‘C:Documents2.5RGB cameraImage for bad of wordsRGB’;
Path_Grey = ‘C:Documents2.5RGB cameraImage for bad of wordsDepth’;
imdsColor = imageDatastore(Path_RGB);
imdsDepth = imageDatastore(Path_Grey);
% imdsColor = subset(imdsColor, indexPairs(:, 1));
% imdsDepth = subset(imdsDepth, indexPairs(:, 2));
% Inspect the first RGB-D image
currFrameIdx = 1;
currIcolor = readimage(imdsColor, currFrameIdx);
currIdepth = readimage(imdsDepth, currFrameIdx);
currIdepth = rgb2gray(currIdepth);
[rows, colums] = size(currIdepth);
currIcolor = imresize(currIcolor, [rows colums]);
imshowpair(currIcolor, currIdepth, "montage");
I am using MATLAB R2023b, and I’ve done some research on the Internet, but I haven’t found a solution. Can you help me?
Thank you very much. Good afternoon,
I’m using MATLAB’s Visual SLAM with RGB-D Camera example (https://uk.mathworks.com/help/vision/ug/visual-slam-with-an-rgbd-camera.html), and I got this error message:
"Error using worldpointset/updateLimitsAndDirection
Invalid location for world point 1. It coincides with one of the views that observes the world point."
When I am exercuting this line of code:
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In:
% Create an empty imageviewset object to store key frames
vSetKeyFrames = imageviewset;
% Create an empty worldpointset object to store 3-D map points
mapPointSet = worldpointset;
% Add the first key frame
vSetKeyFrames = addView(vSetKeyFrames, currKeyFrameId, initialPose, Points=currPoints,…
Features=currFeatures.Features);
% Add 3-D map points
[mapPointSet, rgbdMapPointsIdx] = addWorldPoints(mapPointSet, xyzPoints);
% Add observations of the map points
mapPointSet = addCorrespondences(mapPointSet, currKeyFrameId, rgbdMapPointsIdx, validIndex);
% Update view direction and depth
mapPointSet = updateLimitsAndDirection(mapPointSet, rgbdMapPointsIdx, vSetKeyFrames.Views);
In the example code, I’ve just modified the download and browse part of the input image sequence.
The code I’ve added is as follows:
% Select the synchronized image data
Path_RGB = ‘C:Documents2.5RGB cameraImage for bad of wordsRGB’;
Path_Grey = ‘C:Documents2.5RGB cameraImage for bad of wordsDepth’;
imdsColor = imageDatastore(Path_RGB);
imdsDepth = imageDatastore(Path_Grey);
% imdsColor = subset(imdsColor, indexPairs(:, 1));
% imdsDepth = subset(imdsDepth, indexPairs(:, 2));
% Inspect the first RGB-D image
currFrameIdx = 1;
currIcolor = readimage(imdsColor, currFrameIdx);
currIdepth = readimage(imdsDepth, currFrameIdx);
currIdepth = rgb2gray(currIdepth);
[rows, colums] = size(currIdepth);
currIcolor = imresize(currIcolor, [rows colums]);
imshowpair(currIcolor, currIdepth, "montage");
I am using MATLAB R2023b, and I’ve done some research on the Internet, but I haven’t found a solution. Can you help me?
Thank you very much. rgb-d camera, updatelimitsanddirection, computer vision toolbox MATLAB Answers — New Questions