• No results found

(a) Original Images. (b) Stitched Image

N/A
N/A
Protected

Academic year: 2021

Share "(a) Original Images. (b) Stitched Image"

Copied!
6
0
0

Loading.... (view fulltext now)

Full text

(1)

IN THE MATLAB ENVIRONMENT

M.Mudrova, A. Prochazka

Instituteof ChemicalTechnology, Department of Computingand ControlEngineering

Abstract

The paper is devoted to possibilities of geometric modi cations of images to

enable connection of separate scenes of overlaying images using their selected

features. Resultsofvariousimagetransformsveri edintheMatlabenvironment

are compared with standard software tools. Final algorithms are veri ed for

simulatedimagesat rst and thenappliedto realimages.

Keywords: ImageRegistration, Image Stitching,AlphaBlending, SpatialTransformations

1 Introduction

Image registration[5 , 7 ,6 ]is animportant partof imagerestoration that useobjective criteria

and priorknowledge to improvepictures. Thismethod processes distortedimages thepixelsof

which are shiftedfrom theircorrect position. Another pictureof the same object taken from a

di erent camerapositionoften servesasa controlimage. Thissituation isvery commonin the

remote sensing [2 ] where image registration method helps to nd the corresponding points in

two imagesofthesame regiontaken fromthedi erent viewingangles. The paperdescribesthe

application ofimageregistration intheimagestitching.

(a) Original Images

(b) Stitched Image

Figure1: Processofimagestitchingpresenting(a)threeoverlappingoriginalimagesofSt. Vitus

cathedral,(b) the nalstitchedimageobtainedbytheCanon companysoftware

Manynewdigitalcameras includingtheirprofessionalsoftwareprovidethepossibilitiesof

stitching images- thatmeansjoiningthepartiallyoverlappingsnapsto create panoramas. But

- after takingsuitablephotos - it ispossibleto useanyother imageprocessingsoftware aswell

[3 ]. Various algorithms producingdesired picture from original photos can be implemented in

thesimilarway. Thegoalstudiedinthepaperisinstitchingof imagesbymeansoftheMatlab

system and its Image Processing Toolbox [1 ]. Three snaps of St. Vitus Cathedral in Prague

(2)

intheJPEGformatonlyso thattheminimumcompressionlevel waschosen.

2 Image Registration Principle

Thegoal ofimageregistrationisremovingofimagedistortionaccording tosome prior

informa-tion. Thepixelsintheincomingdistortedimageareshiftedfromtheircorrectpositioncausedby

variousreasons. Thefactof makingonlytheplanarprojectionsofthree dimensionalobjects or

variousviewer's positions belongs to themost common causesof distortion. Moreover, various

optical systemscan producevarioustypesof distortion. The spatialtransformationsconstitute

abasicmathematicaltoolformappingreceivingdistortedimageinto correctsystem. The prior

informationaboutproperpositionsofpixelsisoftengivenbyanother(base)pictureofthesame

scenetaken fromthedi erentpointofview. Thecoordinatesysteminoneoftheimagesusually

is notCarthesian(see Fig.2). Even,the curvesdescribingthe systemneednotto be linear. It

is obvious that the shapes of the areas inside one image are quite di erent from the shapesof

thesame areas inthesecond one.

(a) (b)

Figure 2: An example of the image distortion caused by various points of view. (a) Image of

Carthesiangrid viewedfrom thedirection ofz-axis. (b)The same grid distortedwithselection

of anotherviewerposition

The resultof applicationof spatialtransformation to thedistortedimageI(x;y)is anew

imageJ(x ;y) whereeverypixel(x;y) isevaluatedbyselectedspatialtransformationequations:

x=F x (x;y) (1) y=F y (x;y) (2) Forms of functions F x ;F y

are given by the selected type of transformation. Projective,

aÆne,polynomial,linearconformalandothermethodsbelongtothereasonabletypesofspatial

transformations. The functions' parameters are estimated from the selected set of points for

whichweknowthepositioninthenewimage. Thisinformationistakenfromcomparisonofthe

baseimageinthecaseofimageregistration. Asthepixelcoordinatesx;yinthenewimageneed

notbe integer, theuse of an appropriateinterpolation method isnecessary to knowthe colour

levelexactly inthepixel coordinates. An exampleofimage registrationisshowninFig. 3.

(a) (b) (c) (d)

Figure3: Anexampleofimageregistrationpresenting(a)originalimageservingasaprototype

imageusedasthebaseimageintheregistrationprocess,(b)distortedimageexportedfrom 3D

drawing system in sililar way as the base image, (c) selection of control points in the Matlab

system, (d) resulting image after registration after the application of the aÆne transform and

(3)

Stitchingimages meansjoiningseveral partiallyoverlappedpicturesinto onepanorama. In the

digital photography there are some basic rules for taking incoming snaps described in [4 ] but

ingeneral itwouldbepossibleto joinanytwo(or more)corresponding picturesresultingfrom

various systems. The results of image stitching usually are not perfect, but dependingon the

usedalgorithmsandqualityofsourcepicturesthey canbegoodenoughto notnoticethejoins.

Two mainproblemsmustbe solved to accomplish thesatisfactoryresult:

 Source imagesregistration bymeansofspatialtransformations

 Mapping colourofsource imagesusinghistogram adjustment

The followingMatlab algorithm is focused on solvingthe rst problem epecially. Its function

wasveri edinjoiningoftwoupperphotosofSt. VitusCathedral(Fig.1a). Itcanbeappliedto

thegrayscale images orto theR,G,B colourlayers separately inthecaseof true-colourimages.

Figure 4: Selectionof control pointsset forthe given imageregistration. The important point

pairswere selected inbothimagesand corrected bymeansof correlation analysis

The algorithmconsistsof 4 steps:

1. Importinputimages into Matlab environment usingcommandimread

2. Registrationof the upperimage according to the lower one. The set of 42 control points

(Fig. 4) was selected using command cpselect for estimation of the parameters for

fol-lowingspatialtransform. Thesemanually selectedpointswerecorrectedusingcorrelation

analysis (cpcorrcommand). The projective transformand bicubic interpolationmethod

seems to be the most suitable modi cation in the case of these pictures. Result of its

applicationisshownintheFig.5. Themodi edpictureservesasaninputimageinto the

followingpartof thealgorithm

3. Selection of the cutting linein both images. The vertical line(at the similar position as

at theCanonpanorama) hasbeenselected intheupperimage. Thecorrespondinglinein

thelowimagewasfoundbymeansofcorrelationoflinescolorpro le(Thesameresolution

must have beenensuredbypreviousresamplingofimages)

4. Joining selected parts of both images into one. The method of alpha blending has been

(4)

Figure5: Anexampleofanimagetransformpresenting(a)theupperoriginalimageofSt. Vitus

Cathedraland (b) thesame imagemodi ed withprojective transform

4 Results

Fig.6comparesresultsofrealimagesstitchingachievedbystandardCanonsoftwareand

result-ing from theMatlab algorithm described above. The cutting line has beenselected according

(a) (b) (c)

Figure6: Resultingimagesand theircriticaldetailspresenting(a)stitchingwithoutany

(5)

cutting lineselection - as picturesare joined inthe vertical direction,theline going througha

remarkablehorizontallinecan bemore applicable. Thisfactis documentedintheFig.7.

Figure 7: The real image od St. Vituscathedral and its critical detail stitched in the Matlab

environment at theselected horizontalpro le

5 Conclusion and Suggestions for Further Investigation

It is possible to summarize that the Matlab system including its Image Processing Toolbox

provides large possibilitiesof spatial transformationsand image registration. Achieved results

documents wide possibilities of application of Matlab tools in the stitching process of given

images. The presented algorithm can be completed with a better solution of colour mapping.

Theappropriatealgorithmforautomatic ndingthesamedetailsintheoverlappedpartsofthe

stitchedimages willbefurtherstudied aswell.

Acknowledgments

The work has beensupported bythe research grant of the Facultyof Chemical Engineeringof

(6)

[1] Humusoft,Praha. Matlab - Image Processing Toolbox - User'sManual, 2002.

[2] Hozman J. Klma M., Bernas M. and Dvorak P. Zpracovan obrazove informace. 

CVUT,

FEL,Praha,1999.

[3] Berceanu M. StitchingPanoramas. www.berceanu.com.au, 2002.

[4] Ne O. Tajna kniha o digitaln fotogra i. UnisPublishing,Brno, 2001.

[5] Bosdogianni P.Petrou M. Image Processing,TheFundamentals. JohnWileyandSons, UK,

1999.

[6] Benes B.SochorJ., 

ZaraJ. Algoritmy poctacove gra ky. 

CVUT,FEL,Praha,1996.

[7] Marenka S. Watkins Ch., Sadun A. Modern Image Processing: Warping, Morphing and

Classical Techniques. Academic Press,UK, 1993.

M. Mudrova,A.Prochazka

Instituteof ChemicalTechnology,Prague

Department of Computingand ControlEngineering

Technicka1905, 166 28 Prague 6

Phone.: 00420-22435 4027, Fax: 00420-22435 5053

E-mail: [email protected], [email protected]

References

Related documents

Fine wines, champagne and premium sprits Complimentary Additional charge throughout the ship.. Bon voyage champagne Complimentary

Idiopathic facial paralysis (Bell’s palsy): a study of 180 patients [Paralisia facial periférica id- iopática de Bell]. Van

The purpose of present research work was to enhance the iontophoretic delivery of Rizatriptan Benzoate (RZB) through optimized gel based formulation by using chemical

ACD: aboveground carbon density; AGB: aboveground biomass; C: carbon; FC: fractional cover; FIA: Forest Inventory and Analysis; LFS: low fire severity; LiDAR: Light Detection

A numerical study of variable thermal conductivity and radiation on the flow and heat transfer of an electrically conducting micropolar nanofluid over a

The Substance Abuse and Mental Health Services Administration's (SAMHSA) Center for Mental Health Services (CMHS) is a proud sponsor of this implementation resource kit for Assertive

RSLIS will promote, strengthen and communicate a strong international LIS profile, hereby retaining and further developing its international standing worldwide as a highly