5 c -----------------------------------------------------------
7 subroutine findcut(icl,iscr,jscr,idim,jdim,index,iside,
10 c :::::::::::::::::::::
findcut ::::::::::::::::::::::::::::;
11 c find best place to split the 2d array of flagged points
12 c either split at a hole, or
use signatures to find
13 c zero crossing of laplacian.
14 c ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::;
17 implicit double precision (a-h,o-z)
22 dimension iscr(idim), jscr(jdim)
25 c include call.i to get def
's of horizontal/vertical. 26 c integer horizontal, vertical 27 c parameter(horizontal = 1) 28 c parameter(vertical = 2) 33 c look for holes first in horizontal then vertical direction 36 .eq.
if (iscr(i) 0) then 44 .eq.
if (jscr(j) 0) then 52 c no holes - find 2nd derivative of signatures for best cut. 53 c overwrite signature arrays. don't make cuts less than minoff
57 do 50 i = ilo+1, ihi-1
59 iscr(i) = iscr(i+1)-2*icur+ipre
65 imid = (ilo + ihi) / 2
66 do 60 i = ilo+minoff, ihi-minoff+1
69 locdif = iabs(itemp1-itemp2)
70 if (itemp1*itemp2.lt.0)
then 71 if (locdif .gt. locmaxi)
then 74 else if (locdif .eq. locmaxi)
then 75 if (iabs(i-imid).lt.iabs(indexi-imid)) indexi = i
82 do 130 j = jlo+1, jhi-1
84 jscr(j) = jscr(j+1)-2*jcur+jpre
90 jmid = (jlo + jhi) / 2
91 do 160 j = jlo+minoff, jhi-minoff+1
94 locdif = iabs(jtemp1-jtemp2)
95 if (jtemp1*jtemp2.lt.0)
then 96 if (locdif .gt. locmaxj)
then 99 else if (locdif .eq. locmaxj)
then 100 if (iabs(j-jmid).lt.iabs(indexj-jmid)) indexj = j
105 c ::::: choose max dif for splitting
107 220
if (locmaxi .gt. locmaxj)
then 111 else if (locmaxi .lt. locmaxj)
then 115 else if (iabs(indexi-imid).lt.iabs(indexj-jmid))
then 125 c :::::
if inflection pt. not over the threshold, signal
126 c ::::: with index 0 (out of range)
127 if (locmax .lt. ithres) index = 0
integer, parameter vertical
integer, parameter horizontal
subroutine findcut(icl, iscr, jscr, idim, jdim, index, iside,
Find best place to split the 2D array of flagged points.
The module contains the definition of a "node descriptor" as well as other global variables used duri...