Image quality evaluation method and device, electronic equipment, scanning pen and storage medium
By detecting the contrast of image frames and characters and black areas, and using preset thresholds to judge image quality, the problem of insufficient image frame quality assessment in image acquisition devices is solved, thereby improving the effect and accuracy of image recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-22
- Publication Date
- 2026-03-17
AI Technical Summary
In existing technologies, image acquisition devices cannot effectively evaluate the quality of image frames, resulting in a decrease in image recognition performance and accuracy, especially when there is low contrast, no characters, or periodic black image areas, the recognition results are inaccurate.
By detecting the contrast of image frames, detecting characters and black image areas, and using preset thresholds to determine image quality, corresponding prompts are output to adjust the acquisition parameters.
It enables the determination of the validity of image frames, avoids the impact on image recognition effect and accuracy, and improves the reliability of image recognition.
Smart Images

Figure CN115240197B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of image processing technology, and in particular to an image quality evaluation method, apparatus, electronic device, scanning pen, and storage medium. Background Technology
[0002] With the continuous upgrading and development of information technology in recent years, image recognition devices have emerged in large numbers, such as dictionary pens and scanning pens. Image recognition devices process and stitch together images acquired by image scanning devices, and then perform recognition on the stitched images. The quality of the images acquired by the image scanning device directly affects the effect and accuracy of subsequent image recognition. For example, images without characters will not produce any recognition results; images with background textures will be directly recognized as similar irrelevant characters; or invalid images with too low contrast will be directly recognized as irrelevant characters, resulting in invalid image recognition results. However, during the image acquisition and recognition process, users cannot determine the quality of the acquired image frames, and therefore cannot determine whether the acquired image frames are valid. Summary of the Invention
[0003] Based on the defects and shortcomings of the prior art, this application proposes an image quality evaluation method, apparatus, electronic device, scanning pen, and storage medium, which can evaluate the quality of image frames and thus determine the validity of image frames.
[0004] The first aspect of this application provides an image quality assessment method, including:
[0005] The contrast of the acquired image frames is detected, and characters and black image regions are detected from the image frames;
[0006] If any of the preset conditions is detected, the image quality of the image frame is determined to be substandard.
[0007] The preset conditions include the image frame having a contrast lower than a preset contrast threshold, the image frame not containing any characters, and the image frame containing periodic black image regions.
[0008] Optionally, the detection of the contrast of the acquired image frames includes:
[0009] The contrast of the image frame is calculated using the pixel values of each pixel in the image frame and a pre-set contrast calculation formula.
[0010] Optionally, detecting characters from the image frame includes:
[0011] Character edge extraction is performed on the acquired image frames to obtain character edge image frames;
[0012] Foreground dilation is performed on the character edges in the character edge image frame to obtain a connected character volume;
[0013] The presence of characters in the image frame is determined based on the number and size of the connected characters.
[0014] Optionally, the step of extracting character edges from the acquired image frame to obtain a character edge image frame includes:
[0015] Based on the gradient magnitude of each pixel in the image frame and the predetermined first binarization threshold, the image frame is binarized to obtain a first binary image frame.
[0016] Non-character edge filtering is performed on the foreground in the first binary image frame to obtain a character edge image frame.
[0017] Optionally, detecting black image regions from the image frame includes:
[0018] The acquired image frame is binarized using a pre-set second binarization threshold to obtain a second binary image frame;
[0019] If a black image region is determined to exist in the image frame based on the second binary image frame, the acquisition time of the image frame is recorded, and based on the acquisition times of all recorded image frames containing black image regions, it is determined whether there is a periodic black image region in the image frame.
[0020] Optional image quality assessment methods also include:
[0021] When none of the preset conditions occur, the image frame is stitched together with the pre-stored historical stitched images to obtain the target stitched image;
[0022] Based on the text content in the target stitched image, an image quality evaluation result for the target stitched image is determined.
[0023] Optionally, based on the text content in the target stitched image, an image quality evaluation result for the target stitched image is determined, including:
[0024] Character edge extraction and edge foreground dilation are performed on the text content in the target stitched image to obtain a character edge map;
[0025] The height percentage of the text content in the target spliced image is determined based on the connected characters in the character edge map.
[0026] If the height ratio of the text content in the target spliced image exceeds the preset ratio range, then the image quality of the target spliced image is determined to be unqualified.
[0027] Optional image quality assessment methods also include:
[0028] If the height ratio of the text content in the target spliced image exceeds the preset ratio range, a prompt message indicating that the characters in the target spliced image are too large or too small will be output.
[0029] Optional image quality assessment methods also include:
[0030] When the height ratio of the text content in the target spliced image does not exceed the preset ratio range, text recognition is performed on the target spliced image;
[0031] Based on the text recognition results of the target stitched image, it is determined whether the image quality of the target stitched image is qualified.
[0032] Optionally, based on the text recognition results of the target stitched image, determining whether the image quality of the target stitched image is acceptable includes:
[0033] Obtain the posterior probability of a preset number of text recognition results from all the text recognition results of the target stitched images;
[0034] Calculate the posterior probability variance based on the posterior probabilities of a preset number of text recognition results.
[0035] If the posterior probability variance is less than a preset variance threshold, then the image quality of the target stitched image is determined to be unqualified.
[0036] If the posterior probability variance is not less than a preset variance threshold, then the image quality of the target stitched image is determined to be qualified.
[0037] Optional image quality assessment methods also include:
[0038] If the posterior probability variance is detected to be less than a preset variance threshold, the recognition confidence level corresponding to the posterior probability variance is output.
[0039] Optional image quality assessment methods also include:
[0040] If the contrast of the image frame is detected to be lower than a preset contrast threshold, a prompt message indicating that the image frame has low contrast will be output.
[0041] If no character is detected in the image frame, a prompt message indicating that there are no characters in the image frame is output.
[0042] If a periodic black image region is detected in the image frame, a prompt message is output indicating that the frame rate of the scanning device is inconsistent with the refresh rate of the scanned device.
[0043] A second aspect of this application provides an image quality evaluation apparatus, comprising:
[0044] The detection module is used to detect the contrast of the acquired image frames and to detect characters and black image regions from the image frames;
[0045] The image frame quality evaluation module is used to determine that the image quality of the image frame is unqualified if any of the preset conditions are detected.
[0046] The preset conditions include the image frame having a contrast lower than a preset contrast threshold, the image frame not containing any characters, and the image frame containing periodic black image regions.
[0047] A third aspect of this application provides an electronic device, including: a memory and a processor;
[0048] The memory is connected to the processor and is used to store programs;
[0049] The processor is used to implement the above-described image quality evaluation method by running the program in the memory.
[0050] A fourth aspect of this application provides a scanning pen, comprising:
[0051] A scanning camera, and a processor connected to the scanning camera;
[0052] The scanning camera is used to capture image frames and send the image frames to the processor;
[0053] The processor is used to detect the contrast of the acquired image frames, and to detect characters and black image regions from the image frames;
[0054] If any of the preset conditions is detected, the image quality of the image frame is determined to be substandard.
[0055] The preset conditions include the image frame having a contrast lower than a preset contrast threshold, the image frame not containing any characters, and the image frame containing periodic black image regions.
[0056] The fifth aspect of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the above-described image quality evaluation method.
[0057] The image quality evaluation method proposed in this application detects the contrast of acquired image frames and detects characters and black image regions from the image frames. If any of the following occurs: the contrast of the image frame is lower than a preset contrast threshold, no characters are found in the image frame, or periodic black image regions are found in the image frame, then the image quality of the image frame is determined to be unqualified. Using the technical solution of this application, the image quality of acquired image frames can be evaluated, thereby determining the validity of the image frame and avoiding the impact of image quality on image recognition performance and accuracy. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0059] Figure 1 This is a flowchart illustrating an image quality evaluation method provided in an embodiment of this application;
[0060] Figure 2 This is a schematic diagram of the processing flow for detecting characters from an image frame provided in an embodiment of this application;
[0061] Figure 3 This is a comparison image of the original image frame and the character edge image frame with / without characters, provided in the embodiments of this application;
[0062] Figure 4 This is a schematic diagram of the processing flow for detecting black image regions from an image frame, provided in an embodiment of this application.
[0063] Figure 5 This is a flowchart illustrating another image quality evaluation method provided in an embodiment of this application;
[0064] Figure 6 This is a flowchart illustrating another image quality evaluation method provided in an embodiment of this application;
[0065] Figure 7 This is a comparison diagram of connected components before and after merging, provided in an embodiment of this application;
[0066] Figure 8 This is a flowchart illustrating another image quality evaluation method provided in an embodiment of this application;
[0067] Figure 9 This is a schematic diagram of the structure of an image quality evaluation device provided in an embodiment of this application;
[0068] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0069] The technical solutions of this application are applicable to image quality evaluation scenarios, such as the quality evaluation of scanned images during image scanning. By employing the technical solutions of this application, image quality evaluation can be performed on acquired image frames, thereby determining the validity of the image frame.
[0070] In image recognition, the quality of the image to be recognized directly affects the effectiveness and accuracy of the recognition process. For example, image scanning and recognition devices such as scanning pens and dictionary pens may produce no recognition results for images without characters, may misidentify images with background textures as similar but irrelevant characters, or may directly identify images with low contrast as irrelevant characters. Because image scanning and recognition devices cannot determine the quality of the captured image frames during the scanning process, they cannot determine whether the image frames are valid, nor can they determine the image recognition effect or the accuracy of the recognition results.
[0071] In view of the shortcomings of the prior art and the existing problem that the quality of the acquired image frames cannot be determined, thus making it impossible to judge whether the image frames are valid, the inventors of this application have proposed an image quality evaluation method after research and experimentation. This method can evaluate the quality of the acquired image frames and determine the validity of the image frames.
[0072] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0073] This application proposes an image quality evaluation method, see [link to relevant documentation]. Figure 1 As shown, the method includes:
[0074] S101, Detect the contrast of the acquired image frame, and detect characters and black image areas from the image frame.
[0075] Specifically, during image recognition, if the brightness of the captured image is insufficient, resulting in low contrast, the characters in the image frame will lack clarity due to the darkness, making them unrecognizable or leading to incorrect character recognition. If the image is captured as a grayscale image, the text or background colors may suffer from "color weakness" (loss of contrast) during conversion, also resulting in low contrast and making character recognition impossible or incorrect. For example, red text on a green background or red text on a blue background will lose contrast and appear low after being converted to grayscale and captured.
[0076] If there are no characters in the image frame, background textures or other elements in the image frame may be misidentified as irrelevant characters. Furthermore, since the graphics on an electronic device screen are composed of fluorescent dots that emit light when struck by an electron beam, and because the phosphors in the cathode ray tube emit light for a very short time after being struck by the electron beam, the electron beam must continuously strike the phosphors to keep them emitting light. This results in the screen constantly refreshing. The lower the screen refresh rate, the greater the flickering and jitter of the displayed image. A high refresh rate provides a better viewing experience in certain scenarios, reducing screen flicker. If the image being captured is displayed on an electronic device screen, and the frame rate of the image scan differs from the refresh rate of the screen, then images from when the screen is refreshed will be captured, causing periodic black image areas (i.e., "black frames" or "black bars") to appear in the scanned image frames. If "black frames" or "black bars" appear periodically in the scanned image frames, it indicates that the frame rate of the image scan is different from the refresh rate of the screen, and subsequent scanned image frames will continue to show periodic black image areas, affecting image recognition.
[0077] To ensure the effectiveness and accuracy of image recognition, it is necessary to determine the validity of the scanned image frames. Only by ensuring the validity of the image frames can the accuracy of image recognition be guaranteed. Therefore, it is necessary to check whether the image quality of the scanned image frames is up to standard in order to determine whether the image frames are valid and thus determine the image recognition effect. As mentioned above, the image quality of an image frame is related to its contrast, the presence or absence of characters, and the presence or absence of black image regions. Therefore, this embodiment needs to calculate the contrast of the image frame based on the pixel values of each pixel; determine the presence of characters in the image frame by detecting connected characters; and detect the presence of periodically occurring black image regions by detecting black image regions and recording the times when black image regions appear.
[0078] S102. If any of the preset conditions is detected, the image quality of the image frame is determined to be unqualified.
[0079] Specifically, through the above detection, if any of the following occurs: the contrast of an image frame is lower than a preset contrast threshold, no characters are present in the image frame, or periodic black image regions are present in the image frame, then the image quality of the image frame is considered unqualified. The preset contrast threshold is a critical image contrast value that ensures image recognition. If the contrast of an image frame is lower than this threshold, it indicates that the image frame's contrast is too low, which will affect image frame recognition. This embodiment determines the validity of an image frame by evaluating its image quality.
[0080] Furthermore, if the contrast of an image frame is detected to be lower than a preset contrast threshold, a prompt message indicating low contrast is output; if no characters are detected in an image frame, a prompt message indicating no characters are present is output; if periodic black image regions are detected in an image frame, a prompt message indicating that the frame rate of the scanning device is inconsistent with the refresh rate of the scanned device is output. These prompts inform the user that the quality of the currently acquired image frame is unacceptable, allowing the user to take appropriate action. For example, if the user receives a prompt message indicating low contrast or no characters in the image frame, the user can discard the current image frame and adjust the scanning angle or position of the scanning device. If the user receives a prompt message indicating that the frame rate of the scanning device is inconsistent with the refresh rate of the scanned device, the user can adjust the frame rate of the scanning device or abandon scanning the scanned device.
[0081] As described above, the image quality evaluation method proposed in this application detects the contrast of acquired image frames and detects characters and black image regions from the image frames. If any of the following occurs: the contrast of the image frame is lower than a preset contrast threshold, there are no characters in the image frame, or there are periodic black image regions in the image frame, then the image quality of the image frame is determined to be unqualified. Using the technical solution of this embodiment, image quality evaluation can be performed on acquired image frames to determine their validity, thus avoiding the impact of image quality on image recognition performance and accuracy.
[0082] As an optional implementation, another embodiment of this application discloses that, in step S101 above, detecting the contrast of the acquired image frame includes:
[0083] The contrast of an image frame is calculated using the pixel values of each pixel in the image frame and a pre-set contrast calculation formula.
[0084] Specifically, contrast ratio represents the degree of contrast between bright and dark areas of an image frame, typically indicating the clarity of the image quality. This embodiment calculates the contrast ratio of an image frame using the pixel values of each pixel within the frame, according to a pre-set contrast ratio calculation formula. The pre-set contrast ratio calculation formula is as follows:
[0085]
[0086] Where C represents the contrast of the image frame; δ(i,j) represents the pixel difference between adjacent pixels i and j; and P δ (i, j) represents the pixel distribution probability where the pixel difference between adjacent pixels i and j is δ. In addition, there are generally two ways to determine adjacent pixels: 4-nearest neighbors and 8-nearest neighbors. 4-nearest neighbors are pixels that are adjacent in the four directions of top, bottom, left, and right, while 8-nearest neighbors are pixels that are adjacent in the eight directions of top, bottom, left, right, upper left, upper right, lower left, and lower right.
[0087] As an optional implementation method, see [link to implementation details]. Figure 2 As shown, another embodiment of this application discloses that, in step S101 above, detecting characters from an image frame includes:
[0088] S201. Extract character edges from the acquired image frames to obtain character edge image frames.
[0089] Specifically, to detect characters in an image frame, it is first necessary to extract the character edges from the image frame to obtain a character edge image frame. Because character edges have special characteristics compared to the edges of other objects, especially printed text, they have double edges with fixed font size and basically consistent stroke width. Early text detectors used the consistent color or pixels inside the character edges and their relatively fixed size and stroke width to locate the text position. Therefore, in this embodiment, the presence or absence of characters in the image frame can be determined based on the character edges in the image frame.
[0090] Furthermore, the specific steps are as follows:
[0091] First, the image frame is binarized based on the gradient magnitude of each pixel in the image frame and a pre-determined first binarization threshold to obtain a first binary image frame.
[0092] To extract character edges from an image frame, a first binarization threshold needs to be predetermined, and the image frame is then binarized according to this threshold. In this embodiment, the Otsu threshold of the image frame is determined based on the grayscale values of each pixel, and this Otsu threshold can be used as the first binarization threshold. However, when there are few characters in the image frame, the Otsu threshold may be large, resulting in a lower accuracy in character edge extraction. Therefore, a fixed constraint threshold can be preset, and the minimum value between the Otsu threshold and the constraint threshold can be used as the first binarization threshold. For example, when there are few characters in the image frame, the calculated Otsu threshold is greater than the preset constraint threshold, and this constraint threshold is used as the first binarization threshold; when the number of characters in the image frame is normal, the calculated Otsu threshold is less than the preset constraint threshold, and this Otsu threshold is used as the first binarization threshold.
[0093] This embodiment requires calculating the gradient magnitude of each pixel in the image frame. By comparing the gradient magnitude of each pixel with a first binarization threshold, the image frame is binarized to obtain the first binary image frame corresponding to the image frame. For example, the grayscale value of pixels in the image frame with a gradient magnitude greater than the first binarization threshold is set to 0, and the grayscale value of pixels in the image frame with a gradient magnitude less than the first binarization threshold is set to 255, thereby achieving binarization of the image frame.
[0094] Furthermore, the gradient magnitude of a pixel needs to be calculated based on the gradient in the x-direction and the gradient in the y-direction. For example, for a pixel with coordinates (x, y), its gradient g in the x-direction... x = f(x+1, y) - f(x, y), where the gradient g in the y-direction is... y = f(x, y+1) - f(x, y), then the gradient magnitude of the pixel at coordinate (x, y) is... Where f(x+1, y) represents the pixel value of the pixel at coordinates (x+1, y), f(x, y) represents the pixel value of the pixel at coordinates (x, y), and f(x, y+1) represents the pixel value of the pixel at coordinates (x, y+1).
[0095] Second, non-character edge filtering is performed on the foreground in the first binary image frame to obtain a character edge image frame.
[0096] After obtaining the first binary image frame corresponding to the image frame in this embodiment, since the first binary image frame contains foreground pixels with a grayscale value of 0 and background pixels with a grayscale value of 255, this embodiment can filter out non-character edges from the foreground composed of foreground pixels in the first binary image frame to obtain a character edge image frame. Because character edges have special characteristics compared to the edges of other objects—characters have double edges with roughly the same stroke width—edges in the foreground of the first binary image frame that do not conform to these characteristics can be filtered out based on this feature. For example, the average distance between the nearest edges in the top, bottom, left, and right directions can be calculated first, and this distance can be used as the width threshold of the character. If it is a character edge, the distance between the two edges of the character is similar to the determined width threshold; if it is not a character edge, the distance between it and other edges will exceed the width threshold.
[0097] S202. Perform foreground dilation on the character edges in the character edge image frame to obtain a connected character volume.
[0098] Specifically, after obtaining the character edge image frame through the above steps, the character edge in the character edge image frame is represented by the foreground connected component. However, during character edge extraction, the foreground of the extracted character edge may be discontinuous. Therefore, in order to ensure the continuity of the character edge in the character edge image frame, foreground dilation can be performed on the character edge in the character edge image frame to obtain a continuous and clear character connected component.
[0099] S203. Determine whether characters exist in the image frame based on the number and size of the connected characters.
[0100] Specifically, this embodiment pre-sets a threshold for the number and size of connected characters. If the number of connected characters in a character image frame exceeds the number threshold, and among all connected characters, there are connected characters whose size exceeds the size threshold, then it indicates that a character exists in the image frame. If the size of a connected character is less than the size threshold, then it may be that the character corresponding to that connected character is only half a character, such as... Figure 3 The characters in the upper left and lower left corners of the b2 diagram are connected. Figure 3 In the image, a1 is an image frame without characters, a2 is an image frame with character edges in a1, b1 is an image frame with characters, and b2 is an image frame with character edges in b1.
[0101] As an optional implementation method, see [link to implementation details]. Figure 4 As shown, another embodiment of this application discloses that, in step S101 above, detecting a black image region from an image frame includes:
[0102] S401. Using a pre-set second binarization threshold, the acquired image frame is binarized to obtain a second binary image frame.
[0103] Specifically, in this embodiment, a second binarization threshold can be preset, and the image frame can be binarized using the second binarization threshold to obtain a second binary image frame. To distinguish between the binarization of characters in the detected image frame and the binarization of black image regions in the detected image frame, different binarization methods or different binarization thresholds can be used to binarize the image frame. For example, when detecting characters in the image frame, the image frame is binarized by setting the grayscale value of pixels with a gradient magnitude greater than the first binarization threshold to 0, and setting the grayscale value of pixels with a gradient magnitude less than the first binarization threshold to 255. Similarly, when detecting black image regions in the image frame, the image frame is binarized by setting the grayscale value of pixels with a gradient magnitude greater than the second binarization threshold to 255, and setting the grayscale value of pixels with a gradient magnitude less than the second binarization threshold to 0. This allows for the distinction between a binary image frame without characters and a binary image frame that is a black frame.
[0104] S402. If a black image region is determined to exist in the image frame based on the second binary image frame, the acquisition time of the image frame is recorded, and based on the acquisition times of all recorded image frames containing black image regions, it is determined whether there is a periodic black image region in the image frame.
[0105] Specifically, after obtaining the second binary image frame, it is possible to analyze whether there are black image regions within it. For example, the grayscale values of pixels with gradient magnitudes greater than the second binarization threshold are set to 255, and the grayscale values of pixels with gradient magnitudes less than the second binarization threshold are set to 0. If the second binary image frame contains strip-shaped regions running horizontally or vertically, it indicates the presence of "black bars." Alternatively, if all pixels in the second binary image frame have a grayscale value of 0, it indicates the image frame is a "black frame." The presence of "black bars" or a "black frame" in an image frame indicates the existence of black image regions within that frame.
[0106] If a black bar image region is detected in an image frame, the acquisition time of that image frame is recorded. The acquisition times of all recorded image frames containing black image regions are analyzed to determine whether the black image regions appear periodically. If the black image regions appear periodically, then it indicates that there are periodic black image regions in that image frame.
[0107] As an optional implementation method, see [link to implementation details]. Figure 5 As shown, another embodiment of this application discloses an image quality evaluation method, which further includes:
[0108] S503. When none of the preset conditions occur, the image frame is stitched together with the pre-stored historical stitched image to obtain the target stitched image.
[0109] Specifically, if none of the following conditions are met—that is, the image frame's contrast is not lower than the preset contrast threshold, the image frame contains no characters, and the image frame contains periodic black image regions—that is, the image frame's contrast is not lower than the preset contrast threshold, the image frame contains characters, and the image frame does not contain periodic black image regions, then the image quality of the image frame is considered acceptable. In this case, the image frame can be stitched together with pre-stored historical stitched images to obtain the target stitched image. In this embodiment, the stitching between the image frame and the historical stitched images can be implemented using existing image stitching methods, which will not be elaborated upon in detail here.
[0110] S504. Based on the text content in the target stitched image, determine the image quality evaluation result of the target stitched image.
[0111] Specifically, after evaluating the quality of the image frames in this embodiment, it is also necessary to evaluate the quality of the stitched target image. This embodiment determines the character size of the text content in the target stitched image based on the character size, and then evaluates the image quality accordingly. If the characters are too large, the complete characters cannot be displayed in the target stitched image, leading to image recognition errors; if the characters are too small, they may be a portion of the previous line of text that was accidentally scanned while scanning the current line.
[0112] Figure 5 Steps S501-S502 and Figure 1 The steps S101-S102 are the same, and the specific steps S501-S502 will not be described in this embodiment.
[0113] As an optional implementation method, see [link to implementation details]. Figure 6 As shown, another embodiment of this application discloses step S504, which involves determining the image quality evaluation result of the target stitched image based on the text content in the target stitched image, including:
[0114] S604. Perform character edge extraction and edge foreground dilation on the text content in the target stitched image to obtain a character edge map.
[0115] Specifically, in order to determine the character size of the text content in the target stitched image, it is first necessary to extract the character edges of the text content in the target stitched image and perform foreground dilation on the character edges to obtain a character edge map. Among them, the method of character edge extraction is the same as that of the character edge extraction of the image frame in step S201, and the method of foreground dilation of the character edges is the same as that of the foreground dilation of the character edges in the character edge image frame in step S202, which will not be specifically elaborated in this embodiment.
[0116] S605. Determine the height ratio of the text content in the target stitched image according to the character connected components in the character edge map.
[0117] Specifically, from the character edge map corresponding to the above target stitched image, the character connected components can be extracted. The connected components that are small and close to each other on the left and right or the connected components with an up-down structure can be merged. For example, the character connected components corresponding to the characters with a left-right structure may be divided into two character connected components on the left and right, and the character connected components corresponding to the characters with an up-down structure may be divided into multiple small character connected components distributed up and down. Therefore, for the characters with a left-right structure, the two character connected components on the left and right need to be merged, and for the characters with an up-down structure, the connected components distributed up and down need to be merged, so as to judge the character size for the merged character connected components. For example, Figure 7 In Figure A, the character connected components corresponding to the character "念" include multiple connected components distributed up and down (such as the connected components enclosed by multiple squares corresponding to the character "念" in Figure A). After merging the character connected components corresponding to the character "念", a whole character connected component is obtained in Figure B (such as the connected component enclosed by a single square corresponding to the character "念" in Figure B). After merging the character connected components of each character in the character edge map, then determine the height ratio of each merged character connected component in the character edge map.
[0118] S606. If it is detected that the height ratio of the text content in the target stitched image exceeds the preset ratio range, determine that the image quality of the target stitched image is unqualified.
[0119] Specifically, in this embodiment, a preset ratio range is set. If it is detected that the height ratio of the text content in the target stitched image exceeds the preset ratio range, it means that the characters in the text content of the target stitched image are too large or too small. At this time, the image quality of the target stitched image is unqualified. For example, if the height ratio of the characters in the text content of the target stitched image reaches 100%, it means that the character connected components penetrate the entire image boundary, indicating that the characters are too large at this time, and the target stitched image may not be able to display the complete characters, thus affecting image recognition. If the height ratio of the characters in the text content of the target stitched image is less than the minimum value in the preset ratio range, it means that the characters in the text content are too small at this time.
[0120] Furthermore, if the height ratio of the text content in the target spliced image exceeds the preset ratio range, a prompt message indicating that the characters in the target spliced image are too large or too small will be output to prompt the user that the character size in the target spliced image composed of image frames is not up to standard, so that the user can react in a timely manner.
[0121] Figure 6 Steps S601-S603 and Figure 5 The steps S501-S503 are the same, and steps S601-S603 will not be described in detail in this embodiment.
[0122] As an optional implementation method, see [link to implementation details]. Figure 8 As shown, another embodiment of this application discloses an image quality evaluation method, which further includes:
[0123] S807. When the height ratio of the text content in the target spliced image does not exceed the preset ratio range, perform text recognition on the target spliced image.
[0124] Specifically, if the height ratio of the text content in the target stitched image does not exceed the preset ratio range, it indicates that the image quality of the target stitched image is qualified, that is, the character size of the text content in the target stitched image is qualified. At this time, text recognition needs to be performed on the target stitched image. In this embodiment, text recognition of the image can be implemented using existing image recognition methods, which will not be described in detail here.
[0125] S808. Based on the text recognition results of the target spliced image, determine whether the image quality of the target spliced image is qualified.
[0126] Specifically, after recognizing the text content in the target stitched image, it is necessary to determine the credibility of correctly recognizing each character in the target stitched image based on the text recognition results, thereby determining whether the image quality of the target stitched image is up to standard.
[0127] Furthermore, the specific steps are as follows:
[0128] First, obtain the posterior probability of a preset number of text recognition results from all the target stitched images.
[0129] In this embodiment, a preset number of text recognition results are selected from the text recognition results of all target spliced images corresponding to each character. For example, if the preset number is 3, then the posterior probabilities of the three text recognition results with the highest posterior probabilities are selected from all text recognition results of each character.
[0130] Second, the posterior probability variance is calculated based on the posterior probabilities of a preset number of text recognition results.
[0131] For each character, calculate the posterior probability of a preset number of text recognition results, and then calculate the posterior probability variance for each character. For example, if the preset number is 3, to calculate the posterior probability variance of a certain character, first calculate the square of the difference between each posterior probability of that character and the average of the three posterior probabilities, and then use the average of the three squared values as the posterior variance probability of that character.
[0132] Third, if the posterior probability variance is less than the preset variance threshold, the image quality of the target stitched image is determined to be unqualified; if the posterior probability variance is not less than the preset variance threshold, the image quality of the target stitched image is determined to be qualified.
[0133] In this embodiment, a preset variance threshold is set. If the posterior probability variance of a character is less than the preset variance threshold, it indicates that the confidence level of the correct character recognition is low, and the image quality of the target stitched image is determined to be unqualified. If the posterior probability variance of a character is not less than the preset variance threshold, it indicates that the confidence level of the correct character recognition is high, and the image quality of the target stitched image is determined to be qualified. At this time, the text recognition result of the target stitched image can be output.
[0134] Furthermore, if the posterior probability variance of the detected text is less than a preset variance threshold, the recognition confidence level corresponding to that posterior probability variance is output so that the user can react according to the recognition confidence level of the text, such as re-recognizing the text content, re-stitching the image, or re-acquiring image frames.
[0135] Figure 8 Steps S801-S806 and Figure 6 The steps S601-S606 are the same, and steps S801-S806 will not be described in detail in this embodiment.
[0136] Corresponding to the image quality evaluation method described above, this application also proposes an image quality evaluation device, see [link to relevant documentation]. Figure 9 As shown, the device includes:
[0137] The detection module 100 is used to detect the contrast of the acquired image frames and to detect characters and black image regions from the image frames;
[0138] The image frame quality evaluation module 110 is used to determine that the image quality of the image frame is unqualified if any of the preset conditions are detected.
[0139] The preset conditions include image frame contrast being lower than a preset contrast threshold, image frame not containing characters, and image frame containing periodic black image regions.
[0140] The image quality evaluation device proposed in this application utilizes a detection module 100 to detect the contrast of acquired image frames and to detect characters and black image regions within the image frames. The image frame quality evaluation module 110 determines that the image frame's image quality is unqualified if any of the following occurs: the image frame's contrast is lower than a preset contrast threshold, no characters are present in the image frame, or periodic black image regions are present in the image frame. By employing the technical solution of this embodiment, image quality evaluation can be performed on acquired image frames to determine their validity, thus avoiding the impact of image frame quality on image recognition performance and accuracy.
[0141] As an optional implementation, another embodiment of this application also discloses that the detection module 100 includes: a contrast calculation unit, used to calculate the target contrast of the image frame using the pixel values of each pixel in the image frame and a pre-set contrast calculation formula.
[0142] As an optional implementation, another embodiment of this application also discloses that the detection module 100 further includes: a character edge extraction unit, a foreground expansion unit, and a character detection unit.
[0143] The character edge extraction unit is used to extract character edges from the acquired image frame to obtain a character edge image frame.
[0144] The foreground dilation unit is used to dilate the foreground edges of characters in the character edge image frame to obtain a connected character volume.
[0145] The character detection unit is used to determine whether characters exist in an image frame based on the number and size of connected characters.
[0146] As an optional implementation, another embodiment of this application also discloses a character edge extraction unit, specifically used for:
[0147] Based on the gradient magnitude of each pixel in the image frame and the predetermined first binarization threshold, the image frame is binarized to obtain the first binary image frame.
[0148] Non-character edge filtering is performed on the foreground in the first binary image frame to obtain a character edge image frame.
[0149] As an optional implementation, another embodiment of this application also discloses that the detection module 100 further includes a binarization unit and a determination unit.
[0150] The binarization unit is used to binarize the acquired image frame using a pre-set second binarization threshold to obtain a second binary image frame.
[0151] The determining unit is used to record the acquisition time of the image frame if a black image region is determined to exist in the image frame based on the second binary image frame, and to determine whether there is a periodic black image region in the image frame based on the recorded acquisition times of all image frames containing black image regions.
[0152] As an optional implementation, another embodiment of this application also discloses that the apparatus further includes: a stitching module and a stitched image quality evaluation module.
[0153] The stitching module is used to stitch image frames with pre-stored historical stitched images to obtain the target stitched image when none of the preset conditions occur.
[0154] The image quality evaluation module is used to determine the image quality evaluation result of the target image based on the text content in the target image.
[0155] As an optional implementation, another embodiment of this application also discloses a stitched image quality evaluation module, specifically used for:
[0156] Character edge extraction and edge foreground dilation are performed on the text content in the target stitched image to obtain a character edge map;
[0157] Based on the connected characters in the character edge map, determine the height proportion of the text content in the target spliced image;
[0158] If the height ratio of the text content in the target spliced image exceeds the preset ratio range, the image quality of the target spliced image is determined to be unqualified.
[0159] As an optional implementation, another embodiment of this application also discloses that the device further includes: an output module, used to output a prompt message indicating that the characters in the target spliced image are too large or too small if the height ratio of the text content in the target spliced image is detected to exceed a preset ratio range.
[0160] As an optional implementation, another embodiment of this application also discloses that the image quality evaluation device further includes a recognition module.
[0161] The recognition module is used to recognize text in the target spliced image when the height ratio of the text content in the target spliced image does not exceed the preset ratio range.
[0162] The image quality evaluation module is also used to determine whether the image quality of the target image is up to standard based on the text recognition results of the target image.
[0163] As an optional implementation, another embodiment of this application also discloses a stitched image quality evaluation module, which is specifically used for:
[0164] Obtain the posterior probability of a preset number of text recognition results from all target stitched images;
[0165] Calculate the posterior probability variance based on the posterior probabilities of a preset number of text recognition results.
[0166] If the posterior probability variance is less than the preset variance threshold, then the image quality of the target stitched image is determined to be unqualified.
[0167] If the posterior probability variance is not less than the preset variance threshold, then the image quality of the target stitched image is determined to be qualified.
[0168] As an optional implementation, another embodiment of this application also discloses that the output module is further configured to output the recognition confidence level corresponding to the posterior probability variance if the detected posterior probability variance is less than a preset variance threshold.
[0169] As an optional implementation, another embodiment of this application also discloses an output module, which is further configured to output a prompt message indicating low contrast of the image frame if the contrast of the detected image frame is lower than a preset contrast threshold; output a prompt message indicating no characters in the image frame if no characters are detected in the image frame; and output a prompt message indicating that the frame rate of the scanning device is inconsistent with the refresh frequency of the scanned device if a periodic black image region is detected in the image frame.
[0170] The image quality evaluation device provided in this embodiment belongs to the same concept as the image quality evaluation method provided in the above embodiments of this application. It can execute the image quality evaluation method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects for executing the image quality evaluation method. Technical details not described in detail in this embodiment can be found in the specific processing content of the image quality evaluation method provided in the above embodiments of this application, and will not be repeated here.
[0171] Another embodiment of this application discloses an electronic device, see [link to relevant documentation] Figure 10 As shown, the device includes:
[0172] Memory 200 and processor 210;
[0173] The memory 200 is connected to the processor 210 and is used to store programs;
[0174] The processor 210 is configured to implement the image quality evaluation method disclosed in any of the above embodiments by running the program stored in the memory 200.
[0175] Specifically, the aforementioned electronic device may also include: a bus, a communication interface 220, an input device 230, and an output device 240.
[0176] The processor 210, memory 200, communication interface 220, input device 230, and output device 240 are interconnected via a bus. Among them:
[0177] A bus can include a pathway for transmitting information between various components of a computer system.
[0178] The processor 210 can be a general-purpose processor, such as a general-purpose central processing unit (CPU), a microprocessor, etc., or an application-specific integrated circuit (ASIC), or one or more integrated circuits used to control the execution of the program of the present invention. It can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0179] Processor 210 may include a main processor, as well as a baseband chip, modem, etc.
[0180] The memory 200 stores a program that executes the technical solution of this invention, and may also store an operating system and other key business functions. Specifically, the program may include program code, which includes computer operation instructions. More specifically, the memory 200 may include read-only memory (ROM), other types of static storage devices capable of storing static information and instructions, random access memory (RAM), other types of dynamic storage devices capable of storing information and instructions, disk storage, flash memory, etc.
[0181] Input device 230 may include a device for receiving user input data and information, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0182] Output device 240 may include devices that allow information to be output to a user, such as a display screen, printer, speaker, etc.
[0183] The communication interface 220 may include a device that uses any transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0184] The processor 2102 executes the program stored in the memory 200 and calls other devices, which can be used to implement the various steps of the image quality evaluation method provided in the embodiments of this application.
[0185] Another embodiment of this application provides a scanning pen, which includes a scanning camera and a processor connected to the scanning camera. The scanning camera is used to acquire image frames and send the image frames to the processor; the processor is used to detect the contrast of the acquired image frames and to detect characters and black image areas from the image frames; if any of the preset conditions are detected, the image quality of the image frame is determined to be unqualified; wherein, the preset conditions include the contrast of the image frame being lower than a preset contrast threshold, the absence of characters in the image frame, and the presence of periodic black image areas in the image frame.
[0186] As an optional implementation, the processor in this embodiment detects the contrast of the acquired image frame by: calculating the contrast of the image frame using the pixel values of each pixel in the image frame and a pre-set contrast calculation formula.
[0187] As an optional implementation, the processor in this embodiment detects characters from the image frame, including:
[0188] Character edge extraction is performed on the acquired image frames to obtain character edge image frames;
[0189] Foreground dilation is performed on the character edges in the character edge image frame to obtain a connected character volume.
[0190] The presence of characters in an image frame is determined by the number and size of the connected components.
[0191] As an optional implementation, the processor in this embodiment performs character edge extraction on the acquired image frame to obtain a character edge image frame, including:
[0192] Based on the gradient magnitude of each pixel in the image frame and the predetermined first binarization threshold, the image frame is binarized to obtain the first binary image frame.
[0193] Non-character edge filtering is performed on the foreground in the first binary image frame to obtain a character edge image frame.
[0194] As an optional implementation, the processor in this embodiment detects black image regions from image frames, including:
[0195] The acquired image frame is binarized using a pre-set second binarization threshold to obtain a second binary image frame;
[0196] If a black image region is determined to exist in the image frame based on the second binary image frame, the acquisition time of the image frame is recorded, and based on the acquisition times of all recorded image frames containing black image regions, it is determined whether there is a periodic black image region in the image frame.
[0197] As an optional implementation, the processor in this embodiment is also used for:
[0198] If none of the preset conditions occur, the image frame is stitched together with the pre-stored historical stitched images to obtain the target stitched image;
[0199] Based on the text content in the target stitched image, determine the image quality evaluation result of the target stitched image.
[0200] As an optional implementation, the processor in this embodiment determines the image quality evaluation result of the target stitched image based on the text content in the target stitched image, including:
[0201] Character edge extraction and edge foreground dilation are performed on the text content in the target stitched image to obtain a character edge map;
[0202] Based on the connected characters in the character edge map, determine the height proportion of the text content in the target spliced image;
[0203] If the height ratio of the text content in the target spliced image exceeds the preset ratio range, the image quality of the target spliced image is determined to be unqualified.
[0204] As an optional implementation, the processor in this embodiment is also used for:
[0205] If the height ratio of the text content in the target spliced image exceeds the preset ratio range, a prompt message indicating that the characters in the target spliced image are too large or too small will be output.
[0206] As an optional implementation, the processor in this embodiment is also used to: perform text recognition on the target spliced image when the height ratio of the text content in the target spliced image does not exceed the preset ratio range;
[0207] Based on the text recognition results of the target stitched image, determine whether the image quality of the target stitched image is acceptable.
[0208] As an optional implementation, the processor in this embodiment determines whether the image quality of the target stitched image is acceptable based on the text recognition results of the target stitched image, including:
[0209] Obtain the posterior probability of a preset number of text recognition results from all target stitched images;
[0210] Calculate the posterior probability variance based on the posterior probabilities of a preset number of text recognition results.
[0211] If the posterior probability variance is less than the preset variance threshold, then the image quality of the target stitched image is determined to be unqualified.
[0212] If the posterior probability variance is not less than the preset variance threshold, then the image quality of the target stitched image is determined to be qualified.
[0213] As an optional implementation, the processor in this embodiment is also used to: if the detected posterior probability variance is less than a preset variance threshold, output the recognition confidence level corresponding to the posterior probability variance.
[0214] As an optional implementation, the processor in this embodiment is also used for:
[0215] If the contrast of an image frame is detected to be lower than the preset contrast threshold, a prompt message indicating that the image frame has low contrast will be output.
[0216] If no character is detected in the image frame, a prompt message indicating that there are no characters in the image frame will be output.
[0217] If a periodic black image region is detected in an image frame, a prompt message will be output indicating that the frame rate of the scanning device is inconsistent with the refresh rate of the scanned device.
[0218] The scanning pen provided in this embodiment belongs to the same concept as the image quality evaluation method provided in the above embodiments of this application. It can execute the image quality evaluation method provided in any of the above embodiments of this application and has the corresponding functional modules and beneficial effects for executing the image quality evaluation method. Technical details not described in detail in this embodiment can be found in the specific processing content of the image quality evaluation method provided in the above embodiments of this application, and will not be repeated here.
[0219] Another embodiment of this application provides a storage medium storing a computer program, which, when executed by a processor, implements the various steps of the image quality evaluation method provided in any of the above embodiments.
[0220] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0221] It should be noted that the various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For apparatus embodiments, since they are basically similar to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0222] The steps in the methods of the various embodiments of this application can be adjusted, combined, or deleted according to actual needs.
[0223] The modules and sub-modules in the various embodiments of the present application's devices and terminals can be merged, divided, and deleted according to actual needs.
[0224] It should be understood that the disclosed terminals, devices, and methods can be implemented in other ways, given the several embodiments provided in this application. For example, the terminal embodiments described above are merely illustrative. For instance, the division of modules or sub-modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple sub-modules or modules may be combined or integrated into another module, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.
[0225] The modules or submodules described as separate components may or may not be physically separate. The components that constitute a module or submodule may or may not be physical modules or submodules; that is, they may be located in one place or distributed across multiple network modules or submodules. Some or all of the modules or submodules can be selected to achieve the purpose of this embodiment's solution, depending on actual needs.
[0226] Furthermore, the functional modules or sub-modules in the various embodiments of this application can be integrated into one processing module, or each module or sub-module can exist physically separately, or two or more modules or sub-modules can be integrated into one module. The integrated modules or sub-modules described above can be implemented in hardware or in the form of software functional modules or sub-modules.
[0227] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0228] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software unit executed by a processor, or a combination of both. The software unit can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0229] Finally, 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, 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.
[0230] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An image quality evaluation method characterized by comprising: The method comprises the following steps: detecting the contrast of the obtained image frame, and detecting characters and black image regions from the image frame; if any one of preset conditions is detected, determining that the image quality of the image frame is unqualified; when none of the preset conditions occurs, splicing the image frame with a pre-stored historical spliced image to obtain a target spliced image; based on the text content in the target spliced image, determining an image quality evaluation result of the target spliced image; wherein the preset conditions include that the contrast of the image frame is lower than a preset contrast threshold, that no characters exist in the image frame, and that a periodic black image region exists in the image frame.
2. The method of claim 1, wherein, The method of detecting the contrast of the obtained image frame comprises the following steps: using the pixel values of each pixel point in the image frame and a pre-set contrast calculation formula to calculate the contrast of the image frame.
3. The method of claim 1, wherein, The method of detecting characters from the image frame comprises the following steps: performing character edge extraction on the obtained image frame to obtain a character edge image frame; performing foreground dilation on the character edges in the character edge image frame to obtain a character connected component; determining whether characters exist in the image frame according to the number and size of the character connected component.
4. The method of claim 3, wherein, The method of performing character edge extraction on the obtained image frame to obtain a character edge image frame comprises the following steps: performing binarization on the image frame according to the gradient amplitude of each pixel point in the image frame and a pre-determined first binarization threshold to obtain a first binary image frame; performing non-character edge filtering on the foreground in the first binary image frame to obtain a character edge image frame.
5. The method of claim 1, wherein, The method of detecting black image regions from the image frame comprises the following steps: performing binarization on the obtained image frame using a pre-set second binarization threshold to obtain a second binary image frame; if it is determined that a black image region exists in the image frame according to the second binary image frame, recording the acquisition time of the image frame, and determining whether a periodic black image region exists in the image frame according to the acquisition time of all image frames with black image regions.
6. The method of claim 1, wherein, The method of determining an image quality evaluation result of the target spliced image based on the text content in the target spliced image comprises the following steps: performing character edge extraction and edge foreground dilation on the text content in the target spliced image to obtain a character edge map; determining the height proportion of the text content in the target spliced image according to the character connected component in the character edge map; if it is detected that the height proportion of the text content in the target spliced image exceeds a preset proportion range, determining that the image quality of the target spliced image is unqualified.
7. The method of claim 6, wherein, The method further comprises the following steps: if it is detected that the height proportion of the text content in the target spliced image exceeds a preset proportion range, outputting prompt information indicating that the characters in the target spliced image are too large or too small.
8. The method of claim 6, wherein, The method further comprises the following steps: when the height proportion of the text content in the target spliced image does not exceed a preset proportion range, performing text recognition on the target spliced image; based on the text recognition result of the target spliced image, determining whether the image quality of the target spliced image is qualified.
9. The method of claim 8, wherein, Based on the text recognition result of the target spliced image, it is determined whether the image quality of the target spliced image is qualified, comprising: Obtaining the posterior probability of a preset number of text recognition results in the text recognition results of all the target spliced images; According to the posterior probability of the preset number of text recognition results, the posterior probability variance is calculated; If the posterior probability variance is less than the preset variance threshold, it is determined that the image quality of the target spliced image is unqualified; If the posterior probability variance is not less than the preset variance threshold, it is determined that the image quality of the target spliced image is qualified.
10. The method of claim 9, wherein, Also including: If it is detected that the posterior probability variance is less than the preset variance threshold, the recognition confidence corresponding to the posterior probability variance is output.
11. The method of claim 1, wherein, Also including: If it is detected that the contrast of the image frame is lower than the preset contrast threshold, prompt information indicating that the contrast of the image frame is low is output; If it is detected that there is no character in the image frame, prompt information indicating that there is no character in the image frame is output; If it is detected that there is a periodic black image area in the image frame, prompt information indicating that the frame rate of the scanning device is inconsistent with the screen brushing frequency of the scanned device is output.
12. An image quality evaluation apparatus characterized by comprising: Including: A detection module for detecting the contrast of the obtained image frame, and detecting characters and black image areas from the image frame; An image frame quality evaluation module for determining that the image quality of the image frame is unqualified if any one of the preset conditions occurs; A splicing module for splicing the image frame with a pre-stored historical spliced image to obtain a target spliced image when none of the preset conditions occurs; A spliced image quality evaluation module for determining an image quality evaluation result of the target spliced image based on the text content in the target spliced image; The preset conditions include that the contrast of the image frame is lower than a preset contrast threshold, there is no character in the image frame, and there is a periodic black image area in the image frame.
13. An electronic device, comprising: Including: A memory and a processor; The memory is connected with the processor and is used for storing programs; The processor is used for realizing the image quality evaluation method in any one of claims 1 to 11 by running the programs in the memory.
14. A scanning pen, characterized by Including: A scanning camera and a processor connected with the scanning camera; The scanning camera is used for collecting image frames and sending the image frames to the processor; The processor is used for detecting the contrast of the obtained image frame, and detecting characters and black image areas from the image frame; If any one of the preset conditions occurs, it is determined that the image quality of the image frame is unqualified; When none of the preset conditions occurs, the image frame is spliced with a pre-stored historical spliced image to obtain a target spliced image; Based on the text content in the target spliced image, an image quality evaluation result of the target spliced image is determined; The preset conditions include that the contrast of the image frame is lower than a preset contrast threshold, there is no character in the image frame, and there is a periodic black image area in the image frame.
15. A storage medium, characterized by The storage medium has stored thereon a computer program which, when executed by a processor, implements the image quality evaluation method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Method and device for improving video quality, readable storage medium and electronic equipment
CN113315995A
Imaging adjustment method and device during screen scanning, storage medium and equipment
CN114268703A
Method and apparatus for summarizing a document without document image decoding
US5491760A