1

I am trying to construct Structure from motion with multiple views in MATLAB But error occuring about camera parameters Kindly clear me how can i create my own camera parameters from 356 RGB Aerial images and how can i construct 3d point cloud from these images using MATLAB Kindly Help me It will be a great Favour.

I tried to export Camera info from exif file and meta data as camera parameter

It is the error https://www.mathworks.com/help/vision/examples/structure-from-motion-from-multiple-views.html in this example code, when i implemented it on my data

Undefined function or variable 'cameraParams'.

Error in StructureFromMotionFromMultipleViewsExample (line 80) I = undistortImage(images{1}, cameraParams);

I expected the output 3D point cloud model from multiple images

Edit

imageDir = fullfile('E:\Dataset\rgb-images'); 
imds = imageDatastore(imageDir); 
figure 
montage(imds.Files, 'Size', [3, 2]); 
images = cell(1, numel(imds.Files)); 
for i = 1:numel(imds.Files) 
    I = readimage(imds, i);
    images{i} = rgb2gray(I); 
end 
title('Input Image Sequence'); 
load('F:Practice\cameraParams.mat'); 
I = undistortImage(images{1}, cameraParams);

Here is the code last line contains error.

Patrick Happel
  • 1,336
  • 8
  • 18
  • 1
    Welcome to Stack Overflow! Please take the [tour] and read up on [ask]. At this point the question is difficult to answer, since we lack the code you have. All we can say is that `cameraParams` is undefined, exactly as the error says. Please [edit] the question to contain a [mcve], i.e. a small piece of code which reproduces the error, which is runnable by us. Please provide sample input and output. – Adriaan Aug 03 '19 at 14:04
  • Did you run load(fullfile(imageDir, 'cameraParams.mat'));? It should load the variable cameraParams – Daniel Aug 03 '19 at 14:28
  • Yes i have loaded – Fatima Laraib Aug 03 '19 at 17:35
  • imageDir = fullfile('E:\Dataset\rgb-images'); imds = imageDatastore(imageDir); figure montage(imds.Files, 'Size', [3, 2]); images = cell(1, numel(imds.Files)); for i = 1:numel(imds.Files) I = readimage(imds, i); images{i} = rgb2gray(I); end title('Input Image Sequence'); load('F:Practice\cameraParams.mat'); I = undistortImage(images{1}, cameraParams); Here is the code last line contains error – Fatima Laraib Aug 03 '19 at 17:41
  • I'm not using Windows and therefore cannot test this, but there might be a `\ ` missing after `F:` in the parameter of `load` – Patrick Happel Aug 03 '19 at 22:11

0 Answers0