0

I have the following fish-eye lens distorted image:

enter image description here

I've been trying to use the undistortImagefunction for the distortion:

image = foam.jpg
cameraParams = cameraParameters('RadialDistortion',[0 0 0]); 
J = undistortImage(image,cameraParams); 

The problem is that it doesn't recognize the cameraParameters function

I am new to image processing, so I don't really know why this error Anyone has any idea how can I fix it or find an alternative solution?

Bowecho
  • 899
  • 2
  • 8
  • 17
  • 2
    yeah, undistort the image. You are not giving any information of what you tried! There is a function to undistort images in matlab with the calibration parameters of the camera, have you looked at that? – Ander Biguri Jun 15 '15 at 12:27
  • @Bowecho Please edit the question, rather than post code in comments – Luis Mendo Jun 15 '15 at 13:21
  • You may not have the right toolbox/version for that function. – nkjt Jun 15 '15 at 13:31
  • 1
    Why are you setting your distortion parameters to [0 0 0] ? Please read the help pages on how to select the barrel/pincushion correction values (and the exact names of the arguments to your functions) – Carl Witthoft Jun 15 '15 at 13:45
  • Plase, read the wikipedia page for camera distortion. https://en.wikipedia.org/wiki/Distortion_(optics) . You need to understand what the camera parameters are, as setting them to `[0 0 0]` makes no sense. Also, in order to undistort an image, you need a calibration of the camera. If you want to undistort an image by also estimating the camera parameters you are entering a quite complex field of image processing that can only be solved by reading tons of papers. So, or you already have the parameters, our prepare to read a lots of maths! – Ander Biguri Jun 15 '15 at 14:10
  • I doubt it's about 'lots of maths' (it's a bit vague), but anyway, I wondered if there might be an alternative to what I used. Now I know that what I used is not properly set, and I need to have clear some camera parameters. – Bowecho Jun 15 '15 at 14:35
  • 1
    What you used is correct, but you need the camera parameters! you need to calibrate the camera. http://uk.mathworks.com/help/vision/ref/estimatecameraparameters.html – Ander Biguri Jun 15 '15 at 14:41
  • You can't do this without knowing the camera parameters. The duplicate I've marked should help you. – rayryeng Jun 15 '15 at 14:53
  • Thank you, people. I will check the duplicate out. – Bowecho Jun 15 '15 at 15:22

0 Answers0