Camera testing method and system for marking papers
By setting the lighting environment parameters and simulated marking speed, capturing and storing images in real time, and conducting clarity level analysis and testing, the problem of score statistics errors caused by blurred test papers is solved, and efficient image clarity detection and optimal parameter determination are achieved.
Patent Information
- Application Number
- CN202210365236.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-07
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-04-07
AI Technical Summary
In the existing marking mode, blurred storage of test papers may lead to score statistics errors, and an effective detection method is needed to ensure image clarity.
By setting lighting environment parameters, autofocus, gain and exposure values, and simulating different marking speeds, capturing and storing images in real time, performing clarity level analysis and testing, and counting the overall clarity level of each image.
This method can effectively detect the blurring of the test paper, find various parameters under the best clarity, solve the problem of clarity of the paper, improve the development efficiency of image acquisition equipment, and adapt to different lighting scenarios.
Smart Images

Figure CN114915778B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of camera detection technology, and in particular to a camera testing method and system for marking papers. Background Art
[0002] There are two main modes of exam marking at present: one is suitable for large-scale exams or monthly exams, where operators uniformly scan students' answer sheets on one or more scanning devices, upload the answer sheets to the cloud or computer for storage, and teachers of different subjects divide the work to complete the marking on the application; the other is suitable for small exams or class quizzes, where teachers hand-correct the test papers or answer sheets, score each question in a certain way in the appropriate position as required, and then put them on the test paper scanner for scanning, and automatically calculate the total score based on the corrected score of each question. Both methods have their application scenario requirements, but they also have their limitations.
[0003] Now there is another marking mode on the market. While the teacher is marking the test paper, the scanner also saves the marking image in real time for analysis and score statistics. The scores are counted as soon as the marking is completed. This mode can inherit the traditional marking mode while perfectly combining the technological innovation of the times. It can be said to be the best of both worlds.
[0004] For the last marking mode, every saved image needs to be clear. Therefore, many factors are involved, such as lighting, eye comfort, marking speed of the examiner, etc. Therefore, there may be a problem of blurry test papers, which may lead to errors in score statistics. Therefore, a test method and system that can effectively detect the blurriness of the test papers is needed. Summary of the invention
[0005] The present invention provides a camera testing method for marking examination papers, which can effectively detect blurriness of examination papers.
[0006] In order to solve the above technical problems, this application provides the following technical solutions:
[0007] A camera testing method for marking papers comprises the following steps:
[0008] S1. Set lighting environment parameters;
[0009] S2, setting the auto focus of the image acquisition device to fixed focus, and determining the focus position;
[0010] S3. Simulate marking speed at slow, medium or fast speeds;
[0011] S4, setting the gain and exposure value of the image acquisition device;
[0012] S5, setting the number of image storage and image saving format, and setting the image processing process;
[0013] S6, marking the papers according to the marking speed set in step S3, and storing the images according to the setting in step S5;
[0014] S7, repeating steps S1-S6, capturing images of different scenes in real time under different lighting environment parameters, gain, exposure value and reading speed and storing them in groups;
[0015] S8. Perform a clarity level analysis test on each group of stored images, and calculate the overall clarity level of each image in each scene.
[0016] The basic scheme principles and beneficial effects are as follows:
[0017] This solution is suitable for camera module factories to evaluate the clarity of images in the marking mode. This solution simulates the parameters that affect the clarity of the marking by automatically controlling different lighting environment parameters, different gains, different exposure values, and different marking speeds, and then detects the blur of the test paper, so as to find the parameters under the best clarity and solve the problem of marking clarity. This test method can be well connected to the client, which is convenient for the client to do further debugging and use, thereby improving its development efficiency and adapting to different lighting scenarios.
[0018] Further, the step S8 specifically includes:
[0019] S810, detecting an edge region of each image;
[0020] S820, compensating the edge area to obtain a detection area;
[0021] S830: Calculate the overall clarity level in the detection area.
[0022] Further, the step S830 specifically includes:
[0023] S831, calculating the average pixel value of the detection area of the entire image;
[0024] S832, counting whether each pixel is greater than the average pixel value, if so, it is classified into Class I, otherwise it is classified into Class II, and counting the sum of each pixel in Class I and Class II, which are sum1 and sum2 respectively;
[0025] S833, taking the absolute value of the difference between the two types of pixel sums and the sum of the two types of pixel sums as the clarity level of each image.
[0026] Furthermore, it also includes S9, recording parameters of each frame image of each scene, including lighting environment parameters, reading speed, gain, exposure time and clarity level.
[0027] Furthermore, the process further includes S10, determining whether the minimum value of the definition level of each scene image is lower than a set minimum definition threshold. If it is lower than the minimum definition threshold, determining that the parameters corresponding to the image cannot meet the requirements for marking.
[0028] By setting the minimum clarity threshold, images that do not meet the requirements can be filtered out.
[0029] Further, the method further includes S11, calculating the clarity level according to the maximum clarity level, the minimum clarity level and the average clarity level of each scene image;
[0030] The specific calculation formula is:
[0031] D=(D MAX -D MIN )÷D a
[0032] Where D is the clarity level, D MAX is the maximum value of the clarity level, D MIN Minimum clarity level, D a is the average clarity level value;
[0033] If the clarity level exceeds the set clarity level threshold, the parameters corresponding to the image cannot meet the marking requirements; if it does not exceed the set clarity level threshold, the parameters corresponding to the image are recorded in sequence.
[0034] Furthermore, it also includes S12, performing a longitudinal comparison based on the scene images that do not exceed the clarity level threshold in step S11, calculating the minimum clarity level and the average clarity level value of each scene image in turn, and obtaining the arithmetic square sum of the two, determining the scene corresponding to the image with the minimum arithmetic square sum among all scene images as the clarity critical level scene, and recording the parameters corresponding to the image.
[0035] The image clarity under this parameter can achieve the best visual effect.
[0036] A camera test system for marking papers, comprising a light source device, a marking speed regulator, an image acquisition device and a host computer;
[0037] The light source equipment and image acquisition equipment are connected to the host computer;
[0038] The image acquisition device is used to capture images of the test paper;
[0039] The host computer is used to set the lighting environment parameters of the light source equipment, including color temperature and illumination; it is also used to set the gain and exposure value of the image acquisition equipment, obtain the captured image from the image acquisition equipment and save it, and also used to analyze the clarity level of the image;
[0040] The marking speed regulator is used to adjust the test paper switching speed.
[0041] This solution is suitable for camera module factories to evaluate the clarity of images in the marking mode. This solution simulates the parameters that affect the clarity of the marking by automatically controlling different lighting environment parameters, different gains, different exposure values, and different marking speeds through the host computer, and then detects the blur of the test paper, so as to find the parameters under the best clarity and solve the problem of marking clarity. This test method can be well connected to the client, which is convenient for the client to do further debugging and use, thereby improving its development efficiency and adapting to different lighting scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a schematic diagram of a camera testing system for marking papers according to Embodiment 1;
[0043] Figure 2 A logic block diagram of a camera testing system for marking papers according to Embodiment 1;
[0044] Figure 3 This is a flow chart of a camera testing method for marking papers according to Embodiment 1;
[0045] Figure 4 It is a schematic diagram of the test paper in Example 1;
[0046] Figure 5 It is a schematic diagram of the test paper in Example 1;
[0047] Figure 6 It is a schematic diagram of the test paper in Example 1;
[0048] Figure 7 This is a schematic diagram of the movement of the test paper in Example 1. DETAILED DESCRIPTION
[0049] The following is further described in detail through specific implementation methods:
[0050] Embodiment 1
[0051] like Figure 2 As shown, a camera test system for marking papers in this embodiment includes a light source device, a marking speed regulator, an image acquisition device and a host computer; the image acquisition device includes a bracket, a camera and a camera test box.
[0052] The light source device is connected to the host computer through a serial communication connection line, the camera is connected to the camera test box, and the camera test box is connected to the host computer through a data transmission control line.
[0053] The host computer is used to set the lighting environment parameters of the light source equipment, which include color temperature and illumination. Specifically, different color temperatures and illuminations are set according to the serial port commands sent by the host computer. For example, the color temperature is set to 4000K, and the illumination increases from 100lux to 1500lux in increments of 100lux. In this embodiment, the light source equipment adopts a standard light source box.
[0054] The marking speed regulator is used to adjust the switching speed of the test paper. The marking speed regulator is used to simulate the speed of marking. In this embodiment, the speed is mainly selected based on the data statistical analysis of the marking hand speed of the marker. There are three modes: slow, medium and fast. The marking speed regulator is used to switch the test paper, and the switching method can be carried out by suction cup suction.
[0055] like Figure 1 As shown, the bracket is placed directly below the light source device, the camera faces downward and is at a certain distance from the test paper to be collected. In this embodiment, the distance is set to about 40 cm.
[0056] The host computer is used to set the exposure value and gain of the camera, and continuously capture multiple frames of images through the camera and save them for analysis.
[0057] Using the above-mentioned camera testing system for marking papers, this embodiment further provides a camera testing method for marking papers, comprising the following steps:
[0058] S1. The host computer sets the lighting environment parameters and the color temperature, such as 2850K, 3000K, 4000K, 5000K, 6500K, etc., and then sets different illuminations in fixed step increments, such as 100lux, 200lux...1500lux.
[0059] S2. Connect the camera to the host computer, turn on the host computer and light up the camera. Set the camera's autofocus to fixed focus and determine the focus position; the actual marking camera is generally equipped with an AF autofocus motor, which means that the focus work will be completed first during real-time shooting. In order to ensure the rigor of the test and ignore the motor autofocus factor, the camera's autofocus is set to fixed focus, that is, before continuously capturing images, ensure that the image is clear. Here, the motor DAC value is directly sent (that is, the motor is set with a stroke, for example, the motor stroke range of 10-bit precision is 0~1023) to a fixed value, so that the motor is set at a fixed position, capture a picture to observe the image clarity, if the image captured by setting a certain DAC value is the clearest, then the current setting is the best motor position.
[0060] S3. Place the test paper directly under the camera to ensure that all the test paper contents can be captured. Use the marking speed regulator to simulate the marking speed at slow, medium or fast speeds. For example, set it to slow speed first, and note that the test paper is uniformly moved out of the camera shooting area. Figure 7 The test papers shown are all moved horizontally from left to right to ensure that the upper and lower test papers are overlapped and then separated.
[0061] S4. Set the camera gain and exposure value through the host computer. The gain includes analog gain and digital gain. For example, the analog gain of a camera can be selected from 1 to 64 times, and the digital gain can be selected from 1 to 16 times. The analog gain is set from 1 to 64, and the digital gain is set from 1 to 16. Then the camera is automatically exposed to the appropriate exposure value without weak exposure or overexposure. Then the current exposure time is calculated and recorded according to the relevant parameters.
[0062] S5. Set the number of images to be stored and the image saving format through the host computer, and set the image processing flow; for example, in this embodiment, the number of images to be stored is selected to be 30, the image saving format is jpg format, and the image processing flow includes image noise reduction processing, AWB automatic white balance, LSC lens shading correction application, etc. The image processing flow can be set according to actual needs. For example, in this embodiment, the image is stored after performing AWB automatic white balance processing.
[0063] S6. Mark the papers according to the simulated marking speed in step S3, and capture and store images in real time according to the image storage number and image storage format set in step S5.
[0064] S7. Continue to repeat steps S1-S6, capture images of different scenes in real time under different lighting environment parameters, gains, exposure values and reading speeds, store them in groups, and record their relevant parameters. In this embodiment, the recorded relevant parameters include color temperature and illumination, analog gain and digital gain, exposure time, and reading speed.
[0065] S8. Perform a clarity level analysis test on each set of images saved in the above steps to calculate the overall clarity level of each image in each scene.
[0066] The specific steps are:
[0067] S810, detecting the edge area of each test paper image; in this embodiment, Figure 4-Figure 6 As shown, the test paper uses a black and white picture with clear lines to simulate a detailed real test paper, making it easier to test whether the details of each area of the photographed test paper are captured.
[0068] S820, compensating the edge area to obtain a detection area; in this implementation, the edge area refers to Figure 7 The area between the outer frame line and the inner frame line, the detection area refers to the area within the inner frame line. In other words, the actual edge position of the outer frame line is compensated to the position of the inner frame line. In this embodiment, the inner frame line is determined according to the position of the secondary edge color block. In other embodiments, it can also be set according to actual conditions. Specifically, first determine the outer frame line. According to the overall white background and the black and white shooting area, the coordinates of each row of black edges can be determined. The white edge is compensated by the upper and lower black. After confirmation, the upper, lower, left and right offsets are made. For example, the right edges of the two adjacent black blocks on the right edge are confirmed, and the white block between the two adjacent black blocks is compensated according to the two black blocks. The position of the right edge of the white block is calculated, and the compensation is performed using the nearest neighbor interpolation method.
[0069] S830, calculating the overall clarity level in the detection area, specifically:
[0070] S831, calculating the average pixel value of the detection area of the entire image;
[0071] S832, counting whether each pixel is greater than the average pixel value, if so, it is classified into Class I, otherwise it is classified into Class II, and counting the sum of each pixel in Class I and Class II, which are sum1 and sum2 respectively;
[0072] S833. The absolute value of the difference between the two types of pixel sums and the sum of the previous two types of pixel sums (|(sum1-sum2) / (sum1+sum2)|) is used as the clarity level of each image (the larger the clarity level value, the clearer it is).
[0073] S9. Record the parameters of each frame of each scene, including lighting environment parameters, reading speed, gain, exposure time and clarity level.
[0074] S10, determining whether the minimum value of the clarity level of each scene image is lower than the set minimum clarity threshold. If it is lower than the minimum clarity threshold, determining that the lighting environment parameters, paper marking speed, gain, and exposure time conditions cannot meet the paper marking requirements;
[0075] S11, calculating the clarity level according to the maximum, minimum and average clarity level values of each scene image. The specific calculation formula is:
[0076] D=(D MAX -D MIN )÷D a
[0077] Where D is the clarity level, D MAX is the maximum value of the clarity level, D MIN Minimum clarity level, D aIt is the average clarity level value.
[0078] If the clarity level exceeds the clarity level threshold set by the host computer, the lighting environment parameters, marking speed, gain, and exposure time conditions cannot meet the marking requirements; if it does not exceed the clarity level threshold set by the host computer, the parameters corresponding to the image are recorded in sequence;
[0079] S12. Perform a longitudinal comparison based on the scene images that do not exceed the clarity level threshold set by the host computer in step S11, calculate the minimum clarity level and the average clarity level value of each scene image in turn, and obtain the arithmetic square sum of the two, so as to obtain the clarity level of each scene image, and determine the scene corresponding to the image with the minimum arithmetic square sum among all scene images as the clarity critical level scene, and record the parameters corresponding to the image.
[0080] Embodiment 2
[0081] This embodiment is described by taking a specific project as an example, where the resolution is 4080*3072, the pixel size is 2.8um, and the acquisition frame rate is 16fps.
[0082] The slow marking mode is set through the marking speed regulator, and the color temperature of the host computer light source is set to five gears: 2850K, 3000K, 4000K, 5000K, and 6500K; the illumination range is 100lux~1500lux, with a step of 100lux; the camera analog gain is 1~64, and the digital gain is 1~16, with a step of 2; the exposure brightness value is 130, with a range of ±10; the number of images stored is 30, and the image saving format is jpg format. Here, the number of combinations is 5*15*32*2=4800 groups, and the number of captured images is 4800*30=14400, which are saved in their respective directories. At the same time, the exposure time of each group is calculated according to the above conditions.
[0083] The host computer saves each image in turn according to the above parameters, and performs a clarity level analysis test, calculates the clarity level of each image, and obtains the maximum and minimum clarity levels of each group (4800 groups). If the minimum clarity level of each group is lower than the minimum clarity threshold set by the host computer, it is directly determined that the clarity level of the group is insufficient and does not meet the requirements of the examination. (The clarity level range is 0 to 1. For example, if the maximum clarity level of the first group is 0.865 and the minimum clarity level is 0.214, and the minimum clarity threshold set by the host computer is 0.516, it is directly determined that the clarity level of the first group is insufficient and does not meet the requirements of the examination.).
[0084] Then the host computer continues to calculate the clarity level of each group and compares it with the clarity level threshold set by the host computer. If it exceeds, it is determined that the clarity level of the group is insufficient and does not meet the requirements of the examination. (For example, the clarity level threshold set by the host computer is 0.45, the maximum clarity level of the 100th group is 0.865, the minimum is 0.524, and the average clarity level is 0.61. The clarity level is calculated to be 0.559, which exceeds the clarity level threshold and does not meet the requirements of the examination.).
[0085] Then, the minimum and average clarity levels of each group are calculated vertically, and the arithmetic square sum of the two is obtained. The scene with the minimum arithmetic square sum among all scene images is determined as the critical clarity level scene of the slow marking mode, and the exposure time, lighting and other information are recorded. Repeat the medium-speed marking mode and the fast marking mode to obtain the critical clarity level scene, and record the exposure time, lighting and other information for use in actual marking.
[0086] The above are only embodiments of the present invention. The invention is not limited to the fields involved in this implementation case. The common sense such as the known specific structures and characteristics in the scheme is not described in detail here. The ordinary technicians in the relevant field know all the common technical knowledge in the technical field to which the invention belongs before the application date or the priority date, can obtain all the existing technologies in the field, and have the ability to apply the conventional experimental means before that date. The ordinary technicians in the relevant field can improve and implement this scheme in combination with their own abilities under the enlightenment given by this application. Some typical known structures or known methods should not become obstacles for ordinary technicians in the relevant field to implement this application. It should be pointed out that for those skilled in the art, without departing from the structure of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, which will not affect the effect of the implementation of the present invention and the practicality of the patent. The protection scope required by this application shall be based on the content of its claims, and the specific implementation methods and other records in the specification can be used to explain the content of the claims.
Claims
1. A camera testing method for marking papers, characterized in that: The steps include: S1. Set lighting environment parameters; S2, setting the auto focus of the image acquisition device to fixed focus, and determining the focus position; S3. Simulate marking speed at slow, medium or fast speeds; S4, setting the gain and exposure value of the image acquisition device; S5, setting the number of image storage and image saving format, and setting the image processing process; S6, marking the papers according to the marking speed set in step S3, and storing the images according to the setting in step S5; S7, repeating steps S1-S6, capturing images of different scenes in real time under different lighting environment parameters, gain, exposure value and reading speed and storing them in groups; S8, performing a clarity level analysis test on each group of stored images, and calculating the overall clarity level of each image in each scene; S9, recording the parameters of each frame of each scene, including lighting environment parameters, reading speed, gain, exposure time and clarity level; S10, determining whether the minimum value of the clarity level of each scene image is lower than the set minimum clarity threshold. If it is lower than the minimum clarity threshold, it is determined that the parameters corresponding to the image cannot meet the examination requirements; S11, calculating the clarity level according to the maximum clarity level, the minimum clarity level and the average clarity level of each scene image; The specific calculation formula is: Where D is the clarity level, is the maximum value of the clarity level, Minimum clarity level, is the average clarity level value; If the clarity level exceeds the set clarity level threshold, the parameters corresponding to the image cannot meet the examination requirements; if it does not exceed the set clarity level threshold, the parameters corresponding to the image are recorded in sequence; S12. Perform a longitudinal comparison based on the scene images that do not exceed the clarity level threshold in step S11, calculate the minimum clarity level and the average clarity level of each scene image in turn, and obtain the arithmetic square sum of the two, determine the scene corresponding to the image with the minimum arithmetic square sum among all scene images as the clarity critical level scene, and record the parameters corresponding to the image.
2. The camera testing method for marking papers according to claim 1, characterized in that: The step S8 specifically includes: S810, detecting an edge region of each image; S820, compensating the edge area to obtain a detection area; S830: Calculate the overall clarity level in the detection area.
3. The camera testing method for marking papers according to claim 2, characterized in that: The step S830 specifically includes: S831, calculating the average pixel value of the detection area of the entire image; S832, counting whether each pixel is greater than the average pixel value, if so, it is classified into Class I, otherwise it is classified into Class II, and counting the sum of each pixel in Class I and Class II, which are sum1 and sum2 respectively; S833, taking the absolute value of the difference between the two types of pixel sums and the sum of the two types of pixel sums as the clarity level of each image.
4. A camera testing system for marking papers, characterized in that: A camera testing method for paper marking as described in any one of claims 1 to 3 is used, comprising a light source device, a paper marking speed regulator, an image acquisition device and a host computer; The light source equipment and image acquisition equipment are connected to the host computer; The image acquisition device is used to capture images of the test paper; The host computer is used to set the lighting environment parameters of the light source equipment, including color temperature and illumination; it is also used to set the gain and exposure value of the image acquisition equipment, obtain the captured image from the image acquisition equipment and save it, and also used to analyze the clarity level of the image; The marking speed regulator is used to adjust the test paper switching speed.
Citation Information
Patent Citations
Electronic paper marking method based on linear detection
CN106033534A
Exam paper reading system, device and method based on pattern recognition technology
WO2018006294A1