Image processing apparatus

Abstract: An image processing apparatus comprises a character extraction unit (12, 24) for extracting an area whose density distribution characteristic meets a predetermined condition such as a binarization threshold and a size and a type of local filtering, from an input image (11) of multiple gray levels, and extracts an object area (15a) as an output image (13) from the input image by using the characteristic extraction unit. Area designation means (15, 25) designates an area having a uniform density distribution and containing the object area, to the input image. Condition determination means (16, 26) determines the condition for the characteristic extraction unit based on the density distribution characteristic of the input image in the designated area. In an image processing expert system, the image characteristics of the object image and the background in the area designated by the area designation means are evaluated and analyzed (227, 223, 224) and the inquiry in the form of message is effected to quantize the evaluation of the image characteristic. As a result, the area extraction procedure (222) can be easily executed by the interaciton with an operator.

Description: BACKGROUND OF THE INVENTION The present invention relates to an image processing apparatus which receives and recognizes an image of an object, and more particularly to characteristic extraction or segmentation which extracts an object area based on a density distribution characteristic derived from an input image. In a field of a factory automation (FA), there is a strong need to automatize a visual test such as testing of a printed circuit board or testing of foreign material in medicine by image processing, and various image processing (recognition) apparatus have been developed to meet such needs. In such image processing apparatus, noises are eliminated from an input image in a pre-processing step, an object area is extracted and the object area is recognized. In a defect test of medicine, for example, a tablet area is picked up from an input image, a defect area of the tablet is extracted and the defect is recognized. In such image processing apparatus, much manpower and time are required to develop object recognition algorithm and program. An example of such a software is disclosed in "Development of General Purpose Image Processing Apparatus - Software" by N. Satoh, T. Gotoh et al., the 28th (first half of 1984) National Conference of The Association of Japan Information Processing, Paper No. 4N-98, pages 995 - 996. However, a long time is required to develop the disclosed software even for experts. Of the above processes, the development of a segmentation program to extract the object area from the input image is very hard and time-consuming to a user of the image processing apparatus. The segmentation means used for the visual test generally comprises three steps: (1) normalization of density-frequency distribution, (2) extraction by feature measurement of local density distribution, and (3) final extraction by geometrical feature measurement. In the normalization of the density-frequency distribution of the step (1), pre-processing such as elimination of a noise from an input image is carried out. The density distribution of the input image is parallelly shifted to a reference condition based on an average density or a density at a characteristic point such as a peak frequency, or enlarged or reduced to the reference condition based on a density at a characteristic point so that the density-frequency distribution follows an illumination intensity of a test object and a change in a contrast of the test object and a background. The characteristic point used in the parallel shift may be a minimum/maximum density level of the image, a midpoint of the minimum and maximum density levels, an average density level, a density level for a maximum frequency, a density level for an intermediate one of peaks in the density-frequency distribution, or a density level for a minimum or maximum one of the peaks in the density-frequency distribution, and the characteristic point used in the enlargement/reduction is a combination of a plurality of characteristic points described above. Accordingly, the number of occasions is larger than that for the parallel shift. In searching the peak in the density-frequency distribution, only large peaks may be searched, only small peaks may be searched or both may be searched. The user alternately repeats the development of the program and the experiment to detect the characteristic points to accomplish the normalization of the density-frequency distribution of the step (1). In the extraction by the feature measurement of the local density distribution, a candidate object area is extracted from a specific density distribution or a two-dimension distribution of the specific density for the density-normalized image of the step (1). Usually, the feature measurement of the density distribution in a partial image is calculated and it is stored as a new density around the partial image. This is called a filtering and space product-sum operation (local density characteristic operation), and it is performed to each pixel of the object image and the results thereof are binarized by a predetermined threshold. The feature measurement of the density distribution calculated in the partial image may be an average density of the partial image, the number of pixels having a particular density, an average density after horizontal, vertical and diagonal partial differentiation, the number of pixels having a particular density after such a differentiation, the number of pixels having the particular density in the average density image, a maximum, minimum or intermediate density in the partial image or maximum/minimum densities in the partial image. The user alternately repeats the development of the program and the experiment to find an optimum feature measurement in the partial image to accomplish the extraction of the candidate areas based on the characteristic of the density distribution. In the final extraction by the geometrical feature measurement, only those of the candidate areas extracted in the step (2) which have a specific geometrical feature such as a predetermined range of area, peripheral length or (peripheral length)²/area are extracted. The step (3) has been well studied in the past and various practical methods have been propsed. Accordingly, it is not explained here. The program development works in the steps (1) and (2) take one to two months even if they were done by experts of programming and image processing. If a user having little knowledge on the image processing develops an application program by a trial and error method, a test line of the object product may be substantially changed and the application program may become useless. The steps (1) and (2) are collectively called segmentation by characteristic of density distribution, or characteristic extraction. An image processing technique relating to the present invention is an image processing expert system in which an image processing procedure can be determined through repetitive simple interaction with the user by using a prestored knowledge base of image processing experts. Such a system is shown in "Three Types of Knowledge for Image Analysis Expert System" by Tamura and Sakagami, Electronics and Electrical Communication Association of Japan, AL 83-49 (1983), and "Image Processing Expert System" by Sueda, Mikame and Katagiri, TOSHIBA REVIEW, Vol. 40, No. 5, pages 403 - 406 (1985). On the other hand, in "Method for Automatically Structuring an Image Processing Procedure by Presentation of Sample Patterns and Application Thereof to Structuring a Linear Pattern Extraction Procedure" by Hasegawa, Kubota and Toriwaki, Electronics and Electrical Communication Association of Japan, PRL 85-38 (1985), a characteristic of an image to be extracted is inputted in a form of image or sample pattern instead of abstract wording. The latter two articles are referenced herein not as prior art but to aid the comprehension of the present invention. IEEE TRANSACTIONS ON COMPUTERS, vol. C-25, no. 12, December 1976, pages 1336-1346, IEEE, New York, US; K.-S. FU and A. ROSENFELD: "Pattern recognition and image processing" shows a decision-theoretic method and a syntactic method as an image recognition method after pre-processing. For example, the classifying method classifies the objects in accordance with the Bayes classification rule when the probability density function is known, classifies the objects by learning the sample and deciding the function when the function is not known. The method automatically generates a decision tree and classifies objects by the leaning pattern recognition method. IEEE PROCEEDINGS OF THE FIRST INTERNATIONAL JOINT CONFERENCE ON PATTERN RECOGNITION, October/November 1973, pages 499-503, IEEE, New York, US; M. NAGAO et al.: "Automatic model generation and recognition of simple three-dimensional bodies" shows a segmentation method which analyzes a recognition method and a density distribution using a predetermined model. For example, when there are two areas, one of which corresponds to a peak of density distribution and another of which corresponds to another peak, the segmentation threshold is decided at a value between the peaks. Thus, the area is divided into the two regions. SUMMARY OF THE INVENTION It is an object of the present invention to provide image processing method and apparatus which can readily determine various conditions necessary for segmentation for extracting an object area by a characteristic of a density distribution, by merely reading a partial area containing the object area in an input image. It is another object of the present invention to provide image processing method and apparatus which quantize evaluation of an image characteristic, particularly observation of the image or analysis of data, which has been difficult to attain in the prior art image processing expert system, by utilizing the condition determination technique for the characteristic extraction, so that an appropriate procedure which is not subjectively influenced by the user can be determined. These objects are met by the invention as set out in claim 1. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 is a conceptual view of the present invention, Fig. 2 shows an overall configuration of an embodiment of the present invention, Fig. 3 shows an internal configuration of segmentation means, Fig. 4 explains an operation of the segmentation means, Fig. 5 explains an operation of the embodiment, Figs. 6A and 6B explain an area designation method, Fig. 7 shows an internal configuration of a density distribution normalization evaluation unit, Fig. 8 explains an operation of the density distribution normalization evaluation unit, Fig. 9 shows an internal configuration of a partial density characteristic evaluation unit, Fig. 10 explains an operation of the partial density characteristic evaluation unit, Fig. 11 shows an internal configuration of a characteristic operation/binarization parameter determination unit, Fig. 12 explains an operation of the characteristic operation/binarization parameter determination unit. Figs. 13A - 13C explain a method for calculating a binarization threshold. Figs. 14A and 14B explain a method for calculating a binarization threshold evaluation, DESCRIPTION OF THE PREFERRED EMBODIMENTS Fig. 1 shows a basic concept of the present invention. As an application of the image processing in Fig. 1, a test of a defect in a tablet is considered, although the present invention is applicable to extract a character in a background, for example. In a prior art method, an input image 11 which contains tablet defect (object area having multiple gray levels) is provided, and a user or operator sets various parameters such as selecting a peak for a maximum frequency as a characteristic point to be searched in density distribution normalization process or selecting a partial averaging process as a partial density characteristic operation, based on knowledge or experience of the operator or in accordance with an operation manual. The operator develops a program by which the parameters thus set are reflected to segmentation means 12, has it executed and evaluates a resulting binary image 13. The operator repeats the above steps until a desired result is obtained (block 14 in Fig. 1). Such a work is expensive because of a long time required and the algorithm is not correct due to subjective evaluation by the operator. In the present invention, in order to resolve the above problems, the step of condition setting and trial and error evaluation by the operator (block 14) is eliminated, and area designation means 15 for designating an area containing an object area (defect of a tablet) in an input image is provided, and information of the image is limited only to a density distribution of the object area 15a designated by the area designation means 15 or a density distribution of the object area 15a and a background 15b, out of a density distribution of the entire input image, and condition setting of segmentation means 12 which separates the object area and the background is automatized by using condition determination means 16 by trial and error evaluation. The condition setting of the segmentation means 12 by the density distribution characteristic needs a huge number of steps if it is done by the operator by the program in trial and error method, and it takes several weeks to several months. Thus, the area designation means 15 is provided, and from a relationship between the object area 15a and the background 15b, a condition under which the object area and the background are best separated is selected by a computer from present conditions with a predetermined evaluation measurement. Referring to Fig. 2, an overall configuration of an embodiment of the image processing apparatus is explained. The present embodiment comprises a television camera 21 for imaging an object area, an A/D - D/A converter 22 for converting an analog signal of the television camera 21 to a digital signal and converting a digital signal to an analog signal, a dither/binary image a memory 23 for storing an input multi-gray-level image and a binary image of the object area, segmentation means 24 for extracting those areas from the input multi-gray-level image stored in the dither/binary image memory 23 whose density distribution characteristics meet a predetermined condition and storing them as binary image in the dither/binary image memory 23, area designation means 25 on which the dither/binary images are displayed and, which allows the operator to designate an area containing the object area, density distribution normalization evaluation unit 26 for determining optimum conditions necessary for the density-frequency distribution normalization process of the segmentation means 24 by evaluating, in the trial and error method, conditions assumed for a plurality of input images, a partial density characteristic evaluation unit 27 for determining the optimum conditions necessary for the partial density characteristic operation and the final binarization of the segmentation means 24 by evaluating, in the trial and error method, the conditions assumed for a plurality of input images, a system control unit 28 for controlling an entire system, a console monitor 29 which displays characters, and a keyboard 30 through which the operator enters data. The condition determination means 16 by trial and error evaluation of Fig. 1 corresponds to the density distribution normalization evaluation unit 26, partial density characteristic evaluation unit 27 and the system control unit 28 of Fig. 2. The area designation means 25 (15 in Fig. 1) usually comprises a cathode ray tube (CRT) and coordinate input means such as a tablet or mouse, and it may be a combination of digitizer, track ball and light pen (disclosed in U.S. Serial Nos. 716943 and 716944 filed on March 28, 1985 (EP 85103643.4 and EP 85103823.2) filed by the assignee of the present invention) or other man-machine interface such as an input integrated flat display which is a recently developed coordinate input medium. The coordinates may be directly designated by the keyboard. Any means which can designate the object area may be used. Before the overall operation is described, an internal configuration of the segmentation means 24 and functions and operations of the respective blocks are explained with reference to Figs. 3 and 4. As shown in Fig. 3, segmentation means 24 extracts the object area from the information of the input image stored in the dither/binary image memory 23 under the control of the system control unit 28. The segmentation means 24 comprises a density-frequency distribution characteristic point extraction unit 31, for determining a density level at a characteristic point (for example, a peak for a maximum frequency) of the density-frequency distribution used in the density-frequency distribution normalization process, from the input image and reference image stored in the dither/binary image memory 23, a normalization parameter memory 32 which stores codes of the characteristic points to be determined by the density-frequency distribution characteristic point extraction unit 32 and the characteristic points extracted by the density-frequency distribution characteristic point extraction unit 31 in accordance with the codes of the characteristic points for the reference image, a density-frequency distribution normalization unit 33 for normalizing the density-frequency distribution of the input image which causes coincidence of the characteristic point determined for the input image by the density-frequency distribution characteristic point extraction unit 31 and the characteristic point of the reference image stored in the normalization parameter memory 32, a partial density characteristic operation unit 34 for performing the partial density characteristic operation to a new image outputted from the density-frequency distribution normalization unit 33, a characteristic operation parameter memory 35 which stores a code of a partial density characteristic operation (for example, code of average density) to be performed by the partial density characteristic operation unit 34, a binarization unit 36 for binarizing the new image outputted from the partial density characteristic operation unit 34, and a binarization parameter memory 37 which stores binarization codes and thresholds therefor to be used in the binarization unit 36. Referring to Fig. 4, the operation of the segmentation means 24 is explained. In a step 41, conditions necessary for the segmentation means are set, that is, the code of the characteristic point to be extracted is set in the normalization parameter memory 32, the code of the partial density characteristic operation is set in the characteristic operation parameter memory 35, the code of the binarization is set in the binarization parameter memory 37, the reference image which is a reference for the density-frequency distribution normalization process is stored in a reference image memory 231 in the dither/ binary image memory 23, and the input image is stored in an input image memory 232. Then the segmentation means 24 is started. In a step 42, density levels (P1, P2) to the reference image in the reference image memory 231 are determined by the density-frequency distribution characteristic point extraction unit 31, the characteristic points are extracted in accordance with the codes of the characteristic codes stored in the normalization parameter memory 32 (for example, codes which indicate that two peaks having high frequencies of the peaks in a relatively wide range are supplied as the characteristic points), the density levels (P1, P2) thereof are stored in the normalization parameter memory 32 together with the codes of the characteristic points, the characteristic points for the input image in the input image memory 232 are extracted, and the density levels (P1', P2') thereof are transferred to the density-frequency distribution normalization unit 33. In a step 43, the density-frequency distribution normalization unit 33 normalizes the density to cause the characteristic point of the input image in the input image memory 232 to be coincident with the characteristic point of the reference image, and stores the resulting image in a normalized image memory 233 in the dither/ binary image memory 23. The density conversion by the density-frequency distribution normalization unit 33 linearly converts the density level P' of the input image to the new density level P in accordance with conversion lines represented by P = P 1 P 1 ' ·P' (0 ≤ P' < P 1 ') P = (P 2 - P 1 ) (P 2 ' - P 1 ') · (P' - P 1 ')+P 1 (P 1 ' ≤ P' < P 2 ') P = (N - P 2 ) (N - P 2 ) · (P' - P 2 ')+P 2 (P 2 ' ≤ P') wherein P₁ and P₂ are density levels of the characteristic points in the reference image, P₁' and P₂' are the characteristic points of the input image and N is a maximum number of gray levels, or effects a parallel shift represented by P = P' (P 1 - P 1 ') for the characteristic points P₁ and P₁'. In a step 44, the partial density characteristic operation unit 34 performs the predetermined partial density characteristic operation to the normalized image memory 233 in accordance with the code of the partial density characteristic operation stored in the characteristic operation parameter memory 35 (for example, a code indicating filtering which stores a minimum density in a 3x3-pixel partial image at a center pixel thereof and repeats the operation for each pixel), and stores the result in the partial characteristic image memory 234 in the dither/binary image memory 23. In a step 45, the binarization unit 36 binarizes the image in the partial characteristic image memory 234 by the binarization code (for example, a code indicating that those lower than a threshold T are "1" and others are "0") and the threshold stored in the binarization parameter memory 37, and stores the result in the binary image memory 235 in the dither/ binary image memory 23. The operation of the segmentation means 24 has thus been described. Referring to Figs. 3 - 6, the operation of the overall image processing apparatus shown in Fig. 2 is explained. As shown in Fig. 5, the operation of the image processing apparatus of the present embodiment is divided into two cycles, a density-frequency distribution normalization condition determination cycle comprising steps 51 - 54 and a partial density characteristic operation and binarization condition determination cycle comprising steps 55 - 57. In the former density-frequency distribution normalization condition determination cycle, the operator picks up an object area by the television camera 21 in accordance with a message displayed on the console monitor 29 in the step 51 and designates read-in of the object image through the keyboard 30. Thus, the object area is stored in the reference image memory 231 in the dither/binary image memory 23 as a multi-gray-level image through the signal converter 22 under the control of the system control unit 28. Then, the operator designates the object area and the background area shown in Figs. 6A and 6B by stroking the screen of the area designation means 25 by the input medium while watching the object area displayed on the area designation means 25 in accordance with a message displayed on the console monitor 29. Two designation methods shown by a screen 61 of Fig. 6A and a screen 62 of Fig. 6B are provided to the operator. The screen 61 of Fig. 6A is used when the object area 63 and the background 64 to be designated are sufficiently large and simple. The object area 63 and the background 64 are designated by surrounding the areas. On the other hand, the screen 62 of Fig. 6B is used when the object area 65 and the background 66 to be designated are small or complex, and the areas are painted. If the characteristics of the density distributions of the object area and the background are very uniform, only portions of the areas may be designated. After the designation of the areas by the operator, the system control unit 28 stores the object area and the background designated by the area designation means 25 and causes the density distribution normalization evaluation unit 26 to calculate the density-frequency distributions per unit area in the respective areas and stores them. The density-frequency distribution per unit area means a frequency of the density-frequency distribution multiplied by a reciprocal of the area. The density-frequency distributions per unit area of the object area and the background in the reference image are used to evaluate the normalization conditions. In a step 52, the operator changes the illumination to the object area and the contrast of the object area and the background to those expected in an actual recognition in accordance with a message displayed on the console monitor 29, and again picks up an object area and enters a read-in command through the keybaord 30. Thus, the image of the object area is stored in the input image memory 232 in the dither/binary image memory 23 under the control of the system control unit 28. Then, the operator designates the object area and the background as he/she did in the step 51 by the area designation means 25 in accordance with the message displayed on the console monitor 29, and the designated areas (density-frequency distributions per unit area) are stored in the density distribution normalization evaluation unit 26. In a step 53, the density distribution normalization evaluation unit 26 determines a currently optimum density-frequency distribution normalization condition, that is, an optimum characteristic point code such as a code representing a maximum, minimum or intermediate level of the density-frequency distribution, and stores it in the normalization parameter memory 32 of the segmentation means 24. Then, the system control unit 28 starts the segmentation means 24 and displays the content of the normalization image memory 233 in the dither/binary image memory 23 on the area designation means 25. In a step 54, the operator decides whether to continue the process in accordance with the message displayed on the console monitor 29 and enters the decision through the keyboard 30. If it is to continue the process, the process returns to the step 52, and if it is not to continue the process, the density-frequency distribution normalization condition determination cycle ends and the process proceeds to the next step. Referring to Figs. 7 and 8, the internal configuration and operation of the density distribution normalization evaluation unit 26 are explained. As shown in Fig. 7, the density distribution normalization evaluation unit 26 comprises a density-frequency distribution calculation unit for calculating a density-frequency distribution per unit area of the image memory 231 or input image memory 232 in the dither/binary image memory 23 in the object area and the background stored in the system control unit 28, a reference image object area density distribution memory 72 which stores a density-frequency distribution per unit area of the object area in the reference image memory 231, a reference image background density distribution memory 73 which stores a density-frequency distribution per unit area of the background in the reference image memory 231, a normalized image object area density distribution memory 74 which stores a density-frequency distribution per unit area of the object acrea in the normalized image memory 233 normalized by a number of present characteristic point codes, a normalized image background density distribution memory 75 which stores a density-frequency distribution per unit area of the background in the normalized image memory 233 normalized by a number of preset characteristic point codes, a deviation calculation unit 76 for calculating deviations of the normalized image object code density distribution memory 74 and the normalized image background density distribution image 75 from the reference image object area density distribution memory 72 and the reference image background density distribution memory 73, respectively, a deviation memory 77 which stores deviations for the characteristic point codes calculated by the deviation calculation unit 76, and a deviation compare unit 78 for detecting a minimum deviation stored in the deviation memory 77 and storing the characteristic point code for the minimum deviation in the normalization parameter memory 32 of the segmentation means 24. The operation is explained with reference to Fig. 8. When started by the step 51 of Fig. 5, the density-frequency distribution calculation unit 71 calculates the density-frequency distribution per unit area of the reference image memory 231 of the dither/binary image memory 23 in the object area and the background stored in the system control unit 28, and stores the results in the reference image object area density distribution memory 72 and the reference image background density distribution memory 73. When started by the step 54 of Fig. 5, the system control unit 28 selects one of a number of preset characteristic point codes in a step 81, as shown in Fig. 8, and stores it in the normalization parameter memory 32 of the segmentation means 24. After the setting of the normalization parameter in the step 81, the process proceeds to a step 82. In a step 82, the system control unit 28 starts the segmentation means 24 and then the densityfrequency distribution calculation unit 71 of the density distribution normalization evaluation unit 26 calculates the density-frequency distribution per unit area of the normalized image memory 233 in the dither/binary image memory 23 in the object area and the background stored in the system control unit 28, and stores the results in the normalized image object area density distribution memory 74 and the normalized image background density distribution memory 75 corresponding to the characteristic point code. In a step 83, deviations between the normalized image object area density distribution memory 74 and the normalized image background density distribution memory 75 corresponding to the characteristic point code, and the reference image object area density distribution memory 72 and the reference image background density distribution memory 73, respectively, and stores them in the deviation memory 77 as new deviations in addition to the deviations previously calculated. The above operation is performed for each of the characteristic point codes under the control of the system control unit 28. In a step 84, the deviation compare unit 78 detects the minimum deviation and stores the characteristic point code corresponding to the minimum deviation in the normalization parameter memory 32 of the segmentation means 24. The operation of the density distribution normalization evaluation unit 26 has then been described. Turning back to Fig. 5, the operations of the partial density characteristic operation and the binarization are explained. In a step 55, the operator picks up the object area as he/she did in the step 52 in accordance with the message displayed on the console monitor 29, reads in the image and designates the area as he/she did in the step 51. In a step 56, the partial density characteristic evaluation unit 27 determines a currently optimum condition for the partial density characteristic operation, that is, optimum partial density characteristic point code, binary code and threshold, and stores them in the characteristic operation parameter memory 35 of the segmentation means 24 and the binarization parameter memory 37. The system control unit 28 then starts the segmentation means 24 and displays the binary image memory 235 in the dither/binary image memory 23 on the area designation means 25. In a step 57, the operator decides whether to continue the process or not in accordance with the message displayed on the console monitor and enters the decision thorugh the keyboard 30. If it is to continue the process, the process returns to the step 55, and if it is not to continue the process, the partial density characteristic operation and binarization condition determination cycle is terminated. Referring to Figs. 9 and 10, the internal configuration and the operation of the partial density characteristic evaluation unit 27 are explained. The partial density characteristic evaluation unit 27 comprises a characteristic image density-frequency distribution calculation unit 91 for calculating the density-frequency distribution per unit area of the object area and the backgrund for the partial characteristic image memory 234 which stores the result of the partial density characteristic operation by a number of preset partial density characteristic point codes, a characteristic image object area density-frequency distribution memory 92 and a characteristic image background density-frequency distribution memory 93 which store the density-frequency distributions per unit area of the object area and the background, respectively, calculated by the characteristic image density-frequency distribution calculation unit 91, for each of the partial density characteristic codes, an object area distribution accumulation unit 94 and a background distribution accumulation unit 95 for accumulating the characteristic image object area density-frequency distribution memory 92 and the characteristic image background density-frequency distribution memory 93, respectively, for each designation, a characteristic image object area accumulated density-frequency distribution memory 96 and a characteristic image background accumulated density-frequency distribution memory 97 which store the density-frequency distributions corresponding to the partial characteristic codes, accumulated by the object area distribution accumulation unit 94 and the background distribution accumulation unit 95, respectively, and a characteristic operation/binarization parameter determination unit 98 which selects optimum partial density characteristic point code, binarization code and threshold from the characteristic image object area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97 and stores them in the characteristic operation parameter memory 35 of the segmentation means 24 and the bianrization parameter memory 37. The operation is explained with reference to Fig. 10. In a step 101, the system control unit 28 stores one of a number of present partial density characteristic operation codes in the characteristic operation parameter memory 32 of the segmentation means 24. In a step 102, the segmentation means 24 is started by the system control unit 28 and the characteristic image density-frequency distribution calculation unit 91 of the partial density characteristic evaluation unit 27 calculates the density-frequency distributions per unit area of the partial characteristic image memory 234 in the dither/binary image memory 23 in the object area and the background stored in the system control unit 28, and stores them in the characteristic image object area density-frequency distribution memory 92 and the characteristic image background density-frequency distribution memory 93, respectively, corresponding to the partial density characteristic operation code. In a step 103, the characteristic image object area density-frequency distribution memory 92 and the characteristic image background density-frequency distribution memory 93 corresponding to the partial density characteristic operation code are added to the characteristic image objhect area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97, respectively, by the object area distribution accumulation unit 94 and the background distribution accumulation unit 95, respectively. The above operation is repeated for each of the partial density characteristic operation codes. Then, in a step 104, optimum partial density characteristic operation code and binarization code are selected from the characteristic image object area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97 by using a known method to be referred in Figs. 13 and 14, and they are stored in the characteristic operation parameter memory 35 and the binarization parameter memory 37 of the segmentation means 24. Referring to Figs. 11 to 14, the internal configuration and the operation of the characteristic operation/binarization parameter determination unit 98 are explained. As shown in Fig. 11, the characteristic operation/binarization parameter determination unit 98 comprises a binarization threshold calculation unit 111 for calculating binarization thresholds for the characteristic image object area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97 corresponding to the partial density characteristic operation code (a plurality of binarization threshold calculation units 111, 111' and 111" of different threshold calculation methods are provided), a binarization threshold memory 112 which stores the threshold corresponding to the partial density characteristic operation code calculated by the binarization threshold calculation unit 111 (binarization threshold memories 112' and 112" are provided for the binarization threshold calculation units 111' and 111", respectively), a binarization evaluation unit 113 for evaluating the binarization based on the binarization threshold 112 corresponding to the partial density characteristic operation code, and the characteristic image object area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97, a binarization evaluation memory 114 which stores the binarization evaluation corresponding to the partial density characteristic operation code calculated by the binarization evaluation unit 113 (binarization evaluation memories 114' and 114" are provided for the binarization threshold calculation units 111' and 111", respectively), and an evaluation compare unit 115 for detecting a maximum evaluation value of the binarization evaluation memories 114, 114' and 114" and storing the code of the binarization threshold calculation unit corresponding to the maximum evaluation value, the threshold and the partial density characteristic operation code in a predetermined parameter memory of the segmentation means 24. The operation is explained with reference to Fig. 12. In a step 121, the binarization threshold calculation unit 111, 111' and 111" calculate the thresholds in different methods based on the characteristic image object area accumulated density-frequency distribution memory 96 and the characteristic image background accumulated density-frequency distribution memory 97 for the partial density characteristic code, and store them in the binarization threshold memories 112, 112' and 112", respectively. The binarization threshold calculation unit 111, 111' and 111" calculate the binarization thresholds in the methods shown in Figs. 13A, 13B and 13C, respectively. In the method of Fig. 13A, a threshold T is set at a center of distribution. T = µ b σ t + µ t σ b σ b + σ t where (µ t , σ t ) and (µ b ,σ b ) are average values and deviations of the object area and background accumulated density-frequency distribution memories 96 and 97, respectively. In the method of Fig. 13B, an average value and a deviation of a portion of the background accumulated density-frequency distribution which is on the left of an average value µ t (smaller than the average value µ t ) of the object area accumulated density-frequency distribution memory 96 are represented by (µ b1 , σ b1 ), and an average value and a deviation of a portion of the background accumulated density-frequency distribution which is on the right of the average value µ t are represented by (µ b2 , σ b2 ), and the densities between a center T1 of (µ t , σ t ) and (µ b1 , σ b1 ) and a center T2 of (µ t , σ t ) and (µ b2 , σ b2 ) are binarized. In the method of Fig. 13C, a distribution (µ t1 , σ t1 ) of a portion of the object area which is on the left of an average value of a background distribution (µ b , σ b ) and a distribution (µ t2 , σ t2 ) of a portion of the object area which is on the right of the average value of the background distribution are determined, thresholds T1 and T2 are similarly determined, and the densities which are smaller than T1 or larger than T2 are binarized. In a step 122, the binarization evaluation unit 113 evaluates the binarization thresholds 112, 112' and 112" for the partial density characteristic operation code and stores the evaluations in the binarization evaluation memories 114, 114' and 114". As shown in Fig. 14A, the evaluation is represented by a sum of an integration St (hatched area) which is a portion binarized as the object area when the characteristic image object area accumulated density-frequency distribution memory 96 is divided by the calculated threshold, and an integration Sb (hatched area) which is a portion not binarized when the characteristic image background accumulated density-frequency distribution memory 97 is divided by the calculated threshold. The larger the sum is, the better are the object area and the background binarized. In Fig. 14B, numeral 141 denotes the object area or region designated by the operator, numeral 142 denotes the background area or region and numeral 143 denotes a binary pattern binarized under a certain condition. A ratio At'/At of an area At' of the binary pattern 143 contained in the region 141 and an area At of the region 141 is calculated, and a ratio (Ab-At")/Ab of a difference (Ab-At") between an area Ab which is outside of the region 141 and within the region 142 and an area At" of the binary pattern 143 contained in the area Ab, and the area Ab, and a sum At'/At+(Ab-At")/Ab is accumulated for all designations. The accumulation corresponds to St+Sb in Fig. 14A. The above method is disclosed in U.S. Serial No. 687,757 filed on December 31, 1984 and assigned to the present assignee (corresponding to Japanese Patent Application Nos. 58-248151 and 58-248152). Turning back to Fig. 12, in a step 123, the evaluation compare unit 115 detects the maximum one of the binarization evaluations 114, 114' and 114" corresponding to the partial density characteristic operation code, and supplies the partial density characteristic operation code corresponding to the maximum evaluation, the code corresponding to the binarization threshold calculation unit and the threshold to the segmentation means 24. The embodiment of the present invention has thus been described. In the segmentation, the area designation means is provided to limit the image information so that the operator (using) can easily set the condition of segmentation of the object area and the background. In the present embodiment, the above condition, that is, the characteristic point code for the normalization, the partial density characteristic code and the binarization code are selected from the preset codes and are set into the segmentation means. Alternatively, those codes may be given priority and the user may operate the codes in the sequence of priority.

Claims: An image processing system comprising: area designation means (25) for designating an area (At, 141) containing at least partly (At') an object to be identified (143) and part of background area (142) on an input image having multiple gray levels; area segmentation means (24) having a partial density characteristic operation section (34) for performing a plurality of kinds of filtering processing on the input image, and a binarization processing section (36) for binarizing the output of the partial density characteristic operation section (34), and means (234) for storing the results of the partial density characteristic operation; a partial density characteristic evaluation means (27) for calculating a plurality of density distributions of the stored results of the partial density characteristic operation based on different characteristics, calculating a plurality of thresholds based on the density distributions, performing binarization processing on the object area and the background using the thresholds, performing binarisation processings using the plurality of thresholds with respect to a plurality of input images after said plurality of kinds of filtering processing, calculating for each binarized image a sum of two terms, the first term being the ratio (At'/At) of an area (At') of the binarized object contained in the designated area (141) and said designated area (At, 141), the second term ((Ab-At")/Ab) being one minus the ratio of an area (At") of the binarized object outside the designated area (141) and an area (Ab) of the binarized image outside the designated area (141), accumulating the sums for the plurality of input images and for each threshold and determining a threshold and a filtering processing which result in a maximum accumulation of the sum. The image processing system of claim 1, wherein said area designation means (15, 25) includes an image display screen and means for designating the area by painting the area (At) containing the object on the screen. The image processing system of claim 2, wherein said means for designating the object containing area includes an edge emphasising module. The image processing system of claim 1, wherein said area designation means (15, 25) includes a detection module for extracting a density distribution of an image only in the designated area. The image processing system of claim 1, further comprising a density distribution normalisation evaluation means (26) for calculating a normalized image object area density distribution and a normalized image background density distribution.

Inventors: KANASAKI MORIO, MISHIMA TADAAKI, ONUMA CHIEKO, ORITA MIYAHIKO, SUZUKI MASATO, TAKATOO MASAO, TODA YUJI, KANASAKI, MORIO, MISHIMA, TADAAKI, ONUMA, CHIEKO, ORITA, MIYAHIKO, SUZUKI, MASATO, TAKATOO, MASAO, TODA, YUJI
Applicants: HITACHI LTD, HITACHI, LTD.
Application year: 1986
Main classification: G06T5
IPC codes: G06T7