METHOD AND ARRANGEMENT FOR FINDING THE CENTROID OF A BODY

Abstract: A method and arrangement for determining at least one dimension data for a body (11), specially data relating to centroid coordinate of an image of said body reproduced on a sensor (15) that produces a signal containing pixel data for said reproduced image (16). The method comprising: interpolating said signal and calculating a centre (<o>x</o>k) for a length (lk) of a segment representing a section of said image, and using said calculated centre (<o>x</o>k) and said length (lk) to determine the centroid coordinate (x') by summing all the products of the n power of the said lengths (lk) and centre point of each segment divided by the sum of the n power of said length (lk).

Description: METHOD AND ARRANGEMENT FOR FINDING THE CENTROID OF A BODY TECHNICAL FIELD OF THE INVENTION The present invention relates to a method and arrangement for determining at least one dimension data for a body, specially data relating to centroid coordinate of an image of said body reproduced on a sensor that produces a signal containing pixel data for said reproduced image. BACKGROUND AND RELATED ART Motion analysis is now a well-known method using camera unit and computer aid to analyse, e.g. bio-mechanics of human, animals or motions of a robot arm etc. In a simple system markers are attached to the object to be analysed. In the past, the object provided with the markers was first filmed and then manually analysed and digitalised to determine the correct position of the markers. This was a time-consuming procedure. Presently, cameras equipped with so-called CCD sensors are used. CCD sensor, which is a light sensor, is generally arranged in communication with necessary optical elements. A CCD sensor, consisting of lines of charged coupled sensors arranged as a matrix, i.e. arranged in an X and Y coordinate system, for one or several colours, converts the light (from the optical element) projected on it, by electronically scanning in Y direction each line of X sensors and producing a television (video) signal. Then, the signals may be analysed in different ways to detect the position of the markers attached to the object. U.S. Patent 5,077,294, describes a motion analyse system using a camera converting the image of a body having illuminated markers placed thereon into a plurality of image frames, each comprising a plurality of image lines. Each image line comprises a plurality of pixels. Then an image processor is used to receive each image line and detect the occurrence of a marker in each image line. This is done by comparing each pixel amplitude to a threshold value and indicating when a pixel amplitude value exceeds the threshold value. Then an offset value representing the difference between the pixel amplitude value and the threshold value is added to a running total of amplitude values for the detected marker. The offset value is to calculate the moment value for each pixel in each marker based on the position of the pixel in the scan line. The calculated moment line value is then added to a running total of amplitude values for the detected marker. The amplitude and the moment sums for each series of pixels for each marker in each image line are passed to a signal processor, which groups the amplitude and the moment sums for each marker together, then the groups' values are used to calculate a centroid value for each marker. Although above invention addresses problems of fast calculation, it lacks the accuracy in high resolution applications. The problems may occur specially when using markers of small dimensions. SUMMARY OF THE INVENTION It is an object of the present invention to overcome above problem and present a novel method for faster calculation of a centroid of a marker, preferably a substantially circular marker, in real time and using the resources of a simple camera, used for collecting the information in an inexpensive way. These objects are achieved by using a method characterised in interpolating said signal and calculating a centre for a length of a segment representing a section of said image, and using said calculated centre and said length to determine the centroid coordinate by summing all the products of the n power of the said lengths and centre point of each segment divided by sum of the n power of said length. Another parameter is determined by a method characterized in steps of: interpolating said signal and calculating a length of a segment representing a section of said image, and using said calculated length to determine the area of the image by using summing all length. The invention also relates to an arrangement for determining at least one dimension data for a body, comprising: means for collecting image data for said body, converting means for producing a digital signal containing pixel data for said reproduced image, comparator unit for generating difference between a pixel signal level and a threshold value, computation unit for calculating a centre point for length of each segment representing a section of said image, calculating a centroid coordinate and/or an area of said image and/or a radius of said image. Other advantageous embodiments of the invention are characterised in the depending claims. BRIEF DESCRIPTION OF THE DRAWINGS In the following the invention will be described with reference to enclosed drawings, in, which: Fig. 1 is a schematic diagram of a simple motion analyse system according to the invention. Fig. 2 is a block diagram over the primary functions of the camera according to fig. 1. Fig. 3 shows an example of a marker used in a system according to present invention, having a substantially spherical form. Fig. 4 is a diagram showing the analog and digital signal to be processed according to the present invention. Fig. 5 is a schematic section through a digitalised marker according to the present invention. Fig. 6 is a schematic dataflow diagram of a preferred camera used in an arrangement according to the present invention. Fig. 7 is a schematic view of a marker image for roundness test. BASIC THEORY Basically, an analogous system uses a conventional video signal from a camera as an input. By means of said signal the X and Y coordinates for the marker, which is separated from the surroundings in intensity of light are calculated. The aim is to measure a movement of the marker as exact as possible, i.e. the inaccuracy, which is a result of the video signal consisting of a set of finite number of dots to be minimised. The video signal consists of a number of lines, which are scanned in chronological order. A marker generates an image, which extends over one or several lines. By means of a comparator, it is possible to determine the start and the end of a marker section on a line may be determined. The marker image on a line is called a segment. The time is measured partly from the beginning of the line to the beginning of the segment QQ and partly from the beginning of the line to the end of the segment (X e ). The mean value of these two periods is a measure for the position of a segment in the space, in horizontal direction (if the lines are horizontal) while the serial number of the line (S) is a measure for position of the segment in the vertical direction. The length 1 of the segments is then X e -X s . The X and Y coordinates of the marker, X m and Y m , respectively are obtained through formulas 1 and 2: The ]T sign indicates that the summation is carried out over all segments being a member of the marker image. The above is applicable for an analogous signal. Similar calculations may be carried out, if image dots from a digital detector are transferred to another order than linear. There the centre points for all image elements that are members of the same marker are calculated. First, the image elements can be translated to lines and then the calculation may be carried out as in the analogous case. The time points X s and X,, can be measured (when scanning the pixel value in horizontal direction) with an electronic counting device connected to an oscillator. The counter starts in the beginning av the line and it is read when the start and end of a segment are reached. One problem is that the oscillator frequency, due to technical and economical reasons is limited. In the digital case the problem may be that the image elements cannot be as small as required. To overcome this problem in analogues case a comparator is provided fed with video signals, which starts an integrator, which generates a linear potential slope, which starts from a potential V a at time X s to reach V b . The slope is than sampled and measured when the counter changes between two values. The time when the slope passes a predetermined threshold value is calculated and used to define the time X ss . The difference between X,. and X ss is may be a constant and it is determined by the integrator and the delays in the comparators. The time X,.,. is easily calculated from the measured points on the potential slope at the time for the change of the counter provided that at least two points on the slope are measured. For example, if two voltage values are measured, V, at t, and V 2 at t j and V 0 is between V, and V 2 , X ss is interpolated by formula 3: The time X e is measured in same way. In this embodiment a linear slope is used, because the calculations become simpler, however, other curves may be used. DETAILED DESCRIPTION OF AN EMBODIMENT A simple schematic system according to the present invention is shown in fig. 1. The system comprises at least one camera 10 directed to an object, in this case a human body 12, to be analysed and at least one marker 11 attached to the object 12. The camera 10 may be connected to a computer device 13, to further process the received signals from the camera 10. In the following, references will be made to an embodiment of a system operating in IR region, i.e. the camera "sees" bodies emitting infrared radiation. An example of a substantially spherical marker 25 is shown in fig. 3, having a reflecting surface. The camera 10 may be provided with means to emit IR-light, which is then reflected by the marker 25. The special design of the marker allows the cameras from different angels apprehend a circular form for a correct positioning. In this embodiment the camera 10 is equipped with a CCD unit operating substantially in same way as described above. The block diagram of fig. 2 schematically illustrates some primary parts of the camera 10 intended to execute the method according to the invention. The camera 10 includes optical elements 14 such as lenses and other focusing means (not shown) to projet the image 16 of a marking device 11 onto a CCD unit 15. The surface of the CCD unit is then scanned and the image signals including pixel information are converted to a suitable video signal by means of a converting unit 17, which may be integrated in the CCD unit. The video signal representing image lines, is then serially or in parallel sent to a processing unit 18. The processing unit digitalises the received video signal, for example using an A/D-converter 19. This signal may also be digitalised in unit 17. The processing unit may be connected to a memory unit, not shown, containing a set of instructions for controlling the processing unit. In respect of the "Basic Theory" part, herein above, the image elements may be arranged in lines, for example by means of a low-pass filter to provide some continuos signal, which can be processed as the analogous signal. However, in the preferred embodiment each image element is measured individually and from the measured values, a value is interpolated, determining when a threshold T is passed, analogously to the Basic Theory part. In this case the integrator and the comparator are eliminated. Graphs representing the digital and video signals are presented in the diagram of fig. 4 using references D and A, respectively. The axes of the diagram represent voltage level and pixel number in a digital or video signal. Back to fig. 2, the digitalized signal is then passed over to a comparison unit 20, which interpolates individual sample values about the predetermined threshold value T, also called video level, which may be obtained from a memory unit 21. As described above, the object is to determine when the amplitude of the signal passes the value T. Each passage presents a start and stop coordinate of each segment with a high resolution, which can be about 30 x number of pixels on a row. In a computation unit 22 following calculation is executed: r-v X h h i.gh . resul ,o „ti.on = Pixel No. + y _τ -r ( 4 ) Where V, and V 2 are the signal levels of preceding and succeeding pixels, respectively, received from the comparatione unit 21. Here, the formula 4 may be regarded as a special case of formula 3. The pixel number may be obtained from a counter (not shown). Depending on the components used, levels V, and V 2 may be measured having resolution of 10 bits, the pixel number (MSB) 9 bits and (T-N,)/(N -Nι) 7 bits. Then the centre point x' of the marker is computed in a computation unit 22 by means of previous values stored in a memory unit 23, using formula (5): where l k is the length of the segment k (i.e., X ek -X sk ), according to fig. 5, S is the serial number of the image element, and x k is the centre of the segment k. In this case, in the digital case, the formulas (1) and (2) are substituted by formulas (5) and (6), respectively. However, formula (1) and (2) alone do not contribute to obtaining an exact value as desired. To obtain a more accurate, stable and high resolutive x', the n power of l k is calculated. In the preferred embodiment the square of l k , i.e. n = 2 is calculated. Fig. 5 schematically illustrates the digitalized two dimensional image 26 of the marker according to fig. 3. The reason for computation of the square of the l k is to obtain a more accurate value, specially in circular images, as the lengths of the segments, i.e. \ k , l k and l k+1 , shifts very fast the longer the segment is from the centre region of the circular image. By better stability, is meant that small incorrectness in X,, and X s , measurement and possible rounding errors have less effect on the result. The constant n does not need to be an integer. The accuracy improvement in vertical direction (y') becomes spectacular for a video signal, as the number of line segments in a marker is few. The l k 's may then be stored in the memory unit 23, for further calculations. For example, the area A of the image may be calculated using formula for area: A= ∑l k . For a circular marker, it is possible to calculate the radius using A= i^.π, which yields formula (7): which may be computed in the computation unit 22. The results are then transformed to an interface unit to further transmission to the computer unit 13, in which the computed values, x' and r, can be used to show the position of the marker on a screen for simulation, positioning and other applications. The dataflow in a preferred embodiment of a camera 10 is illustrated in fig. 6, in which parts functioning as above are designated with same designation numeral. The camera 10 is provided withe s light source 27, such as an IR-flash, surrounding the lens opening on the camera casing. The CCD sensor 15, is arranged in communication with the lens 14. The signal from CCD is provided to a video processing unit 28, which after processing the video signal from the CCD sensor 15 forwards the processed signal to an analog/digital converter 19. To achieve a synchronised timing, the CCD sensor 15, video processing unit 28 and A/D-converter are synchronised by a common timing signal outputted from timing control device 29, e.g. including an oscillator and a counter. The result from the A/D converter is provided to a memory unit 30, preferably of FIFO memory (First In, First Out). A register 31 is arranged for supplying a preceding data. By means of a comparator 20, generating a write signal, preferably two pixel values per translations are stored in the memory unit 30. Moreover, the number of the pixel and line number of image line is provided by the counter of the timing control unit 29. The data stored in the memory unit 30 is then used by a processing unit 32, for instance for centroid calculation as described above. Furthermore, an instruction set memory unit 33 is arranged for storing the operation instructions, a data memory unit 34 for storing processed data and a communication unit 35 is arranged for transferring the processed data, for example to a computer. If, substantially spherical or circular markers are used, for correct calculation, the system must carry out a "roundness" test, so that only images that pass the test, may be analysed. The roundness test according to the invention may be employed in any other application requiring similar test or procedure. Referring to fig. 7, which illustrates some segments of the image, in a first step, the symmetry of the digital image of the marker is tested to see if a rectangle, which exactly enclose all segments is a square, i.e. where Δ is an acceptable difference. In a second step quotient of the area of the square and the area of all segments is controlled, which should give an ideal value, 4/π, if the segments form a circle, i.e. ( v X max - X mi . n )' ( Y max - Y mi . n )' — + X Δ TT all secmenst n Then the segment symmetry is tested, where the centre of the marker is calculated X,,,, Y m , and a control is conducted to find out that centre of each segment, e.g. in x direction, does not deviate from the X m , i.e. all segments are symmetrically positioned around X,,,. Any possible deviation is then preferably regulated to the size of the marker, e.g. in x direction. Accordingly, all segments must fulfill the following: ( N X cent A-er of f segment A. ~ X m ) ' _ ,-. o _ Although, we have described and shown a preferred embodiment, the invention is not limited to said embodiment, variations and modifications may be made within the scope of the attached claims. The processing unit 18 may be integrated in the camera 10, or in a peripheral unit. The number of units and their function in the processing unit 18 may also vary. Moreover, the system is not limited to a camera using CCD sensors. Video signals from a camera can be used in a scanning apparatus to track and determine the position of a marker for centroid calculations. Further, the form of the marker may vary due to the application area. In a robot system, for example a trapezoid formed marker may be used. LIST OF DESIGNATION SIGNS 10 Camera unit 11 Marker 12 Object 13 Computer 14 Lens 15 CCD unit 16 Image 17 Converting unit 18 Processing unit 19 A/D-converting unit 20 Comparator 21 Memory unit 22 Calculation unit 23 Memory unit 24 Interface unit 25 Marker 26 Marker image 27 Light source 28 Video processing unit 29 Timing control unit 30 FIFO memory unit 31 Register 32 Processing unit 33 Program memory 34 Data Memory 35 Communication unit

Claims: CLAIMS 1. A method for determining at least one dimension data for a body (11), specially data relating to centroid coordinate of an image of said body reproduced on a sensor (15) that produces a signal containing pixel data for said reproduced image (16), characterized in, - interpolating said signal and calculating a centre (x k ) for a length (l k ) of a segment representing a section of said image, and - using said calculated centre (x k ) and said length (l k ) to determine the centroid coordinate (x') by summing all the products of the n power of the said lengths (l k ) and centre point of each segment divided by sum of the n power of said length (l k ). 2. A method according to claim 1, characterized in, that n is 2. 3. A method according to one of claims 1 or 2, characterized in, that end or start point of a segment (x) is calculated using following formula: T-V. X = p + m V 2 -v 1 Wherein T is a predetermined threshold value, Vi and V 2 are signal levels of preceding and succeeding pixels, respectively and p is the number of the pixel m. 4. A method for determining at least one dimension data for a body (11), specially the area of an image of said body reproduced on a sensor (15) that produces a signal containing pixel data for said reproduced image (16), characterized in, steps of: - interpolating said signal and calculating a length (1 k ) of a segment representing a section of said image, and - using said calculated length (1 k ) to determine the area (A)of the image by using summing all said lengths (1 k ). 5. Method according to claim 4, characterised in, that radius (r) of said image is calculated by using following formula: where l k is the calculated length of a segment k. 6. A method according to any of claims 1-5, characterised in, that the method further comprises a method for testing the roundness of the marker (11). 7. The method for testing the roundness of a marker according to claim 6, characterised in, - testing the image of the marker to detect if a rectangle, which exactly encloses all segments, is a square, and/or - calculating quotient of the area of the square and the area of all segments, being equivalent to an idle value, 4/ π, if the segments form a circle, and/or - testing segment symmetry, by calculating the centre (X m , Y m ) of the marker image, and controlling that the centre of each segment does not deviate from the centre point, i.e. all segments are symmetrically positioned around the centre point. 8. An arrangement for determining at least one dimension data for a body (1 1), comprising: means (15) for collecting image data for said body, converting means (19) for producing a digital signal containing pixel data for said reproduced image (16), comparator unit (20) for generating a time point for passing a threshold value (T), computation unit (22) for calculating a centre point ( x k ) for length (1 k ) of each segment representing a section of said image, calculating a centroid coordinate (x') and/or an area of said image and/or a radius of said image. 9. An arrangement according to claim 8, characterised in, that said image data collecting means, said converting means (19), said comparator unit (20), and said computation unit (22) are arranged in a camera unit (10). 10. An arrangement according to any of claims 8 or 9, characterised in, that a timing unit (39) is arranged to synchronise the video signal and count number of image lines and/or pixels.

Inventors: FRIDH GOERAN, JOSEFSSON THORLEIF, FRIDH, GOERAN, JOSEFSSON, THORLEIF
Applicants: FRIDH GOERAN, JOSEFSSON THORLEIF, QUALISYS AB, FRIDH, GOERAN, JOSEFSSON, THORLEIF
Application year: 1998
Main classification: G06T7
IPC codes: A61B5, G06T7