METHOD AND APPARATUS FOR IDENTIFYING AN OBJECT USING AN ORDERED SEQUENCE OF BOUNDARY PIXEL PARAMETERS

Abstract: The present invention relates to a method and apparatus for identifying an examined object having a discernible boundary. An image of the object is formed (34) and segmented into a plurality of pixels (36). The boundary of the object in the image is detected (40) and the parameters of the boundary pixels form an ordered sequence: p1...pk...pN, where p1 is the parameter value of the first boundary pixel; where pN is the parameter value of the last boundary pixel; N is the total number of boundary pixels and k is the index to the N pixels. The pk data point is determined (42) such that k satisfies the relationship (I): i-1/M < k/N <= i/M, where M is the total number of quantile partitions and i is the ith quantile partition. The object is identified based upon the pk data point value, which is the ith quantile in M partitions developed from the above relationship.

Description: METHOD AND APPARATUS FOR IDENTIFYING AN OBJECT USING AN ORDERED SEQUENCE OF BOUNDARY PIXEL PARAMETERS ** * * * * * * * * * * * * * * ** * ** * * * *** * Technical Field The present invention relates to a method and an apparatus for identifying an object under examination, wherein an image of the object is formed. More particularly, the present invention relates to a method and an apparatus for identifying an object based upon the object having a discernable boundary and a novel feature termed "quantile". Background Of The Invention Methods and apparatuses for identifying an object are well-known in the art. The art of identifying biological samples is replete with various techniques for identifying the type of biological samples under examination. See, for example, U.S. Patent No. 4,175,860. Formation of histograms of various parameters are also known. See for example U. S. Patent No. 3,851,156. Heretofore, one of the known methods for identifying an object is to use the size of the object. Other parameters of the object which can be used to identify an object include color, internal optical density, and average intensity within the boundary of the object. In some cases, however, it is not possible to identify an object uniquely or to differentiate two objects if certain of their parameters yield the same result. Thus, for example, if two objects have the same size and have the same internal optical density and have the same average visible light intensity, then it is not possible to identify one of the objects or to differentiate these two objects, based upon these parameters. In addition, some of these parameters are computationally intensive requiring considerable amount of time or computer resources. Thus, the present invention contemplates a novel method and apparatus for identifying an object or to differentiate two objects based upon a new parameter which is termed "quantile". Summary Of The Invention In the present invention, a method of identifying an object, under examination, which has a discernible boundary is disclosed. The method comprises the steps of forming an image of the object. The image is segmented to form a plurality of pixels. The boundary of the object under examination in the image is then detected. A measurement is made of a parameter of each pixel within the boundary detected. The parameter values of the pixels measured within the boundary detected are formed in an ordered sequence. The particular measured parameter value P k , where k is an index of the ordered sequence, is determined such that the index k satisfies the following relationship: i-1 k i M N M N - is the total number of pixels; M - is the total number of quantile partitions i - index corresponding to the i th fraction of partition or i th quantile The object under examination is then identified based upon the P k parameter value which is the i th quantile within M partitions developed from the above relationship associated with the object. The present invention also contemplates an apparatus to carry out the foregoing method. Brief Description Of The Drawings Figure 1 is a schematic graphical illustration of two objects "a" and "b" which have the same size and shape and the same average intensity but which are different . Figure 2 is a graph showing a histogram of intensity of light versus the number of pixels in the boundary detected. Figure 3 is a graph showing a cumulative histogram of intensity of light versus the cumulative number of pixels in the boundary detected, and with the quantile feature determined for each object. Figure 4 is a table of pre-determined relationships or quantiles of various known objects. Figure 5 is an ordered sequence of the values of the parameter measured for the pixels in the boundary. Figure 6 is a block diagram of an apparatus suitable for carrying out the method of the present invention. Detailed Description Of The Drawings Referring to Figure 1, there is shown a schematic diagram of an image 10 of two objects: object "A" 12 and "B" 14. Although the description set forth hereinafter is with reference to the method of the present invention to distinguish object "A" from object "B", it can be seen that the method of the present invention is equally applicable to identifying a single object which is under examination. Each of the objects 12 and 14 has a discernible boundary 18 and 20, respectively. As shown in Figure 1, each of the objects 12 and 14 has the same size and shape. Although for illustration purposes, objects 12 and 14 are shown as having the same size and shape, it is not necessary to the practice of the present invention. The purpose of illustrating the method of the present invention using objects 12 and 14 having the same size and shape is to show how the method of the present invention can be used to distinguish objects 12 and 14 under examination when other parameters, such as size and shape, cannot be used. Objects 12 and 14, of course, represent images of real objects, such as cells, genes or other biological or non-biological objects. In the method of the present invention, an image 10 is taken of the objects 12 and 14. The image 10 can be formed by using an electronic video camera, such as a CCD (the specific details of an apparatus suitable to carry out the method of the present invention will be discussed hereinafter) . The image 10 is then filtered in accordance with the different color filters that can be used to distinguish the type of color of the object. Each of the different color images is segmented, to form a plurality of pixels. Each pixel is then digitized. The boundary of each of the objects 12 and 14 is determined. This can be done, for example, by the method disclosed in U.S. Patent No. 4,538,299, which is incorporated herein by reference. Once the boundary of each of the objects 12 and 14 is determined, one of the parameters of each pixel within the boundary is measured. One parameter can be the intensity of visible light. Thus, the intensity of visible light at each pixel, positioned within the boundary positions 18 and 20, is measured. One prior art method is to form a histogram of intensity versus the number of pixels. Referring to Figure 2, there is shown two histograms. The histogram of Figure 2a corresponds to the object 12 whereas the histogram of Figure 2b corresponds to the object 14. As can be seen from Figure 1, object 12 has a substantially uniform intensity (the dark image indicates brightness) throughout the entire region within the boundary 18. Thus, the histogram, as shown in Figure 2a, shows substantially N x pixels each having an intensity of -.-_. In contrast, object 14 has a small area 16 that has greater intensity than the uniform intensity I 1 of object 12. The histogram, as shown in Figure 2b, shows that N 2 number of pixels in the spot 16 have substantially an intensity value of I 2 , with N x > N 2 and I 2 > I 1 . Once the histogram of each object 12 and 14 has been formed, a cumulative histogram is then developed. The cumulative histogram is formed by summing the number of pixels that has at least a certain intensity value. If N = f(I) , where N is the number of pixels having an intensity level I, then Cum N = F(I) where Cum N is the cumulative number of pixels having an intensity level ≤I, and where I F(I) = Σ f(j) j=o The cumulative histograms of the histograms shown in Figure 2a and 2b, are shown in Figure 3. The particular parameter value, such as intensity of visible light, associated with a cumulative fraction of all pixels, is termed a quantile. Thus, from Figure 3, the 50th quantile is I 3 for object 12 and I 4 for object 14. It should be noted that unlike conventional percentile representations, which are even increments of discrete percents, quantile representations are not limited to discrete, even increments. Thus, an object may be identified by its ith, jth, or kth quantile, where i, j, and k do not necessarily occur in discrete, even increments. Since the quantile relationship, shown in Figure 3, associated with each objects 12 and 14 is different, the objects 12 and 14 can be distinguished from one another, based upon this developed quantile relationship. Alternatively, to uniquely identify a particular object, such as object 14, the quantile relationship associated with the object 14 can be compared to a table of pre-determined relationship of other known objects whose quantile relationships have been pre-determined. The table of pre-determined quantile relationships of other known objects can be based upon experimental results. The comparison of the quantile relationship to the table of pre¬ determined quantile relationships would then serve to identify uniquely the type of the object that is under examination. For the purpose of distinguishing the objects 12 and 14 from one another or to identify an unknown object by comparing the quantile relationship, it is not necessary to compare each ordered pair of numbers (Q,I) (where Q is the quantile number and I is intensity associated therewith) , to each other (in the case of two particles) or to a table (in the case of attempting to uniquely identify an object) . One method is to compare the associated intensity value of the object under examination at a particular quantile number to the associated intensity value of another object at the same quantile number, or to a table of associated intensity values of identified objects at the same quantile number. Thus, as shown in Figure 3, the 50th quantile for the object 12 has an intensity value of I 3 and the same 50th quantile for the object 14 has the value I 4 . These intensity values can be compared to each other to distinguish one object from another. Alternatively, the 50th quantile of one of the objects can be compared to a table of intensity values of identified particles whose 50th quantile have been pre-determined. See Figure 4. By comparing the 50th quantile of the unknown object to the table, the unknown object can be identified. Of course, if we are dealing with objects of biological particles having statistical variations in intensity, it may not be possible to determine precisely the intensity associated with a particular quantile for the same particle under all cases of examination. Thus, a table relationship may encompass a range of values of intensity for a particular quantile such that the object having that range of intensity values, can be uniquely identified. The range of values can be developed from representative samples identified from experimental results. The foregoing example illustrates a method of distinguishing objects wherein the average intensity of the two objects 12 and 14 are indistinguishable. However, using the intensity of visible light and the quantiles developed therefor, the objects can be distinguished from one another. Parameters, other than intensity of light can also be used to distinguish the particles. Thus, another parameter suitable for use is differentiating by color representation. Color can be represented by three primary colors of red, blue, and green. Alternatively, color can also be represented by hue, intensity, and saturation; or by cyan, magenta and yellow. In one particular embodiment, the difference in color representation of the primary colors is used. The parameter of log(a) - log(b) may be employed, where a, and b are intensities of red and blue primary colors, respectively. Other possible combinations include: a being green and b being red; or a being green and b being blue. The problem with the foregoing method of calculating quantiles is that a cumulative histogram must be formed. This necessitates the creation of a plurality of discrete "bins". A bin is defined by a cumulative fraction of all the pixels from a first fraction to a second fraction. As can be seen from Figure 3, the entire value of the cumulative histogram from 0 to I τ must be divided into a number of discrete bins. The i th quantile is the value of I corresponding to the i th cumulative fraction of the pixels. For parameters, such as log(a) - log(b) , as mentioned hereinabove, the range of values can be enormous (due to the nature of the logarithmic operation) . Thus, the choice of the boundary of the bins may become difficult. In the method of the present invention, quantiles can be calculated without calculating a cumulative histogram. In the method of the present invention, the values of the parameters measured for each of the pixels within the boundary detected are placed in an ordered sequence. This is shown in Figure 5. As previously discussed, for the example used in the method of the present invention, the objects 12 and 14 are assumed to be the same size and shape. Thus, each of those objects 12 and 14 would be segmented into the same number of total pixels, N. The parameter, for example of intensity of visible light, for each of the pixels within the boundary is then placed in an ordered sequence. P x is the value of the pixel having the lowest intensity of visible light. P N is the value of the pixel having the largest value of the parameter, such as intensity visible light. The values of the parameter of the pixels measured are then formed in an ordered sequence. A value of P k represents the parameter of the pixel between the smallest value and the largest value with k being the index to the N pixels. Thereafter, k is chosen such that k satisfies the following relationship: i-1 k i M N M where M is the total number of quantile partitions and i is the i th fraction of partition or i th quantile. For the i th chosen quantile, once k is determined, the intensity value of the data point P k would be the intensity value associated with the i th quantile, or simply the value of the ith quantile. Thereafter, the object under examination can be distinguished from other objects based upon the i th quantile. Alternatively, the object under examination can be distinguished from all other objects based upon a table of predetermined values of corresponding i th quantile. This can be accomplished even where the two objects do not have the same number of pixels. Thus, for example, object 1 has N x pixels and Object 2 has N 2 pixels. The parameters of the pixels are placed in an ordered sequence as follows: ■ -L O - P- L ... P kl ... P N1 - object 1 having N x pixels P- L ... P k2 ... P N2 - object 2 having N 2 pixels where k is the index. For each object, the P k data point is determined such that k satisfies the following: i-1 k i M Total No. of pixels M for the object M - total number of quantile partitions; i - i th fraction of partition or i th quantile partition where for Objects 1 and 2 i and M are chosen to be the same. The resultant value of P k for each object is compared to one another to differentiate the objects. Of course, as previously discussed, Objects 1 and 2 can be the same type of object even if P kl does not equal P k2 . There can be a range of values for a particular quantile such that objects having values within that range will still be the same type. As can be seen from the foregoing, with the method of the present invention, no cumulative histogram calculation is made. As a result, there is no need to set the size of the bin to calculate the cumulative histogram. A simple comparative relationship to determine the index of the data points is determined from which the value of the data point of the parameter measured is then obtained which corresponds to the quantile of interest. An example of the method of the present invention can be seen with reference to the following Table 1, with an example of three particles: Particle 1, Particle 2, and Particle 3, each having 50 pixels of varying intensity of the same parameter. TABLE 1 The next table, Table 2, shows various statistical values computed for the three particles. TABLE 2 Particle 1 Particle 2 Particle 3 The next table, Table 3, shows the creation of a plurality (10) of "bins" with each bin containing a count of the number of pixels having a value between a first count to a second count. Thus, Bin #1 contains all the pixels having intensity values between 0 and 10. For particle #1, there would be 13 such pixels. For particles #2 and #3, there would be 40 and 40 respectively. The 10 bins are chosen to partition the maximum range of pixel intensity values into 10 fractions. Since the maximum range of intensity value is zero to 41.23, 97.00, and 97.00 for particles #1, #2 and #3 respectively, the 10 bins are chosen to delineate pixel intensity values of 0-10-20-... -90- 100. The column entitled Cumulative Histogram is a cumulative count (shown as a %) of the total number of pixels having an intensity value between zero and the value associated with the Bin #. As can be seen from Table 3, particles #2 and #3 are indistinguishable based upon cumulative histogram. Further, as previously discussed, for intensity values based upon log( ), the value can be large. Thus, the range of pixel intensity values will be large, rendering difficult the division of the intensity values into a manageable number of bins. CO P- C t- r-I O O O O O H H HC r*τ*-)ω coσ.o The following table, Table 4, shows the table of pixel intensity values (Table 1) rearranged in accordance with the method of the present invention. The pixel intensity values are ordered in a sequential order, from highest to lowest. (Of course, the ordered sequence can be from the lowest to the highest . ) In this example, P 50 for each of the three particles have the values 6.46, 2.87 and 1.66, respectively, while P x is 41.23, 97.00 and 97.00 respectively. where Rank is the order in sequence by the intensity of the pixel, Pixel* is the number of the pixel from Table 1, Intensity is the value of the intensity for the corresponding Pixel* from Table 1, and Percent is the percent of particles that would have intensity value shown under Intensity or less. Thus, the pixel having the Rank of 3 for Particle 1 is Pixel* 45 from Table 1. Pixel* 45 for Particle 1 has an intensity value of 34.80. Further 95.91% of all pixels in Particle 1 have intensity values of 34.80 or less. If the number of "bins" or fractions, M is chosen to be 10 (the same as the example based upon a cumulative histogram calculation) , and N-number of pixels = 50, then i - 1 k A i 10 50 10 where i is the i th bin . If i=10 9 k» 10 50 k 10 = 46 , 47 , 48 , 49 , 50 . If we choose k 10 = 50, then P kl0 = 6.46, 2.87, 1.66 for particles *1, #2 and #3, respectively. Since P kl0 = 2.87 for particle *2 clearly differs from P kl0 = 1.66 for particle #3, particles *2 and #3 can be differentiated, while other statistical based analysis such as histogram, and cumulative histogram are unable to differentiate the particles. Furthermore, although a single value was compared, clearly a range of values can be compared. Note that the same holds true for P k9 (K 9 = 45) = 8.55, 3.77, 1.98 and P k8 (K 8 =40) = 9.16, 4.25, 2.25 for particles *1, #2 and #3 respectfully. An apparatus 30 suitable for carrying out the method of the present invention is shown in Figure 6. The apparatus 30 comprises a microscope 32, which is focused on an examination area 33. The examination area can be a microscopic slide or a flow cell such as that disclosed in U.S. Patent No. 4,338,024. A camera 34 is attached to the microscope 32 and is adapted to image a portion of a suspension having a particle therein. The camera 34 is preferably of a raster scan type and may be a CCD camera model XC-711 manufactured by Sony. The camera 34 can form an electrical image of the field of view as seen through the microscope 32. Further, the camera 34 segments the image into a plurality of pixels, with an electrical signal corresponding to each pixel of the image. The camera 34 also outputs a plurality of signals (3) one for each of the colors (Red, Blue, and Green) . Each of the signals from the camera 34 is supplied to a digitizer 36, which digitizes the image intensity of each pixel into an electrical signal representing the grey scale value. Preferably, the pixel is digitized into a gray scale value between 0 and 255, inclusive. From the digitizer, the digitized gray scale value is supplied to a memory 38, where the values are stored. The memory 36 can be a RAM. A boundary detector 40, such as that disclosed in U.S. Patent No. 4,538,299 operates on the image in the memory 38 and detects the boundary of the image detected. The result is also stored in the memory 38. From the memory 38, a computer 42 operates on the image and measures a parameter, such as intensity of light, of each pixel within the boundary detected. In the event the apparatus 30 seeks to determine the identity of a single particle under examination, then the particular quantile value derived by the computer 42 is compared to the table of stored values 46 of previously identified particles. The table 46 can be a ROM or another memory. The result can be displayed on the display 44. In the event the apparatus 30 seeks to differentiate a plurality of objects under examination, then a quantile is developed for the same parameter for each of the pixels in the boundary of each of the images of the different objects. From the quantile, the particles under examination can be differentiated from one another. The result can be displayed on the display 44. The computer 42 carries out its tasks in accordance with a computer program. A copy of a program to compute quantiles written in the C language for execution under the MS-DOS operating system is as follows: 37 */ 3B struct ccdef <. 37 char ceang -i /* angular position of next point 0 - 7 */ 40 int ) /* x-poβltion of current point */ 4^ Int t /* y-positiόn of current point */ 2 j ., /* chain code definition structure */ 43 44 typedef char nBgroupC93ι /* B-group of characters ( pixels ) */ 45 46 typedef struct i 7 int pxt /* x-coordinate */ 49 int py» /* y-coordinate */ 49 > point . /* point coordinates */ 50 51 typedef point nBpointsC73ι /* array of central point and B neighbors */ 52 53 /* 94 *tt****w»*ff»*w************************************* w ************************ 55 ** BUDROUTINE DECLARATIONS 56 ***************************************************************************** 57 */ 5B int ccaboxOOi 59. int ccabrkOO. w 60 int ccaconscOi *J* 61 int ccaconssOi 62 int ccadconOOi 63 int ccadetpOO) 64 int ccadilateO; 65 int ccadisεlO; 66 int ccadisstO. 67 int ccaenterO; 6B int ccaerodlOj 69 int ccaerσdeO) 70 int ccafilinOi 71 int ccafililOi 72 int ccafili2()ι 73 void ccafil-1 <-)?— 74 int ccanBbfOO. 75 int ccanβfoH). 76 77 1 /* ndap.hO Block Diagram Software ndap.hO 2 ** 3 ** Programmer: H. L. Kasdan ι\ ** 5 ** Copyright : (C) 19B8 by 6 ** International Remote Imaging Systems Inc. 7 ** B ************************************************************************** 7 ** 10 ** NAME 11 ** ndap. h - NIH data analysis header file 12 ** 13 ** SYNOPBIB 14 ** 15 ** DESCRIPTION 16 ** I 17 ** BEE ALSO £ IB ** I 17 ** DIAGNOSTICS 20 ** 21 ** BUGS 22 ** 23 ** REVISION HISTORY 24 ** 25 *************************************************************************** 26 */ 27 /* 2B *************************************************************************** 29 ** DEFINES 30 *************************************************************************** 31 */ 32 Hdefine CAXMAX 50 /* cell array x-maximum */ 33 ttdefine CAYMAX 50 /* cell array y-maximυm */ 34 /* 35 *************************************************************************** 36 ** STRUCTURE DEFINITION 37 *************************************************************************** 3B */ 39 struct imageO -C 40 char fnametl4_ι /* cell data file name and extension */ 41 int cellnσ. /* cell number */ 42 long int riodi /* red iod */ 43 long int giodi /* green iod */ 44 long int biodi /* blue iod */ 45 long int rioti /* red lot */ 46 ong int gioti /* green lot */ 47 long int biot» /* blue lot */ I 4B int careai /* cell area */ Y 49 int windowi /* box window size */ 50 int thresh. /* edge trace threshold */ 51 char ctypeC12-)ι /* cell type */ 52 int cxO. /* cell trace starting x-position */ 53 int cyO; /* cell trace starting y-poβition */ 54 int cx ini /* cell trace minimum x-poβition */ 55 int cymini /* cell trace minimum y-poβition */ 56 int cxmaxi /* cell tract maximum x-poβition »/ 57 int cymaxj /* cell trace maximum y-poβition */ 5B int cpiei /* cell points in edge */ 59 char ccct256_ι /* cell chain code */ 60 unsigned char crimgCCAYMAXKCAXMAXli /* cell red image */ 61 unsigned char egimgtCAYMAXJtCAXMA Ii /* cell green image */ 62 unsigned char cbimgtCAYMAX-ItCAXMAX-l) /# cell blue image */ 63 unsigned char cnrin.gtCAYMAX_.-_CAXMAXHi /* cell normalized red image */ 64 unsigned char cngimgCCAYMAX3CCAXMAX_lι /* cell normalized green image */ 65 unsigned char cnbimgtCAYMA HCAXMAX- /* cell normalized blue image */ 66 int lgmlrtCAYMAX CAXMAX-h /* log green minus log red image */ 67 int lbmlgtCAYMAXltCAXMAX-.. /* log blue minus log green image */ 6B int lrmlbCCAYMAX-.CCAXMAX_Ij /* log red minus log blue image */ 69 int qclgmlrt503» /* log green minus log red cell quantiles */ 70 int qclbmlgt50-lι /* log blue minus log green cell quantiles */ 71 int qclrmlbC503» /* log red minus log blue cell quantiles */ 72 int mclgmlπ /* log green minus log red cell pixel mean */ 73 int mclbmlgj /* log blue minus log green cell pixel mean */ 74 int mclrmlbi /* log red minus log blue cell pixel mean */ 75 int sdclgmlπ /* log green minus log red cell pixel std dev */ I 76 to int sdclbmlgi /* log blue minus log green cell pixel std dev */ **. 77 int sdclrmlb. /* log red minus log blue cell pixel std dev */ I 7B char ccimgCCAYMAXJCCAXMAX]> /* cell chain code image */ 79 struct ccdef cccimgt256_). /* cell chain code struct */ BO ι /* imageO - cell image data structure */ Bl struct histO B2 unsigned int rhiβt0t256_.» /* red image histogram */ B3 unsigned int ghist0t256.Ii /* green image histogram */ B4 unsigned int bhiβt0t256-JJ /* blue image histogram */ B5 unsigned int rihiβt0t256- /* red image interior histogram */ B6 unsigned int gihi βt0t2563. /* green image interior histogram */ B7 unsigned int bihi st0t256-lι /* blue image interior histogram */ BB unsigned int rehistOI2563ι /* red image exterior histogram */ B9 unsigned int gebi3tOC256-l) /* green image exterior histogram */ 90 unsigned int b hist0t256_Iι /* blue image exterior histogram */ 91 ι /* histO - tell image data histogram structure */ 92 struct chistO -t 93 unsigned int crhist0t2563> /# red image cum histogram */ 94 unsigned int cghist0C2563. /* green image cum histogram */ 95 unsigned int cbhistOC2563ι /* blue image cum histogram */ 96 unsigned int crihist0t2563. /* red image interior cum histogram */ 97 unsigned int egihist0C256.li /* green image interior cum histogram */ 98 unsigned int cbihist0[2563ι /* blue image interior cum histogram */ 99 unsigned int crehistOC2563» /* red image exterior cum histogram */ 100 unsigned int cgehistOC2563ι /* green image exterior cum histogram */ 101 unsigned int cbehistOI-2563- /* blue image exterior cum histogram */ 102 >ι /* chistO - ceil image data histogram structure */ 103 struct qtlO -C 104 unsigned int qrOt503ι /* red image quantiles */ 105 unsigned int qgOt503» /* green image quantiles */ l 106 unsigned int qbOt503ι /* blue image quantiles */ y 107 unsigned int qriOt503ι /* red image interior quantiles */ I 10B unsigned int qgiOt503> /* green image interior quantiles */ 109 unsigned int qbiOt503ι /* blue image interior quantiles */ 110 unsigned int qreOC503ι /* red image exterior quantiles */ .111 unsigned int qgeOt503ι /* green image exterior quantiles */ 112 unsigned int qbe0t503ι /* blue image exterior quantiles */ 113 unsigned int mrO» /* red image mean */ 114 unsigned int mgO; /* green image mean */ 115 unsigned int mbOj /* blue image mean */ 116 unsigned int mriOi /* red image interior mean */ 117 unsigned int mgiOi /* green image interior mean */ IIB unsigned int mbiOi /* blue image interior mean */ 119 unsigned int mreO. /* red image exterior mean */ 120 unsigned int mgeOi /* green image exterior mean */ 121 unsigned int mbeO. /* blue image exterior mean */ 122 unsigned int sdrO. /* red image std deviation */ 123 unsigned int sdgO. /* green image std deviation */ 124 unsigned int sdbOj /* blue image std deviation */ 125 unsigned int sdriOi /* red image interior βtd deviation */ 126 unsigned int sdgiO. /* green image interior std deviation */ I 127 unsigned int sdbiOi /* blue image interior std deviation */ 12B unsigned int sdreOi /* red image exterior βtd deviation */ σ. 129 unsigned int sdgeO. /# green image exterior std deviation #/ 130 unsigned int sdbeO. /* blue image exterior std deviation */ 131 ι /* qtlO - cell image data quantile structure */ 132 /* 133 ft************************************************************************** 134 ** SUBROUTINE DECLARATIONS 135 ## **#***#******************##*****#***•*•*##**#*********#********* *********** 136 */ 137 c har «l b l tb l ( ) ι 1 /* ndaphOO Analysis Software ndaphOO 2 ** 3 ** Programmer: H. L. Kasdan 4 ** 5 ** Copyright : 19BB by 6 ** International Remote Imaging Systems. Inc. 7 ** B ***************#****#******#*****#***************************************# 9 ** 10 ** NAME 11 ** ndaphO - image histogram routine 12 ** 13 ** SYNOPSIS 14 ** #include <stdio. h> 15 ** ttinclυde <βtring. h> 16 ** ^include "cca. h" 17 ** ^include "ndap. h" IB ** int ndaphO( int mode, struct imageO *p_imageO, I 19 ** struct histO *p_hiβtO» Struct chistO *p_chistO ) ϊ^ 20 ** int model histogram formation mode I 21 ** struct imageO *p_imageOι pointer to imageO data structure 22 ** struct histO *p_b--_-*tOι pointer to histO data structure 23 #* struct chistO *p_chiβtOι pointer to chistO data structure 24 ** 25 ** DESCRIPTION 26 ** Routine generates histogram to histO data structure 27 ** using data from imageO data structure according to 2B ** specified mode. 29 ** mode operation 30 ** 31 ** 0 use un-normalized image data from imageO 32 ** 1 use normalized image data from imageO 35 ** 36 ** DIAGNOSTICS 37 ** 3B ** BUGS 39 ** 40 ** REVISION HISTORY 41 ** 900507 hlk modified for *. URN file precursor to use window size 42 ** 43 *************************************************************************** 44 */ 45 ttinclude <βtdio. h> 46 -Hinclude <βtring. h> 47 ttinclude "cca. h" 4B ttinclude "ndap. h" 49 ttdefine FALSE 0 50 ttdefine TRUE 1 51 ttdefine PMAXX 50 52 «define PMAXY 50 53 ttdefine PMINX 0 54 Hdefine PMINY 0 ^ 55 CD 56 ' 57 int ndaphO. mode. p_imageO» p_histO» p_chistO ) 5B int model /* histogram formation mode */ 59 struct imageO *p_imageO. /* pointer to imageO data structure */ 60 struct histO *p_histOι /* pointer to histO data structure */ 61 struct chistO *ρ_chiβt > /* pointer to chistO data structure */ 62 -C 63 /* 64 *************************************************************************** 65 ** LOCAL STORAGE 66 ****#*********##********#*****************#***************#*******##******* 67 */ 6B int err *= 0» /* error return */ 69 int i» /* generic index */ 70 int xi /* x-coordinate value */ 71 int yi /* y-coordinate value */ 72 /* 73 ************************************************************************* 74 ** Do Histogram According to Mode 75 ************************************************************************* 76 */ 77 switch (mode) 7B -C 79 case 1: /* normalized image is data source */ BO Bl for ( i = Oi i < 256ι i++) B2 < B3 p_histO->rhiβtOCi-I - Oi B4 p_histO->ghistOCi-l - 0) B5 p_histO->bhistOCl3 = Oi B6 p_hist0->rihist0-:i3 » Oi , B7 p_hist0->gihist0Ci3 - 0» to BB p_histO->bihistOCi-l - Oi f B9 p_histO->rehistOti-l ■ 0» 90 p_hiβtO->gehistOCi_l = Oi 91 p_hiβtO->behiβtOCi_l » Ol 92 > /* end - for ( i = O i < 256ι i++) */ 93 94 for (y = PMINYi y < p_imageO->windσw. y++) 95 < 96 for (x = PMINX x < p_imageO->tιiindoωι x++) 97 . 9B p_histO->rhistOC(int)p_imageO->cnrimgCy-ltx3-l += 1» 99 p_histO->ghistOC(int)p_imageO->cngimgty-ICxD3 += li 100 p_histO->bhiβtOC(int)p_imageO->cnbimgCy-I-:x-I-l +=• 1; 101 if (<p_imageO->ccimgty3Cx3 «=•= 'x') II 102 (<(p_imageO->ccimgty-!Cji-I ->«■» 'O'J bit (p_ima eO->ccimgCy -IC -l < 'B')))> 103 < 104 /* 105 ** Do Interior 106 */ 107 p_histO->rihistOC ( int ) p_imageO->cnrimgCy3Cx33 += 1J 1°B P_hi β tO->gihi β tO [( int ) p_imageO->cngimgty3Cx33 += 1> 1 9 P_hi β tO->bihistOt ( int ) p_imageO->cnbimgty3Cx33 +•= li HO > /* end - if (... 11 ... ) */ 111 else 112 - 113 /* 114 ** Do Exterior 115 */ 116 p_histO->rehistOC(int)p_imageO->cnrimgi:y3i:x33 +== li 117 p_hiβtO->gehistOC(int)p_imageO->cngimgCy3Cx33 +-= li IIB p_histO->behistOC(int)p_imageO->cnbimgCy3Cx33 += li 119 > /* end - else (... 11 ... ) */ 120 > /* end - for <x = PMINXi x < p_imβgeO->ωindoωι x++) */ 121 /* end - for <y = PMINYi y < p_ima eO->ωindoω» y++) */ J, 122 o 123 /* I 124 ** Compute Cumulative Histogram 125 */ 126 p_chiβtO->crhistOC03 = p_histO->rhist0t03» 127 p_chist0->cghist0C03 = p_histO->ghiβtOC03ι 12B p_chist0->cbhiβt0C03 = p_histO->bhistOC03ι 129 p_chistO->crihistOC03 = p_histO->rihist0t03> 130 p_chist0->cgihist0t03 = p_histO-> ihist0C03> 131 p_chist0->cbihist0t03 *= p_hiβtO- bihist0t03ι 132 p_chiβtO->crehistOC03 = p_histO->rehiβtOC03ι 133 p_chiβtO->cgehistOCO] « p_histO->gehistOC03ι 134 p chiβt0->cbehist0C03 = p hist0->behist0C03ι 135 113366 for ( i = li i < 256ι i++) -31- nnn M I N I U U u CL CL I I I O O B.+ + + + + 4 UI U UI O O O O O O O 4 44444 444444 uι uι t_-ι uι ui ui m * * ** ** ** •rt -rt *rt .C X X X X X X rt rt rt βl fc OlX fc OIX fc U U U U U U U Λ A A A A A A I I I I I I I 4 o4o4o4o4oo44o4 ui ui ui ui ui ui ui ** ** ** ** ** ** ** X X X X X X X U U U U U U U I I I I 1 I I -_L __L O. CL C --L C-. tD0~Ortr j n-*i >0 DDD^Or t nin*>Ti -- tn hOrtriin*e-i --_ii > tD nn*f *ιr , J , J' , -fv ι ϊ , *5 , '-f i!'inι(.ιnEιinιnu.ιnιnιn<c 4 . ι<ι-o )<ι<<ι v ->θrtrun*crιn.cNtDD^θrtrun*<rιn*Λ roD^θrtnιπ*^ιn-^Nmι>θrtrun*-r_- __Hj--,-rtrrt^rtNrtr^rtl^rtrtrtr^rtrtπ3rt0Drt0Drt0D -rt-0rt--0---0.rttDrt-D_-D-.rt- rt->rtI rtD^rtChrt- rt- «0^-D ^ -rtD * *rO-rO-OmrOurO-nOj 206 207 for < i = li i < 256ι i++) 20B 209 p_chistO->crhist0Ci3 = p_hi5tO->rhistOti3 + p_chistO->crhistOCi - 13ι 210 p_chist0->cghist0Ci3 = p_hiBt0->ghiBt0Ci3 + p_chistO->cghistOCi - 13ι 211 p_chistO->cbhist0Ci3 = p_hist0->bhist0Ci3 + p_chistO->cbhistOti - 13ι 212 p_chistO->crihist0Ci3 » p_histO-->rihistom + p_chistO->crihistOCi - 213 p_chistO->c ihist0Ci3 •= p_hist0->gihist0Ci3 + p_chistO->cgihistOti - 214 p_chistO->cbihistom = p_hist0- bihist0Ci3 + p_chiβtO- cbihistOti - 215 p_chiβtO->crehist0Ci3 - p_hist0->rehlβt0Ci3 + p_chistO->crehistOCi - 216 p_chistO->cgehistom ■ p_histO->gehiβtθm + p_chistO->cgehistO--i - 217 p_chistO->cbehistom - p_histO->behistom + p_chistO->cbehistOti - l 21B > /* end ~ - for ( i « Ol i < 256ι i++) */ » ω 219 break) I 220 > /* end - switch (mode) */ 221 222 return(err)ι 223 224 > /* end - int ndaphO(char *cβ) */ 1 /* ndapctqOO Analysis Software ndapctqOO 2 ** 3 ** Programmer: H. L. Kasdan 4 ** 5 ** Copyright : 19BB by 6 ** International Remote Imaging Systems. Inc. 7 ** B ************************************************************************** 9 ** 10 ** NAME 11 ** ndapctqO - produce cum hist quantiles and statistics routine 12 ** 13 ** SYNOPSIS 14 ** -Hinclude <stdio. h> 15 ** ^include - string. h> 16 ** -Hinclude "cca. h" 17 ** flinclude "ndap. h" IB ** int ndapctqO< struct chistO *p_chistO» struct qtlO *p_qtl0 ) 19 ** struct chistO *p_chistOι pointer to chistO data structure , 20 ** struct qtlO *p_qtlOι pointer to qtlO data structure •--> 21 ** ^ 22 ** DESCRIPTION 23 ** Routine generates quantiles of cell 24 ** image data using data from chistO data structure. 25 ** 26 ** BEE ALBO 27 ** 28 ** DIAGNOSTICS 29 ** 30 ** BUGS 31 ** 32 ** REVISION HIBTORY 33 ** 34 ft************************************************************************** 36 ttinclude <math. h> 37 ttinclude <stdio. h> 3B ttinclude <string. h> 39 ttinclude "cca. h" 40 ttinclude "ndap. h" 41 ttdefine BNPCT 95 42 ttdefine BOFF 2B 43 ttdefine GNPCT 95 44 ttdefine GOFF 21 45 ttdefine FALSE 0 46 ttdefine NVALUE 200 /# iormήliied maximum image value */ 47 ttdefine PMAXX 46 4B ttdefine PMAXY 46 49 ttdefine PMINX 2 50 ttdefine PMINY 2 51 ttdefine RNPCT 95 52 ttdefine ROFF 25 53 ttdefine TRUE 1 54 55 void ndapqntlUi 56 void ndapmsdl( )ι 57 J, 5B int ndapctqOC p_chistO» p_qtlO ) <* 59 struct chistO *p_chistOι /* pointer to chistO data structure */ 60 struct qtlO *p_qtlOι /* pointer to qtlO data structure */ 61 <. 62 63 /* 64 *************************************************************************** 65 ** LOCAL STORAGE 66 ft************************************************************************** 7 * f 6B int err = Oi /* error return */ 69 int ii /* generic index */ 70 int ni /* number of interior pixels - length of index 71 array */ 72 /* 73 ***************#*#**#******************#****************#***#************** 74 ** Compute Statistics for 9 images 75 *************************************************************************** N •*0 N h DD . S t >D θ ϋ O rt D HnI j CnDC «β D-ø ιn l t j DtD-tDDt-DhDθ'rtC r t o θr t rt or t mor t no-o-r t r rt om —o-o , _or _otD_ _ θ i>. rtθrt rt rt n ι 113 ** bi Cell Image 114 */ 115 ndapqntl(8.p_chistO->cbihiβtOt03- «ψ_qtlO->qbiOC03 )ι 116 ndapmβdl(!<p_chist0->cbihi5t0C03» 117 -J«p_qtlO->iTibiO, *<p_qtlO->stlbiO>ι IIB 119 /* 120 ** re Cell Image 121 */ 122 ndapqntl(?<p_chist0->crehist0C03» Ϊφ_qtl0->qre0t03 ) I 123 ndapmsdl (?<p_chist0->crehist0C03. 124 8<p_qtl0->mre0. &p_qtl0->sdre0)i 125 126 /* 127 ** ge Cell Image 12B */ 129 ndapqntl(?<p_chist0->cgehist0l-03» ?.p_qtl0->qge0-.03)» 130 ndapmsdl<J.p_chistO->cgehi5tO-.03. , 131 S.p_qtl0->mge0, Ϊ.p_qtl0->sdge0)ι w 132 133 /* 134 ** be Cell Image 135 */ 136 ndapqntl (!.p_ch i st0->cbeh i st0C03, ?<p_qtl0->qbe0CO3 ) i 137 ndapmsdl (?«p_chist0->cbehist0C03, 13B &p_qtl0->mbe0, 8<p_qtl0->sdbe0)ι 139 140 141 return(err)ι 142 143 > /* end - int ndapc q0( char *cs) */ 144 145 /* ndapqntl () Analysis Software ndapqntl () 146 ** 147 ** Programmer: . L. Kasdan 14B ** 149 ** Copyright : 19BB by 150 #* International Remote Imaging Bystems» Inc. 151 ** 152 ************************************************************************** 153 ** 154 ** NAME 155 ** ndapqntl - compute quantiles from cumulative histogram 156 ** 157 ** SYNOPSIS 15B ** -ttinclude <stdio. h> 159 ** ttinclude <βtring. h> 160 ** ttinclude "cca. h" 161 ** ttinclude "ndap. h" 162 ** void ndapqntK unsigned int chistt2563 int quantC503) 163 ** unsigned int chistC2963ι cumulative histogram array 164 ** int quantC503l arrray in w ich 50 quantiles 165 ** ωiil be returned 166 ** 167 ** DESCRIPTION 16B ** Routine orders determines quantiles from cumulative histogram 169 ** array. 170 ** J, 171 ** SEE ALSO ω 172 ** • 173 ** DIAGNOSTICS 174 ** 175 ** DUGS 176 ** 177 #* REVISION HISTORY 17B ** 179 ************************************^ 1B1 void ndapqntK chist, quant) 182 unsigned int chistC2563ι /* cumulative histogram array */ B3 int quantC503, /* arrra g ih „ h i c h 50 " nt|1 „ U 1B4 ωill be returned */ 1B5 189 *************************************************************************** 190 ** LOCAL STORAGE 191 ***#******************#*****#***********#********************************** 192 */ 173 long int CJI /* target cum hist value for next quantile */ 194 int ii 195 int jO = Oi /* quantile index */ 196 long int 150 =» 50ι /* number of quantiles */ 197 long int maxnυm »» chistC255Jι /* total number of values in histgrβ */ 19B int n = 256ι /* size of histogram array */ 199 /* 200 ** Generate Quantiles 201 */ 202 cj » (((long int)(jO 4- i)) * maxnυm) / i50ι 203 for (i = i (i <=> n) kit ( jO < 50)ι i++) 204 205 ωhile (((unsigned int)cj <= chistCi3) hk ( jO < 50)) 206 _ I 207 quantCjO++3 <=• ii 20B cj = (((long int)(jO + 1)) * maxnυm) / 150ι * ϊ 209 > /* end - while ((jnext - j0++) > 1) */ 210 211 > /* end - for (i => l i <= ni i++) */ 212 > /* end - void ndapqntK int n» int arrinC3» int indxE3) */ 213 214 215 /* ndap sdK) Analysis Software ndβpmsdlO 216 ** 217 ** Programmer: H. L. Kasdan 21B ** 219 ** Copyright : 19BB by 220 ** International Remote Imaging Systems * Inc. 221 ** 222 ************************************************************************** 223 ** 224 ** NAME 262 263 l 264 /* 265 *************************************************************************** 266 ** LOCAL STORAGE 267 ****..********************************************************************** 26B */ 269 int chvalυei /* current histogram value */ 270 double di /* double index */ 271 double dmeani /* running first moment */ 272 int dopixeli /* previous temp pixel value */ I 273 double dpixeli /* temp pixel value */ • -_ 274 double dnt = (doυble)chistC2553ι /* total number of points in histogram */ ' 275 double dβdevi /* double std dev */ 276 double dsmi /* running second moment */ 277 int ii 27B int n « 256ι /* histogram array siie */ 279 /* 2B0 ** Compute Moments 2B1 */ 2B2 dmean -» 0. i 2B3 dsm = 0. i 2B4 dopixel = 0. » 2B5 for (i = Oi (i < n)l i++) 2B6 {. 2B7 chvalue = ( int)chistti3ι 2BB dpixel «•*■- (double) (chvalue - dopixeDi 2B9 if (dpixel != 0. ) 290 < 291 di ■=• (dσυble)iι 292 dmean +=> dpixel * di 293 dsm +-= dpixel * di « dii 294 > /* end - if (dpixel lc 0. ) */ I 295 dopixel = chvalυei 296 > /* end - for (i = ii i ni i++) */ I 297 dmean /«-» dnti 29B *mean = (int)dmeanι 300 dsdev « dsm - (dmean * dmean)ι 301 dsdev •= (dsdev >= (doυble)O. ) ? dsdev : (doυble) . i 302 dsdev **-- sqrt(dsdev)ι 303 *βdev *- » (int)dsdevι 304 > /* end - void ndapmsdK int n» int arrinC3. int indxt]) */ 305 1 /* ndapmlqO() Analysis Software ndapmlqOO 3 ** Programmer: H. L. Kasdan 4 ** 5 ** Copyright : 19BB by 6 ** International Remote Imaging Systems- Inc. 7 ** B ************************************************************************** 9 w* 10 ** NAME 11 ** ndapmlqO - produce log image quantiles and statistics routine 12 ** 13 ** SYNOPSIS 14 ** ttinclude <stdio. h> 15 ** ttinclude <string. h> 16 ** ttinclude "cca. h" 17 ** ttinclude "ndap. h" IB ** int ndβpmlqO( struct imageO *p_imageO ) 19 ** struct imageO *p_imageOι pointer to imageO data structure 20 ** I 21 ** DESCRIPTION ω 22 ** Routine generates quantiles of log difference cell • 23 ** image data using data from imageO data structure. 24 ** Modified heapsort algorithm is used to order pixel data. 25 ** 26 ** BEE ALSO 27 ** 2B ** DIAΘNOBTICB 29 ** 30 ** BUGS 31 ** 32 ** REVISION HISTORY 33 ** 900507 hlk modified for *. URN precursor to use window value 34 ** 35 ******#****#**************#***********•***#********************************* 36 */ 37 ttinclude <math. h> 3B ttinclude <stdio.h> 37 ttinclude <string. h> 40 ttinclude "cca. h" 41 ttinclude "ndap. h" 42 ttdefine BNPCT 95 43 ttdefine BOFF 2B 44 ttdefine QNPCT 95 45 ttdefine GOFF 21 46 ttdefine FALSE 0 47 ttdefine NVALUE 200 /* normalized maximum image value */ 4B ttdefine PMAXX 46 49 ttdefine PMAXY 46 50 ttdefine PMINX 2 51 ttdefine PMINY 2 52 ttdefine RNPCT 95 53 ttdefine ROFF 25 54 ttdefine TRUE 1 55 56 void indexx( )ι 57 void ndapqntOUl I 5B void ndapmsdOOi 59 I 60 int ndapmlqO( p__imageO ) 61 struct imageO *p_imageOι /* pointer to imageO data structure */ 62 . 63 /* 64 *************************************************************************** 65 ** GLOBAL STORAGE 66 *************************************************************************** 67 */ 6B extern int ltabOC2563ι /* precomputed log table values */ 69 70 /* 71 *************************************************************************** 72 ** LOCAL STORAGE 73 *************************************************************************** 74 */ 75 int bnvaluei /* blue pixel normaliiing value */ 76 int err =*■ Oi /* error return */ 77 int ii /* generic index */ 7B .. int indxCCAXMAX * CAYMAX + 131 /* interior pixel index array */ 79 int gnvaluei /* green pixel normalizing value */ BO long int lptmpi /* temporary pixel value */ Bl int n /* number of interior pixels - length of index B2 array */ B3 int rnvaluei /* red pixel normalizing value */ B4 int xi /* x-coordinβte value */ B5 int yi /* y-coordinate value */ B6 /* B7 ************************************************************************* BB ** Generate Index Array B9 *********************#*********#****************#********#*************** 90 */ 91 n = Oi /* index coυnt */ 92 93 for ( y = Oi y < p_imageO->windowι y++ ) l 94 < -t-> 95 for ( x = Oi x < p_imageO->windoωι x++ > *f 96 -C 97 if ((p_imageO->ccimgty]tx3 -== 'x') II 9B ( ( (p_imageO->ccimgty3Cx3 >=• 'O') k (p_imageO->cc imgCy3tx3 < 'B')))) 99 -t 100 indxC++π3 = (y * CAXMAX) + x 101 > /* end - if (... I I (... ) ■!-& (... ) ) */ 102 103 > /* end - for ( x = Oi % <. p_imageO->ωindowι x++ ) */ 104 > /* end - for ( y = Oi y < p_imageO->window» y++ ) */ 105 /* 106 ** lgmlr Cell Image 107 */ 10B indexx.n. !p_imageO->lgmlrC03t03> indx)ι /* order index array for lgmlr */ 109 ndapqntO(n. --<p_image0->lgmlri:03C03ι indxi !«p_imageO->qc lgmlrC03)ι 110 ndapmsdO(n» •&p_imageO->lgmlrC03t03ι indx. 111 ?<p_imageO->mclgmlr» & imageO->βdclgml )> 112 113 /* 114 ** Ibmlg Cell Image 115 */ 116 indexx(n. •J<ρ_imageO->lbmlgC03l-03t. indx)ι /* order index array for Ibmlg */ 117 ndapqntO(n> &p_image0->lbmlgl_03 -.03. indx. ?<p_imageO->qc lbmlgCOl ) i IIB ndapmsdO(n. _<p_imageO->lbmlgC03C03» indx * 119 S.p_imageO->mc Ibmlg. ?«p_imageO->sdc Ibmlg ) i 120 121 /* 122 ** lrmlb Cell Image 123 */ 124 indexx(n* S.p__image0->lrmlb C03.-03. indx)ι /* order index array for lrmlb */ 125 ndapqntO(n- 8<p_imageO->lrmlbC03t03» indx. S<p_imageO->qc lrmlb t03 ) 126 ndβpmsd0(n. &p__.image0->lrmlb-.03l-03» indx. 127 !<p_imageO->mclrmlb» fc.ρ_image0-->sd lrπ.lb)» 12B 129 130 return(err)) 131 132 /* end - int ndapmlq0(char *cβ) */ *. 133 o> 134 /* indexxO Analysis Software indexxO 135 ** 136 ** Programmer: H. L. Kasdan 137 ** 13B ** Copyright : 19BB by 139 ** International Remote Imaging Systems. Inc. 140 ** 1 1 ************#********#***#***#**************#************************#**** 142 ** 143 ** NAME 144 ** indexx - order index array for log image data 145 ** 146 ** SYNOPSIS 147 ** ttinclude <βtdio. h> 14B ** ttinclude string. h> 149 ** ttinclude "cca. h" 150 ** ttinclude "ndap. h" 151 ** void indexx ( int n, int *-rrint3. int indxt]) 152 ** int ni number of elements to be ordered 153 ** in arrint3ι array containing elements to 15 ** be ordered 155 ** t indxC3ι array containing indecies of 156 ** elements in arrin that will 157 ** be ordered. This index array 150 ** will be ordered in place. 159 ** 160 ** DESCRIPTION 161 ** Routine orders elements in array arrin specified in 162 ** index array* indx. 163 ** 164 ** SEE ALSO 165 ** 166 ** DIAGNOSTICS 167 ** 16B ** BUGS 169 ** 170 ** REVISION HISTORY 171 ** 172 *************************************************************************** I 173 */ ti 174 void indexx( n, arrin. indx) ' 175 int ni /* number of elements to be ordered */ 176 int arrinC3ι /* array containing elements to 177 be ordered */ 17B int indxt]) /* array containing indecies of 179 elements in arrin that will 1B0 be ordered. This index array 181 will be ordered in place. */ 1B2 1B3 -C 1B4 /* 1B5 *************************************************************************** 1B6 ** LOCAL STORAGE 1B7 *************************************************************************** IBB */ 1B9 int i 190 int indxti 191 int in 192 int J' 193 int li 194 int 195 /* 196 «* Do heapβort 197 */ 19B 1 = (n » 1) + li 199 ir * ni 200 201 for (I I ) 202 {. 203 204 if (1 > 1) 205 q = arrint< indxt = indxt—13)3ι 206 else 207 I 20B q = arrinC ( indxt = indxtirj!■Ji 00 209 indxCir3 - indxtili I 210 if (—ir == 1) 211 212 indxCU == indxti 213 returni 214 > /* end - if (—if » 1 ) */ 215 > /* end - else (1 > i) */ 216 217 i •= li 21B j = 1 « l 219 220 while (j <= ir) 221 i 222 if (j < ir ?.«« arrinCindxtj33 < arrinCindxtj + 133) j++ι 223 if (q < arrintindxtj33) 224 225 indxCi3 = indxCj3ι 231 indxti] = indxti 232 233 > /* end - for (i i ) */ 234 235 /* end - void indexx( int n. int arrinC3» int indxC3) */ 236 237 /* ndapqntOO Analysis Software ndapqnt () 23B ** 239 ** Programmer: H. L. Kasdan 240 ** 241 ** Copyright : 19BB by 242 ** International Remote Imaging Systems. Inc. 243 ** 244 # # ### ## *** #### # # # # #* ## ## ## #######**###** # ## # **.# ### *^ 245 ** I 246 ** NAME £ 247 ** ndapqntO - order index drray for log image data • 24B ** 249 ** SYNOPSIS 250 ** ttinclude <stdio. h> 251 ** -ttinclude <string. h> 252 ** ttinclude "cca. h" 253 ** ttinclude "ndap. h" 254 ** void ndapqntO( int n. int arrinC]. int indxt], int quantt503) 255 ** int n number of elements to be ordered 256 ** int arrinC3ι array containing elements to 257 ** be ordered 25B ** int indxt3ι array containing indecies of 259 ** elements in arrin that will 260 ** be ordered. This index array 261 *# will be ordered in place. 262 ** int quantt503ι arrray in which 50 quantiles 263 ** will be returned 264 ** 265 ** DESCRIPTION 26 ** Routine orders determines quantiles from elements in array 267 ** arrin according to index array, indx. 26B ** 269 ** SEE ALSO 270 ** 271 ** DIAGNOSTICS 272 ** 273 ** DUGS 274 ** 275 ** REVISION HISTORY 276 ** 277 *************************************************************************** 270 */ 279 void ndapqntO< n. arrin, indx, quant ) 2B0 int ni /* number of elements to be ordered */ 2B1 int arrint3ι /* array containing elements to 2B2 be ordered */ 2B3 int indxt3ι /* array containing indecies of 2B4 elements in arrin that will 2B5 be ordered. This index array I 2B6 will be ordered in place. */ g 287 int quantt503ι /* arrray in which 50 quantiles I 2BB will be returned */ 2B9 290 291 - 292 /* 293 *************************************************************************** 294 ** LOCAL STORAGE 295 *************************************************************************** 296 */ 297 int ii 29B int jO = O /* quantile index */ 299 int jnexti /* target quantile index */ 300 /* 301 ** Generate Quantiles 302 */ 303 qυanttOl « arrintindxtl]]ι 304 jO -= li 305 for (i = li (i <= n) *<?. ( jO 50)i i++) 306 { 307 jnext - (i * 50) / ni 30B while (((jnext - jO) > 0) !<«. < JO < 50)) 309 < 310 quanttj0++3 == arrintindxti33ι 311 /* end - while ((jnext - j0++) > 1) */ 312 313 /* end - for (i •=• li i <= ni i-M-) * 314 > /* end - void ndapqntO( lήt tl» int βrrint]. int indxt]) */ 315 316 317 /* ndapmsdOO Analysis Software ndapmsdOO 318 ** 319 ** Programmer: H. L. Kasdan 320 ** 321 ** Copyright : 19BB by 322 ** International Remote Imaging Systems. Inc. I 323 ** 324 ************************************************************************** I 325 ** 326 ** NAME 327 ** ndapmsdO - order index array for log image data 32B ** 329 ** SYNOPSIS 330 ** ttinclude <math. h> 331 ** ttinclude <stdio. h> 332 ** ttinclude <βtring. h> 333 ** ttinclude "cca. h" 337 ** int ni number of elements to be ordered 338 ** int arrint3ι array containing elements to 339 ** be ordered 340 ** int indxt]) array containing indecies of 341 ** elements in arrin that will 342 ** be used. 343 ** int *meanι mean value of specified 344 ** elements 345 ** int *βdevι standard deviation of 346 ** specified elements 347 ** 34B ** DESCRIPTION 349 ** Routine orders computes mean and standard deviation of 350 ** elements in array arrin specified in index array, indx. 351 ** 352 ** BEE ALSO 353 ** 354 ** DIAGNOSTICS 355 ** 356 ** BUGS 357 ** I 35B ** REVISION HISTORY £ 359 ** I 360 *************************************************************************** 361 */ 362 void ndapmsdO( n, arrin, indx, mean, sdev) 363 int ni /* number of elements to be ordered */ 364 int arriπt]ι /* array containing elements to 365 be ordered */ 366 int indxt3) /* array containing indecies of 367 elements in arrin that will 36B be ordered. This index array 369 will be ordered in place. */ 370 int *meanι /* mean value of specified 371 elements */ 372 int *sdevι /* standard deviation of 373 specified elements */ 374 375 376 { 377 /* 37Θ *********************************#**********#************»***************** 379 ** LOCAL STORAGE 3B0 ***********************#****************************»#***#***###»#»#♦##*»** 381 */ 3B2 double d eani /* running first moment */ 3B3 double dpixel /* temp pixel value */ 3B4 double dsdevi /* double std dev */ 3B5 double dsmi /* running second moment */ 3B6 int it 3B7 /* 3BB ** Compute Moments 3B9 */ 390 dmean *= 0. 391 dsm « 0. i 392 for (i - li ( i <- n)ι i++) 393 . 394 dpixel = (double)arrin indxti]]) 395 dmean += dpixeli 396 dsm += dpixel * dpixeli I 397 > /* end - for (i = ii i <•» ni _++ ) */ UJ 39B dmean /= (double)nι I 399 *mean = (int)dmeanι 400 dsm /= (double)nι 401 dsdev •"» dsm - (dmean * dmean)! 402 dsdev = (dsdev >= (doυble)O. ) ? dsdev : (double ) O. i 403 dsdev » sqrt(dsdev)ι 404 *βdev β (int)dsdevι 405 > /* end - void ndapmsdO( int n» int arrint]. int indxt ]) */ 406

Claims: WHAT IS CLAIMED IS; 1. A method of identifying an object under examination, said object has a discernible boundary; said method comprising the steps of: a) forming an image of said object; b) segmenting said image to form a plurality of pixels; c) detecting the boundary of said object under examination in said image; d) measuring a parameter of each pixel within the boundary detected; e) forming an ordered sequence of the parameter of the pixel measured, within the boundary detected; P . . . P k ... P N P- L - first value of the parameter of the pixel within the boundary detected; P N - last value of the parameter of the pixel within the boundary deducted; N - total number of pixels within the boundary detected; k - index to the N pixels; f) determining the P k data point (s) such that k satisfies the following relationship; and i-1 k i M N M M - total number of quantile partitions; i - i th fraction of partition or i th quantile partitions; g) identifying said object under examination, based upon the relationship developed from step (f) associated with said object. 2. The method of Claim 1 wherein P 1 is the smallest value and P N is the largest value. 3. The method of Claim 1, wherein said identifying step further comprising: comparing said relationship of step (f) associated with said object under examination, to a table of pre-determined relationships of other identified objects to identify the object under examination. 4. The method of Claim 3, wherein said table of pre-determined relationships of other identified objects comprises a range of values. 5. The method of Claim 3, wherein said table of predetermined relationships of other identified object comprises a single value. 6. The method of Claim 4, wherein said table of pre-determined relationships are based upon experimental results. 7. The method of Claim 6, wherein said table of predetermined relationships of other identified object comprises a single value. 8. The method of Claim 1, wherein said parameter is intensity of visible light. 9. The method of Claim 1, wherein said parameter is a function of color representations at the same position. 10. The method of Claim 9, wherein said color representation is based upon three primary colors. -se¬ 11. The method of Claim 9, wherein said color representation is based upon hue, intensity, and saturation of colors. 12. The method of Claim 10, wherein said parameter is log (a) - log (b) where a and b are the intensities of two different colors. 13. The method of Claim 12 wherein a is red color and b is blue color. 14. The method of Claim 12, wherein a is blue color and b is green color. 15. The method of Claim 12, wherein a is green color and b is red color. 16. A method of differentiating a plurality of different objects under examination, wherein each object has a discernible boundary; said method comprising the steps of: a) forming a plurality of images, with each image of each of said plurality of objects; b) segmenting each of said plurality of images to form a plurality of pixels; c) detecting the boundary of each object under examination in each of said images; d) measuring a parameter of each pixel within the boundary of each object detected; e) forming an ordered sequence of the parameter of the pixel measured, within the boundary detected for each object; P-* . ... P kl ... P N1 - object 1 having N x pixels P x ... P k2 ... P N2 - object 2 having N 2 pixels f) determining, for each ordered sequence formed, the P k data point (s) such that k satisfies the following; and i-1 k i M Total No. of pixels for the object M - total number of quantile partitions; i - i th fraction of partition or i th quantile partition; g) comparing the P k data point (s) of each ordered sequence for each object to one another, for identical variables of i and M, to differentiate the objects. 17. The method of Claim 16, wherein said parameter is intensity of visible light. 18. The method of Claim 16, wherein said parameter is a function of color representations at the same position. 19. The method of Claim 18, wherein said color representation is based upon three primary colors. 20. The method of Claim 18, wherein said color representation is based upon hue, intensity, and saturation of colors. 21. The method of Claim 19, wherein said parameter is log (a) - log (b) where a and b are the intensities of two different colors. 22. The method of Claim 21 wherein a is red color and b is blue color. 23. The method of Claim 21, wherein a is blue color and b is green color. 24. The method of Claim 21, wherein a is green color and b is red color. 25. An apparatus for identifying an object under examination, said object has a discernible boundary; said apparatus comprising: a) means for forming an image of said object; b) means for segmenting said image to form a plurality of pixels; c) means for detecting the boundary of said image of said object under examination; d) means for measuring a parameter of each pixel within the boundary detected; e) means for forming an ordered sequence of the parameter of the pixel measured, within the boundary detected; P-, ... P k ... P N P- L - first value of the parameter of the pixel within the boundary detected; P N - last value of the parameter of the pixel within the boundary deducted; N - total number of pixels within the boundary detected; k - index to the N pixels; f) means for determining the P k data point (s) such that k satisfies the following relationship; and i-1 < k ≤ i M N M - total number of quantile partitions; i - i th fraction of partition or i th quantile partition; g) means for identifying said object under examination, based upon the relationship of P k to i th quantile in M partitions developed from step (f) associated with said object. 26. The apparatus of Claim 25 wherein P 1 is the smallest value and P N is the largest value. 27. The apparatus of Claim 25, wherein said means for identifying further comprising: means for comparing said relationship of step (f) associated with said object under examination, to a table of pre-determined relationships of other identified objects to identify the object under examination. 28. The apparatus of Claim 27, wherein said table of pre-determined relationships of other identified objects comprises a range of values. 29. The apparatus of Claim 26, wherein said parameter is intensity of visible light . 30. The apparatus of Claim 29, wherein said parameter is a difference of color representations at the same position. 31. The apparatus of Claim 30, wherein said color representation is based upon three primary colors. 32. The apparatus of Claim 30, wherein said color representation is based upon hue, intensity, and saturation of colors. 33. The apparatus of Claim 31, wherein said parameter is log (a) - log (b) where a and b are the intensities of two different primary colors. 34. The apparatus of Claim 33, wherein a is red color and b is blue color. 35. The apparatus of Claim 33, wherein a is blue color and b is green color. 36. The apparatus of Claim 33, wherein a is green color and b is red color. 37. An apparatus for differentiating a plurality of objects under examination, each of said objects has a discernible boundary; said apparatus comprising: a) means for forming an image of each of said plurality of objects to form a plurality of images; b) means for segmenting each of said plurality of images to form a plurality of pixels; c) means for detecting the boundary of each of said plurality of objects under examination in each of said plurality of images; d) means for measuring a parameter of each pixel within the boundary of each object detected; e) means for forming an ordered sequence of the parameter of the pixel measured, within the boundary detected for each object; P- . ... P kl ... P N1 - object 1 having N x pixels P 1 ... P k2 ... P N2 - object 2 having N 2 pixels f) means for determining, for each ordered sequence formed, the P k data point (s) such that k satisfies the following; and i-1 k i M Total No. of pixels M for the object M - total number of quantile partitions; i - i th fraction of partition or i th quantile partition; g) means for comparing the P k data point (s) of each ordered sequence for each object to one another, for identical variables of i and M, to differentiate the objects. 38. The apparatus of Claim 37 wherein P-_ is the smallest value and P N is the largest value. 39. The apparatus of Claim 37, wherein said means for identifying further comprising: means for comparing said relationship of step (f) associated with said object under examination, to a table of pre-determined relationships of other identified objects to identify the object under examination. 40. The apparatus of Claim 39, wherein said table of pre-determined relationships of other identified objects comprises a range of values. 41. The apparatus of Claim 38, wherein said parameter is intensity of visible light. 42. The apparatus of Claim 41, wherein said parameter is a difference of color representations at the same position. 43. The apparatus of Claim 42, wherein said color representation is based upon three primary colors . 44. The apparatus of Claim 42, wherein said color representation is based upon hue, intensity, and saturation of colors. 45. The apparatus of Claim 43, wherein said parameter is log (a) - log (b) where a and b are the intensities of two different primary colors. 46. The apparatus of Claim 45, wherein a is red color and b is blue color. 47. The apparatus of Claim 45, wherein a is blue color and b is green color. 48. The apparatus of Claim 45, wherein a is green color and b is red color.

Inventors: KASDAN HARVEY LEE, KASDAN, HARVEY, LEE
Applicants: INT REMOTE IMAGING SYSTEMS INC, INTERNATIONAL REMOTE IMAGING SYSTEMS, INC.
Application year: 1993
Main classification: G06K9
IPC codes: G06K9, G06T1