A method, device, terminal and storage medium for extracting image content

By performing high contrast retention processing, image fusion and linear light enhancement processing on the writing board images, the problem of incomplete and fractured image content extraction in the prior art is solved, and higher image content extraction integrity is achieved.

CN113628196BActive Publication Date: 2025-02-18GUANGDONG XIAOTIANCAI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110938232.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-16
Publication Date
2025-02-18
Estimated Expiration
2041-08-16

AI Technical Summary

Technical Problem

In the prior art, when extracting students' calculations and painting content on a handwriting board, the problem of incomplete and broken image content is prone to occur. The main reason is that the pixel values ​​in the image are not within a certain threshold range due to the uneven force of the students.

Method used

By acquiring the image to be processed, high contrast retention processing and image fusion are performed, and linear light enhancement processing is performed on the fused image to enhance the pixel value difference between the pixel area corresponding to the image content and the pixel area corresponding to the non-image content, thereby improving image content extraction integrity.

Benefits of technology

This method can effectively enhance the information display of image content, improve the integrity of image content extraction, and avoid incomplete extraction and fracture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113628196B_ABST
    Figure CN113628196B_ABST
Patent Text Reader

Abstract

The present application is applicable to the field of image processing, and provides a method, device, terminal and storage medium for extracting image content. The above-mentioned method for extracting image content specifically includes: obtaining an image to be processed; performing high-contrast retention processing on the image to be processed to obtain a high-contrast image of the image to be processed; performing image fusion on the image to be processed and the high-contrast image to obtain a fused image; performing linear light enhancement processing on the fused image to obtain a linear light enhanced image; and taking the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed. The embodiments of the present application can improve the integrity of graphic content extraction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of image processing, and in particular, relates to a method, device, terminal and storage medium for extracting image content. Background Art

[0002] Currently, there are more and more hardware products used to help students learn, and a handwriting tablet is one of them. A handwriting tablet can record the characters, graffiti, and other content left by students when they calculate and draw on the handwriting tablet. The handwriting tablet or a device connected to the handwriting tablet can use the image of the handwriting tablet to extract the image content for data analysis, so as to achieve the effect of assisting students in learning and education.

[0003] At present, the common image content extraction scheme generally uses threshold segmentation to segment the image content in the image. In actual applications, students do not apply uniform strength when calculating and drawing on the handwriting board, and the pixel values ​​corresponding to the image content such as characters and graffiti in the image do not all fall within a certain threshold range. Therefore, the use of threshold segmentation schemes often results in incomplete image content extraction and fragmented image content. Summary of the invention

[0004] The embodiments of the present application provide a method, device, terminal and storage medium for extracting image content, which can improve the integrity of image content extraction.

[0005] A first aspect of an embodiment of the present application provides a method for extracting image content, comprising:

[0006] Get the image to be processed;

[0007] Performing high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed;

[0008] Performing image fusion on the image to be processed and the high-contrast image to obtain a fused image;

[0009] Performing linear light enhancement processing on the fused image to obtain a linear light enhanced image;

[0010] The first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range is used as the image content of the image to be processed.

[0011] A second aspect of an embodiment of the present application provides a device for extracting image content, comprising:

[0012] An image acquisition unit, used for acquiring an image to be processed;

[0013] A high contrast retention unit, used for performing high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed;

[0014] An image fusion unit, used for fusing the image to be processed and the high-contrast image to obtain a fused image;

[0015] A linear light enhancement unit, used for performing linear light enhancement processing on the fused image to obtain a linear light enhanced image;

[0016] The image content extraction unit is used to take the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed.

[0017] A third aspect of an embodiment of the present application provides a terminal, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0018] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0019] A fifth aspect of an embodiment of the present application provides a computer program product, which, when executed on a terminal, enables the terminal to implement the steps of the method.

[0020] In an embodiment of the present application, by acquiring an image to be processed and performing high-contrast retention processing on the image to be processed to obtain a high-contrast image of the image to be processed, then, the image to be processed and the high-contrast image are fused to obtain a fused image, and then the fused image is subjected to linear light enhancement processing to obtain a linear light enhanced image. This can enhance the difference in pixel value between the pixel area corresponding to the image content and the pixel area corresponding to the non-image content in the image to be processed, strengthen the information display of the image content in the image, and make the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed, so that the integrity of the image content extraction is higher. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0022] Figure 1 This is a schematic diagram of an implementation flow of a method for extracting image content provided in an embodiment of the present application;

[0023] Figure 2is a schematic diagram of an original image provided in an embodiment of the present application;

[0024] Figure 3 is a schematic diagram of a first inversion diagram provided in an embodiment of the present application;

[0025] Figure 4 This is a schematic diagram of a specific implementation process of sharpening the first inverted image provided by an embodiment of the present application;

[0026] Figure 5 is a schematic diagram of a second sharpened image provided by an embodiment of the present application;

[0027] Figure 6 is a schematic diagram of a high-contrast image provided in an embodiment of the present application;

[0028] Figure 7 is a schematic diagram of a fused image provided in an embodiment of the present application;

[0029] Figure 8 is a schematic diagram of an image content provided by an embodiment of the present application;

[0030] Fig. 9 is a schematic diagram of a target image provided in an embodiment of the present application;

[0031] Fig.10 It is a structural schematic diagram of an image content extraction device provided in an embodiment of the present application;

[0032] Fig.11 It is a schematic diagram of the structure of the terminal provided in the embodiment of the present application. DETAILED DESCRIPTION

[0033] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0034] Currently, there are more and more hardware products used to help students learn, and a handwriting tablet is one of them. A handwriting tablet can record the characters, graffiti, and other content left by students when they calculate and draw on the handwriting tablet. The handwriting tablet or a device connected to the handwriting tablet can use the image of the handwriting tablet to extract the image content for data analysis, so as to achieve the effect of assisting students in learning and education.

[0035] At present, the common image content extraction scheme generally uses threshold segmentation to segment the image content in the image. In actual applications, students do not apply uniform strength when calculating and drawing on the handwriting board, and the pixel values ​​corresponding to the image content such as characters and graffiti in the image do not all fall within a certain threshold range. Therefore, the use of threshold segmentation schemes often results in incomplete image content extraction and fragmented image content.

[0036] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0037] Figure 1 A schematic diagram of an implementation flow of a method for extracting image content provided in an embodiment of the present application is shown. The method can be applied to a terminal and is suitable for situations where the integrity of image content extraction needs to be improved.

[0038] The terminal may be a handwriting tablet with certain processing capabilities, a terminal device connected to the handwriting tablet, or other terminal devices that need to extract characters from an image.

[0039] Specifically, the above-mentioned method for extracting image content may include the following steps S101 to S105.

[0040] Step S101, obtaining an image to be processed.

[0041] The image to be processed refers to an image containing image contents such as characters, graffiti, etc. to be extracted. In the implementation of the present application, different character images to be processed can be selected according to actual conditions.

[0042] In some embodiments of the present application, the above-mentioned terminal can obtain the original image obtained by photographing the handwriting board; perform inversion processing on the original image to obtain a first inversion image of the original image; perform sharpening processing on the first inversion image, and use the second sharpened image obtained after the sharpening processing as the image to be processed.

[0043] Specifically, the inverting process of the original image may include: subtracting the pixel value of each pixel in the original image from the set pixel value to obtain a first inverted image of the original image. The set pixel value may be 255, that is, for each pixel in the original image, the original pixel value of the pixel in the original image is subtracted from 255 to obtain the pixel value of the pixel in the first inverted image.

[0044] like Figure 2 The present application shows an original image obtained by capturing a handwriting tablet, and the first inverted image corresponding to the original image is shown in FIG. Figure 3 shown.

[0045] In order to make the blurred character edges in the first inverted image clearer, after obtaining the first inverted image, the first inverted image may be sharpened. Figure 4 As shown, the above-mentioned sharpening process for the first inverted image may specifically include the following steps S401 to S402.

[0046] Step S401, performing Gaussian filtering on the first inverted image to obtain a Gaussian blurred image of the first inverted image.

[0047] Specifically, the above-mentioned Gaussian filtering process is an image blurring algorithm, which can make each pixel in the output Gaussian blurred image a weighted sum of the corresponding pixel on the original image and the surrounding pixels based on a Gaussian template (convolution kernel).

[0048] The present application does not limit the specific method of Gaussian filtering, and in some embodiments of the present application, bilateral filtering can be used. More specifically, it can be implemented by the bilateral filtering function provided by OpenCV, wherein the parameter kernel size of the bilateral filtering function can be set to 11, that is, the size of the Gaussian template (convolution kernel) can be 11; the parameters sigmaColor and sigmaSpace of the bilateral filtering function can be set to 0, that is, the standard deviation of the color space and the standard deviation of the coordinate space are both 0.

[0049] Step S402 , weighting the pixel values ​​of each second pixel point in the first inverted image and the pixel values ​​of the pixel points at the same position as each second pixel point in the Gaussian blurred image of the first inverted image to obtain a second sharpened image.

[0050] Specifically, in some embodiments of the present application, the product of the pixel value of each second pixel point in the first inverted image and the first weight value can be calculated, and the product of the pixel value of the pixel point at the same position as each second pixel point in the Gaussian blurred image of the inverted image and the second weight value can be calculated. Then, the product of the pixel value of each second pixel point in the first inverted image and the first weight value and the product of the pixel value of the pixel point at the same position as each second pixel point in the Gaussian blurred image of the first inverted image and the second weight value are added to obtain a second sharpened image.

[0051] That is to say, the pixel value of a pixel point in the second sharpened image is the product of the pixel value of the pixel point at the same position in the first inverted image and the first weight value, plus the sum of the product of the pixel value of the pixel point at the same position in the Gaussian blurred image and the second weight value.

[0052] The specific values ​​of the first weight value and the second weight value can be adjusted according to actual conditions. In some implementations of the present application, the first weight value can be 2, and the second weight value can be -1.

[0053] Figure 5 Shows the Figure 3 The second sharpened image is obtained by sharpening the first inverted image.

[0054] In some other embodiments of the present application, the terminal may also directly obtain an original image obtained by photographing the handwriting board, perform sharpening processing on the original image, and use a first sharpened image obtained after the sharpening processing as the image to be processed.

[0055] The process of sharpening the original image can refer to the description of the process of sharpening the first inverted image, which will not be described in detail in this application.

[0056] It should be noted that in the embodiments of the present application, the terminal may select one of the two aforementioned methods to obtain a sharpened image based on the material of the handwriting board and the color of the characters on the handwriting board as the character image to be processed.

[0057] In actual applications, the camera may include the background outside the handwriting board into the original image when photographing the handwriting board, that is, only part of the pixel area in the original image is the pixel area corresponding to the handwriting board. Therefore, in order to facilitate subsequent processing and avoid noise in the extracted characters, in some embodiments of the present application, after obtaining the original image obtained by photographing the handwriting board, image recognition can be performed on the original image to obtain the pixel area corresponding to the handwriting board in the original image, and then the pixel area corresponding to the handwriting board is processed with perspective change to obtain the handwriting board image.

[0058] That is to say, in some other embodiments of the present application, the terminal may also obtain an original image obtained by photographing a handwriting board; perform image recognition on the original image to obtain a pixel area corresponding to the handwriting board in the original image; perform perspective change processing on the pixel area corresponding to the handwriting board to obtain a handwriting board image; perform sharpening processing on the handwriting board image, and use the third sharpened image obtained after the sharpening processing as the image to be processed. Alternatively, obtain an original image obtained by photographing a handwriting board; perform image recognition on the original image to obtain a pixel area corresponding to the handwriting board in the original image; perform perspective change processing on the pixel area corresponding to the handwriting board to obtain a handwriting board image; perform inversion processing on the handwriting board image to obtain a second inversion image of the handwriting board image; perform sharpening processing on the second inversion image, and use the fourth sharpened image obtained after the sharpening processing as the image to be processed.

[0059] Specifically, the present application does not limit the specific method of image recognition. In some embodiments of the present application, the terminal can input the original image into a pre-trained handwriting board recognition model, and the handwriting board recognition model outputs the pixel area corresponding to the handwriting board in the original image.

[0060] The handwriting tablet recognition model may be a YOLO model.

[0061] Specifically, in some embodiments of the present application, the training process of the handwriting board recognition model may include: obtaining a sample image set, wherein the sample image set includes a plurality of sample original images obtained by photographing the handwriting board. At the same time, the staff may pre-mark the pixel areas corresponding to the handwriting board in each original image. Then, select the target training samples from the sample image set, input each target training sample into the network model to be trained, obtain the pixel area corresponding to the handwriting board output by the network model to be trained, and based on the pre-marked pixel area corresponding to the handwriting board, calculate the accuracy of the network model to be trained. If the accuracy of the network model to be trained is less than the accuracy threshold, adjust the parameters in the network model to be trained, and re-execute the step of selecting the target training sample from the sample image set and the subsequent steps until the accuracy of the network model to be trained is greater than or equal to the accuracy threshold, and obtain the handwriting board recognition model.

[0062] At this time, the terminal can obtain the pixel area corresponding to the handwriting board in the original image by using the trained handwriting board recognition model.

[0063] After obtaining the pixel area corresponding to the handwriting board in the original image, in some embodiments of the present application, the terminal may perform perspective change processing on the pixel area corresponding to the handwriting board to obtain a handwriting board image. The perspective change processing refers to projecting the pixel area corresponding to the handwriting board onto a new visual plane to obtain a handwriting board image, which can realize the correction of the pixel area corresponding to the handwriting board in the original image and avoid the interference of information outside the handwriting board area in the original image on the image content extraction unit.

[0064] Step S102, performing high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed.

[0065] In an embodiment of the present application, since there is a certain difference in pixel value between the pixel area corresponding to the characters in the character image to be processed and the pixel area corresponding to other than the characters, the terminal can highlight the boundary information of the characters in the character image to be processed through high contrast retention processing.

[0066] In some embodiments of the present application, the high-contrast retention processing of the character image to be processed may specifically include: performing Gaussian filtering on the character image to be processed to obtain a Gaussian blurred image of the character image to be processed, and then, for a pixel point at a certain position of the character image to be processed, based on the pixel value of the pixel point, the pixel value of the pixel point at the same position as the pixel point in the Gaussian blurred image, and the set pixel value, determine the pixel value of the pixel point at the same position as the pixel point in the high-contrast image. The set pixel value may be adjusted according to actual conditions. In some embodiments of the present application, the set pixel value may be 127.

[0067] More specifically, the pixel value of a pixel in the high-contrast image is equal to the pixel value of the pixel at the same position in the character image to be processed minus the pixel value of the pixel at the same position in the Gaussian blurred image, and the value obtained by adding the difference to the set pixel value.

[0068] Figure 6 Shows the Figure 5 The image to be processed shown is subjected to high contrast retention processing to obtain a high contrast image.

[0069] In an embodiment of the present application, high-contrast retention processing can be used to mix a Gaussian blurred image obtained by smoothing the image to be processed and a high-frequency image to be processed, thereby retaining edge information in the image to be processed, that is, highlighting the boundary information of characters in the character image to be processed.

[0070] Step S103, performing image fusion on the image to be processed and the high-contrast image to obtain a fused image.

[0071] Specifically, the above-mentioned image fusion refers to adding the pixel value of a pixel point in the character image to be processed and the pixel value of the pixel point at the same position as the pixel point in the high-contrast image to obtain the pixel value of the pixel point at the same position as the pixel point in the fused image.

[0072] Step S104: perform linear light enhancement processing on the fused image to obtain a linear light enhanced image.

[0073] In some embodiments of the present application, the linear light enhancement processing specifically includes: normalizing each third pixel point in the fused image to obtain a first normalized pixel value corresponding to each third pixel point; determining a linear light value of each fourth pixel point; and adding the first normalized pixel value of each fourth pixel point in the fused image to the linear light value corresponding thereto to obtain a linear light enhanced image. Each of the fourth pixel points is a third pixel point whose first normalized pixel value among the third pixel points is within a preset value range.

[0074] In some embodiments of the present application, the linear light value of each of the fourth pixel points may be a linear light value calculated based on its first normalized pixel value and the second normalized pixel value of the pixel point at the same position in the high-contrast image. The linear light value may be used to enhance the contrast of the fused image.

[0075] Specifically, the terminal can normalize the pixel values ​​of each third pixel point, for example, the pixel values ​​of each third pixel point can be divided by 255 to obtain the first normalized pixel value corresponding to each third pixel point, and the first normalized pixel values ​​are all within [0, 1]. For a third pixel point, if the first normalized pixel value corresponding to it is not within the preset numerical range, the linear light value can be not increased; if the first normalized pixel value corresponding to it is within the preset numerical range, at this time, the third pixel point is the fourth pixel point, then the terminal can also normalize the high-contrast image to obtain the second normalized pixel value of each pixel point in the high-contrast image, and based on the first normalized pixel value corresponding to the fourth pixel point and the second normalized pixel value corresponding to the pixel point at the same position in the high-contrast image, calculate the linear light value corresponding to the fourth pixel point. Among them, the preset numerical range can be selected according to the actual situation. In some embodiments of the present application, the preset numerical range can be a value other than 0.5.

[0076] More specifically, if the corresponding first normalized pixel value is within the preset value range, the corresponding linear light value is equal to the first normalized pixel value minus the product of the second normalized pixel value corresponding to the pixel point at the same position in the high-contrast image and 2, and then the difference is subtracted by 1. It can be understood that the obtained linear light value is also a normalized value.

[0077] In order to ensure that the pixel values ​​in the obtained linear light enhanced image do not exceed a reasonable range, in some embodiments of the present application, the above-mentioned adding the first normalized pixel values ​​of each fourth pixel point in the fused image to the linear light values ​​corresponding thereto to obtain the linear light enhanced image may specifically include: adding the first normalized pixel values ​​of each fourth pixel point in the fused image to the linear light values ​​corresponding thereto to obtain the third normalized pixel values ​​corresponding to each fourth pixel point; performing numerical verification on the third normalized pixel values ​​corresponding to each fourth pixel point, and determining the fourth normalized pixel values ​​corresponding to each fourth pixel point according to the verification result of the numerical verification to obtain the linear light enhanced image.

[0078] Specifically, in some embodiments of the present application, the first normalized pixel value of each fourth pixel in the fused image can be added to the linear light value corresponding thereto to obtain the third normalized pixel value corresponding to each fourth pixel, and then the third normalized pixel value corresponding to each fourth pixel is numerically checked. If the verification result of the numerical check is that the third normalized pixel value corresponding to a fourth pixel is greater than 1, the first pixel value of the first pixel is set to 1; if the verification result of the numerical check is that the third normalized pixel value corresponding to a fourth pixel is less than 0, the first pixel value of the first pixel is set to 0; if the verification result of the numerical check is that the third normalized pixel value corresponding to a fourth pixel is greater than or equal to 0 and less than or equal to 1, the corresponding third normalized pixel value is retained and the third normalized pixel value is replaced by the fourth normalized pixel value. Therefore, according to the verification result of the numerical check, the above terminal can determine the fourth normalized pixel value corresponding to each fourth pixel to obtain a linear light enhanced image.

[0079] Figure 7 Shows the Figure 5 The image to be processed and Figure 6 The high-contrast image shown is subjected to image fusion to obtain a fused image, and a linear light enhanced image is obtained.

[0080] In an embodiment of the present application, through high-contrast retention processing, image fusion processing and linear light enhancement, the difference in pixel value between the pixel area corresponding to the character and other pixel points can be enlarged, so that the pixel area corresponding to the character in the character image to be processed is strengthened.

[0081] Step S105: taking the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed.

[0082] The above-mentioned preset pixel value range refers to the range of pixel values ​​of pixel points corresponding to the image content.

[0083] In an embodiment of the present application, if the pixel value of a first pixel point in the linear light enhanced image is within a preset pixel value range, it means that the first pixel point belongs to the pixel point corresponding to the image content, and if the pixel value of a first pixel point in the linear light enhanced image is outside the preset pixel value range, it means that the first pixel point does not belong to the pixel point corresponding to the image content.

[0084] Specifically, in some embodiments of the present application, the terminal may traverse each first pixel point, and if the pixel value of a first pixel point is outside a preset pixel value range, the pixel value of the first pixel point is set to 0 to remove the pixel point, and if the pixel value of a first pixel point is within the preset pixel value range, the pixel value of the first pixel point is retained. After traversing all first pixel points in the linear light enhanced image, the first pixel points within the preset pixel value range may be used as image content of the image to be processed.

[0085] Figure 8 Shows from Figure 7 The image content obtained after the linear light enhancement image shown is processed.

[0086] It should be noted that, based on the different materials of the handwriting board and the color of the characters, the above-mentioned preset pixel value range can be adjusted according to the actual situation. Specifically, the preset pixel value range can be determined based on a large number of histograms, each of which counts the pixel value of the first pixel point in different linear light enhanced images. In some embodiments of the present application, the preset pixel value range can be set to be greater than or equal to 230, that is, the normalized pixel value corresponding to the preset pixel value range is greater than or equal to 0.9.

[0087] In an embodiment of the present application, by acquiring an image to be processed and performing high-contrast retention processing on the image to be processed to obtain a high-contrast image of the image to be processed, then, the image to be processed and the high-contrast image are fused to obtain a fused image, and then the fused image is subjected to linear light enhancement processing to obtain a linear light enhanced image. This can enhance the difference in pixel value between the pixel area corresponding to the image content and the pixel area corresponding to the non-image content in the image to be processed, strengthen the information display of the image content in the image, and make the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed, so that the integrity of the image content extraction is higher.

[0088] Furthermore, compared with manually performing cutout processing on the image to be processed, the image content extraction method provided in the present application can achieve real-time and batch processing effects.

[0089] Furthermore, the above-mentioned method for extracting image content may also include: superimposing the image content of the character image to be processed on the target background to obtain the target image, and displaying the target image.

[0090] Among them, the target background can be set according to user needs.

[0091] In some embodiments of the present application, the target background may be a background image with a pixel value of 255. For example, Fig. 9 Shows the Figure 8The target image is obtained by superimposing the image content shown on a background image with a pixel value of 255.

[0092] In the implementation manner of the present application, the terminal can obtain a target image by superimposing the image content of the image to be processed onto the target background. The target background is generally different in color from the image content, so the image content in the obtained target image is further highlighted. At this time, the terminal can display the target image to allow the user to better view the image content.

[0093] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders.

[0094] like Fig.10 FIG. 1 is a schematic diagram of the structure of an image content extraction device 1000 provided in an embodiment of the present application. The image content extraction device 1000 is configured on a terminal.

[0095] Specifically, the image content extraction device 1000 may include:

[0096] An image acquisition unit 1001 is used to acquire an image to be processed;

[0097] A high contrast retention unit 1002 is used to perform high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed;

[0098] An image fusion unit 1003 is used to fuse the image to be processed and the high-contrast image to obtain a fused image;

[0099] A linear light enhancement unit 1004 is used to perform linear light enhancement processing on the fused image to obtain a linear light enhanced image;

[0100] The image content extraction unit 1005 is configured to take the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed.

[0101] In some embodiments of the present application, the above-mentioned image acquisition unit 1001 can also be specifically used to: acquire the original image obtained by photographing the handwriting board, sharpen the original image, and use the first sharpened image obtained after the sharpening process as the image to be processed.

[0102] In some embodiments of the present application, the above-mentioned image acquisition unit 1001 can also be specifically used to: acquire the original image obtained by photographing the handwriting board; perform inversion processing on the original image to obtain a first inversion image of the original image; perform sharpening processing on the first inversion image, and use the second sharpened image obtained after the sharpening processing as the image to be processed.

[0103] In some embodiments of the present application, the above-mentioned image acquisition unit 1001 can also be specifically used to: perform Gaussian filtering on the first inverted image to obtain a Gaussian blurred image of the first inverted image; weightedly process the pixel values ​​of each second pixel point in the first inverted image and the pixel values ​​of the pixel points at the same position as the each second pixel point in the Gaussian blurred image of the first inverted image to obtain the second sharpened image.

[0104] In some embodiments of the present application, the above-mentioned image acquisition unit 1001 can also be specifically used to: acquire the original image obtained by photographing the handwriting board; perform image recognition on the original image to obtain the pixel area corresponding to the handwriting board in the original image; perform perspective change processing on the pixel area corresponding to the handwriting board to obtain a handwriting board image; perform sharpening processing on the handwriting board image, and use the third sharpened image obtained after the sharpening processing as the image to be processed.

[0105] In some embodiments of the present application, the above-mentioned image acquisition unit 1001 can also be specifically used to: acquire the original image obtained by photographing the handwriting board; perform image recognition on the original image to obtain the pixel area corresponding to the handwriting board in the original image; perform perspective change processing on the pixel area corresponding to the handwriting board to obtain a handwriting board image; perform inversion processing on the handwriting board image to obtain a second inversion image of the handwriting board image; perform sharpening processing on the second inversion image, and use the fourth sharpened image obtained after the sharpening processing as the image to be processed.

[0106] In some embodiments of the present application, the linear light value of each of the above-mentioned fourth pixel points is a linear light value calculated based on its first normalized pixel value and the second normalized pixel value of the pixel point at the same position in the high-contrast image.

[0107] In some embodiments of the present application, the linear light enhancement unit 1004 may also be specifically used to: add the first normalized pixel values ​​of the fourth pixels in the fused image to the linear light values ​​corresponding thereto, respectively, to obtain the third normalized pixel values ​​corresponding to the fourth pixels; perform numerical verification on the third normalized pixel values ​​corresponding to the fourth pixels, respectively, and determine the fourth normalized pixel values ​​corresponding to the fourth pixels, respectively, according to the verification results of the numerical verification, to obtain the linear light enhanced image.

[0108] It should be noted that, for the convenience and simplicity of description, the specific working process of the above-mentioned image content extraction device 1000 can refer to Figures 1 to 9 The corresponding process of the method will not be repeated here.

[0109] like Fig.11 , which is a schematic diagram of a terminal provided in an embodiment of the present application. The terminal may be a handwriting board with certain processing capabilities, a terminal device connected to a handwriting board, or other terminal devices that need to extract characters from an image.

[0110] Specifically, the terminal 11 may include: a processor 110, a memory 111, and a computer program 112 stored in the memory 111 and executable on the processor 110, such as an image content extraction program. When the processor 110 executes the computer program 112, the steps in the above-mentioned various image content extraction method embodiments are implemented, such as Figure 1 Alternatively, when the processor 110 executes the computer program 112, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Fig.10 The image acquisition unit 1001, the high contrast retention unit 1002, the image fusion unit 1003, the linear light enhancement unit 1004 and the image content extraction unit 1005 are shown.

[0111] The computer program may be divided into one or more modules / units, which are stored in the memory 111 and executed by the processor 110 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the terminal.

[0112] For example, the computer program may be divided into: an image acquisition unit, a high contrast preservation unit, an image fusion unit, a linear light enhancement unit, and an image content extraction unit.

[0113] The specific functions of each unit are as follows: an image acquisition unit, used to acquire an image to be processed; a high-contrast retention unit, used to perform high-contrast retention processing on the image to be processed to obtain a high-contrast image of the image to be processed; an image fusion unit, used to perform image fusion on the image to be processed and the high-contrast image to obtain a fused image; a linear light enhancement unit, used to perform linear light enhancement processing on the fused image to obtain a linear light enhanced image; an image content extraction unit, used to use the first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed.

[0114] The terminal may include, but is not limited to, a processor 110 and a memory 111. Those skilled in the art will appreciate that Fig.11 It is only an example of a terminal and does not constitute a limitation on the terminal. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the terminal may also include input and output devices, network access devices, buses, etc.

[0115] The processor 110 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0116] The memory 111 may be an internal storage unit of the terminal, such as a hard disk or memory of the terminal. The memory 111 may also be an external storage device of the terminal, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal. Further, the memory 111 may also include both an internal storage unit of the terminal and an external storage device. The memory 111 is used to store the computer program and other programs and data required by the terminal. The memory 111 may also be used to temporarily store data that has been output or is to be output.

[0117] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0118] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0119] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0120] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminals and methods can be implemented in other ways. For example, the device / terminal embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0121] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0123] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0124] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A method for extracting image content, characterized in that: include: Get the image to be processed; Performing high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed; Performing image fusion on the image to be processed and the high-contrast image to obtain a fused image; Performing linear light enhancement processing on the fused image to obtain a linear light enhanced image; Taking a first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed; The linear light enhancement processing is performed on the fused image to obtain a linear light enhanced image, including: normalizing each third pixel point in the fused image to obtain a first normalized pixel value corresponding to each third pixel point; determining the linear light value of each fourth pixel point, wherein each fourth pixel point among the fourth pixel points is a third pixel point whose first normalized pixel value among the third pixel points is within a preset value range; the linear light value of each fourth pixel point among the fourth pixel points is a linear light value calculated based on its first normalized pixel value and the second normalized pixel value of the pixel point at the same position in the high-contrast image; adding the first normalized pixel value of each fourth pixel point in the fused image to the linear light value corresponding thereto to obtain the third normalized pixel value corresponding to each fourth pixel point; performing a numerical check on the third normalized pixel value corresponding to each fourth pixel point, and determining the fourth normalized pixel value corresponding to each fourth pixel point according to the check result of the numerical check to obtain the linear light enhanced image.

2. The method for extracting image content according to claim 1, characterized in that: The step of obtaining the image to be processed comprises: Acquire an original image obtained by photographing a handwriting tablet, perform sharpening processing on the original image, and use a first sharpened image obtained after the sharpening processing as the image to be processed; Alternatively, an original image is obtained by photographing a handwriting tablet; the original image is inverted to obtain a first inverted image of the original image; the first inverted image is sharpened, and a second sharpened image obtained after the sharpening is used as the image to be processed.

3. The method for extracting image content according to claim 2, characterized in that: The sharpening process of the first inverted image comprises: Performing Gaussian filtering on the first inverted phase image to obtain a Gaussian blurred image of the first inverted phase image; The pixel values ​​of each second pixel point in the first inverted image and the pixel values ​​of the pixel points at the same position as the second pixel points in the Gaussian blurred image of the first inverted image are weighted to obtain the second sharpened image.

4. The method for extracting image content according to claim 1, characterized in that: The obtaining of the image to be processed further includes: Acquire an original image obtained by photographing a handwriting tablet; perform image recognition on the original image to obtain a pixel area corresponding to the handwriting tablet in the original image; perform perspective change processing on the pixel area corresponding to the handwriting tablet to obtain a handwriting tablet image; perform sharpening processing on the handwriting tablet image, and use a third sharpened image obtained after the sharpening processing as the image to be processed; Alternatively, an original image is obtained by photographing a handwriting board; image recognition is performed on the original image to obtain a pixel area corresponding to the handwriting board in the original image; perspective change processing is performed on the pixel area corresponding to the handwriting board to obtain a handwriting board image; inversion processing is performed on the handwriting board image to obtain a second inversion image of the handwriting board image; sharpening processing is performed on the second inversion image, and a fourth sharpened image obtained after the sharpening processing is used as the image to be processed.

5. A device for extracting image content, characterized in that: include: An image acquisition unit, used for acquiring an image to be processed; A high contrast retention unit, used for performing high contrast retention processing on the image to be processed to obtain a high contrast image of the image to be processed; An image fusion unit, used for fusing the image to be processed and the high-contrast image to obtain a fused image; A linear light enhancement unit, used for performing linear light enhancement processing on the fused image to obtain a linear light enhanced image; An image content extraction unit, configured to take a first pixel point in the linear light enhanced image whose pixel value is within a preset pixel value range as the image content of the image to be processed; The linear light enhancement unit is used to: normalize each third pixel point in the fused image to obtain a first normalized pixel value corresponding to each third pixel point; Determine the linear light value of each fourth pixel point, each of the fourth pixel points is a third pixel point of the third pixel points whose first normalized pixel value is within a preset value range; the linear light value of each of the fourth pixel points is a linear light value calculated based on its first normalized pixel value and the second normalized pixel value of the pixel point at the same position in the high-contrast image; add the first normalized pixel value of each fourth pixel point in the fused image to the linear light value corresponding thereto, respectively, to obtain the third normalized pixel value corresponding to each fourth pixel point; A numerical check is performed on the third normalized pixel values ​​respectively corresponding to the fourth pixel points, and the fourth normalized pixel values ​​respectively corresponding to the fourth pixel points are determined according to the check result of the numerical check to obtain the linear light enhanced image.

6. A terminal comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.

7. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Question searching method based on image preprocessing and learning equipment

    CN111027556A

  • Image processing method and device, electronic equipment and storage medium

    CN112967207A