This page was created by the IDL library routine
mk_html_help
. For more information on
this routine, refer to the IDL Online Help Navigator
or type:
? mk_html_help
at the IDL command line prompt.
Last modified: 13.07.2004
(See /IDL/pro_src/RODENA/pro_neu/merk/cdtp.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/i_schwelle_a.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/morph_demo.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/pickproject.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/pp.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/praeparat_rechnen.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/praeparat_zeigen.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/projekt_test.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/p_r_abfr.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/schwelle_a.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/schwelle_k.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/w_test.pro)
(See /IDL/pro_src/RODENA/pro_neu/merk/xschw_a.pro)
List of Routines
Routine Descriptions
CDTP
[Next Routine]
[List of Routines]
NAME:
CDTP
PURPOSE:
Displays DTP and TIFF-Image files
CATEGORY:
INPUT/OUTPUT of images
CALLING SEQUENCE:
CDTP, name
INPUTS:
Name: Image file name with wild cards (string)
OUTPUTS:
none
RESTRICTIONS:
Full color images are only displayed in grey
KEYWORDS:
MASK: =1 Bitplane 0 is displayed with exor and mask in yellow
=2 Binary image is displayed with border in red
=3 Mask generated from threshold from PIC File
SMASK: extension.plane
Bitplane plane from dtp-file.extension is displayed
with exor and mask in yellow or with border in red (MASK=2)
CT: Colortable number, default is 3
GREY: Colortable number 0
XSIZE: Window size, default is 640
YSIZE: Window size, default is 512
MAX: Window size = 1024x768
ZOOM: Zoom size, default is 1
ORDER: Reverse display order (see TV)
FILE: Image file names from file are resolved
NONAME: No name printing in the display
LOCATE: Stores mouseclicks on images and returns image name
=1 Start of schwelle_k
=2 Set a second diagnosis (button left=a/middel=b/right=d)
=3 Print the project,device and cell name
VERBOSE:Prints at some points
LUN: Opened logical unit for printing
EXTENSION:Image file extension (default='cel')
MODIFICATION HISTORY:
Written by: K. Rodenacker, 20.7.93.
Modified by: K. Rodenacker, 08.11.95.
Modified by: K. Rodenacker, 13.11.95.
Modified by: K. Rodenacker, 05.03.97.
Modified by: K. Rodenacker, 04.08.97.
I_SCHWELLE_A
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
I_SCHWELLE_A
PURPOSE:
Schwellberechnung eines Bildes
CATEGORY:
Featuring
CALLING SEQUENCE:
I_SCHWELLE_A, Bild
[, SMASK='ext.lev', DISPLAY, PARAMETER=pstr]
INPUTS:
Bild: Full ImageName
KEYWORD PARAMETERS:
SMASK: Separates Maskenfile (default=cem.0)
(file extension.ebene)
DISPLAY:
PARAMETER:external given parameter structure
OUTPUTS:
1. Wenn Maske im Bild werden die Bilder auch veraendert
Falls ein Merkmalfile bereits vorhanden ist, kann, wenn mehr Bilder
vorhanden sind, dieses File fortgesetzt (f) und verlaengert werden.
PROCEDURE:
EXAMPLE:
I_SCHWELLE_A, 'SYS$SYSDEVICE:[iliad.test.ttt]ttt001.cel'
MODIFICATION HISTORY:
Written by: K.Rodenacker 20.11.95
MORPH_DEMO
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
MORPH_DEMO
From people_demo
pro read_people_index, names, offsets, USE_CURRENT=use_current
filename = 'people.idx'
if keyword_set(use_current) eq 0 then $
filename = filepath(filename, sub='images')
openr, lun, filename, /GET
nimages = 0L ;The number of people
readf, lun, nimages
tmp = replicate({ pos: 0L, name: ''}, nimages+2)
readf, lun, tmp
names = strtrim(tmp(0:nimages-1).name,2)
offsets = tmp.pos
free_lun, lun
end
function people_image, index, lun, offsets, TOP_VALUE=top_value, LABEL = lw
if keyword_set(lw) then WIDGET_CONTROL, lw, $
SET_VALUE='Reading JPEG compressed image'
point_lun, lun, offsets(index)
read_jpeg, unit = lun, a
if n_elements(top_value) le 0 then top_value=230
a=bytscl(a, min=0, max=top_value, top=!d.n_colors-1)
if keyword_set(lw) then WIDGET_CONTROL, lw, SET_VALUE=' '
return, a
end
function barycentric, x, y, xt, yt, zt
det = (xt(1)-xt(0)) * (yt(2)-yt(0)) - (xt(2)-xt(0)) * (yt(1)-yt(0))
w0 = ((xt(1)-x) * (yt(2)-y) - (xt(2)-x) * (yt(1)-y)) / det
w1 = ((xt(2)-x) * (yt(0)-y) - (xt(0)-x) * (yt(2)-y)) / det
w2 = ((xt(0)-x) * (yt(1)-y) - (xt(1)-x) * (yt(0)-y)) / det
print, w0, w1, w2
return, w0 * zt(0) + w1 * zt(1) + w2 * zt(2)
end
pro morph, i0, i1, x0, y0, x1, y1, nsteps, QUINTIC = quint
This procedure actually does the morphing.....
i0 = first image, i1 = second.
x0, y0 = vectors of CPs in first image
x1, y1 = CPs in 2nd image
nsteps = # of transitions, including the two end-images.
ncp = n_elements(x0)
if ncp ne n_elements(y0) or ncp ne n_elements(x1) or $
ncp ne n_elements(y1) then $
message, "Number of control points doesn't match"
TRIANGULATE, x0, y0, tr, bounds
TRIANGULATE, x1, y1, tr1, bounds1
s = size(i0)
t = size(i1)
if (s(0) ne 2) or (t(0) ne 2) or (s(1) ne t(1)) or (s(2) ne t(2)) then $
message,'Image dimensions inconsistent'
nx = s(1)
ny = s(2)
gs = [1,1]
b = [0,0,nx-1, ny-1]
if n_elements(quint) eq 0 then quint = 0
xinteranimate, set=[nx, ny, nsteps], /SHOWLOAD, /CYCLE
for i=0, nsteps-1 do begin ;Each step
t = float(i) / float(nsteps-1) ;From 0.0 to 1.0
xt = x0 + (x1-x0) * t ;From 1st to 2nd
yt = y0 + (y1-y0) * t
xt1 = x1 + t * (x0-x1) ;From 2nd to 1st
yt1 = y1 + t * (y0-y1)
im1 = INTERPOLATE(i1, $
TRIGRID(x0,y0,xt1,tr, gs, b, QUINT=quint), $
TRIGRID(x0,y0,yt1,tr, gs, b, QUINT=quint))
im0 = INTERPOLATE(i0, $
TRIGRID(x1,y1,xt1,tr, gs, b, QUINT=quint), $
TRIGRID(x1,y1,yt1,tr, gs, b, QUINT=quint))
im = byte(t * im1 + (1.0-T) * im0)
xinteranimate, image=im, frame=i
endfor
end
pro morph_demo_event, ev
common morph_demo_common, cmd_button, frames_button, msg, lun, image_in, $
draw, draw_size, im_size, dwin, sx, nx, state, iindex, imlt, imrt, $
ncp, cpx, cpy, nimages, offsets
WIDGET_CONTROL, ev.top, /HOURGLASS ;Show busy
wset, dwin ;Our window
case ev.id of
draw: BEGIN ;Button event?
if ev.press ne 0 then return ;Only presses
if state le 1 then begin ;selecting an image?
im = ((draw_size > 384) - ev.y) / sx * nx + ev.x / sx
iindex(state) = im
if state eq 0 then WIDGET_CONTROL, msg, $
SET_VALUE='Select other image' $
else begin
WIDGET_CONTROL, msg, SET_VALUE='Pick LEFT control point'
erase
for i=0,1 do begin
imrt = people_image(iindex(i), lun, offsets, LABEL=msg)
tv, congrid(imrt, draw_size, draw_size), i*draw_size, 0
if i eq 0 then imlt = imrt
endfor
endelse
state = state + 1
ncp = 0
endif else begin ;Must be marking a CP
rt = ev.x ge draw_size ;Right image?
x = (ev.x mod draw_size) * im_size / draw_size ;Scale to pixels
y = ev.y * im_size / draw_size
if rt ne (ncp and 1) then return ;Proper image? If not, toss.
plots, ev.x, ev.y, /dev, color=!d.n_colors-1, PSYM=2
empty
if ncp eq 0 then begin ;1st cp?
cpx = x
cpy = y
endif else begin
cpx = [cpx, x]
cpy = [cpy, y]
endelse
ncp = ncp + 1
WIDGET_CONTROL, msg, SET_VALUE= $
'Mark the ' + (['LEFT','RIGHT'])(ncp and 1) + ' image.'
IF (!Version.Os NE 'MacOS') THEN $
tvcrs, ev.x - (2*rt-1) * draw_size, ev.y, /dev $
ELSE tvcrs, 1
endelse
ENDCASE
cmd_button: case ev.value of
'Done': BEGIN
if image_in eq 0 then FREE_LUN, lun
WIDGET_CONTROL, ev.top, /DESTROY
ENDCASE
'Help': BEGIN
XDISPLAYFILE, Group = ev.top, Title='Morph Demo Help', TEXT= [ $
"Morphing is the gradual and continuous changing of one image to", $
"another. This demonstration shows IDL's built-in irregular gridding,", $
"interpolation and image processing capabilities by changing one person's", $
"face to another.", $
" ", $
"To run this demo, select two images with the same general orientation.", $
"Then alternately mark control points on the same feature in each image.", $
"For example, the tip of the nose, corners of the lips, pupils of the eyes,", $
"and top of the head are readily distinguished features of human faces.",$
" More control points give better results.", $
" ", $
"When all points are marked, press the 'Go' button to morph between the", $
"images. You can experiment by adding or removing control points, and", $
"stop and restart the animatation."]
ENDCASE
'Delete CP': BEGIN ;Remove prev CP
if state le 1 then return
if ncp le 0 then return
ncp = (ncp + (ncp and 1)) - 2 ;Better be even
if ncp gt 0 then begin
cpx = cpx(0:ncp-1)
cpy = cpy(0:ncp-1)
endif
tv, congrid(imlt, draw_size, draw_size), 0, 0
tv, congrid(imrt, draw_size, draw_size), draw_size, 0
for i=0, ncp-1 do $
plots, cpx(i) * draw_size / im_size + (i and 1) * draw_size, $
cpy(i) * draw_size / im_size, /DEV, PSYM=2, COLOR=!d.n_colors-1
WIDGET_CONTROL, msg, SET_VALUE= 'Mark the left image.'
ENDCASE
'Restart': BEGIN ;Restart
erase
ncp = 0
if image_in then begin
tv, congrid(imlt, draw_size, draw_size), 0, 0
tv, congrid(imrt, draw_size, draw_size), draw_size, 0
endif else begin
tv, people_image(nimages, lun, offsets, LABEL=msg)
state = 0
endelse
ENDCASE
'Go' : BEGIN
if ncp lt 2 then return
if xregistered("XInterAnimate") THEN return
widget_control, frames_button, GET_VALUE=i
nframes = ([3,8,16,32])(i)
i2 = indgen(ncp/2) * 2 ;Alternate CPs
i1 = im_size -1
x0 = [cpx(i2), 0, i1, i1, 0] ;Add corners to CPs
x1 = [cpx(i2+1), 0, i1, i1, 0]
y0 = [cpy(i2), 0, 0, i1, i1]
y1 = [cpy(i2+1), 0, 0, i1, i1]
morph, imlt, imrt, x0, y0, x1, y1, nframes
xinteranimate, 40, group = ev.top
ENDCASE
ENDCASE
else: i2=0 ;Dummy stmt
ENDCASE
end
+
pro morph_demo, GROUP=Group, im0, im1, USE_CURRENT=use_current
Demo for morphing. If im0 and im1 are supplied, they are the two
images to morph. If not supplied, the people.dat file is read and
the user selects two faces to morph.
USE_CURRENT = true to read from files in current directory.
PICKPROJECT
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
PICKPROJECT
PURPOSE:
Simple user interface for feature evaluation and idl usage
CATEGORY:
Featuring
CALLING SEQUENCE:
PICKPROJECT [, /NEW, PREFIX='...', USER='...']
or
PP
KEYWORD PARAMETERS:
NEW: New file naming format
USER: only VMS: for users different from default(=getenv("USER")
PREFIX: only Unix: for different mountpoints
EXTENSION:image file extension
OUTPUTS:
Depending from executed functions
SIDE EFFECTS:
Strong influences on featuring projects !!
RESTRICTIONS:
PROCEDURE:
EXAMPLE:
PICKPROJECT,/NEW
MODIFICATION HISTORY:
Written by: K. Rodenacker, 26.09.1995
PP
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
PP
Kurzaufruf von Prozedure PICKPROJECT (siehe dort)
pro pp,_EXTRA=tt
pickproject,_EXTRA=tt
end
PRAEPARAT_RECHNEN
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
PRAEPARAT_RECHNEN
PURPOSE:
Feature extraction of one specimen
only VMS
CATEGORY:
Featuring
CALLING SEQUENCE:
PRAEPARAT_RECHNEN, Projekt, Device, Praeparat
[,/NEW,USER='...',/DISP,NUM=...]
INPUTS:
Projekt: Name of projekt (top level directory)
Device: Device name (VMS)
Praeparat: Name of specimen
KEYWORD PARAMETERS:
USER: ='xyz' Username if not default
Will fail without write-access
NEW: New image file names (only numbers)
DISPLAY: Display and wait for keyboard input
NUMBER: =x Starting number (default=1)
PATH_PIC: ='path' Path for new pic-file
SUBIMAGE: =y Distance from Maske (default=8)
SMASK: ="extension.plane" for separate maskefile
1 ... 8 short-cut for "cem.0" ... "cem.7"
NOOVERWRITE: Create new output PIC file
PIN: New PIC-File will be used for input,
independent from PATH_PIC
SZENE: allow more than one object per image
EXTENSION: image file extension
For testing purposes
PARAMETER: =parameter_structure
expicitely given parameter structure
ON_ERRORS: No roll back on errors
VERBOSE: Feedback per object
TIMER_RESET: Reset of timer variables
NORANDOM: No random 1bit added
EXTENSION: image file extension
PROCEDURE:
EXAMPLE:
PRAEPARAT_RECHNEN,'test1','$1$dia0','ttt',/NEW
MODIFICATION HISTORY:
Written by: K. Rodenacker, 29, Nov 1994.
Changed 24, July 1995
pro praeparat_rechnen, proj, dev, praep, $
NUMBER=num, NEW=nw, DISPLAY=disp, PIN=pin, $
PATH_PIC=path_pic, SUBIMAGE=subimage, $
USER=user, SMASK=smask, NOOVERWRITE=noover, $
SZENE=szene, PARAMETER=xpara, ON_ERROR=onerr, $
WATERSHED=water, VERBOSE=verb, TIMER_RESET=timer, $
DEBUG=debug, NORANDOM=noran, EXTENSION=ext
PRAEPARAT_ZEIGEN
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
PRAEPARAT_ZEIGEN
PURPOSE:
Display of the images of one specimen
CATEGORY:
Featuring
CALLING SEQUENCE:
PRAEPARAT_ZEIGEN, Projekt, Device, praeparat
[,/NEW,/SELECT='...',USER='...']
INPUTS:
Projekt: Name of projekt (top level directory)
Device: Device name (VMS)
directory root (non VMS)
Praeparat: Name of specimen
KEYWORD PARAMETERS:
USER: (only VMS) Username if not default
NEW: New image file names (only numbers)
SELECT: Selection criteria, .e.g. '13*'
very useful from CDTP
MASK for display of object mask
MAX for large display area
RESTRICTIONS:
Mostly useful under VMS
PROCEDURE:
EXAMPLE:
PRAEPARAT_ZEIGEN,'test1','$1$dia0','ttt',/NEW,USER='ILIAD',SEL='0*0'
MODIFICATION HISTORY:
Written by: K. Rodenacker, 09, Nov 1994.
PROJEKT_TEST
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
PROJEKT_TEST
PURPOSE:
Listing of projekt structure including cell numbers,
feature file sizes, PPP file sizes etc.
CATEGORY:
Featuring
CALLING SEQUENCE:
PROJEKT_TEST, Projekt, Device
[,/VERBOSE,/NEW,/PRINT,USER='...']
INPUTS:
Projekt: Name of projekt (top level directory)
Device: Device name (VMS)
directory root (non VMS)
KEYWORD PARAMETERS:
USER: (only VMS) Username if not default
VERBOSE: Each directory will be listed
default (only such with errors)
PRINT: Output will be printed and stored in
file 'Projekt.lis'
NEW: New image file names (only numbers)
EXTENSION: image file extension (and type) (default=cel)
OUTPUTS:
Listing of the projekt
E.G. in Verbose mode:
NR. Specimen ERR Anf End PIC PPP
1 501a2 0 1 163 163 163
2 bild -2 * 0 0 0 0
3 cc -2 * 0 0 0 0
4 dtp -2 * 0 0 0 0
5 ild -2 * 0 0 0 0
6 invar -2 * 0 0 0 0
7 merk -2 * 0 0 0 0
8 nnn -2 0 0 8 0
RESTRICTIONS:
Mostly useful under VMS
PROCEDURE:
EXAMPLE:
PROJEKT_TEST,'test1','$1$dia0',/VER,/NEW,USER='ILIAD'
MODIFICATION HISTORY:
Written by: K. Rodenacker, 09, Nov 1994.
P_R_ABFR
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
P_R_ABFR
PRO P_R_ABFR, disp, wait, naff, a_ff, inum, iinum, onum
Abfragen im interaktive Modus von PRAEPARAT_RECHNEN
aloop:if wait then print,format='($," P_R>: ")'
a=get_kbrd(wait)
case a of
---- Help
'?': begin
print,"x=Abort/w=toggle wait/d=toggle display/p=print ?/<CR>=cont :"
wait=1
goto, aloop
end
---- Help
'h': begin
help
wait=1
goto, aloop
end
---- Abortion
'x': begin
update_pic,naff, a_ff, onum
message,'Aborted by user request !'
end
---- Change wait status
'w': wait=(not wait) and 1
---- Stop for debugging
's': stop,'Number: ',long(a_ff(0))
---- Change display status
'd': disp=(not disp) and 1
---- Print (parts of) actual feature vector
'p': begin
print,' Type group name: '
i_prfeat,a_ff
wait=1
goto, aloop
end
'-': iinum=iinum-2
'+': iinum=iinum+1
else:
endcase
end
SCHWELLE_A
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
SCHWELLE_A
PURPOSE:
Schwellberechnung der Bilder eines Praeparates
CATEGORY:
Featuring
CALLING SEQUENCE:
SCHWELLE_A, Project, Device, Praeparat
[,USER=user, NEW, DISPLAY]
INPUTS:
Projekt: ProjektName
Device: Bildspeicher Device
Praeparat: PraeparatName
KEYWORD PARAMETERS:
USER: Username (default=f$user())
NEW: Neue kurze Filenamen
SMASK: Separates Maskenfile (default=cem.0)
(file extension.ebene)
EXTENSION:image file extension (and type)
DISPLAY:
PARAMETER:external given parameter structure
OUTPUTS:
1. Merkmalsfile wird erzeugt
2. Wenn Maske im Bild werden die Bilder auch veraendert
Falls ein Merkmalfile bereits vorhanden ist, kann, wenn mehr Bilder
vorhanden sind, dieses File fortgesetzt (f) und verlaengert werden.
PROCEDURE:
EXAMPLE:
SCHWELLE_A, 'TEST1', 'SYS$SYSDEVICE:', 'TTT', /NEW
MODIFICATION HISTORY:
Written by: K.Rodenacker 21.10.93
Modification: 11.11.94
Modification: 05.03.97
SCHWELLE_K
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
SCHWELLE_K
PURPOSE:
Schwellkontrolle der Bilder eines Praeparates
CATEGORY:
Featuring
CALLING SEQUENCE:
SCHWELLE_K, Project, Device, Praeparat
[, NUM=Start, USER=user, /NEW, /UPGRADE]
INPUTS:
Projekt: ProjektName
Device: Bildspeicher Device
Praeparat: PraeparatName
KEYWORD PARAMETERS:
NUM: Startnummer (default=1)
USER: Username (default=f$user())
NEW: Neu Filenamen
UPGRADE:update_dtp anstelle vom write_dtp, recommended for harddisk
MASK: Binary Mask in bitplane 0 of greyscale image
SMASK: 1..8 Binary Mask in bitplane x of separat image ext='cem'
SCROLL: Scolling enabled
S_SCROLL:Viewport size (default=128), switches on SRCOLL
I_SIZE: Maximum Image Size (default=128)
ON_ERROR: For testing purposes only
EXTENSION: image file extension (and type)
OUTPUTS:
1. Merkmalsfile wird ueberschrieben
2. Wenn Maske im Bild werden die Bilder auch veraendert
COMMON BLOCKS:
SCHWELLE
SCHWELLM
PROCEDURE:
Benutzt werden SCHWELLE bei reiner Schwellkontrolle und
SCHWELLM bei Masken SchwellKontrolle
EXAMPLE:
SCHWELLE_K, 'TEST1', 'SYS$SYSDEVICE:', 'SSS', /NEW
MODIFICATION HISTORY:
Written by: K.Rodenacker 19.10.93
Modification: K.Rodenacker 11.11.94
Last Modification: K.Rodenacker 06.03.97
W_TEST
[Previous Routine]
[Next Routine]
[List of Routines]
NAME:
W_TEST
PURPOSE:
Visual test of shading images
CATEGORY:
Featuring
CALLING SEQUENCE:
W_TEST, Projekt, Device [,/NEW,USER='...']
INPUTS:
Projekt: Name of projekt (top level directory)
Device: Device name (VMS)
directory root (non VMS)
KEYWORD PARAMETERS:
USER: (only VMS) Username if not default
NEW: New image file names (only numbers)
EXTENSION: imges file type (default=cel)
OUTPUTS:
Names of shadingimages
RESTRICTIONS:
Only useful under VMS
PROCEDURE:
EXAMPLE:
W_TEST,'test1','$1$dia0',/NEW,USER='ILIAD'
MODIFICATION HISTORY:
Written by: K. Rodenacker, 23, May 1995.
XSCHW_A
[Previous Routine]
[List of Routines]
NAME:
XSCHW_A
PURPOSE:
Schwellberechnung eines Bildes
CATEGORY:
Featuring
CALLING SEQUENCE:
Res = XSCHW_A, Bild, pstr [, /DISPLAY]
INPUTS:
Bild: image:xxxarr(n,m)
Pstr: parameter structure for threshold
THSF: float factor
THSA: float additive constant
THSV: short method (1,2,3,-1)
THSM: byte generate mask
THSS: short frequency threshold
THSR: byte activate NOT rice
KEYWORD PARAETERS:
DISPLAY:
OUTPUTS:
Res = structure
thresh:int =0 No threshold found
thresh1:int secondary threshold
mask:bytarr(n,m)
kx:float
ky:float
lox:float
loy:float
rux:float
ruy:float
PROCEDURE:
EXAMPLE:
s_mask=XSCHW_A, bild, pstr
MODIFICATION HISTORY:
Written by: K.Rodenacker 11.1.96