A method for identifying filled options and related devices
By targeting the grayscale characteristics of each question to be identified, determining the background and option grayscale values, and identifying the filled-in options on the answer sheet, the problem of low recognition accuracy caused by uneven colors is solved and the recognition accuracy is improved.
Patent Information
- Application Number
- CN202111415215.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2041-11-25
AI Technical Summary
When the prior art recognizes the options that are filled in on the answer sheet, the recognition accuracy is low due to the uneven color of the answer sheet, making it difficult to accurately identify each option that is filled in.
By determining the ash characteristics of each identification topic itself, determine the background gray value and option gray value of the target to identify the topic, and use the difference in the gray value to identify the application options.
It reduces the probability of failure to identify filled-in options due to uneven color on the answer sheet, and improves the accuracy of identifying filled-in options.
Smart Images

Figure CN114255243B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image recognition technology, and in particular to a filled-in option recognition method and related device. Background Art
[0002] Identifying filled-in areas in images is a technology that is closely related to people's daily lives. For example, students usually fill in their answers on answer sheets during exams, and examiners need to identify the filled-in options on the answer sheets. In order to ensure the accuracy of the examination, it is necessary to have a high recognition success rate for the filled-in options on the answer sheets.
[0003] In the related art, the identification of the filled options usually requires analyzing the color of the corresponding area to be identified on the entire answer sheet, and identifying the filled options by the difference between the background color of the answer sheet and the color of each option. However, since the answer sheet itself may have printing problems that lead to inconsistent colors, the same answer sheet may have a variety of colors, making it difficult to accurately identify each filled option using the related art. Summary of the invention
[0004] In order to solve the above technical problems, the present application provides a method for identifying filled-in options, and the processing device can identify the filled-in options based on the grayscale characteristics of each question to be identified in the area to be identified, thereby reducing the probability of failure in identifying the filled-in options due to uneven color of the answer sheet and improving the recognition accuracy of the filled-in options.
[0005] The embodiments of the present application disclose the following technical solutions:
[0006] In a first aspect, an embodiment of the present application discloses a method for identifying a filled option, the method comprising:
[0007] Determine a target topic area occupied by a target topic to be identified in a region to be identified, wherein the region to be identified includes a plurality of topics to be identified, and the target topic to be identified is any one of the plurality of topics to be identified;
[0008] Determine the background gray value corresponding to the target question to be identified according to the gray value of each pixel in the target question area, wherein the background gray value is used to reflect the gray characteristics of the unfilled portion of the target question area;
[0009] Determine the option grayscale values corresponding to the various candidate items of the target question to be identified, wherein the option grayscale values are used to reflect the grayscale characteristics of the portion occupied by the various candidate items in the target question area;
[0010] The candidate items whose grayscale values differ from the background grayscale value in the candidate items by more than a first threshold are determined as the filled-in options of the target question to be identified.
[0011] In a possible implementation, if there is no candidate item among the candidate items whose difference between the option grayscale value and the background grayscale value is greater than the first threshold, the method further includes:
[0012] Determine a standard option grayscale value corresponding to the to-be-recognized area, wherein the standard option grayscale value is the smallest option grayscale value among option grayscale values corresponding to a plurality of to-be-recognized options included in the to-be-recognized area;
[0013] The candidate items whose grayscale values among the candidate items differ from the grayscale value of the standard option by less than a second threshold are determined as the filled-in options of the question to be identified.
[0014] In a possible implementation, the method further includes:
[0015] Determine the option grayscale difference between the maximum option grayscale value and the minimum option grayscale value among the option grayscale values corresponding to the respective options to be selected;
[0016] In response to the option grayscale difference being less than a third threshold, the step of determining the standard option grayscale value corresponding to the to-be-identified area is performed.
[0017] In a possible implementation, the method further includes:
[0018] Determine the proportion of pixels whose grayscale values are smaller than the background grayscale value among the pixels corresponding to the candidate items;
[0019] The step of determining the candidate items whose grayscale values among the candidate items and the background grayscale value have a difference greater than a first threshold as the filled-in options of the target question to be identified includes:
[0020] The candidate items whose difference between the grayscale value of the option and the background grayscale value is greater than the first threshold and whose proportion of pixels whose grayscale value is less than the background grayscale value is greater than the fourth threshold are determined as the filled-in options of the target question to be identified.
[0021] In a possible implementation, before determining the target topic area occupied by the target topic to be identified in the area to be identified, the method further includes:
[0022] Binarization is performed on the image information corresponding to the answer sheet to be identified by Rayleigh entropy to obtain a grayscale image corresponding to the answer sheet to be identified;
[0023] The area to be identified is determined according to the positioning information in the grayscale image, and the positioning information is used to locate the question to be identified in the answer sheet to be identified.
[0024] In a possible implementation, determining the candidate items whose grayscale values among the candidate items differ from the grayscale value of the standard option by less than a second threshold as the filled-in options of the question to be identified includes:
[0025] According to the grayscale judgment coefficient, the grayscale value of each candidate option and the grayscale value of the standard option are reduced, and the magnitude of the reduction decreases as the value to be processed increases;
[0026] The candidate items whose difference between the processed option grayscale value and the processed standard option grayscale value is less than a second threshold value are determined as the filled-in options of the question to be identified.
[0027] In a possible implementation, determining the background gray value corresponding to the target title to be identified according to the gray value of each pixel in the target title area includes:
[0028] Determine the first pixel in the target topic area whose grayscale value is greater than a grayscale threshold, wherein the grayscale threshold is used to identify pixels belonging to an unfilled portion;
[0029] Calculating a first grayscale average value corresponding to the first pixel;
[0030] Determine a representative grayscale interval corresponding to the target topic area from a plurality of grayscale intervals, wherein the representative grayscale interval is a grayscale interval with the most pixels in the target topic area, and a minimum value of the plurality of grayscale intervals is the grayscale threshold;
[0031] Calculating a second grayscale average value corresponding to a second pixel in the representative grayscale interval;
[0032] The background grayscale value corresponding to the target question to be identified is determined according to the first weight, the first grayscale average value, the second weight, and the second grayscale average value, wherein the first weight is the weight corresponding to the first grayscale average value, and the second weight is the weight corresponding to the second grayscale average value.
[0033] In a second aspect, an embodiment of the present application discloses a device for identifying a filled option, the device comprising a first determination unit, a second determination unit, a third determination unit and a fourth determination unit:
[0034] The first determining unit is used to determine a target topic area occupied by a target topic to be identified in a region to be identified, the region to be identified includes a plurality of topics to be identified, and the target topic to be identified is any one of the plurality of topics to be identified;
[0035] The second determination unit is used to determine the background gray value corresponding to the target question to be identified according to the gray value of each pixel in the target question area, and the background gray value is used to reflect the gray characteristics of the unfilled part of the target question area;
[0036] The third determination unit is used to determine the option grayscale values corresponding to the various options of the target question to be identified, wherein the option grayscale values are used to reflect the grayscale characteristics of the portion occupied by the various options in the target question area;
[0037] The fourth determining unit is used to determine the candidate items whose grayscale value difference between the option and the background grayscale value among the candidate items is greater than a first threshold as the filled-in option of the target question to be identified.
[0038] In a possible implementation, if the candidate items do not have a candidate item whose difference between the option grayscale value and the background grayscale value is greater than the first threshold, the device further includes a fifth determining unit and a sixth determining unit:
[0039] The fifth determining unit is used to determine a standard option grayscale value corresponding to the to-be-recognized area, wherein the standard option grayscale value is the smallest option grayscale value among option grayscale values corresponding to a plurality of to-be-recognized options included in the to-be-recognized area;
[0040] The sixth determination unit is used to determine the candidate items whose grayscale values among the candidate items and the grayscale value of the standard option are less than a second threshold as the filled-in options of the question to be identified.
[0041] In a possible implementation manner, the device further includes a seventh determining unit and an executing unit:
[0042] The seventh determining unit is used to determine the option grayscale difference between the maximum option grayscale value and the minimum option grayscale value among the option grayscale values corresponding to the various candidate options;
[0043] The execution unit is used to execute the step of determining the standard option grayscale value corresponding to the to-be-identified area in response to the option grayscale difference being less than a third threshold.
[0044] In a possible implementation manner, the apparatus further includes an eighth determining unit:
[0045] The eighth determination unit is used to determine the proportion of pixels whose grayscale values are smaller than the background grayscale value among the pixels corresponding to the candidate items;
[0046] The fourth determining unit is specifically configured to:
[0047] The candidate items whose difference between the grayscale value of the option and the background grayscale value is greater than the first threshold and whose proportion of pixels whose grayscale value is less than the background grayscale value is greater than the fourth threshold are determined as the filled-in options of the target question to be identified.
[0048] In a possible implementation manner, the apparatus further includes an acquiring unit and a ninth determining unit:
[0049] The acquisition unit is used to perform binarization processing on the image information corresponding to the answer sheet to be identified by Rayleigh entropy to obtain a grayscale image corresponding to the answer sheet to be identified;
[0050] The ninth determination unit is used to determine the area to be identified based on the positioning information in the grayscale image, and the positioning information is used to locate the question to be identified in the answer sheet to be identified.
[0051] In a possible implementation manner, the sixth determining unit is specifically configured to:
[0052] According to the grayscale judgment coefficient, the grayscale value of each candidate option and the grayscale value of the standard option are reduced, and the magnitude of the reduction decreases as the value to be processed increases;
[0053] The candidate items whose difference between the processed option grayscale value and the processed standard option grayscale value is less than a second threshold value are determined as the filled-in options of the question to be identified.
[0054] In a possible implementation manner, the second determining unit is specifically configured to:
[0055] Determine the first pixel in the target topic area whose grayscale value is greater than a grayscale threshold, wherein the grayscale threshold is used to identify pixels belonging to an unfilled portion;
[0056] Calculating a first grayscale average value corresponding to the first pixel;
[0057] Determine a representative grayscale interval corresponding to the target topic area from a plurality of grayscale intervals, wherein the representative grayscale interval is a grayscale interval with the most pixels in the target topic area, and a minimum value of the plurality of grayscale intervals is the grayscale threshold;
[0058] Calculating a second grayscale average value corresponding to a second pixel in the representative grayscale interval;
[0059] The background grayscale value corresponding to the target question to be identified is determined according to the first weight, the first grayscale average value, the second weight, and the second grayscale average value, wherein the first weight is the weight corresponding to the first grayscale average value, and the second weight is the weight corresponding to the second grayscale average value.
[0060] In a third aspect, an embodiment of the present application provides a computer device, the device comprising a processor and a memory:
[0061] The memory is used to store program code and transmit the program code to the processor;
[0062] The processor is used to execute the filled option identification method described in any one of the first aspects according to the instructions in the program code.
[0063] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the filled-in option identification method described in any one of the first aspects.
[0064] It can be seen from the above technical solution that when identifying the filled options, the processing device can first determine the target question area occupied by the target question to be identified in the area to be identified, and the area to be identified includes multiple questions to be identified, and each question to be identified has a corresponding option. In order to avoid the problem that the filled options of some questions cannot be accurately identified due to the uneven color of the answer sheet, the background grayscale value can be determined according to the grayscale characteristics of each question to be identified. For example, the background grayscale value corresponding to the target question to be identified can be determined according to the grayscale value of each pixel in the target question area, and the background grayscale value is used to reflect the grayscale characteristics of the unfilled part in the target question area. Subsequently, the processing device can determine the option grayscale values corresponding to each option of the target question to be identified, and the option grayscale value is used to reflect the grayscale characteristics of the part occupied by each option in the target question area. Thus, the difference between the option grayscale value and the background grayscale value can reflect whether the option is filled. Since the background grayscale value is determined based on the pixel grayscale value of the target question area, it can more accurately reflect the grayscale characteristics of the unfilled part of the target question area, and thus can more accurately identify the filled options in the target question area, thereby improving the accuracy of identifying the filled options. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 A flowchart of a filled option identification method provided in an embodiment of the present application;
[0067] Figure 2 A schematic diagram of a filled option identification method provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of a filled option identification method provided in an embodiment of the present application;
[0069] Figure 4 A structural block diagram of a filled-in option identification device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The embodiments of the present application are described below in conjunction with the accompanying drawings.
[0071] How to more accurately identify the filled options in the area to be identified has always been one of the hot issues studied by technical personnel in related fields. In related technologies, it is usually adopted to analyze the overall pixel grayscale characteristics of the area to be identified that contains all the questions to be identified, determine the background grayscale value corresponding to the unfilled part in the area to be identified, and then judge whether the option is filled based on the background grayscale value and the grayscale value of each option.
[0072] However, due to problems such as uneven printing of answer sheets, pixels with large grayscale values may appear in the unfilled part of the area to be identified, which will make it difficult for the background grayscale value determined based on the entire area to be identified to fit the background grayscale characteristics corresponding to each question to be identified, making it difficult to accurately identify the filled options for each question to be identified. For example, when most of the unfilled parts of the area to be identified are lighter in color and have higher grayscale values, but some areas are darker in color and have lower grayscale values, the background grayscale value determined based on the overall unfilled part of the area to be identified may be low. When identifying the filled options based on the difference between the background grayscale value and the option grayscale value, the grayscale value of the filled options in the lighter areas of the questions to be identified may be close to the background grayscale value, making it difficult to identify.
[0073] In order to solve the above technical problems, the present application provides a method for identifying filled-in options, and the processing device can identify the filled-in options based on the grayscale characteristics of each question to be identified in the area to be identified, thereby reducing the probability of failure in identifying the filled-in options due to uneven color of the answer sheet and improving the recognition accuracy of the filled-in options.
[0074] It is understandable that the method can be applied to a processing device, which is a processing device capable of identifying filled-in options, for example, a terminal device or a server with a filled-in option identification function. The method can be executed independently by a terminal device or a server, or it can be applied to a network scenario in which a terminal device and a server communicate, and is executed by the cooperation of a terminal device and a server. Among them, the terminal device can be a computer, a mobile phone and other devices. The server can be understood as an application server or a Web server. In actual deployment, the server can be a stand-alone server or a cluster server.
[0075] Next, a filled-in option identification method provided in an embodiment of the present application will be introduced in conjunction with the accompanying drawings.
[0076] See also Figure 1 , Figure 1 A flowchart of a filled option identification method provided in an embodiment of the present application, the method comprising:
[0077] S101: Determine the target topic area occupied by the target topic to be identified in the area to be identified.
[0078] The area to be identified is the area to be identified with the filled options, the area to be identified includes multiple questions to be identified, and the target question to be identified is any one of the multiple questions to be identified. Each question to be identified can have one or more options to be selected, which are selected by filling in the options.
[0079] In order to improve the accuracy of identifying the filled-in options, in the embodiment of the present application, the processing device can perform grayscale analysis on the area occupied by each question to be identified in the area to be identified, so that the obtained background grayscale value can fit the grayscale characteristics of the question to be identified. Based on this, the processing device can first determine the target question area occupied by the target question to be identified in the area to be identified.
[0080] S102: Determine the background gray value corresponding to the target title to be identified according to the gray value of each pixel in the target title area.
[0081] It is understandable that the lighter the pixel color, the larger the corresponding grayscale value; the darker the color, the smaller the corresponding grayscale value. Based on this, the processing device can determine the pixels that are definitely not filled in the part by the grayscale values corresponding to the pixels. For example, the processing device can set a grayscale threshold of 100, determine the pixels greater than the grayscale threshold as pixels of the unfilled part, and determine the background grayscale value corresponding to the target to be identified based on these pixels.
[0082] In a possible implementation, in order to further improve the accuracy of the background grayscale value, the processing device may first determine the first pixel in the target question area whose grayscale value is greater than a grayscale threshold, where the grayscale threshold is used to identify pixels belonging to the unfilled portion, and may be set to 100, for example. Subsequently, the processing device may calculate a first grayscale average value corresponding to the first pixel, and the first grayscale average value may reflect the overall grayscale characteristics of the unfilled area.
[0083] It is understandable that the filled portion usually accounts for a smaller proportion of the area occupied by the question, and the unfilled portion accounts for a larger proportion. Therefore, the processing device can also divide it into multiple grayscale intervals, the minimum value of the multiple grayscale intervals is the grayscale threshold, so that the main background grayscale of the target question area can be analyzed based on the multiple grayscale intervals. The processing device can determine the representative grayscale interval corresponding to the target question area among the multiple grayscale intervals, and the representative grayscale interval is the grayscale interval with the most pixels in the target question area, that is, the representative grayscale interval is the grayscale interval that best fits the background grayscale of the target question area.
[0084] The processing device can calculate the second grayscale average value corresponding to the second pixel in the representative grayscale interval, and the second grayscale average value can reflect the main grayscale characteristics of the unfilled part of the target question area. The processing device can determine the background grayscale value corresponding to the target question to be identified based on the first weight, the first grayscale average value, the second weight, and the second grayscale average value, the first weight being the weight corresponding to the first grayscale average value, and the second weight being the weight corresponding to the second grayscale average value. Thus, based on this determination method, the processing device can make the obtained background grayscale value reflect the overall grayscale characteristics of the unfilled part and highlight the main grayscale of the unfilled part, thereby improving the accuracy of the background grayscale value, and thus improving the accuracy of the recognition of the filled options.
[0085] S103: Determine the option grayscale values corresponding to the various options of the target question to be identified.
[0086] Among them, the option grayscale value is used to reflect the grayscale characteristics of the portion occupied by each candidate item in the target question area. In the embodiment of the present application, the processing device can determine the positions of each candidate item corresponding to the target question to be identified in the area to be identified by preset position information, etc., and then determine the option grayscale values corresponding to each candidate item according to the pixel grayscale values at these positions.
[0087] S104: Determine the candidate items whose grayscale value difference between the option and the background grayscale value is greater than a first threshold as the filled-in option of the target question to be identified.
[0088] As mentioned above, the background grayscale value can accurately reflect the grayscale characteristics of the unfilled part in the target question area, and the option grayscale value can accurately reflect the grayscale characteristics of the part occupied by each option. Therefore, the difference between the option grayscale value and the background grayscale value can reflect the grayscale difference between the part occupied by each option and the unfilled part, so as to determine whether the occupied part is filled.
[0089] The processing device can preset a first threshold, and then determine whether the difference between the option grayscale value corresponding to each candidate item and the background grayscale value is greater than the first threshold. If it is greater, it means that the option grayscale value of the candidate item is significantly different from the unfilled part, that is, the candidate item has a greater probability of being a filled option.
[0090] It can be seen from the above technical solution that when identifying the filled options, the processing device can first determine the target question area occupied by the target question to be identified in the area to be identified, and the area to be identified includes multiple questions to be identified, and each question to be identified has a corresponding option. In order to avoid the problem that the filled options of some questions cannot be accurately identified due to the uneven color of the answer sheet, the background grayscale value can be determined according to the grayscale characteristics of each question to be identified. For example, the background grayscale value corresponding to the target question to be identified can be determined according to the grayscale value of each pixel in the target question area, and the background grayscale value is used to reflect the grayscale characteristics of the unfilled part in the target question area. Subsequently, the processing device can determine the option grayscale values corresponding to each option of the target question to be identified, and the option grayscale value is used to reflect the grayscale characteristics of the part occupied by each option in the target question area. Thus, the difference between the option grayscale value and the background grayscale value can reflect whether the option is filled. Since the background grayscale value is determined based on the pixel grayscale value of the target question area, it can more accurately reflect the grayscale characteristics of the unfilled part of the target question area, and thus can more accurately identify the filled options in the target question area, thereby improving the accuracy of identifying the filled options.
[0091] It is understandable that some users may fill in lightly when filling in options due to filling tools, printing problems, or filling strength, etc. In this case, if only the method of comparing the background grayscale value and the option grayscale value is used to determine the filled option, it may fail because the grayscale value of the filled option is close to the background grayscale value.
[0092] However, when the user fills in the options as a whole relatively lightly, the difference between the options filled in by the user should be relatively consistent in grayscale under normal circumstances. Based on this, in order to further improve the recognition success rate of the filled-in options, the processing device can also determine whether the candidate option is a filled-in option based on the grayscale value difference between the options filled in by the user. If there is no candidate option whose difference between the option grayscale value and the background grayscale value is greater than the first threshold value among the candidate options, the processing device can determine the standard option grayscale value corresponding to the area to be identified, and the standard option grayscale value is the smallest option grayscale value among the option grayscale values corresponding to the multiple candidate options included in the area to be identified. It can be understood that since the closer the color is to black, the smaller the grayscale value, the candidate option with the smallest option grayscale value in the area to be identified has a greater probability of being a filled-in option. Based on this, the processing device can compare the option grayscale value of each candidate option of the target question to be identified with the standard option grayscale value. If the option grayscale value is closer to the standard option grayscale value, it means that the candidate option has a greater probability of being a filled-in option. The processing device can determine the candidate items whose grayscale value difference between the option and the quasi-option grayscale value is less than the second threshold as the filled-in option of the question to be identified, so that the filled-in option can be accurately identified even when the overall filled color is lighter.
[0093] In addition to judging whether the filling is too light by the background grayscale value and the option grayscale value, the processing device can also analyze the difference between the grayscale values of multiple options for the same question to distinguish whether the filling is too light. It can be understood that in general, there are filled and unfilled options in the multiple options for the same question. When the grayscale difference between the multiple options for the same question is small, it can be explained to a certain extent that the filling color of the filled option is lighter and closer to the unfilled option.
[0094] Based on this, in a possible implementation, the processing device may also determine the option grayscale difference between the maximum option grayscale value and the minimum option grayscale value among the option grayscale values corresponding to each option to be selected, and preset a third threshold value for judgment. If the option grayscale difference is less than the third threshold value, it means that the color of the filled option is lighter. At this time, in response to the option grayscale difference being less than the third threshold value, the processing device may execute the step of determining the standard option grayscale value corresponding to the area to be identified, so that the lighter filling situation can be more accurately identified.
[0095] It is understandable that when identifying filled options, since the user may have erased or filled in the options by mistake, some of the options may not be the options that the user wants to fill in, but some areas of the options may be stained with some traces of filling. Based on this, in order to more accurately identify the filled options and reduce the probability of misidentification, the processing device can further analyze the proportion of the filled area.
[0096] In one possible implementation, the processing device can determine the proportion of pixels whose grayscale values are less than the background grayscale value in the corresponding pixels of each candidate item. It can be understood that pixels whose grayscale values are less than the background grayscale value have a greater probability of being pixels of the filled area. If the proportion of pixels whose grayscale values are less than the background grayscale value in the pixels corresponding to a candidate item is relatively high, it means that the proportion of the filled part in the candidate item is relatively large, that is, the probability of being a filled option is relatively high. Based on this, the processing device can determine the candidate items whose grayscale values and background grayscale values in each candidate item are greater than the first threshold, and whose grayscale values in the corresponding pixels are less than the background grayscale value. The proportion of pixels is greater than the fourth threshold as the filled option of the target question to be identified. The fourth threshold is used to determine whether the proportion of pixels in the filled area is relatively high. Thus, the processing device can identify the filled option through multiple standards, reduce the probability of misidentification, and improve the accuracy of identifying the filled option.
[0097] In addition to improving recognition accuracy through multiple recognition methods, before recognizing the filled-in options, the processing device can also determine the area to be recognized in a more accurate manner, so that the grayscale value of the area to be recognized can accurately reflect the filling status of the options to be recognized. In a possible implementation method, the processing device can binarize the image information corresponding to the answer sheet to be recognized through Rayleigh entropy to obtain the grayscale image corresponding to the answer sheet to be recognized. The answer sheet to be recognized is the answer sheet containing the information in the above-mentioned area to be recognized, such as Figure 2 As shown, Figure 2 This is a schematic diagram of a grayscale image obtained through Rayleigh entropy. Rayleigh entropy can be expressed using the following formula:
[0098]
[0099] It should be noted that Figure 2 In order to clearly show the processing effect, the color has been reversed, that is, the filled part is in Figure 2 The colors with higher gray values are shown in the Figure 2 Displayed as colors with lower gray values.
[0100] The processing device can determine the area to be identified based on the positioning information in the grayscale image. The positioning information is used to locate the question to be identified in the answer sheet to be identified. For example, the positioning information can be a positioning mark on the answer sheet, etc. The processing device can quickly find the location of the question to be identified in the answer sheet through the positioning mark. Since Rayleigh entropy can reflect the degree of uneven distribution of information, Rayleigh entropy can be used to retain the filling situation more completely and accurately.
[0101] It is understandable that in different grayscale gradients, the human eye has certain differences in its ability to recognize different grayscale values. For example, when the grayscale values of two areas are relatively low, that is, the colors are relatively dark, the ability to recognize the difference in grayscale values is relatively poor, that is, the naked eye of people in the two dark areas has a relatively low perception of grayscale. When the grayscale values of two areas are relatively high, that is, the colors are relatively light, the ability to recognize the difference in grayscale values is relatively strong, that is, the naked eye of people in the two light areas has a relatively high perception of grayscale. Based on this, when the user is filling in the options to be selected, if he is accustomed to filling in darker colors, the grayscale differences between different filled options may be relatively high; if he is accustomed to filling in lighter colors, the grayscale differences between different filled options may be relatively low.
[0102] Therefore, in order to further improve the accuracy of identifying the filled options, when determining whether to fill in by comparing the difference between the option grayscale value of the candidate option and the grayscale value of the standard option, the processing device can adjust the obtained difference according to different grayscale values to make it more in line with the actual filling habits of the user. In a possible implementation, the processing device can reduce the option grayscale value and the standard option grayscale value in each candidate option according to the grayscale judgment coefficient, and the amplitude of the reduction processing decreases as the value to be processed increases. The value to be processed is the option grayscale value or the standard option grayscale value to be processed. Through this processing method, when the color filled by the user is generally darker, the grayscale value of the standard option and the grayscale value of the filled option are both low. At this time, the amplitude of the reduction processing is large, and the processing device can reduce the difference between the grayscale value of the filled option and the standard option to a certain extent, so that the option filled by the user can be accurately determined; when the color filled by the user is generally lighter, the grayscale value of the standard option and the grayscale value of the filled option are both high. At this time, the amplitude of the reduction processing is small, and the processing device can further expand the difference between the grayscale value of the filled option and the standard option to a certain extent, so that the unfilled part and the filled option can be accurately distinguished. It can be understood that this processing method can also be applied to the comparison of the grayscale values of the options between the various options to be selected.
[0103] The processing device can determine the candidate options whose difference between the processed option grayscale value and the processed standard option grayscale value is less than the second threshold as the filled-in options for the question to be identified, so that the recognition result can be more in line with the user's actual filling effect and improve the recognition accuracy.
[0104] For example, Figure 3 As shown, since the color correction of scanners and display screens is based on Gamma changes, the human eye's perception of brightness is not proportional to physical power, but a power function. Therefore, the grayscale value can be processed based on the Gamma function:
[0105] f(I)=cI γ
[0106] When γ<1, as shown by the dotted line, in the low gray value area, the dynamic range becomes larger, and the image contrast is enhanced; in the high gray value area, the dynamic range becomes smaller, the image contrast decreases, and at the same time, the overall gray value of the image becomes larger.
[0107] When γ>1, as shown by the solid line, the dynamic range of the low gray value area becomes smaller, and the dynamic range of the high gray value area becomes larger, which reduces the image contrast in the low gray value area and increases the image contrast in the high gray value area. At the same time, the overall gray value of the image becomes smaller.
[0108] In the recognition of fill-in questions, when the fill-in is lighter, the gray value of the option image is higher. In order to improve the accuracy of the lighter fill-in, it is necessary to improve the contrast of the lightly filled image; according to the above description, to improve the contrast of the high gray value area, the Gamma value selection range is greater than 1. According to the sRGB standard, the Gamma value is set to 2.2; c defaults to 1. Therefore, the dynamic range of the objective question background color in the low gray value area becomes smaller after calculation, and the dynamic range in the high gray value area becomes larger. For example, the two gray values are 0 and 50, respectively. After normalization and Gamma change, they are (0, 7.07), while 200 and 250 are (149.42, 244.13) after transformation. Obviously, when the gray value difference is constant, the contrast in the low gray value area is significantly lower than that in the high gray value area.
[0109] First, the processing device may normalize the calculated option grayscale value and the standard option grayscale value according to the following formula:
[0110]
[0111] At this time, max and min are 0 and 255 respectively;
[0112] After normalization, Gamma transformation is performed, and the transformed result is multiplied by 255 to obtain the final grayscale result. The final grayscale value result is used to compare the grayscale values of the standard option and the grayscale values of the options to be selected. The third threshold can be selected as 40, and the second threshold can be selected as 85.
[0113] Next, a method for identifying filled-in options provided by an embodiment of the present application will be introduced in conjunction with an actual application scenario. In the actual application scenario, the processing device may be an identification instrument for identifying the result of filling in the answer sheet.
[0114] First, the recognition instrument can perform binarization processing on the answer sheet image based on Rayleigh entropy to obtain a grayscale image of the area to be recognized, and then calculate the background grayscale value corresponding to each question to be recognized in the area to be recognized. The scheme for calculating the background grayscale value is as follows:
[0115] Divide the grayscale value 100-250 into 16 gradients; count the number of pixels with grayscale values greater than 100 in the question area corresponding to each question to be identified, and calculate the grayscale average value average_pixel of these pixels; then count the grayscale gradient with the most occurrences, and then calculate the average value maxLevel_pixel of the grayscale of the grayscale gradient pixels; pixels below 100 are assumed to be non-unfilled parts (but not necessarily filled parts), and no statistical calculation is performed; the background grayscale value backGround_pixel is calculated as follows:
[0116] backGround_pixel=ratio_1*average_pixel+ratio_2*maxLevel_pixel
[0117] Among them, ratio_1 and ratio_2 are weights, which are set to 0.6 and 0.4 respectively;
[0118] Then, the option grayscale value of each candidate item is calculated, that is, the option grayscale value of the candidate item is obtained by summing the pixel grayscale values in the candidate item and dividing it by the number of pixels; and the minimum option grayscale value minPixel in the area to be identified is recorded. Through the option grayscale value and the background grayscale value, the processing device can first determine the filled option through the first threshold.
[0119] Then, in order to avoid misidentification due to shallow filling, irregular filling and other problems, the recognition instrument can begin to determine whether each question in the area to be recognized belongs to the scenario of irregular filling.
[0120] The recognition instrument calculates the difference between the maximum option grayscale value and the minimum option grayscale value in the options corresponding to the target question to be recognized, namely background_diff;
[0121] Then, the grayscale difference gray_diff between the minimum option grayscale value of the target question to be identified and the standard option grayscale value minPixel corresponding to the area to be identified can be calculated;
[0122] It is determined whether background_diff is less than the third threshold value diff_1, and whether the difference gray_diff is greater than the second threshold value. When one of the above conditions is met, it is considered that the filling of the current question belongs to a relatively light and irregular scene. At this time, the determination of the filling of the option not only depends on the grayscale difference between the options, but also on the filling area of the option to determine whether the option is filled.
[0123] The recognition instrument can calculate the difference between the grayscale value of each option to be selected and the grayscale value of the standard option. When the difference is less than diff_2, it is considered to be a filled option.
[0124] At the same time, the recognition instrument can use the previously calculated background gray value backGround_pixel value of each question to be recognized as a reference value. Pixel gray values less than backGround_pixel represent filling. The filled area in the corresponding area of each candidate item is calculated, and it is considered filled when it is greater than 0.6.
[0125] When both of the above conditions are met at the same time, the current option is considered to be filled.
[0126] Based on the method for identifying a filled option provided in the above embodiment, the present application embodiment also provides a device for identifying a filled option. Figure 4 , Figure 4 This is a structural block diagram of a filled option recognition device 400 provided in an embodiment of the present application, the device includes a first determination unit 401, a second determination unit 402, a third determination unit 403 and a fourth determination unit 404:
[0127] A first determining unit 401 is used to determine a target topic area occupied by a target topic to be identified in a region to be identified, wherein the region to be identified includes a plurality of topics to be identified, and the target topic to be identified is any one of the plurality of topics to be identified;
[0128] The second determining unit 402 is used to determine the background gray value corresponding to the target title to be identified according to the gray value of each pixel in the target title area, wherein the background gray value is used to reflect the gray characteristics of the unfilled part of the target title area;
[0129] The third determining unit 403 is used to determine the option grayscale values corresponding to the various options of the target question to be identified, wherein the option grayscale values are used to reflect the grayscale characteristics of the portion occupied by the various options in the target question area;
[0130] The fourth determining unit 404 is used to determine the candidate items whose grayscale value difference between the option and the background grayscale value is greater than a first threshold as the filled-in option of the target question to be identified.
[0131] In a possible implementation, if the candidate items do not include a candidate item whose difference between the option grayscale value and the background grayscale value is greater than the first threshold value, the device 400 further includes a fifth determining unit and a sixth determining unit:
[0132] A fifth determining unit, configured to determine a standard option grayscale value corresponding to the to-be-recognized area, wherein the standard option grayscale value is the smallest option grayscale value among option grayscale values corresponding to a plurality of to-be-recognized options included in the to-be-recognized area;
[0133] The sixth determining unit is used to determine the candidate items whose grayscale values among the candidate items and the grayscale value of the standard option are less than a second threshold as the filled-in options of the question to be identified.
[0134] In a possible implementation manner, the apparatus 400 further includes a seventh determining unit and an executing unit:
[0135] A seventh determining unit, configured to determine an option grayscale difference between a maximum option grayscale value and a minimum option grayscale value among the option grayscale values corresponding to the respective options to be selected;
[0136] An execution unit is used for executing the step of determining the standard option grayscale value corresponding to the area to be identified in response to the option grayscale difference being less than a third threshold.
[0137] In a possible implementation manner, the apparatus 400 further includes an eighth determining unit:
[0138] An eighth determining unit, configured to determine the proportion of pixels whose grayscale values are smaller than the background grayscale value among the pixels corresponding to the candidate items;
[0139] The fourth determining unit 404 is specifically configured to:
[0140] The candidate items whose difference between the grayscale value of the option and the background grayscale value is greater than the first threshold and whose proportion of pixels whose grayscale value is less than the background grayscale value is greater than the fourth threshold are determined as the filled-in options of the target question to be identified.
[0141] In a possible implementation manner, the apparatus 400 further includes an acquiring unit and a ninth determining unit:
[0142] An acquisition unit is used to perform binarization processing on the image information corresponding to the answer sheet to be identified by using Rayleigh entropy to obtain a grayscale image corresponding to the answer sheet to be identified;
[0143] The ninth determination unit is used to determine the area to be identified based on the positioning information in the grayscale image, and the positioning information is used to locate the question to be identified in the answer sheet to be identified.
[0144] In a possible implementation manner, the sixth determining unit is specifically configured to:
[0145] According to the grayscale judgment coefficient, the grayscale value of each candidate option and the grayscale value of the standard option are reduced, and the magnitude of the reduction decreases as the value to be processed increases;
[0146] The candidate items whose difference between the processed option grayscale value and the processed standard option grayscale value is less than a second threshold value are determined as the filled-in options of the question to be identified.
[0147] In a possible implementation manner, the second determining unit 402 is specifically configured to:
[0148] Determine the first pixel in the target topic area whose grayscale value is greater than a grayscale threshold, wherein the grayscale threshold is used to identify pixels belonging to an unfilled portion;
[0149] Calculating a first grayscale average value corresponding to the first pixel;
[0150] Determine a representative grayscale interval corresponding to the target topic area from a plurality of grayscale intervals, wherein the representative grayscale interval is a grayscale interval with the most pixels in the target topic area, and a minimum value of the plurality of grayscale intervals is the grayscale threshold;
[0151] Calculating a second grayscale average value corresponding to a second pixel in the representative grayscale interval;
[0152] The background grayscale value corresponding to the target question to be identified is determined according to the first weight, the first grayscale average value, the second weight, and the second grayscale average value, wherein the first weight is the weight corresponding to the first grayscale average value, and the second weight is the weight corresponding to the second grayscale average value.
[0153] The present application also provides a computer device, the device comprising a processor and a memory:
[0154] The memory is used to store program code and transmit the program code to the processor;
[0155] The processor is used to implement the filled option identification method described in any one of the above embodiments according to the instructions in the program code.
[0156] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the device performance detection methods for a game program described in the aforementioned embodiments.
[0157] A person of ordinary skill in the art can understand that all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the above-mentioned storage medium can be at least one of the following media: read-only memory (English: read-only memory, abbreviated: ROM), RAM, magnetic disk or optical disk, etc. Various media that can store program codes.
[0158] It should be noted that each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device and system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments. The device and system embodiments described above are merely schematic, in which the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0159] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for identifying a filled option, characterized in that: The method comprises: Determine a target topic area occupied by a target topic to be identified in a region to be identified, wherein the region to be identified includes a plurality of topics to be identified, and the target topic to be identified is any one of the plurality of topics to be identified; Determine the background gray value corresponding to the target question to be identified according to the gray value of each pixel in the target question area, wherein the background gray value is used to reflect the gray characteristics of the unfilled portion of the target question area; Determine the option grayscale values corresponding to the various candidate items of the target question to be identified, wherein the option grayscale values are used to reflect the grayscale characteristics of the portion occupied by the various candidate items in the target question area; Determine the candidate items whose grayscale values of the options among the candidate items and the grayscale value of the background are greater than a first threshold as the filled-in options of the target question to be identified; Determining the background grayscale value corresponding to the target title to be identified according to the grayscale value of each pixel in the target title area includes: Determine the first pixel in the target topic area whose grayscale value is greater than a grayscale threshold, wherein the grayscale threshold is used to identify pixels belonging to an unfilled portion; Calculating a first grayscale average value corresponding to the first pixel; Determine a representative grayscale interval corresponding to the target topic area from a plurality of grayscale intervals, wherein the representative grayscale interval is a grayscale interval with the most pixels in the target topic area, and a minimum value of the plurality of grayscale intervals is the grayscale threshold; Calculating a second grayscale average value corresponding to a second pixel in the representative grayscale interval; The background grayscale value corresponding to the target question to be identified is determined according to the first weight, the first grayscale average value, the second weight, and the second grayscale average value, wherein the first weight is the weight corresponding to the first grayscale average value, and the second weight is the weight corresponding to the second grayscale average value.
2. The method according to claim 1, characterized in that If there is no candidate item among the candidate items whose difference between the option grayscale value and the background grayscale value is greater than the first threshold, the method further includes: Determine a standard option grayscale value corresponding to the to-be-recognized area, wherein the standard option grayscale value is the smallest option grayscale value among option grayscale values corresponding to a plurality of to-be-recognized options included in the to-be-recognized area; The candidate items whose grayscale values among the candidate items differ from the grayscale value of the standard option by less than a second threshold are determined as the filled-in options of the question to be identified.
3. The method according to claim 2, characterized in that The method further comprises: Determine the option grayscale difference between the maximum option grayscale value and the minimum option grayscale value among the option grayscale values corresponding to the respective options to be selected; In response to the option grayscale difference being less than a third threshold, the step of determining the standard option grayscale value corresponding to the to-be-identified area is performed.
4. The method according to claim 1, characterized in that: The method further comprises: Determine the proportion of pixels whose grayscale values are smaller than the background grayscale value among the pixels corresponding to the candidate items; The step of determining the candidate items whose grayscale values among the candidate items and the background grayscale value have a difference greater than a first threshold as the filled-in options of the target question to be identified includes: The candidate items whose difference between the grayscale value of the option and the background grayscale value is greater than the first threshold and whose proportion of pixels whose grayscale value is less than the background grayscale value is greater than the fourth threshold are determined as the filled-in options of the target question to be identified.
5. The method according to claim 1, characterized in that Before determining the target topic area occupied by the target topic to be identified in the area to be identified, the method further includes: Binarization is performed on the image information corresponding to the answer sheet to be identified by Rayleigh entropy to obtain a grayscale image corresponding to the answer sheet to be identified; The area to be identified is determined according to the positioning information in the grayscale image, and the positioning information is used to locate the question to be identified in the answer sheet to be identified.
6. The method according to claim 2, characterized in that The step of determining the candidate items whose grayscale values among the candidate items differ from the grayscale value of the standard option by less than a second threshold as the filled-in options of the question to be identified includes: According to the grayscale judgment coefficient, the grayscale value of each candidate option and the grayscale value of the standard option are reduced, and the magnitude of the reduction decreases as the value to be processed increases; The candidate items whose difference between the processed option grayscale value and the processed standard option grayscale value is less than a second threshold value are determined as the filled-in options of the question to be identified.
7. A device for identifying a filled option, characterized in that: The device comprises a first determining unit, a second determining unit, a third determining unit and a fourth determining unit: The first determining unit is used to determine a target topic area occupied by a target topic to be identified in a region to be identified, the region to be identified includes a plurality of topics to be identified, and the target topic to be identified is any one of the plurality of topics to be identified; The second determination unit is used to determine the background gray value corresponding to the target question to be identified according to the gray value of each pixel in the target question area, and the background gray value is used to reflect the gray characteristics of the unfilled part of the target question area; The third determination unit is used to determine the option grayscale values corresponding to the various options of the target question to be identified, wherein the option grayscale values are used to reflect the grayscale characteristics of the portion occupied by the various options in the target question area; The fourth determining unit is used to determine the candidate items whose grayscale value difference between the option and the background grayscale value among the candidate items is greater than a first threshold as the filled-in option of the target question to be identified; The second determining unit is specifically configured to: Determine the first pixel in the target topic area whose grayscale value is greater than a grayscale threshold, wherein the grayscale threshold is used to identify pixels belonging to an unfilled portion; Calculating a first grayscale average value corresponding to the first pixel; Determine a representative grayscale interval corresponding to the target topic area from a plurality of grayscale intervals, wherein the representative grayscale interval is a grayscale interval with the most pixels in the target topic area, and a minimum value of the plurality of grayscale intervals is the grayscale threshold; Calculating a second grayscale average value corresponding to a second pixel in the representative grayscale interval; The background grayscale value corresponding to the target question to be identified is determined according to the first weight, the first grayscale average value, the second weight, and the second grayscale average value, wherein the first weight is the weight corresponding to the first grayscale average value, and the second weight is the weight corresponding to the second grayscale average value.
8. A computer device, characterized in that: The device comprises a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the filled option identification method described in any one of claims 1-6 according to the instructions in the program code.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the filled-in option identification method described in any one of claims 1-6.
Citation Information
Patent Citations
Filling mark recognition method based on image processing
CN103310211A
Intelligent marking method and system of objective questions
CN105989347A