Download as pdf
Download as pdf
You are on page 1of 8
Lect 3 “Date chasses TT. dota dasses Supported by Matlab and TPT fer wegresenting pixel Uatuer in he Letimrsing, Table + tuge panies Desce prion at floating: pom Ruwbeers vint 8 | Unsigned 5+ bit ‘whegers UintiG | URigned 16-bit ia: Unsigned 32-bit integers “ Signed B-bit inregers y+ | d-10"| ps Lsereot Date The Prequontty, Data classes “Hheat encountered in mods Qrocerting, ove. double, oink & anh Logical. * Legend ormals ore Creakack by sing, Senesion Legical or by sine, felationad operoters. Lome “Tsees Ae becLbvox “suppares four rmpes of images: a Lurensity lmeges e Binary Images i Indexed Images « RGB tmoges « Trrensity Tmeges? C Groascnte Smeges) Bu intensity image is a dete matrix whese, Notues Weve been Scoted to —apresent intensities Z inary Images : Raggeat asroy Containing only Os and Ls Wherpreted as black and white , vespech aay ‘we MatLab Convention , Blo ise vareble fer Binary N : hoe We omy comtains Of eet Ect Ls Whese, Values ore of data class dilGrent Gen legicat C Socexample int a), ib ts met considered @ binary, imege in Matlab. - Canversion O _ numede cured te binor Te Caver& . We ude Ranetion Legical . » A = [ 9) soit: b teaiediees > B= Great CA); “fF 4 Covteces other haw 0, and Js Th Gpreat feacser Converts all nenterc Vetwes 60 Sgpreat G- Using felatronnt etapa copcec operator we ease erem re a KA pemurns Lif Bis Spent acre de otherwise ft returns oO, ‘ . Coprené avrnys Cun be converted +o Pumente areys ase Ya, dake class Conver functions, Indexed “Lmage An ‘ndexed image Consists of an array and oa Corhomeap matrix, We pitt values in an aney ave direct \adices mts a colermap, low Convention in Matleb = Usweble x, rekr to 4 away , ® ~The eure of — chass Legicat, vine 8, vintié , Sine or double . “The Colervenep matin is an my 8 onto, ek class dowble ( Voiues in Le (} rong). Each por of map specifies the ved, oyeen cond lune Components ef a Single color. ~The Color ef each image piel is delermined by Msing Ceeresgending yale ef X as an index wre meg. A Golormae is often Stored with on indexed \mage ond is automatically Leaded With image when Using — (myvead Sumemon , “ You Can use ony colormap that you Cheese , hot ony He defauls " Retationslip Letween Values in tre image metrix ond Me Colermop : Vanable mere —» reler bo da Sclermap Single, double] 1 Werengy PLP is Whe length of Mu Colermap, Value be Myst row, 2 secand,--- Leggeat vinkS | Vame g Points te te Lest row, Value L —-poiths te He second and so o1 oie 16 + REG Color Lrmage (trie corer image) “Truc color Wroges, yequire o three. mensional array ¢ mech maby by oh chass vine 8, vine 6, Single ey double hese peel Uotues specify BEksn sit Values, RGB Array Dare Types 4 UnJice an indexed image , however, these intensity Values sore Stend — direcy in the image anny, het indirectty in a Colormap, x m ond Hn are. Re numbers of rows ond Columns oF Pixels tmo He image | and Mu Nick dimension consists of Hees planes, Containing, ved, Qreen, amc be intensity Values, Gee. example f tre datennine “he Color of he pixel Cuz, 86) => » leok at the RGB triplet shred in CM2, 86,123), Suppose (112, BE, 1) contains “Whe voiwe B.N23B , (112, 86,2) contains 2 98F4 and (112, 86,3) Contains @25%3 , The color of Me pineal at (lit, Pe) is: G.1238 @.98F4 22543 Converting, berween Bate classes ond Image Tspes Matlab expects operands ln numero Cemputaton bo be of double. When you Shexe on image , you shoud stere (+ as vintS image since Huis require for less yremery than double . When You ore processing, On image you shousl Coaver& it te double, Te convert, we use 2 methods: i. “Type Casting, Convert from ane deka type +o onether: B= data- Cass. Name ¢ A) Canvert — Yhe Away A 40 Awpe of daka- olass-rome Exomele® B = double CA) © xamele © 7 D = Vint 8CO > a V8 c 4s on ary of dass Soule, iy Vlad wi Vawes are Le-a2ss)} (Passibie Jractional Joke ) a ah dass double hos oxy Vowues oukside wee range Je ess). Metleb Cowerts f oO aN \olues thek are less than ©, ond convert bo 255 ak Vokues Hek or qreake Nhon 255, in Dekween are converted te integers b- if an ow c- Dampers by discarding Mr Lroacienat parts, * Conerting ong ot He numentc data classes bo Legicot > vesulls In an crmy with Legeck \s iw Lecotion. walure Hea Inguk arog, Was newer Values and eyicak Os where Contains Os. Aha ing 2 Convecting, between Image Classes and Types. = pecferm Mecessory seating Ses Convert = bebween imnone Classes and Lypes. @) Warvink BCX) ¢ detects \ngut data class and scales to atlow retognitvon of data as atid image dato. douwkle to vine 8. “Conver an image named % Crom Examyle 9 Comider We Lotlovsing 2%% image $ of class Goulole . Seles ors wie - 15] performing Wa conversion = Amavinnd (F) % 35 @ (28 Vat ass 4) m2 dewle cx) ke lass double tm vonge te) Bovble » no efCeck, > Converse x — ingue Angua is ef dass Unless “Conver an image named % Crom wintd te double . Example + consider “He class vitkB image - > bh = wws( Les 5%) 128 20e)); PeRecming We Conversion. yg = \madeusle Ch) . D.9I9F DNIGS 4 = b.4t06 a tbh e)_mak2gray (%, L Amin Armas]) takes arbitrary cfouble oxy Anpor range Coed Nowes Converé +o Zero. + Noles > Amex ed four ke 4. “Convert an arbitrary orn eb deusle te an army of closs dovble scoted +o te ted , mare ret CA) TX seks Ae Vates of Amin oncf Bmax *4o “Me actual Minimum one matimum Yalues and scaled to im Ke a) ime bw CX Tr) + Comuere intensity image Cimpae matin) te a binary \mage y ang ting Ness thon “T cukpuk set to 9, ourwi se. surpet se te 4. - vre Lou, urge is loycoh. Wee bw (x) % Vs os (defart), E xomple .=> Comere, He Setrewing double image » Fe! 2 5 3 4) be binary suck hor Nowes | ond 2 become © ond Me other Awe vatuss become 4. Scouumwont first we converse ik de He Yonge Coe t] >» 4 mat 2aroy CF) A= ? @. 3333 or |. sow, The We Convert ck be binary using a a cesheld ( &- 6) DS gh = imrbe (9, 96) Qb= 2 © \ 1 > Converting Lmeges Motlels Command SPeaton NV dither (+) 2 Binary, rom Bray scale + Indexed from RES v gay ind c) Conver’ between intensity format bo dered Sarma Wind 2 gray c-) convert between indexed te intensity uv inda rab indexed —» rae y mate grag 0) Fequiar marnx —» intensity , Create a geyscole intensity image from date im a motex by seating tine dota. rgbe gray) RGB bo intensity ¢ apt ind ©) RGR to indexed Vo mt be intensity te bmery Matlah Tage Arithmerre Sunctrons Geet box CEPT) Mat Lab Description - imadd CA, 8) A+B Adding tue images eo imsubtract ¢ A, B) A-B subtracting twe images 2 immultiply CA, 8) A. x8 mmuleiply two images «im divide CA, 8) A./B divide tye Images Che Nemes are pounded re the nearest integer, net Atuncated Qe true integer Se ttrest~.) Lromele + Wu Coley 4 whe Matlel » >» e = ee a >» class CL) y 4% vint® > Size ( I) 2 250 340 3 » — Rguee » Amege © 5); » Ka! Some He) > » klabel Co Some text!) > 2 ‘ »> b dl, roe, ) A _ens C2,+,1) = 42 Zany (3,2) = 37 ans (2,43) = 4 D> = double (') /ass 5 » € (231, toe, :) % ans Ct, 8, 4 ems Cyt, 2) = @luS! > Gass Co) AX double = @ be ans (33,8) = 2/608 Arroy “ndexi a- Necker ial: “3 Exomples: 3 SFI) ZX wo vectr declraron » vc) K access hu second Clement «f Huy >» we Vi % too \eotor is Comerted to a Column he trantpese operator ( ) » ve CT} Nectar wsi: D> vC123) ZK “Wwe access blocks of elements, We Use’ Ymoklab’s Colon Notorion. access Bist Haree ctaments of V. D v(2:8) % access he Second —Herounh tu fourth. DD. wOSrend) % oth clement from Hird te He ast | > vor) He Produce a Column Vector DNC: end) x preduce 2 DP VC letend) 7% stack at 4) count ve by 2 and stop whew He cont reaches Hu last D> Nes r-2 2) 7 stocklot lest decrasd by 2) and Srepped at Hla Wrst element, \o. Morvix wdexing D> Ae El 2? 5 G Ss €5 7% & BJ A~ 3 *% B® Mmorvn declaration. AC2.3) % access cMement tn 0 marek (2-101, Column] > c= ACt, 3)7/ (ott Rows, Haied columns) D> T= ACU2Z, 123)3 exrract He bop Awo Rows >A (end, end) “Z Get _ She ost element (ast Row, lust Solemn) D Es AC! 37, Ct ID): Z% usivy Vectors te inher Ante a matrix , Tow Necker >

You might also like