A method for detecting voter marked ballots and intelligent voting machine
By capturing and processing grayscale images of paper ballots in intelligent voting machines, setting standard layers and minimum grayscale values, and automatically identifying ballot markings, the problem of voters marking ballots is solved, ensuring the fairness and anonymity of the election.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CAS OF CHENGDU INFORMATION TECH CO LTD
- Filing Date
- 2025-02-11
- Publication Date
- 2026-07-21
AI Technical Summary
Existing electronic election systems are unable to effectively detect voter markings on paper ballots, undermining the anonymity and fairness of elections.
By acquiring grayscale images of both sides of paper ballots, processing the images using a processor, setting standard layers and minimum grayscale values, and automatically identifying markings on the ballots, a contact image sensor is used to simultaneously acquire grayscale images and detect markings.
It enables automatic recognition of ballot markings, ensuring the fairness of voting, preventing voters from marking ballots, and improving the fairness of elections.
Smart Images

Figure CN120853179B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of marker recognition technology, and more specifically, to a method for detecting voter-marked ballots and an intelligent voting machine. Background Technology
[0002] Elections must be fair, just, and anonymous. Therefore, paper-based elections must also ensure anonymity. Voters cannot make specific markings on their ballots to prove or distinguish their votes and thus track their whereabouts; this behavior undermines the anonymity of the election. Therefore, electronic election systems based on paper ballots must be able to detect this behavior to ensure anonymity. Most existing electronic election systems do not rely on specific technologies to prevent this voter behavior but rather on management or manual methods, which introduces a degree of uncontrollability. Summary of the Invention
[0003] The purpose of this invention is to provide a method for detecting voter marking on ballots and an intelligent voting machine, which can automatically identify marking on paper ballots, thereby eliminating the act of marking ballots and ensuring the fairness of voting activities.
[0004] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:
[0005] In a first aspect, embodiments of the present invention provide a method for detecting voter-marked ballots, the method comprising: obtaining at least one standard layer based on an electronic ballot, wherein the contents of the at least one standard layer do not overlap; setting a first minimum grayscale value for the image at each of the standard layers corresponding to an unmarked paper ballot, and a second minimum grayscale value at the background color of the unmarked paper ballot; acquiring grayscale images of the front and back sides of the paper ballot to be detected; separating the portions of the front and back grayscale images corresponding to the at least one standard layer as detection images; if any grayscale value of the detection image is less than the corresponding first minimum grayscale value, it is marked in a preset marking image; if any grayscale value at the background color of the front and back grayscale images is less than the corresponding second minimum grayscale value, it is also marked in the preset marking image.
[0006] Secondly, embodiments of the present invention also provide an intelligent voting machine, which includes at least a processor and an image acquisition device. The image acquisition device is used to acquire grayscale images of the front and back of a paper ballot and send them to the processor for processing. The processor is used to execute the method for detecting voter markings on ballots to identify whether there are markings on the paper ballots.
[0007] This invention provides a method and intelligent voting machine for detecting voter-marked ballots. The method includes: obtaining at least one standard layer based on an electronic ballot; setting a first minimum grayscale value for the image at each standard layer corresponding to an unmarked paper ballot, and a second minimum grayscale value for the background color of the unmarked paper ballot; acquiring grayscale images of the front and back sides of the paper ballot to be detected; separating the portions of the front and back grayscale images corresponding to the standard layers as detection images; and then detecting the detection images. If any grayscale value in the detection image is less than the corresponding first minimum grayscale value, or any grayscale value at the background color of the front and back grayscale images is less than the corresponding second minimum grayscale value, it is marked in a preset marking image. This achieves automatic recognition and detection of markings on the ballot, ensuring the fairness of the voting process.
[0008] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 A schematic diagram of the structure of an intelligent voting machine provided in an embodiment of the present invention is shown.
[0011] Figure 2 The diagram shows a flowchart of a method for detecting voter-marked ballots provided by an embodiment of the present invention.
[0012] Figure 3 This is a front view of an electronic ballot provided by an embodiment of the present invention.
[0013] Figure 4 The diagram shows the reverse side of an electronic ballot provided in an embodiment of the present invention.
[0014] Figure 5 This diagram illustrates a standard layer provided by an embodiment of the present invention.
[0015] Figure 6 (a) to (b) show partial schematic diagrams of a ballot provided in an embodiment of the present invention.
[0016] Figure 7 (a) to (b) show a schematic diagram of a grayscale image provided by an embodiment of the present invention.
[0017] Figure 8 (a) to (b) show a schematic diagram of an image spacing provided by an embodiment of the present invention.
[0018] Figure 9 This illustration shows a grayscale image provided by an embodiment of the present invention.
[0019] Figure 10 (a) to (b) show schematic diagrams of an extended standard layer provided by an embodiment of the present invention.
[0020] Figure 11 (a) to (c) show schematic diagrams of a detection image formation provided by an embodiment of the present invention.
[0021] Figure 12 This diagram illustrates a preset marker image provided by an embodiment of the present invention.
[0022] Figure 13 A schematic diagram of a remaining detection area provided by an embodiment of the present invention is shown.
[0023] Figure 14 (a) to (c) show another schematic diagram of detection image formation provided by an embodiment of the present invention.
[0024] Figure 15 This diagram illustrates another remaining detection area provided by an embodiment of the present invention.
[0025] Figure 16 (a) to (c) show another schematic diagram of detection image formation provided by an embodiment of the present invention.
[0026] Figure 17 (a) to (b) show a schematic diagram of a marking provided by an embodiment of the present invention.
[0027] Figure 18 This diagram illustrates another remaining detection area provided by an embodiment of the present invention.
[0028] Figure 19 (a) to (b) show another schematic diagram of the marking provided in the embodiments of the present invention.
[0029] Illustration:
[0030] 100-Intelligent Voting Machine. Detailed Implementation
[0031] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0032] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this invention, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0033] Please refer to Figure 1 This is a schematic diagram of the structure of an intelligent voting machine 100 provided in an embodiment of the present invention. The intelligent voting machine 100 includes at least a processor (not shown in the figure) and an image acquisition device (not shown in the figure). Further, the image acquisition device includes at least two contact image sensors (CIS) (not shown in the figure), which are spaced at a fixed interval to simultaneously acquire grayscale images of both sides of the paper ballot as it passes through.
[0034] In other words, the intelligent voting machine 100 has a transmission mechanism at the ballot insertion slot. When a paper ballot is inserted, this mechanism drives it forward at a constant speed. At this time, at least two contact image sensors simultaneously capture grayscale images of both sides of the ballot and transmit these images to the processor. The processor then identifies and marks the ballot according to the method described below for detecting voter-marked ballots. If a mark is found, the intelligent voting machine 100 will display that the ballot is marked and will reject, eject, or invalidate the ballot. If no mark is found, the intelligent voting machine 100 will display that the ballot is not marked and is a valid ballot.
[0035] Please refer to Figure 2 The diagram shown is a flowchart illustrating a method for detecting voter-marked ballots according to an embodiment of the present invention, specifically including:
[0036] S110, at least one standard layer is obtained based on the electronic ballot, and the contents of the at least one standard layer do not overlap.
[0037] This electronic ballot is the electronic version of the paper ballot, and its content is identical to the paper ballot. Based on this electronic ballot, at least one standard layer is obtained; that is, the electronic ballot is divided into at least one standard layer displayed in black, according to different colors. Each standard layer contains a portion of the content from the electronic ballot, and the content of the standard layers does not overlap. If the electronic ballot only has black and a white background, only one standard layer needs to be created; if the electronic ballot contains dark red, light red, and black, it can be divided into two or three standard layers. Each standard layer contains content displayed in only one color, but all standard layers are presented in black and white.
[0038] The following example illustrates this:
[0039] like Figure 3 The image shown is a front view of an electronic ballot provided in an embodiment of the present invention, with reference to the accompanying diagram. Figure 4 This is a schematic diagram of the reverse side of an electronic ballot provided in an embodiment of the present invention. Both the front and back of the electronic ballot need to be marked using the voter mark detection method provided in this embodiment of the present invention. The detection process and method are the same; to avoid repetition, the following description only uses the mark recognition process on the front of the electronic ballot as an example.
[0040] Because the front of the electronic ballot has three colors: black (the text area), dark red (the "SAMPLE" text at the top), and light red (the table area), in order to better detect the presence of markings in different areas, the electronic ballot is divided into three standard black layers, such as... Figure 5 As shown, there are standard layers SI0, SI1, and SI2, each containing a portion of the content from the electronic ballot (distinguished by different colors). There is no overlap between the contents of each standard layer. Combining the contents of all standard layers yields the complete content of the electronic ballot. This allows for better marking and verification of all content on the electronic ballot, preventing omissions and improving detection accuracy.
[0041] Furthermore, based on the physical scanning accuracy of the image acquisition device on the intelligent voting machine 100, the multiple standard layers formed above can be scaled and converted into images of the same size. For example, if the physical scanning accuracy is 200 DPI, the standard image size corresponding to an A4-sized ballot is approximately 1653 pixels wide * 2338 pixels high. It's easy to understand that the size of the standard layer is consistent with the size of the actual paper ballot for easy comparison and detection. The size of the paper ballot can be set according to actual needs, and the standard layer can be adjusted accordingly as the size of the paper ballot changes.
[0042] S120, set a first minimum grayscale value for the image at each of the standard layers corresponding to the unmarked paper ballot, and a second minimum grayscale value for the background color of the unmarked paper ballot.
[0043] In other words, a clean, unmarked paper ballot is selected and inserted into the smart voting machine 100. The image acquisition device captures its grayscale image. For each standard layer portion of this grayscale image, after traversing its pixels, a minimum grayscale value is selected for each (named the first minimum grayscale value for easy differentiation later). Simultaneously, for the background area of the unmarked paper ballot, a minimum grayscale value is also selected after traversing its pixels, serving as the second minimum grayscale value. When other paper ballots are subsequently inserted into the smart voting machine 100 for mark detection, the ballots will be separated into multiple parts according to their respective standard layers. The minimum grayscale value of each corresponding part in each standard layer should not be less than the first minimum grayscale value and the second minimum grayscale value. If it is less than either, the ballot is considered potentially marked.
[0044] The following example illustrates this:
[0045] like Figure 6 As shown in (a), this is a partial schematic diagram of a ballot provided in an embodiment of the present invention. The ballot originally had the word "SAMPLE" in dark red on it. After being scanned by an image acquisition device, it forms a shape as shown in (a). Figure 6 (b) shows a grayscale image where, without any markings in the text area, the minimum grayscale value is 50 when traversing all pixels of the text. When a paper ballot is subsequently tested by the smart voting machine 100, if the minimum grayscale value of this portion is less than 50, it can be assumed that someone has marked the "SAMPLE" text area on the ballot. For unmarked paper ballots, minimum grayscale values are also set for other standard layers. For example, using the same method, the minimum grayscale value for black text can be set to 0, and the minimum grayscale value for tables to 130, etc. It should be noted that this minimum grayscale value setting is related to the accuracy of the image acquisition device of the smart voting machine 100; different devices require corresponding adjustments to this minimum grayscale value.
[0046] Furthermore, the reason for setting a minimum grayscale value for the image at each standard layer corresponding to the unmarked paper ballot, and also for the background area (blank area without any content) of the unmarked ballot, is that users may mark both the content and the blank areas of the ballot. Therefore, in addition to identifying the content areas of the paper ballot, it is also necessary to mark and identify the background area. It should be noted that theoretically, the blank area of the paper ballot should be white after scanning, with a grayscale value of 255. However, due to the focal length of the contact image sensor, the actual scanned image may contain shadows, or due to the printing process, the background of the ballot itself may not be pure white, but may be reddish or light pink. Therefore, it is also necessary to search for the minimum grayscale value pixel by pixel in the background area of the unmarked paper ballot, rather than directly setting the minimum grayscale value according to convention.
[0047] S130: Collect grayscale images of the front and back sides of the paper ballot to be tested.
[0048] In other words, when a ballot is inserted into the intelligent voting machine 100, the ballot needs to be inspected. First, the image acquisition device of the intelligent voting machine 100 acquires grayscale images of both sides of the paper ballot to be inspected. It should be noted that ballot markings may exist on both the front and back of the ballot. When identifying the markings on the paper ballot to be inspected, images of both the front and back need to be acquired and identified separately. Since the identification process and method are the same, for the sake of simplicity, the following description will only use the identification process of the front of the ballot as an example.
[0049] To improve the accuracy of ballot recognition, after the processor of the intelligent voting machine 100 receives the front and back grayscale images, it needs to perform preprocessing on the images, which specifically includes:
[0050] like Figure 7 As shown in (a), this is a schematic diagram of a grayscale image provided in an embodiment of the present invention. It is a grayscale image acquired by an image acquisition device after a paper ballot to be detected is inserted into the intelligent voting machine 100. The image is then subjected to noise reduction, rotation, and cropping to obtain the image shown in (a). Figure 7 (b) shows the effective image area.
[0051] Because the paper ballots to be tested are inserted into the intelligent voting machine 100 using a method where the contact image sensor remains stationary while the ballot moves at a constant speed, the ballot image information in the acquired grayscale image will experience longitudinal random deformation due to changes in the movement rate. For example... Figure 8 As shown in (a), the standard image spacing might be 207 pixels, but after the paper ballot to be tested is image acquired, as shown in (a), the standard image spacing might be 207 pixels. Figure 8As shown in (b), its longitudinal spacing may randomly deform into 209PX. Therefore, this embodiment of the invention also restores its random longitudinal deformation, specifically by: identifying... Figure 7 (b) The positional difference between the center coordinates of the left and right positioning blocks (multiple small black squares arranged vertically on the leftmost and rightmost sides of the ballot in the effective image area shown in the figure) and the center coordinates of the left and right positioning blocks on the standard electronic ballot is used to remap the positional difference to eliminate its vertical random deformation.
[0052] In addition, it is necessary to remove non-detection areas from the effective image area after remapping. That is, the parts of the ballot that cannot be used for detection are removed, such as the positioning blocks, the actual fill-in areas of voters, and other areas that do not need to be detected (such as the ellipse to the left of the candidate's name in the figure). This yields a grayscale image that is actually used for detection, as shown in the figure. Figure 9 As shown.
[0053] S140, the portion of the front and back grayscale images corresponding to the at least one standard layer is separated as the detection image.
[0054] S150, if any gray value of the detected image is less than the corresponding first minimum gray value, it is marked in the preset mark image; if any gray value at the background color of the front and back gray images is less than the corresponding second minimum gray value, it is also marked in the preset mark image.
[0055] The acquired grayscale images of the front and back sides have already been preprocessed in S130, so further processing of the grayscale images is carried out as follows:
[0056] First, because the transmission mechanism of the image acquisition device drives the ballot forward at a constant speed during the scanning process of the paper ballot, and there is a fixed distance between the two contact image sensors, the acquired grayscale image will have slight deviations in the information area. For example, a line that is theoretically 2 pixels wide will become 3 pixels thicker. To compensate for this error, the multiple standard layers obtained in S110 need to be expanded. Figure 10 As shown in (a), this is a standard layer SI0 provided in an embodiment of the present invention. Figure 10 (b) shows the expanded standard layer SI0, and other standard layers are also processed synchronously. The so-called expansion means that the image information range of the standard layer is thickened, so that the standard layer used for testing is thickened by 1 pixel (which can be adjusted as needed) to cover the error of the acquired grayscale image, making the ballot mark detection more accurate.
[0057] Secondly, based on at least one extended standard layer, corresponding parts on the aforementioned front and back grayscale images are separated to obtain at least one detection image.
[0058] The following example illustrates this:
[0059] like Figure 11 (a) is the expanded standard layer SI0. Figure 11 (b) is Figure 9 The processed grayscale image DIin to be detected is shown below. Figure 11 (c) A detection image DIb0 is obtained by separating the corresponding part of the grayscale image to be detected based on the extended standard layer. All pixels in the detection image DIb0 are searched to obtain the corresponding grayscale value. All grayscale values are compared with the first minimum grayscale value set in S120 corresponding to the part of the standard layer. If the first minimum grayscale value set for the standard layer SI0 is 0, then each searched grayscale value is compared with 0. If any grayscale value is less than 0, then a marker may exist at the location of that pixel. Figure 12 The diagram shown is a schematic of a preset marker image provided in an embodiment of the present invention. The preset marker image is pure black (or pure white, depending on actual needs). Pixels that may contain markers (pixels with grayscale values less than a first minimum grayscale value) are marked (in white for easy display) within the preset marker image. In this embodiment, no markers are found on the detection image DIb0, therefore no marking is required on the preset marker image. The remaining detection area is as follows: Figure 13 The DIw0 shown is the remaining part of the grayscale image DIin after removing the detection area DIb0 that has been detected in this round.
[0060] like Figure 14 (a) shows the remaining detection region DIw0. Figure 14 (b) is the expanded standard layer SI1. Figure 14 (c) The second detection image DIb1, separated from the remaining detection region DIw0 based on the extended standard layer SI1, can also be understood as obtaining the second detection image DIb1 by intersecting the remaining detection region DIw0 with the standard layer SI1. Then, the grayscale value of all pixels in the second detection image DIb1 is searched, and this grayscale value is compared with the first minimum grayscale value set for the standard layer SI1. For example, if the first minimum grayscale value set for the standard layer SI1 is 50, then the grayscale value of all pixels in the second detection image DIb1 is compared with 50. If any pixel has a grayscale value less than 50, it is considered that there may be a marker at that location, and the pixel position is marked as shown in the image. Figure 12 In the preset marked image shown. In this embodiment of the invention, there is no marking on the second detection image DIb1, so there is no need to mark it in the preset marked image, and the remaining detection area DIw1 is as follows. Figure 15 As shown.
[0061] like Figure 16 (a) shows the remaining detection region DIw1. Figure 16 (b) is the expanded standard layer SI2. Figure 16 (c) Based on the extended standard layer SI2, a third detection region DIb2 is separated from the remaining detection region DIw1. Then, the grayscale value of all pixels in the third detection region DIb2 is searched and compared with the first minimum grayscale value set for the standard layer SI2. If the first minimum grayscale value set for the standard layer SI2 is 130, then the grayscale values of all pixels in the third detection region DIb2 are compared with 130. If any pixel has a grayscale value less than 130, it is determined that a marker may exist at that pixel location. In this embodiment of the invention, as... Figure 17 (a) shows a schematic diagram of the third detection region DIb2. After detection, there are pixels with gray values below 130 in the first row of the table, while the gray values of the pixels in other positions are around 135-200. Therefore, the pixels with gray values below 130 in the first row of the table may be marked. Thus, these potentially marked pixels are marked in the preset marked image DIout, as shown below. Figure 17 As shown in (b), pixels suspected of having been marked are highlighted in white within a pre-defined black marked image. The remaining detection area DIw2 is as follows: Figure 18 The portion of the image shown is the background color of the grayscale image.
[0062] like Figure 19 (a) shows the remaining detection region DIw2. All pixels in DIw2 are iterated through, and their grayscale values are compared with the second minimum grayscale value corresponding to the background color. If the second minimum grayscale value corresponding to the background color is set to 190, then the grayscale values of all pixels in DIw2 are compared with 190. If any pixel has a grayscale value less than 190, then that pixel may be marked, and it needs to be marked in a preset marking image. In this embodiment, the remaining detection region DIw2 also has remaining markers, whose corresponding pixel grayscale values are all less than 190. Therefore, the marked pixel positions are marked in the preset marking image DIout, as shown below. Figure 19 As shown in (b). Since each analysis result is marked on the same preset labeled image, Figure 19(b) This refers to the identification results of all markings on the front of the paper ballot to be inspected. It can be clearly seen that voters have made numerical markings in the upper right corner of the ballot. Therefore, this solution can effectively identify the markings on the ballot. It should be noted that the back of the ballot also needs to be identified simultaneously. The final identification result is the result of identifying both the front and back of the ballot. This embodiment of the invention only illustrates the front ballot identification method. It should also be noted that there are many types and versions of ballots. This embodiment of the invention only illustrates one version of ballot, but the method for detecting voter markings on ballots provided by this embodiment of the invention is universal.
[0063] Furthermore, if the ballot itself contains impurities or ink splatter due to printing quality issues, these conditions may lead to misidentification as markings. To improve the accuracy of marking recognition and avoid misjudgments, it is necessary to further assess the area of the finally identified markings. Specifically:
[0064] The total area of the marked pixels on the preset marked image DIout is calculated. If the total area is greater than a predetermined threshold, the paper ballot to be tested is considered to have a mark; if the total area is less than the predetermined threshold, the paper ballot to be tested is considered not to have a mark. For example, if the threshold is set to 1mm... 2 If the total area of the marked pixels is greater than 1 mm 2 If the value is less than 1, then the mark is considered to exist; if the value is less than 1, then the mark does not exist.
[0065] Therefore, the method for detecting voter-marked ballots provided by the embodiments of the present invention can intelligently identify ballots when users insert them into smart voting machines, thereby identifying ballots with markings and improving the fairness of paper ballots.
[0066] In summary, the present invention provides a method and intelligent voting machine for detecting voter-marked ballots. The method includes: obtaining at least one standard layer based on an electronic ballot; setting a first minimum grayscale value for the image at each standard layer corresponding to an unmarked paper ballot, and a second minimum grayscale value for the background color of the unmarked paper ballot; acquiring grayscale images of the front and back sides of the paper ballot to be detected; separating the portions of the front and back grayscale images corresponding to the standard layers as detection images; and then detecting the detection images. If any grayscale value in the detection image is less than the corresponding first minimum grayscale value, or any grayscale value at the background color of the front and back grayscale images is less than the corresponding second minimum grayscale value, it is marked in a preset marking image, thereby achieving automatic recognition and detection of markings on the ballot and ensuring the fairness of voting.
[0067] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0068] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0069] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0070] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the invention should be included within the scope of protection of the invention. It should be noted that similar reference numerals and letters in the following figures denote similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0071] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A method for detecting voter-marked ballots, characterized in that, The method includes: Based on the electronic ballot, at least one standard layer is obtained, and the contents of the at least one standard layer do not overlap. Specifically, the electronic ballot is divided into at least one standard layer displayed in black according to different colors. Each standard layer contains a portion of the contents of the electronic ballot, and the contents of the standard layers do not overlap. Set a first minimum grayscale value for the image at each of the standard layers corresponding to the unmarked paper ballot, and a second minimum grayscale value for the background color of the unmarked paper ballot; Collect grayscale images of the front and back sides of the paper ballot to be tested; The portion of the grayscale image on both sides that corresponds to the at least one standard layer is separated as the detection image; If any gray value of the detected image is less than the corresponding first minimum gray value, it is marked in the preset marking image. If any gray value of the background color of the front and back gray images is less than the corresponding second minimum gray value, it is also marked in the preset marking image. The method further includes: The total area of the marked pixels on the preset marked image is counted. If the total area is greater than a predetermined threshold, it is considered that there is a mark on the paper ballot to be tested. If the total area is less than the predetermined threshold, it is considered that there is no mark on the paper ballot to be tested.
2. The method for detecting voter-marked ballots as described in claim 1, characterized in that, After acquiring grayscale images of the front and back sides of the paper ballot to be tested, the following steps are also included: The grayscale images of the front and back sides are preprocessed.
3. The method for detecting voter-marked ballots as described in claim 2, characterized in that, The preprocessing specifically includes: The effective image region is obtained by denoising, rotating, and cropping the grayscale images of the front and back sides. Identify the positional difference between the center coordinates of the left and right positioning blocks set on the ballot in the effective image area and the center coordinates of the left and right positioning blocks set on the electronic ballot, and perform remapping based on the positional difference; Remove the non-detected region content from the effective image region after remapping.
4. The method for detecting voter-marked ballots as described in claim 1, characterized in that, The method further includes: The at least one standard layer is extended.
5. The method for detecting voter-marked ballots as described in claim 4, characterized in that, The step of separating the portion of the front and back grayscale images corresponding to the at least one standard layer as the detection image includes: Based on the extended at least one standard layer, corresponding portions on the front and back grayscale images are separated to obtain at least one detection image.
6. An intelligent voting machine, characterized in that, The intelligent voting machine includes at least a processor and an image acquisition device. The image acquisition device is used to acquire grayscale images of the front and back of the paper ballot and send them to the processor for processing. The processor is used to execute the method for detecting voter-marked ballots as described in any one of claims 1-5, so as to identify whether there are marks on the paper ballot.
7. The intelligent voting machine as described in claim 6, characterized in that, The image acquisition device includes at least two contact image sensors. When the paper ballot is inserted into the smart voting machine, the at least two contact image sensors respectively acquire grayscale images of the front and back of the paper ballot.
8. The intelligent voting machine as described in claim 6, characterized in that, The intelligent voting machine also includes a display screen, which is used to display in real time the identification result of whether the paper ballot has a mark.