13.08.2018 Views

[Studies in Computational Intelligence 481] Artur Babiarz, Robert Bieda, Karol Jędrasiak, Aleksander Nawrat (auth.), Aleksander Nawrat, Zygmunt Kuś (eds.) - Vision Based Systemsfor UAV Applications (2013, Sprin

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

132<br />

S. Fraś et al.<br />

the basis of event handl<strong>in</strong>g. A m<strong>in</strong>imum quantity of the code responsible for<br />

receiv<strong>in</strong>g consecutive frames, process<strong>in</strong>g and show<strong>in</strong>g them to the user <strong>in</strong> the<br />

application w<strong>in</strong>dow, is located <strong>in</strong> the ma<strong>in</strong> loop of the program. The rema<strong>in</strong><strong>in</strong>g<br />

operations are carried out by press<strong>in</strong>g one of available buttons or <strong>in</strong> response to<br />

meet<strong>in</strong>g certa<strong>in</strong> conditions specified by programmer himself.<br />

Fig. 8. The application w<strong>in</strong>dow<br />

A large part of the work was based on exploit<strong>in</strong>g ready-made functions serv<strong>in</strong>g<br />

the purpose of the image process<strong>in</strong>g. The whole process of the calibration of the<br />

cameras is carried out based on the OpenCV [8] library. It provides both, simple to<br />

implement functions realis<strong>in</strong>g real time video process<strong>in</strong>g, as well as the mecha-<br />

nisms that are used to calibrate the cameras and straighten<strong>in</strong>g of distorted images.<br />

S<strong>in</strong>ce the application is written <strong>in</strong> C#, EmguCV [9] library has to be used. Em-<br />

guCV is a cross platform<br />

.Net wrapper to the OpenCV image process<strong>in</strong>g library.<br />

The calibration requires direct<strong>in</strong>g the camera at an object with a known shape and<br />

a characteristic pattern, <strong>in</strong><br />

order to f<strong>in</strong>d the calibration of the parameters of distor-<br />

(chessboard) was used. Captured samples should conta<strong>in</strong> about thirty images of<br />

tion by use of certa<strong>in</strong> functions. A pattern of alternat<strong>in</strong>g black and white squares<br />

the chessboard <strong>in</strong> various positions.<br />

The CameraCalibration.F<strong>in</strong>dChessboardCorners(…) function is used to f<strong>in</strong>d<br />

coord<strong>in</strong>ates of the chessboard corners <strong>in</strong> the currently processed frame. Because<br />

these po<strong>in</strong>ts are only approximated, the utilization of CvInvoke.cvF<strong>in</strong>dCorner<br />

SubPix(…) function, which computed the exact location of the corners, was<br />

necessary.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!