LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Camera calibration : internal parameters

Hi,

The goal of my project is to measure the water level of a stream in a known environment using some image processing and analysis algorithms. The water is directly against a wall (i.e. a plane). I already have an algorithm that detects the interface between the water and the wall and now I need to use this information to get the actual water level in meters ; therefore I am working on the calibration of the camera. On my wall, I have some points for which the real coordinates are known, so the external calibration of the camera will not be a big problem.

However, I am working with a wide-angle camera that has a lot of radial distortion. In order to eliminate this distortion, I need to normalize the coordinates of the interested points using the internal calibration parameters of my camera. The parameters I need to get are the following :

- focal length
- principal point
- skew
- distortion

I tried to use the calibration VIs in the vision toolkit but they don't seem to be doing what I need. Ideally, I am looking for a VI that does pretty much the same as the Camera Calibration Toolbox in Matlab ( http://www.vision.caltech.edu/bouguetj/calib_doc/ ), but in LabView. I would like to come with a chess board, take several pictures and have a VI that gives me the internal parameters of the camera.

Does anybody have an idea of how to get these parameters ? Any help would be greatly helpful. Thanks !

Laurent

0 Kudos
Message 1 of 13
(11,997 Views)
Hi Laurent,

There is a brief description of the calibration in the NI Vision Concept Manual, chapter 3.
Otherwise, there is alos the knowledgbase NI Vision Algorithms

Best regards
Nick_CH
0 Kudos
Message 2 of 13
(11,976 Views)
Hi Nick !

First I want to thank you for answering my questions. I read both articles you sent on the subject of calibration. However, the calibration VIs provided by NI vision will not be useful for my application. Please let me explain the application I am working on, maybe your advice can be useful. The goal of my project is to measure the water level in a sewers system using image analysis. The free volume in sewers system is in general very limited ;  for a general vision of the system, a wide angle view camera is needed (an image is attached). As you know, the problem with this type of cameras is the radial distortion created by the lens. For a good lens distortion error removal, a large amount of measurement images is needed for the learning of the internal camera parameters.

My second point is the following : as I read in the articles you sent me, a large number of grid points is needed for the spacial calibration to be accurate, in particular when there is a lot of image distortion. Yet, due to the difficult environment in which we are working here, it is almost impossible to place a large number of points accurately on a wall for the purpose of calibration. And even if this was possible, the calibration of the camera parameters (internal) wouldn't be as good as if the calibration was done in a nice familiar environment such as a lab.

The problem here with the NI vision calibration algorithms is that either they account for perspective-only calibration or for perspective AND distortion. What I would like to do is to take away the distortion error in my lab where I can find easily the camera parameters and then measure the homography matrix (perspective) on site which needs a smaller number of points. This is the reason why I am looking for more specific calibration VIs than the ones provided by NI vision. However, I find NI vision very user-friendly and easy to work with so I do not consider of changing my working environment Smiley Very Happy

If you can help me on this, I would be very happy !!

Cheers, Laurent

0 Kudos
Message 3 of 13
(11,963 Views)
OOPs, forgot the attachment. Sorry for that.
0 Kudos
Message 4 of 13
(11,962 Views)

Hi!

 

I'm dealing with a similar problem but related with another application.

 

Did you manage to get a solution for your problem?

If so, can you share it?

 

Thanks in advance.

 

Best regards!

0 Kudos
Message 5 of 13
(11,611 Views)

Hi Goju,

 

I used the Matlab Camera Calibration Toolbox http://www.vision.caltech.edu/bouguetj/calib_doc/ for the calculation of the camera intrinsic parameters. The parameters are stored into a.m file. Then I have a set of VIs that use this information to transform coordinates from distorted to undistorted to normal (and all ways round), as well as image-undistortion or image distortion VIs. A zip file containing these Vis is attached to the message. Do not hesitate to contact me in case of questions/remarks. 

 

Laurent

0 Kudos
Message 6 of 13
(11,592 Views)

Lolon,

 

 thank you very much. That's exactly what I was looking for.

 

I've already thought of doing the same but you've just saved me a lot of work and time... 😉

 

Best regards.

0 Kudos
Message 7 of 13
(11,589 Views)

Lolon,

 

just one question.

 

With your VI's is it possible to calculate the z coordinate (xw, yw, zw) in the real world of an image point (xi, yi)?

 

thank you very much in advance!

 

Best regards!

0 Kudos
Message 8 of 13
(11,582 Views)

Hi Goju,

 

With a fixed (i.e. not moving) single camera it is not possible to calculate the 3D position of a point. You have to keep in mind that a camera is a projection of a point on a plane (pin-hole camera model). However, it is possible to calculate the 3D coordinates of points using two cameras (stereo-vision) (or a single moving camera). You can also use known visual features (rulers, points, etc.) placed in your image for the spatial calibration.

 

Good luck !

 

Laurent

0 Kudos
Message 9 of 13
(11,576 Views)

Lolon,

 

you're completely right.

 

My setup comprises a camera and a light projector.

 

Although, I'm still not seeing how can I extract the 3D info with that setup 😞 How can I calibrate the projector?

 

This link shows +/- what I'm intending to do:

http://eia.udg.es/~qsalvi/codedLight.mpeg

 

Any help?

Thank you very much in advance.

 

Best regards

0 Kudos
Message 10 of 13
(11,572 Views)