A mobile auxiliary examination paper marking method and system
By calculating the connection area and impurity density dynamically adjusting the filter, the problem that the fixed-size filter cannot adapt to the test paper images is solved, the accuracy and efficiency of impurity recognition and filtering processing is improved, and the efficiency and image quality of the marking work are significantly improved.
Patent Information
- Application Number
- CN202411196255.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-08-29
AI Technical Summary
Fixed-size filters cannot adapt to the pixel points on the test paper image, resulting in a decrease in image clarity and affecting the accuracy and readability of the marking paper.
By calculating the suspiciousness and impurity density of the connecting area, dynamically adjust the size of the filter, build an exploration window centered on pixels, optimize the filter to adapt to the characteristics of different regions, remove impurities and preserve details.
It improves the accuracy of impurity recognition and the flexibility of filtering processing, significantly improves the efficiency of marking work and the clarity of images, and reduces the impact of impurities on the results.
Smart Images

Figure CN118711200B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a mobile auxiliary examination paper marking method and system. Background Art
[0002] Testing is one of the basic needs of education. In order to better test the teaching quality, reduce the error rate of examination marking, and review a large number of examination papers efficiently and conveniently, in the education evaluation and examination marking system, paper examination papers often need to be digitized through a scanner and then uploaded to a remote service center for mobile marking.
[0003] The patent document with the announcement number CN112487273B discloses a mobile assisted examination system and method, the system includes: an authorization login module, which is used for the mobile device to scan the legally obtained authorization QR code, activate and complete the registration, and authorize and allow login; an operation module, which is used for the file server application on the mobile device to control the shutdown of the wireless network module on the mobile device; a management module, which is used to operate the file server according to the operation module and manage the files in the file server; an examination module, which is used to operate the file server according to the operation module and examine the files in the file server; an evidence module, which is used to sort out the corresponding evidence in the evidence section according to the management module and the examination module, and the evidence section generates the examination report text that can be used for court presentation according to the operation module. It can improve the current situation of high office costs, inconvenient terminal carrying, and insecure data transmission in the procuratorate system, and effectively use scattered time to improve business.
[0004] However, in the process of scanning the test paper, due to the influence of various factors such as lighting conditions, scanner resolution, scanning speed, paper texture, etc., the scanned image may have different degrees of noise. These noises may appear as spots, stripes, unclear characters, etc. in the image, affecting the effect of subsequent image processing and the accuracy of marking. Scanned images of test papers or answer sheets are usually processed by filtering to remove irregular spots caused by impurities on the paper. Using a large-size filter can effectively remove these spots but blur the text and lines in the image. Using a small-size filter cannot effectively remove spots in the image. Therefore, a fixed-size filter cannot adapt to each pixel on the test paper image, thereby affecting the clarity of the test paper image, reducing the readability of the test paper, and causing certain obstacles to the marking work. Summary of the invention
[0005] In order to solve the problem that a fixed-size filter cannot adapt to each pixel point on the test paper image, thereby affecting the clarity of the test paper image, reducing the readability of the test paper, and causing certain obstacles to the marking work, the present invention provides a mobile assisted marking method and system.
[0006] In a first aspect, the present invention provides a mobile assisted marking method, which adopts the following technical solution:
[0007] A mobile auxiliary marking method comprises: obtaining a test paper image and the number of pixels and the area of a circumscribed rectangle of each connected area in the test paper image; determining the suspiciousness of each connected area, wherein the suspiciousness is positively correlated with the ratio of the number of pixels and the area of a circumscribed rectangle of the connected area, the ratio of the number of pixels and the area of a circumscribed rectangle of a connected area with the shortest distance to the connected area, and the distance to the connected area with the shortest distance to the connected area; in response to the suspiciousness of the connected area being greater than a preset impurity threshold, the connected area is an impurity area; taking each pixel as the center and the maximum value of the distance between each impurity area as the side length, constructing each pixel exploration window; determining the test paper image and each pixel exploration window in turn. The impurity density of the window, the impurity density is negatively correlated with the average of the distances between each impurity region in the test paper image or in the exploration window of the pixel point and the impurity region with the shortest distance to the impurity region; in response to the impurity density of the pixel point exploration window being not less than the impurity density of the test paper image, the initial filter of the pixel point is optimized, and the side length of the optimized filter is positively correlated with the area of each impurity region in the exploration window of the pixel point, and negatively correlated with the square of the maximum value of the distance between each impurity region in the test paper image and the impurity region with the shortest distance to the impurity region; according to the initial or optimized filter of each pixel point, the test paper image is filtered and impurities are removed.
[0008] The beneficial effect is that by calculating the suspiciousness of the connected area, and combining the number of pixels in the connected area, the area of the circumscribed rectangle, and the distance to the nearest connected area, the impurity area in the test paper image can be more accurately identified. By setting a preset impurity threshold, the impurity area and the non-impurity area can be effectively distinguished to reduce misjudgment. By constructing an exploration window centered on each pixel and dynamically adjusting the filter size according to the impurity density in the exploration window, adaptive processing can be performed according to the characteristics of different areas in the image. The optimized filter size is positively correlated with the area of the impurity area in the exploration window and negatively correlated with the square of the maximum distance between the impurity areas, so that a larger filter size can be used to remove impurities in the impurity-dense area, and a smaller filter size can be used in the impurity-sparse area to retain more details. By filtering and removing impurities from the test paper image, the impact of impurities on the marking results can be reduced, and the accuracy and reliability of marking can be improved. By automating the impurity identification and filtering and removing impurities process, the efficiency of marking can be significantly improved and the workload of manual marking can be reduced.
[0009] Furthermore, the method for obtaining the number of pixel points and the area of the circumscribed rectangle of each connected area in the test paper image is: converting the acquired test paper image into a grayscale image, then converting the grayscale image into a binary image through adaptive threshold binarization, performing irregular connected area processing on the binary image, and obtaining the number of pixel points and the area of the circumscribed rectangle of each connected area in the test paper image.
[0010] Furthermore, the suspiciousness of each connected area satisfies the following relationship:
[0011] ; In the formula, For the The suspiciousness of a connected region, For the The number of pixels in a connected area, For the The area of the circumscribed rectangle of a connected region is To the The number of pixels in the connected area with the shortest distance between connected areas. To the The area of the circumscribed rectangle of the connected region with the shortest distance between connected regions is To the The distance between the connected areas with the shortest distance between them, is a natural exponential function.
[0012] The beneficial effect is that by calculating the suspicion degree, the impurity area in the test paper image can be effectively identified. The calculation of the suspicion degree takes into account the number of pixels in the connected area, the area of the circumscribed rectangle and the distance to the nearest connected area. These data help to distinguish between characters and impurities and improve the accuracy of test paper impurity identification.
[0013] Furthermore, the impurity density of the test paper image satisfies the following relationship:
[0014] ; In the formula, is the impurity density of the test paper image, is the total number of impurity regions in the test paper image, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and are the height and width of the test paper image respectively, is a natural exponential function.
[0015] The beneficial effect is that the impurity density of the test paper image is used as a quantitative indicator to evaluate the quality of the test paper image. Dense impurity distribution may affect the readability and clarity of the image. Therefore, the impurity density of the test paper image can be used to judge the distribution of impurities in the image, which can not only help understand the distribution characteristics of impurities in the image, but also guide subsequent image processing and system design, thereby improving the quality and processing efficiency of the test paper image.
[0016] Furthermore, the impurity concentration of each pixel exploration window satisfies the following relationship:
[0017] ; In the formula, For the Line The impurity density of the pixel exploration window, is the total number of impurity regions in the exploration window of the pixel point, The first The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and The height and width of the exploration window for this pixel are respectively, is a natural exponential function.
[0018] The beneficial effects are: by adjusting the impurity density of each pixel exploration window, the image processing algorithm, such as local denoising or enhancement algorithm, is adjusted to improve the clarity and readability of the impurity area in the specific pixel exploration window; by understanding the distribution of impurities in each pixel exploration window, the object boundary can be segmented more accurately or specific targets can be identified, thereby improving the accuracy and efficiency of the image processing system.
[0019] Furthermore, the side length of the optimized filter satisfies the following relationship:
[0020] ; In the formula, For the Line The filter side length after column pixel optimization, is the round-up symbol, is the function variable, For the Line The first pixel in the exploration window The area of the impurity region, For the Line The number of impurity regions in the exploration window of the column pixel, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, is the total number of impurity areas in the test paper image.
[0021] The beneficial effect is that by calculating the number, area and distance between impurity areas in the exploration window of each pixel point, impurities can be removed accurately without damaging the character information. The optimized filter side length can more accurately remove impurities in the test paper image. According to the optimized filter side length of each pixel point, the filter is dynamically adjusted to make the filter better adapt to different areas, enhance the filter's adaptability to different scenes, and improve the robustness of the system.
[0022] Furthermore, the filtering of the test paper image is median filtering of the test paper image.
[0023] In a second aspect, the present invention provides a mobile auxiliary marking system, which adopts the following technical solution:
[0024] A mobile assisted marking system comprises: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the mobile assisted marking method is implemented.
[0025] By adopting the above technical solution, the above-mentioned mobile assisted marking method is generated into a computer program and stored in a memory so as to be loaded and executed by a processor, thereby making a terminal device based on the memory and the processor for easy use.
[0026] The present invention has the following technical effects:
[0027] The present invention can accurately identify impurities in the test paper image by calculating the suspiciousness of the connected area and determining the impurity area, thereby improving the accuracy of impurity identification; by constructing an exploration window and adjusting the side length of the filter according to the impurity density, it can effectively remove impurities while retaining character details, thereby improving the flexibility and pertinence of the filter processing; by automating the impurity identification and filtering and removing impurities process, the efficiency of the paper marking work can be significantly improved, and since the influence of impurities on the test paper results is reduced, the clarity of the test paper image is improved, the readability of the test paper is improved, and an auxiliary effect is played on the paper marking work. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-restrictive manner, and the same or corresponding reference numerals represent the same or corresponding parts.
[0029] Figure 1 It is a method flow chart of a mobile assisted marking method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] It should be understood that when the terms "first", "second", etc. are used in the claims, descriptions, and drawings of the present invention, they are only used to distinguish different objects, rather than to describe a specific order. The terms "include" and "comprise" used in the description and claims of the present invention indicate the presence of the described features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their collections.
[0032] The embodiment of the present invention discloses a mobile auxiliary marking method, referring to Figure 1 , comprising steps S1 to S7:
[0033] S1: Obtain the number of pixels and the area of the circumscribed rectangle of the test paper image and each connected region in the test paper image.
[0034] Specifically, the acquired test paper image is converted into a grayscale image, and then the grayscale image is converted into a binary image through adaptive threshold binarization. The binary image is processed with irregular connected regions (OpenCV's cv2.connectedComponentsWithStats operation) to obtain the number of pixels and the area of the circumscribed rectangle of each connected region in the test paper image.
[0035] S2: Determine the suspiciousness of each connected area.
[0036] It should be noted that, since the characters in the test paper image are usually composed of lines, the connected areas corresponding to the characters are relatively loose. For example, the character "8" has two circular holes in its corresponding connected area, while the areas corresponding to impurities are usually in pieces. Therefore, the present invention calculates the suspicion that the connected area is an impurity area based on the number of pixels contained in each connected area in the test paper image and the area of the circumscribed rectangle.
[0037] Specifically, the suspiciousness of each connected area satisfies the following relationship:
[0038] ;
[0039] In the formula, For the The suspiciousness of a connected region, is the number of pixel points in the th connected region, is the area of the circumscribed rectangle of the th connected region, is the number of pixel points in the connected region that is the shortest distance to the th connected region, is the area of the circumscribed rectangle of the connected region that is the shortest distance to the th connected region, is the distance to the connected region that is the shortest distance to the th connected region, is the natural exponential function.
[0040] Among them, is the proportion of the pixel points of the th connected domain in its corresponding circumscribed rectangle. The larger this value is, the larger the area occupied by the connected region in its corresponding circumscribed rectangle, the less likely there are holes in the connected region, the more likely the connected region is an impurity region, and the higher the suspicion degree that the connected region is an impurity region. The smaller this value is, the smaller the area occupied by the connected region in its corresponding circumscribed rectangle, the looser the connected region may be, the more likely the connected region is a character region, and the lower the suspicion degree that the connected region is an impurity region. However, for Chinese characters, one character may correspond to multiple connected regions, which may make the possibility of impurity regions of small strokes higher. For example, the dot in the radical of the character "话", the of the connected region corresponding to the dot is larger and may be recognized as an impurity region, while the of the connected region corresponding to the other part of the character "话" is the closest to the connected region corresponding to the dot, and the is corrected by the nearest connected region pair of each connected region. The proportion of the pixel points contained in the nearest connected region of the th connected region in its corresponding circumscribed rectangle is larger, then the nearest connected region of the th connected region is more likely to be an impurity region, is smaller, then the nearest connected region of the th connected region is more likely to be a character region. The distance between the th connected region and its nearest connected region is larger, which means that the th connected region and its nearest connected region are more likely not to belong to the same character, then the th connected region is more likely to be an impurity region. The distance between the th connected region and its nearest connected region The more connected the region is, the more likely it is that it is not an impurity region. right Make corrections, The bigger the right The greater the degree of correction, The more hours, The closer it is to 1, right The smaller the correction degree, the The value of , and then get , The bigger the The higher the suspicion that a connected region is an impurity region, The more hours The more connected regions are suspected to be impurity regions, the lower the suspicion.
[0041] S3: In response to the suspiciousness of the connected area being greater than a preset impurity threshold, the connected area is an impurity area.
[0042] Implementers can set the impurity threshold according to actual implementation conditions, for example, 0.5.
[0043] S4: Construct exploration windows for each pixel.
[0044] With each pixel as the center and the maximum value of the distance between each impurity area as the side length, an exploration window for each pixel is constructed.
[0045] S5: Determine the impurity density of the test paper image and each pixel exploration window.
[0046] It should be noted that, since the impurities on the test paper have a certain uncertainty, some test papers may contain more dense impurities, and some test papers may contain less sparse impurities. Test papers with different degrees of impurities should be processed in different ways. Therefore, the present invention calculates the impurity density of the test paper image and each pixel exploration window according to the average of the distance between each impurity area in the test paper image or in the pixel exploration window and the impurity area with the shortest distance to the impurity area.
[0047] Specifically, the impurity density of the test paper image satisfies the following relationship:
[0048] ;
[0049] In the formula, is the impurity density of the test paper image, is the total number of impurity regions in the test paper image, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and are the height and width of the test paper image respectively, is a natural exponential function.
[0050] Specifically, the impurity concentration of each pixel exploration window satisfies the following relationship:
[0051] ;
[0052] In the formula, For the Line The impurity density of the pixel exploration window, is the total number of impurity regions in the exploration window of the pixel point, The first The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and The height and width of the exploration window for this pixel are respectively, is a natural exponential function.
[0053] in, is the average value of the distance between each impurity region in the test paper image and the impurity region with the shortest distance to the impurity region. The larger the value, the larger the distance between the impurity regions in the test paper image, and the lower the impurity density of the test paper; the smaller the value, the smaller the distance between the impurity regions in the test paper image, and the higher the impurity density of the test paper. For the convenience of calculation, it is divided by the maximum distance that may appear in the test paper image. The way to The impurity density of each pixel exploration window is similar, and will not be described here.
[0054] S6: Optimize the initial filter of pixels.
[0055] It should be noted that, since the impurity density is obtained based on the distance between impurity areas in the image, and impurities are not evenly distributed, some parts of a test paper image may have more impurities and some parts may have less impurities, which to a certain extent affects the judgment of impurities in the test paper. If the size of the median filter is determined directly by the impurity density and filtering is performed, it will affect the removal effect of impurities in the image. Therefore, the present invention calculates the side length of the filter of each pixel by judging the size of the impurity density of the test paper image and the impurity density of the pixel exploration window.
[0056] In response to the impurity concentration of the pixel exploration window being not less than the impurity concentration of the test paper image, the initial filter of the pixel is optimized.
[0057] Implementers can set the initial filter according to actual implementation conditions. For example, the side length of the initial filter is 3. A small-sized filter can better preserve the character details in the test paper image.
[0058] Specifically, the side length of the optimized filter satisfies the following relationship:
[0059] ;
[0060] In the formula, For the Line The filter side length after column pixel optimization, is the round-up symbol, is the function variable, For the Line The first pixel in the exploration window The area of the impurity region, For the Line The number of impurity regions in the exploration window of the column pixel, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, is the total number of impurity areas in the test paper image.
[0061] Among them, when the impurity density of the pixel exploration window is not less than the impurity density of the test paper image, it means that the first Line The impurity density of the exploration window of the column pixel point is large, which may belong to the high-density impurity area. A larger filter size should be used to effectively remove impurities. For the Line The area occupied by the impurity region in the exploration window of the pixel point column. The larger the value, the smaller the impurity region. Line The larger or more impurities are contained in the exploration window of the pixel points in the column, the Line The more likely the pixel in the column is to belong to a high-density impurity area, The larger the Line The larger the filter size used for the column pixels, the easier it is to calculate by dividing by the area of the exploration window. The way to Normalize it and get , and then get , the initial side length 3 of the filter is adjusted upward by this value to increase the filter size. At the same time, in order to match the characteristics of the filter size, Adjust the optimized filter side length to an odd number.
[0062] S7: Filter and remove impurities from the test paper image according to the initial or optimized filter of each pixel point.
[0063] Specifically, the filtering of the test paper image is median filtering of the test paper image.
[0064] Median filtering is a nonlinear signal processing technology, which is mainly used to suppress noise in images or signals. Its basic principle is to replace the value of a point in a digital image or digital sequence with the median of the values of all points in a neighborhood of the point, so that the surrounding pixel values are close to the true value and isolated noise points are eliminated.
[0065] The embodiment of the present invention further discloses a mobile assisted marking system, including a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a mobile assisted marking method of the present invention is implemented.
[0066] The above system also includes other components well known to those skilled in the art, such as a communication bus and a communication interface, and their configuration and functions are known in the art, so they will not be described in detail here.
[0067] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, a computer-readable storage medium may be any suitable magnetic storage medium or magneto-optical storage medium, or any other medium that can be used to store the required information and can be accessed by an application, module, or both. Any such computer storage medium may be part of the device or accessible or connectable to the device.
[0068] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
[0069] The above are all preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Therefore, any equivalent changes made based on the structure, shape, and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A mobile assisted marking method, characterized in that: include: Obtain the number of pixels and the area of the circumscribed rectangle of the test paper image and each connected area in the test paper image; Determine the suspiciousness of each connected area, the suspiciousness is positively correlated with the ratio of the number of pixels of the connected area to the area of the circumscribed rectangle, the ratio of the number of pixels of the connected area with the shortest distance to the connected area to the area of the circumscribed rectangle, and the distance to the connected area with the shortest distance to the connected area; in response to the suspiciousness of the connected area being greater than a preset impurity threshold, the connected area is an impurity area; construct each pixel exploration window with each pixel as the center and the maximum value of the distance between each impurity area as the side length; determine the impurity density of the test paper image and each pixel exploration window in turn, the impurity density is negatively correlated with the mean value of the distance between each impurity area in the test paper image or in the pixel exploration window and the impurity area with the shortest distance to the impurity area in turn; In response to the impurity concentration of the pixel exploration window being not less than the impurity concentration of the test paper image, the initial filter of the pixel is optimized, and the side length of the optimized filter is positively correlated with the area of each impurity region in the pixel exploration window, and negatively correlated with the square of the maximum value of the distance between each impurity region in the test paper image and the impurity region with the shortest distance to the impurity region; The test paper image is filtered and cleaned according to the initial or optimized filter of each pixel.
2. A mobile assisted marking method according to claim 1, characterized in that: The method for obtaining the number of pixels and the area of the circumscribed rectangle of each connected area in the test paper image is as follows: The acquired test paper image is converted into a grayscale image, and then converted into a binary image through adaptive threshold binarization. The binary image is processed into irregular connected regions to obtain the number of pixels and the area of the circumscribed rectangle of each connected region in the test paper image.
3. A mobile assisted marking method according to claim 1, characterized in that: The suspiciousness of each connected area satisfies the following relationship: ; In the formula, For the The suspiciousness of a connected region, For the The number of pixels in a connected area, For the The area of the circumscribed rectangle of the connected region is To the The number of pixels in the connected area with the shortest distance between connected areas. To the The area of the circumscribed rectangle of the connected region with the shortest distance between connected regions is To the The distance between the connected areas with the shortest distance between them, is a natural exponential function.
4. A mobile assisted marking method according to claim 1, characterized in that: The impurity density of the test paper image satisfies the following relationship: ; In the formula, is the impurity density of the test paper image, is the total number of impurity regions in the test paper image, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and are the height and width of the test paper image respectively, is a natural exponential function.
5. A mobile assisted marking method according to claim 1, characterized in that: The impurity density of each pixel exploration window satisfies the following relationship: ; In the formula, For the Line The impurity density of the pixel exploration window, is the total number of impurity regions in the exploration window of the pixel point, The first The distance between an impurity region and the impurity region with the shortest distance to the impurity region, and The height and width of the exploration window for this pixel are respectively, is a natural exponential function.
6. A mobile assisted marking method according to claim 1, characterized in that: The side length of the optimized filter satisfies the following relationship: ; In the formula, For the Line The filter side length after column pixel optimization, is the round-up symbol, is the function variable, For the Line The first pixel in the exploration window The area of the impurity region, For the Line The number of impurity regions in the exploration window of the column pixel, For the test paper image The distance between an impurity region and the impurity region with the shortest distance to the impurity region, is the total number of impurity areas in the test paper image.
7. A mobile assisted marking method according to claim 1, characterized in that: The filtering of the test paper image is median filtering of the test paper image.
8. A mobile auxiliary marking system, characterized in that: include: A processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, a mobile assisted marking method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
A mobile-assisted marking system and method
CN112487273B
Intelligent paper marking system based on visual analysis
CN115880566A
Tobacco shred detection method based on machine vision
CN117274168A