naval postgraduate school · naval postgraduate school monterey, california rear admiral r....

25
NPS62-89-023 DTIC File copy NAVAL POSTGRADUATE SCHOOL Monterey, California TECHNICAL REPORT Image Enhancement Software for Underwater Recovery Operations -User's Manual William J. Partridge Charles WV. Therrieni 16 June 1989 Approved for puiblic release; distribution unlimited. Prepared for: Naval Undersea Weapons Engineering Station Keyport, WA 98345 89 9a 2.6 1 ;5

Upload: phungminh

Post on 14-Oct-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

NPS62-89-023

DTIC File copy

NAVAL POSTGRADUATE SCHOOLMonterey, California

TECHNICAL REPORT

Image Enhancement Software forUnderwater Recovery Operations

-User's Manual

William J. PartridgeCharles WV. Therrieni

16 June 1989

Approved for puiblic release; distribution unlimited.

Prepared for: Naval Undersea Weapons Engineering StationKeyport, WA 98345

89 9a 2.6 1 ;5

Page 2: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

NAVAL POSTGRADUATE SCHOOLMonterey, California

Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull

Superinte2ndent Provost

RQ-roduction of all or part of this report is authorized.

This report was prepared in conjunction with research conducted forNuv, Undersea Weapons Engineering Station and funded by the NavalPostgraduate School.

Willia . artrdeMajor, U. S. Army

Charles W. Therrien

ProfessorDepartment of Electrical and

Computer Engineering

Reviewed by:

JOH'! ' POWERS GORDON E. SCHACHERChairman, Department of Dean. Science and Engineering

Electrical and Computer Engineering

Page 3: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

REPORT DOCUMENTATION PAGE

a :t C~ n ; 'TR C \z MA'RK:IGS

UNCLASSIFIED.d -S.C . CASD . ' T 0'. A.A , ,A 7 OF REPORT

, * C,

NO QRCAN ZA-,ON REPCRT N ),BER(S,

NPS 62-89-023

. ,01, '_ - . CE P, 'a N-E V ,ONORNG ORGANIZAT:ON

Naval Postgraduate School (It apphcable) Naval Undersea Weapons Engineering Station

6 " ,-' C 7) sr. re a (; Z C c 7 ,DDR-SS Cftj. State. and ZIPCode)

Monterey, CA 93943 Keyport, WA 98345

; : C- S'.'B0. 9 PROCUREVEN NS7RUM%,EN.T iDENTti;CA;ON IUV2;

(K' appltcao'e)

Naval Postgraduate School O&MN, Direct Funding:. ='1- :- .. : & :: a-a . , .. '-j" C, ') E C- :_, :.. ,_ ,";" "

POGAM O)ECT -ASK )N,TMontercy, CA 93943 EEMENT NO 1NO NO ACCESS:ON NO

" "_ ,n:JJ - Jv " . .- tCaJ ~ r,

Image Enhancement Software for Underwater Recovery Operations-User's manual

William J. Partridge, Charles W. Therrien

3a E- CC2 4 DAE 0F REPORT (Year. Month, Day) I's PAGE COr,,NT6J _ o-j/9. 16 June 1989 I 20

* -: -, ,6' " 5,ECT TERMS (Continue on reverse 'i necessary and identif'y by blocK number)_Di I c video image enhancement, image processing, underwater

recovery, underwater viewing

jA: - C r rji e rce-sC t n,:crssao, arc cien'It) b biock number)

This report describes software for performing image enhancement on live or recordedvideo images. The software was developed for operational use during underwater recoveryoperations at the Naval Undersea Warfare Engineering Station. The image processing isperformed on an IBM-PC/AT compatible computer equipped with hardware to digitize anddisplay video images. The software provides the capability to provide contrast

enhancement and other similar functions in real time through hardware lookup tables,to automatically perform histogram equalization, to capture one or more frames andaverage them or apply one of several different processing algorithms to a capturedframe. The report is in the form of a user manual for the software and includes guided

tutorial and reference sections. A "Digital :mage Processing Primer' in the appendixserves to explain the principle concepts that are used in the image processing.

TU. A. t- : A- CT 21 ABSTRACT SECURiTY CLASSFCATION. D J\.'D [ SAME AS RPT E DTIC USERS

S":,','- C.S - .j",v --. _- 22b TELEPHONE (incluoe Area Code) ac OFFICE SYMBOL

Charles V. Therrien

DD FORM 1473, a;- AF P 0 t on may oe Used Unto .xna ted SECURITY CLASSIF'CATION OF THIS PAGEA,: .,ther ed~tions are obsolete 0 U.S. Go., me nt ., office ,906-606-2o .

Page 4: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

A BST R ACT

Thlis report describce, software for perf'orming image enhancement on live or recordedvideo imacs. 'I'ie software was developed for operational use during underwater recov-

cry operationis aIt the Naval Unders.ea WVarfaire E~ngineering Station. The imiage procss-

ing, i, perfeCrmled Onl anl IBM-PC ATF compatible computer equipped with hardware to

dliwie an d dis;play videco imacges. The software provides the capability to provide con-

trast enhancement and other simidlar functions in real time through hardware lookup

table, to autonmtically perform histogram equalization, to capture one or more frames

and avecrage theml, or apply one of sev eral different processing algorithms to a captured

frlame-I. T*he report is in the f'orm of a user manual For the software and IilIudes OUIded

tutorial aind diecesec:tions A 'I-iital i mac Processing Primer' in the appendix

ere to explain the principle concepts that are us ed in the image proce-ssing.

T

Page 5: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

TABLE OF CONTENTS

A. G ENt 1E L.. L ................................................ I

B. FQL.IPM [NT R[QUIRLD .................................... 1

C. SIMPLIE SETUP .............................................. I

1, Getting the Board Ready .. .................................. I

2. Installing the B oard ..... ... ....... .. .... .. .... ... ....... .. 2

3. C able Installation .... .. .......... ............ ........... .. 2

4. Running the 'iagnostics . . ...................................

I). LETS T R Y 1i O U T . .........................................

1. Load the Program

2. L ive A ctio n .............................................

3. lake a Snapsh ot .... ........................ .... ..........3

4. 1 ake Two Snapshots . ...................................... 3

5 . A ll B la ck ...............................................3. .. W hite ...................... ......... ...... ..... .. ...3

Put Your Snapshot in the Photo Album ........................ 4

S. Open the ..\lhu to See Your Snapshot .......................... 49. Sim ple Process ne. ......................................... 4

it). I listogram i Lqualization .......... ........................ 5

I . f3ef',re and A fter ...... ...................................5

12. M odifying the Lookup Table ................................ 6

13. )raw Your Own Lookup Table .............................. 6

14. Storing and Retrievinm Your -avorite Lookup Tables ............. 7

15. Piggyback lookup Tables ..................................

10 . Z o o m .................................................7

17. L n zo o m ...............................................8

I8. Sharpen . ............................................... S

19. Low Pass Filter ...........................................

2). \n Edge D etector ........................................ 8

21. I m age A veraging ......................................... 8

. Q I_J(K R JI- LR .N CI LIST . . .................................. S

1. A for sel.cct m em ......................................... 9

Page 6: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

2. B for select mern B. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 9

I. (- Ifori display Ae A.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ...

4. 1 ) fo r displax inei B .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 9

5. F fo r grab .. .. .. .. .. .. .. .. .. . .. .. .. .. .. .. .. .. .. .. .. . .. .. 9

G ' fr -clear((- ). .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... 9

S. I11 for sclear 25 5). .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 9

9. 1 to store im1age9C.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... 9

D ). Ito read inMEC'. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 911 . Kto change2 setuIp. .. .. .. .. .. .. .. . . .. .. .. .. .. .. .. .. .. .. ... 9

12. L For analy sis .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . 9

C. h1 histoerarnil.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... 1

J. e = cq ualize .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . .1

.p= loglut..... .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . ..

h. a abslut. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . ..

1. = freeze .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . ..

k. s =stop. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. . . . .

\1 N to stoic lookup table. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 2

14. Nto read lookUp table .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12

15. ()to select output lookup tab-le .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12

16(. 1) to select in1put lookup table. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12

17-1. Q) for zooni. .. .. .. .. . .. . .. . .. .. . .. . .. . .. .. . .. . .. . .. .. . .. 12

IS. R for unzoom. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 12

19Q. S for sharpen .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... 12

21). T f'or low pas.. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. 1 2

21. Vor edge detector. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... .. 12

22. V for image average. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. ... 12

2 3. W for frarnegrabber off and exit programn.. .. .. .. .. .. .. .. .. .. .. 12

A TFNIIX A.- DIGITA~L IMAGE PROCESSING PRIMELR. .. .. .. .. .. .. .. I

Page 7: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

A . GNRN EARL . ............................................... 13

B. IIIL1 )Il AL INIA G E ..................................... 13

C . T ill: HIISTO G RA M ......................................... 13

D . '111L LO O K U P TA BLI ....... ............................... 14

II:\L I) STRIBUTION LIST .................................... 17

iL"

Page 8: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

A. GENERAL

Ihe "Menu" software package is a menu driven program which provides real time

continuous video image processing using lookup table modification techniques. It also

provides linited non-real time single frame enhancement capability. Control of the

roul:nes in "Menu" varies from manual (requiring operator input to make an adjust-

ment) to automatic or "hands-off' operation. The processing routines were chosen to

provide iimum effectiveness in situations where the images' pixel values are limited

to a relatively small region of the total gray scale range. Typically this would include

images of objects which have actual small variations in shading or those whose contrast

has been reduced by obscuration or dim lighting.

B. EQUIPMENT REQUIRED

'Ihe following equipment is required to use the "Menu" program:

" IBI Personal Computer AT, XF. or PCI or 100' o compatibles with ExtendedGraphics Adaptor card and monitor.

* Imagin., Technology PCVISIONplus Frame Grabber card with standard cable.2(NO IL: Ilhe older model PCVISION F'rame Grabber will not work.)

* Analog video monitor (such as SONY Trinitron 3 Model 1271Q).

• Video source (camera or video tape player).

C. SIMPLE SETUP

-lie 1CVStONolus Frame Grabber User's Manual provides all the information

required to place the Frame Grabber into operation. Itee is a much condensed version

of that procedure with some helpful hints to ease the way.

1. Getting the Board Ready

Figure 2-1 on page 2-' of the Frame Grabber Manual shows the jumper lo-

cations on the board and Table 2-1 on page 2-3 tells how they are configured from the

factory. There are three position functions to be concerned with:

* Since an EGA card is needed to run "Menu" the memory base address must bechanged on the Frame Grabber board. Address DOOO is recommended since thisis the def'ault value in the software. To change to address DOl(), simply insert ajumper at location JS. If other than DOOO is chosen it should be noted for entryeach time "Menu is run.

I Trademark of IBM.

2 lradcmiart of lmiaing Technology Inc.

3 -1ra dnark of SONY

Page 9: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

"'Menu" has a default register base address of 100. To change the FrameGrabberboard insert a jumper at location JIll. Again. if 100 is not used, the chosen valuewill have to be entered each time "Menu" is run.

If an AT host is being used a jumper is required at location J20. If an XT or PCis being used no jumper should be installed at J20.

2. Installing the Board

Pages 3-1 through 3-3 of the FrameGrabber Manual provide a detailed de-

scription for installing the board. A summary is as follows:

* Turn off and unplug the computer and periphials.

* Remove the cover.

P Place the board in any open slot where it fits and install screws.

* Reinstall cover.

* Plug in and turn on computer.

3. Cable Installation

Page 3-5 ofthe Frame Grabber Manual shows how to connect the cable. I lere's

the bottom line:

* Plug the rectangular female connector on the cable into the top connectorprotruding from the board.

• Connect the whtc laheled BNC connector to the video source output.

• Connect the green labeled BNC connector to the 'line' input (not the 'green' inputof the red, green, blue connections).

* Do not connect the red- or blue-labeled cables.

4. Running the Diagnostics.

Pace 3-10 of the Frame Grabber Manual describes the procedure for running1

the diagnostic software included with the Frame Grabber. Since the factorv configura-

tion has been changed as described above, the command < configure> will have to be

entered followed by the register base address (100) and the memory base address

(D0000). The diagnostics take several minutes to run so be patient. As stated in the

manual, system memory or other devices mapped into the same memory space or regis-

ter addresses will cause some tests to fail.

D. LET'S TRY IT OUT

This is an introduction to the "Menu" program. It let's you walk through some of

the features of the program; sort of a hands-on familiarization. If you are not familiar

with some of the concepts described in this section, or with digital image processing in

2

Page 10: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

general, you should probably lhve a look at the Primer which is included in this docu-

ment I an appendix. It e\plain, the neccessarv ideas in just a few pages.

Now tur1n on \ our source (camra or VCR and video monitor to let them warm up.

On %our computer go to the directory where you want to keep the program and copy

menu.e\e there.

1. Load the Program

To get started simply type the word 'menu' followed by <enter>. No <en-

ter - is needed for any selection from here on out unless otherwise noted. The menu

should now he display ed on the computer monitor. If ou are not using the memory

ba,e address 11)(000 and register base address (100) as described in paragraph C above,

ht K to chan,:e setup and follow the instructions on your monitor.

2. Lke Action

Ylen;u selcktion 'I5" provides continuous acquisition and display of the incoming

real imc \ideo imaces. lit '_' and you should see live action from ,our camera or VCR.

If"ou're usirig a tape make sure you press the play button first .

3. Take a Snapshot

Now let's freeie the action. I lit 'I' for snap. This acquires and displaxs a single

frame. You should see a stop action snapshot on N our video monitor. lhe image is also

stored now in framezrabber memory A. the default memory chosen when xou started

up.

4. Take Two Snapshots

Now hit I)' for dinplav memory B. Take another snapshot with the '12' key.

The second snapshot is now displayed on the r-onitor and stored in fraime rabber

nlCmeo:v B. Trv going bac:k to memory A (the 'C' key) to make sure the flirst snapshot

is sLll; there. Note that we are using the display memor- keys and not the select memory

kexs to perform these operations. NMore on select memory later when we start storingimages.

5. All Black

Let's erase one of our snapshots. Display memory B (the 'D' key) and then hit

the 'G' key for screenclear(O). This clears the screen and framegrabber memor-y B to

black or intensity level zero.

6. All White

While still in memory B hit the '11' key for screenclear(255). This erases the

screen and memory B to white or intensity level 255. Darker gray shades have lower

inten:ity levels while lighter shades have higher intensity levels.

* 3

Page 11: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

7. Put Your Snapshot in the Photo Album

Sax ing an image to disk is analogous to putting your snapshot in a photo al-

bumn. You should still have an image in frame memornv A. If not. use the display nim

A and snap routines to get one. Now hit the 'A' key to select memory A. This selects

memory..\ for data manipulations or storage. For our purposes we have selected theimage data in memory A to store on disk. Now hit the Tl' kev and you will be asked to

enter a:'n image name. Ty'pe a name (e.g. 'image') to store the image on the current disk

and directory or path and name (e.g. 'a: iniage') to store it in a different place. Then

xoul 1 be prompted for a comment. You may give it a label ox simply type 'none' (note

that - enter > is required for each of these inputs). The disk drive selected should make

some noieC and your snapshot is satel' tucked awav in the "photo album" (i.e. the ima2e

ti1e is r:kttcti to the disk.

8. Open the Album to See Your Snapshot

lct', see itthe imace was really saved. First erase both Frame nemories a,

desribcd in paragraph 5 or o above. Then select a memory using 'A or '11. Now hit

tic Jkcx. l',pe the image file name ,Iollowed by < enter>) to read the iitnae Ci1

khk. I he im:tgc should appear on the video monitor. If it does not. display the memory

x Cu sClectCd 'the 'C' or I)' key) and the image will appear.

9. Simple Processing

Now let's process real time video images using some simple lookup table mod-

itiea tion t chniqu , a I lit the L' kev - its called analysis, but reallv it just lets iou see

now " o1r iage i being changed. The graph you see on your computer monitor is the

current lookup table. 'lihe horizontal coordinate represents input pixel values and the

x erticl repreets output values.

()n the top of' the computer monitor screen are the current option, available For

Se ctit,,'. The snap (I-"' aiid grahb (i') options work the same as on the previous menu.

-lrv them' Now try the invlut (I ) option and see how the lookup table chances (the

blue line is the current lookup table and the green is a reference linear lookup table line).

'I hC Cflect on the inuge is just like looking at the negatives o'a photograph, except that

we still haxe lixe action. Now hit the 'L key for linear lookup table. We are back to

unprocessed live images.

Kexs 'P' (logarithmic and 'A' (absolute Nalue) also modify the lookup table.

You can experiment with these functions to see the effect on the real time image and

their clrreopom~din g Iookup taqe shape.

Page 12: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

10. Histogram Equalization

Now for the most powerful of our lookup table modification routines. I flit 'E'

for equdliie. Y 4 now are Liven two choices. default and rectangle. This determines

which portion of the image will be used to do the processing. Iost of the time you

will probably use the default mode but let's try rectangle now just for fun. lit 'R' for

rectangle. On the video monitor you will see the live images being displayed with a

rectnle overlaid. Now hit 'Num Lock' en your keyboard. Using the '2', '4', '6', and

'S' keys on the number pad ithe ones with the arrows) you can move the rectangle

around or, the screen. The corner numbers ('1', 3', 7', and'9') are used to change the

size of the rectangle. If your image had a large white or black area in which you were

not interested, it w-oald lessen the impact of the equalization routine on tie area of in-

terest. So you would frame the area of interest with the rectangle. After you have

placd the reiLtanye where you want it. hit S for stop.

Now you have to choose between manual or automatic update. Try manual

Splate first. I lit the NA key. The image will equalize, the new lookup table is plotted.

a 1: h" e action continues using the new lookup table. In this mode, as you notice the

contc:,t, of the im&ge changing you can hit the V" key and equalitation will occur again.

Let, go back now and try the default rectangle parameters. I lit 'C' to change

paramnieters. Now hit 'I)' for default and 'C' For continuous update. You are prompted

for tnnc between updates in seconds. lnter any number 2 through '4. The computer

vill pcrf'rm a new equalization at the interval you specify. Ihis is intended for situ-

at, ion, wh Cre the contents of -he inage are changing often and \ o u dont want to have

to remen'.ber to update. When you have seen enough updatem hir A for stop.

I1. Before and After

Lc Kslok at some histocrams and see whats happening when we equaiic, lit

the 'I V kc', for histograin. Again. you may choose between delault or rectangle to

specify a portion of the image. lt 'D' for default. Now hit tie 1' key for computation

of linear lookup tablo histogram. After the "COMPUTING IIISTOGRAMI- indicator

goes away hit 'NI for computation of modified histogram. W\hen the indicator goes

away this time hit 'D' to display the linear lookup table histogram. This is the infor-

mation used to perform the equalization. The image on the video monitor is the un-

processed version. Now hit 'E' to display the modified histogram. The video image is

enhanced and the "spread out" histomam is displayed. As you toggle back and forth

bctvccn 'I) and Y you can see grar'hically how equalization lets us use the fuli ranje

I I I I

Page 13: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

of intensity levels and the corresponding enhancement of contrast on the image. Con.

vinced? I lit the S' key and let's try something else.

12. Modifying the Lookup Table

lilt the 'N' key. Now we'll go again to the number pad with 'Num Lock on.

Usinc the corner keys '1. '3'. '7', and '9') we'll change the slope of the lookup table by

moving the top or bottom of the curve. To shallow out the lookup table use the '9' key

to move the top to the right and the '1' key to move the bottom to the left. Notice that

enhancement to the live images changes as you modify the curve. When you are finished

hit S' to stop and the resulting lookup table is shown. If you were to develop a "fa-vorite' lookup table which you think you might want to use again, there is a way to save

it in the computer. We'll talk about that later.

13. Dras Your O'sn Lookup Table

Now hit 'M' to perform another form of manual lookup table modification.

Well do this by drawing lines. Using the number pad with 'Num Lock' on move the

pointer on the computer monitor by hitting the '2', '4', '6'. and '8' keys. This will move

it one pixel In the direction of the arrows on the keys. The next key clockwise from each

oft!-ese will move it in the same direction ten pixels . (e.g. The '1' key moves the pointer

in the same direction as the '2' key only faster.) When the pointer is at a location where

you want the line to begin hit 'B' for begin line. Then move the pointer to a location

where you want the line to end and hit 'E' for end line. Now hit 'D' to draw the line

and your chance will take effect on your image. You may draw other lines to connect

secrnents and build a whole new lookup table. To get rid of the clutter just hit 'S' and

then reenter the routine b% hitting 'I'.

Now hit P' to pLUt a pointer on the live video image. To move tile pointer use

the number pad keys In the same manner as x ou dId to move the pointer on the com-

puter monitor described above. Notice on your computer monitor that the position of

the pointer and the intensity level are displayed. One possible use of this capability

would be to find the intensity level of an object in the image and use the draw lookup

table rouline to change all pixels with that intensity to another level. Again, if you were

to draw a reall, :, d al' purpose lookup table, you could save it with a routine which

we'll describ I lit 'S' to exit the video monitor pointer routine and 'S' again to exit

the nodify rouuti-e

6

Page 14: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

Finally. let's go back to the main Menu to see the lookup table storage selection

routines and try some single frame (Frozen) processing. Type "S' to exit the analysis

function.

14. Storing and Retrieving Your Favorite Lookup Tables

Remember that lookup table N ou designed using the modify routine a while ago?

I lere's how you can save it for future use. I lit the 'M' key. Type in a name (e.g. 'mylut'

or 'a: mniut). hit enter, and the values ire saved. To get it back hit the N" key to read

the lookup table values from disk. Again, type in the file name followed by enter and

your lookup table will take effect.

15. Piggyback Lookup Tables

The framegrabber board has two sets of lookup tables, one as the image is put

into frame menory and one as the image is output to the monitor. Up to this point we

have ov u::ed the output lookup tahie. Now we'll modif\ both sets to achieve a dill

fcrent result. flit the ' key to select the input lookup table. Then go back to the

analysis routine ('L) and do a histogram equalization. Everything still looks the same

as the last time we equalized , including the video image, but this time the computed

values went into the input lookup table. Now exit the equalization and analysis routines

to get back to the main menu. 1-lit the '0' kev to select the output lookup table. Then

go back into analysis. You may now use any of the lookup table modification routines

(e.g. in~lut, abslut, etc.) and you will get a "piggybacked" lookup table effect on the im-

aLe. To cet back to normal, hit 'L' to linearize the output lookup table. Go back to the

main mcnu and select and linearize the input lookup table. Note that when you use this

procedure. alwavs put values derived by equalization into the input lookup table or the

equalization will be based on already modified data.

16. Zoom

Now hit the 'R' key to start the zoom Iflnction. On the video monitor y'ou can

see the rectangle we saw before. Using the number pad with 'Num Lock' on you can

move the rectangle with the '2', '4', '6, and 'S keys in the direction of the arrows on the

keys. The size of this one is fixed at approximately one quarter of the screen, since we

will be expanding the image to four times the original. Move the rectangle to the por-

tion of the imace you wish to zoom in on and hit 'S'. The expanded image is displayed.

Notice that some resolution is lost from the original because we are "zooming" digitally

as opposed to changing the focal length of the camera lens. lit 'M' to get back to the

menu. Now you can process the "zoomed" image using the fixed image processing rou-

tines dcscribed bclow.

7

Page 15: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

17. Unzon

To return to a normal image after using the zoom routine and performing any

fixed image processing hit the 'R' key, It is essential that this be done when you are

,iched with a "zoomed' image or the zoom parameters will interfere with other rou-

tines.

18. Sharpen

Snap anl image by hitting the 'F' key or by using the zoom routine (the R' key).

Then hit 'S' to sharpen it. If you watch closely you can see the sharpening occurring

on the displayed image.

19. Low Pass Filter

Snap or zoom another image and then hit 'T' to call the low pass filter routine.

This function is designed to remove high frequency noise from a fixed image. Again.

looking closely you can see the change occurring.

20. An Edge Detector

One more time. snap or zoom an image. This time hit the 'U' key to perform

a Sobel Edgc Iiter. Note the interesting display of the image's edges on the video

monitor.21. Image Averaging

Ilit the '" key. Then enter the number of image frames you want to average

together. 'his number may be limited by the amount of disk space you have available

(2 is a good number to start with). When the averiige image is displayed you should

notice that objects wilich passed across the field o1 view during the operation have f'aded

away. Tihe more frames you average, the less visible these objects will become. Image

averaging is very effective at elininating transient noise, but requires a stable platform

for the source.

To exit the program hit the V' key.

E. QUICK REFERENCE LIST

This list presents the program's options in the order they appear with a brief de-

scription of their output.

• i nn a ua IN U nu l 8

Page 16: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

1. A for select mere A

Selects framegrabber memory A for storing or reading an image to from disk.

2. B for select niem B

Selects Framegrabber memory B for storing or reading an image to from disk.

3. C for display meni A

Selects Framegrabber memory A for acquisition of image from camera and dis-

plays memory A on the monitor.

4. D for display mem B

Selects framegrabber memory B for acquisition of image from camera and dis-

plays memor B on the monitor.

5. E for grab

Continuously acquires image frames from source and displays on video monitor.

Uses fiamegrabber memory designated by 'display mer' functioa.

6. F for snap

Acquires a singlc frame from source and displays it on the video monitor. Uses

framegrabber memorv designated by 'display mem' function.

7. G for sclear(0)

Clears screen and memory to intensity level O.

8. H for sclear(255)

Clears screen and memory to intensitv level 255.

9. 1 to store image

Stores contents of selected memory to disk. Prompts input of filename (includ-

ing path if desiredJ) and conmnnt.

10. J to read image

Reads image from disk file to selected framegrabber memory. Prompts input

of filename (including path if desired).

11. K to change setup

Allows change of software memory base address and register base address. On

screen instructions and example inputs provided.

12. L for analsis

Dispfays lookup tables and histograms. Performs equalization and lookup table

modification routines. Options as follows:

a. m = modlut

Modifies lookup table by drawing lines. Places pointer on video monitor.

Move pointer to desired start point and end point using 'Num Lock' on and number pad

9

Page 17: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

keys '2', '4*. '6'. and 'S' for down, left. up. and right respectively. Use keys 1, '7', '9',

and'3' for faster movement down, left, up, and right respectively./I, b = beginllre. .Maii ks beimiing ufiiill,.

'2/ e = en/line. Marks end of line.

,3) d= drawline. Draws line and enters new values into lookup table.

(4) p = pointer. Places pointer on video monitor. Gives pointer location

and pixel intensity level of that location on computer monitor. Use same method to

move pointer as for line drawing routine above.15, s=stop. Exit lookup table modify routine.

b. n = mnod2 tur

Changes slope of existing lookup table and implements results. With 'Num

Lock' on use number pad keys '1' and '3' to move bottom of curve left and right re-

spectively. Use '7' and '9' keys to move top of curve left and right respectively. I lit 's'

to exit this routine.

c. It = his togramn

Computes and displays histograms for images processed with linear arid

modified lookup tables. Snaps images before and after processing and allows for com-

parison.

I: dl= default. Selects default portion of image for histogram computa-

tion (approximately 90 o of image).

12) r= rectangle. Displays rectangle superimposed on image on video

monitor. Change portion of image used for histogram computation by altering rectangle

size and location. With 'Num Lock' on, use number pad keys "2', '4'. '6'. and 'S' to miov e

rectangle down, left. right. and up respectively. Use '' and '3' ke's to increase and

decrease height. Use '7' and 9' keys to increase and decrease width. lit 's' to exit rec-

tangle routine.

(3,/ 1= corn linl; r. Computes histogram of image processed by linear

LUT. Displays "COMPUTING HISTOGRAM" message until done.

:4) n = coin modhist. Computes histogram of image processed by

modified LUT. Displays "COMPUTING HISTOGRAM" message until done.

(5) d=dis linhist. Displays histogram computed above using image

processed by linear lookup table. Unprocessed image shown on video monitor.

16/ e= dis nodhist. Displays histogram computed above using image

processed by modified lookup table. Processed image shown on video monitor.

s = siop. Exit histogram routine.

10

Page 18: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

d. v = equalize

Pcri,ns histoEranI eq Uali/ation with update on commnand or automatically

at specified intervals I p,.s resulting lookup table after each update.

i id=a1:1u/il. Selects default portion of image to use for equalization

(approxinately 90-. of image .

2 ,= rccitigle. Allows use of rectangle to specify portion of image to

be used a. described in hiistogram rectangle routine above (paragraph 12.c.(2)).

3 c= c,,ltiu,,us update. Selects automatic update of lookup table at

specified intervals. Prompts for desired interval. I lit 's to exit equalization routine from

this mode.

.4 = tuala! updae . Selects lookup table update on command.

(a) u =update- Performs new equalization and updates lookup

table.

b c = changeparam- Returns to default rectangle portion of

iMeC options for changing parameters.

c) f= freezeframe- Acquires and displays a single frame (snap).

d) .,r=rab- Continuous acquisition and display of imagefl-ames.

e) s stop- Exit equalization routine from this mode.

e. 1= linlut

Sets lookup table to linear values. Results in unprocessed image.: i= in 'lut

Set, l0c,,kup table to inverse values. lroduccs a necative imaCe..'. /7 = lJ-ltt

Scts lookup table to logarithmic values. Increases image brightness.

h. a ab.rlut

Inverses intensity levels greater than 127. Reduces image brightness.

i. rab

Continuous aquisition and display of image frames.

j. f=f-eeze

Aquisition and display of a single frame (snap).

k. = .top

Exit ana l\ sis routine.

11

Page 19: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

13. NI to store lookup table

Stores contents of selected lookup table to disk. Prompts input of filename

(including path if desired).

14. N to read lookup tableReads lookup table values from disk to lookup table they were stored from.

Prompts input of filename (including path if desired).

15. 0 to select output lookup tableSelects the output lookup table to perform modifications on and for display in

the analysis routine. When used in conjunction with P' (select input lookup table) al-

lows for process:ng through two modified lookup tables.

16. P to select input lookup table

Selects the input lookup table to perform modifications on and for display in the

analvsis routine. When used in conjunction with '0' (select output lookup table) allows

for processing through two modified lookup tables.

17. Q for zoom

Enlarges chosen area of image. Provides moveable rectangle to select area for

zoom. With "Num Lock" on use number pad keys '2', '4', '6'. and '8' to move rectangle

down. left, right, and up respectively. Ilit 'z' to stop rectangle and fix, zoom image. Ilit

'mi to return to main menu.

18. R for unzoom

Returns image to normal state.

19. S for sharpen

Sharpens fixed image using a high pass filter. May be used on zoomed image.

20. T for Io'i pass

Performs a low pass filter operation on a fixed image. Reduces high frequency

noise. Blurs the image. May be used on zoomed image.

21. U for edge detectorPerforms Sobel edge detector operation on a fixed image. Displays detected

edges. May be used on zoomed image.

22. V for image average

Averages specified number of image frames and displays results. Prompts input

of number of frames to average.

23. W for framegrabber off and exit programTerminates program.

12

Page 20: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

APPENDIX A. DIGITAL IMAGE PROCESSING PRIMER

A. GENERALThis appendix provides the reader with some background on the basics of digital

image processing. It describes the makeup of a digital image, including the concept of

pixels and how gray level shading is accomplished. It also describes the histogram, a

basic tool in the analysis of a digital image. Finally it introduces the lookup table, which

is the primary image processing tool used in the "Menu" program.

B. THE DIGITAL IMAGE

Think about a black and white photograph. Suppose you were to overlay a grid on

it which is 512 squares across by 512 squares down. The picture is divided into 512 x

512 = 262,144 tiny squares. Each square is called a pixel. Now look at an individual

pixel to see what color it is. If it is black it will be assigned the lowest number, intensity

level 0. If'it is white it will be assigned the highest number, intensity level 255. Different

shades of gray will be assigned intensity levels between 0 and 255, with lower numbers

for darker grays and higher numbers for lighter grays. Once the image has been broken

up into pixels and each pixel has been assigned an intensity level, it is said to be digitized.

It's intensity levels are then stored in order somewhere in the computer. In the case of

the framegrabber it is placed into frame memory (either A or B) for processing and or

passing on to the monitor.

C. THE HISTOGRAM

Now Ict's look at our digitized image and count how many black pixels (intensity

level 0) are in it. Then we'll count the dark, dark grays (intensity level 1), the dark grays

(intensity level 2), and so on, all the way up to the whites (intensity level 255). When

we are finished we will have analyzed the image with respect to gray level content. A

plot of this gray levcl content is called a histogram. A histogram is normally plotted as

a bar graph, with the intensit, levels (0 to 255) plotted across the bottom, and the

number of pixels which have each intensity plotted as a v,:rtical bar (see figure 1). The

"Menu" program has a routine which allows you to compute and display the histogram

of an image. The histogram values are also used in an important lookup table modifi-

cation technique, the histogram equalization.

13

Page 21: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

4

2

0 l00 z00

Figure 1. Example of flistogramn

D. THE LOOKUP TABLE

A lookup table provides a way to change all pixels of a particular intensity level to

another intensity level. The table has 256 possible input values (one for each possible

gray level in the original image) and a corresponding output value for each input.

Lookup tables are normally plotted graphically with the input values across the hori-

zontal axis and the corresponding output values on the vertical axis. A lookup table

whose output values are the same as it's input values will not change the image and is

called a linear lookup table. It plots as a straight line from the lower left corner to the

upper right corner of the lookup table graph as shown in figure 2.

An inverse lookup table changes black pixels to white, white pixels to black, and in

between values to their difference from 255. The image processed through the inverse

lookup table looks like a photographic negative. We refer to it as a "negative" image.

lhe inverse lookup table plots as a straight line from the upper left corner to the lower

right corner of the graph as shown in figure 3.

A lookup table stretch is performed by setting low and/or high valued intensity lev-

els to zero and stretching the reduced input range of values to a full scale output range.

14

Page 22: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

OUTPUT

288

10-

ii I II

S 188 280 INPUT

Figure 2. A Linear Lookup Table

1 he resulting graph is a straight line with a steeper slope than our original linear lookup

table (see figure 4) and the image will have overall enhanced contrast; the steeper the

slope the greater the contrast, but for a smaller range of input values.

A more powerful, nonlinear form of stretching the lookup table is the histogram

equalization technique. It performs localized stretching of the lookup table by detecting

the areas of the histogram which have few or no pixel counts and using them to stretch

high pixel count areas across. I listogram equalization is a very efficient means of con-

trast enhancement. The "Menu" program is based primarily on lookup table modifica-

tion techniques and provides the user with the capability to modify the lookup table in

many different ways including those described above.

. 15

Page 23: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

OUTPUT

a180 288 INPUT

Figure 3. An Inverse Lookup Table

OUTPUT

zoo-

too-

8 16la 286 INPUT

Figure 4. A Lookup Table Stretch

16

Page 24: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

INITIAL DISTRIBUTION LIST

No. Copies

Defense Technical Information Center 2Cameron StationAlexandria. VA 22304-6145

2. Library. Code 0142 2Naval Postgraduate SchoolMont::ey. CA 93943-5002

3. Department Chairman, Code 62 1Department of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey, California 93943

4. P, ofessor C. W. Therrien, Code 62 3Department of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey, California 93943

5. Professor Robeito Cristi, Code 62 *

Department of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey', California 93943

6. Professor M. Fargues. Code 62Department of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey. California 93943

7. Professor Ralph -lippenstiel, Code 62Depar, nent of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey, California 93943

S. Professor Murali Tummala, Code 62Department of Electrical and Computer EngineeringNaval Postgraduate SchoolMonterey, California 93943

9. M. Rchard E,;ans 2NUWES. Code 7021Naval Undersea Weapons Engineering StationKeyport, Washington 98345

17

Page 25: NAVAL POSTGRADUATE SCHOOL · NAVAL POSTGRADUATE SCHOOL Monterey, California Rear Admiral R. 'A. Uest, Jr. Dr. Harrison Shull Superinte2ndent Provost RQ-roduction of …

10. CDR HillierNUWES. Code 80Naval Undersea Weapons Engineering Station,Keyport, Washington 9S345

11. Mr. Alan L. LindstromNUWES, Code 70Naval Undersea Weapons Engineering StationKeyport, Washington 98345

12. Professor 0. B. WilsonDepartment of PhysicsNaval Postgraduate School'A ontereV 'California -93943

13. *',IAJ William J. Partridge 3§:tudent DetachmentL.S. Arnmy Command and General Staff Collegei:ort Leavenworth, Kansas 66027

14. Research AdministrationCODE: 012Naval Postgraduate SchoolMonterey, CA 93943