WO2024027583A1 - 图像处理方法、装置、电子设备和可读存储介质 - Google Patents

图像处理方法、装置、电子设备和可读存储介质 Download PDF

Info

Publication number
WO2024027583A1
WO2024027583A1 PCT/CN2023/109785 CN2023109785W WO2024027583A1 WO 2024027583 A1 WO2024027583 A1 WO 2024027583A1 CN 2023109785 W CN2023109785 W CN 2023109785W WO 2024027583 A1 WO2024027583 A1 WO 2024027583A1
Authority
WO
WIPO (PCT)
Prior art keywords
map
brightness
text content
difference
brightness map
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2023/109785
Other languages
English (en)
French (fr)
Inventor
朱泽基
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Publication of WO2024027583A1 publication Critical patent/WO2024027583A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/92Dynamic range modification of images or parts thereof based on global image properties
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30176Document

Definitions

  • This application belongs to the field of artificial intelligence technology, and specifically relates to an image processing method, device, electronic equipment and readable storage medium.
  • some text content such as some product information
  • the text content in the image may not be clear enough due to factors such as the shooting environment and shooting angle. Therefore, the user needs to process the image to make the text content in the image clearer.
  • the purpose of the embodiments of the present application is to provide an image processing method that can solve the problem in the prior art that the image quality is reduced due to changing the properties of the image itself when improving the clarity of the text content in the image.
  • embodiments of the present application provide an image processing method, which method includes obtaining a first brightness map corresponding to a first image and a first color difference map corresponding to the first image; obtaining the first brightness map the first characteristic information of the text content in the first brightness map, and adjust the clarity of the text content in the first brightness map according to the first feature information to obtain the adjusted first brightness map; according to the first The color difference map, and the adjusted first brightness map, generate a second image.
  • embodiments of the present application provide an image processing device, which includes: an acquisition module for acquiring a first brightness map corresponding to a first image and a first color difference map corresponding to the first image; adjusting A module configured to obtain the first characteristic information of the text content in the first brightness map, and adjust the clarity of the text content in the first brightness map according to the first feature information to obtain the adjusted The first brightness map; a generating module configured to generate a second image based on the first color difference map and the adjusted first brightness map.
  • inventions of the present application provide an electronic device.
  • the electronic device includes a processor and a memory.
  • the memory stores programs or instructions that can be run on the processor.
  • the programs or instructions are processed by the processor.
  • the processor is executed, the steps of the method described in the first aspect are implemented.
  • embodiments of the present application provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the steps of the method described in the first aspect are implemented. .
  • inventions of the present application provide a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the first aspect. the method described.
  • embodiments of the present application provide a computer program product, the program product is stored in a storage medium, and the program product is executed by at least one processor to implement the method as described in the first aspect.
  • embodiments of the present application provide an electronic device configured to perform the method described in the first aspect.
  • the first brightness map and the first color difference map corresponding to the first image are respectively obtained.
  • the first feature information of the text content is extracted from the first brightness map, so as to adjust the clarity of the text content according to the first feature information to make the text content clear.
  • a second image is generated.
  • the second image is generated based on the original color difference of the first image and can retain the color of the original image. It can be seen that based on the embodiment of the present application, only the brightness of the image is processed, and the color difference of the image is not processed. On the basis of ensuring the clarity of the text content in the image, the color of the image will not be changed, thereby ensuring the clarity of the image. high quality.
  • Figure 1 is a flow chart of an image processing method according to an embodiment of the present application.
  • FIGS. 2 to 4 are model schematic diagrams of embodiments of the present application.
  • Figures 5 to 8 are schematic diagrams illustrating the image processing method according to the embodiment of the present application.
  • FIG. 9 is a block diagram of an image processing device according to an embodiment of the present application.
  • Figure 10 is one of the schematic diagrams of the hardware structure of the electronic device according to the embodiment of the present application.
  • FIG. 11 is a second schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application.
  • first, second, etc. in the description and claims of this application are used to distinguish similar objects and are not used to describe a specific order or sequence. It is to be understood that the figures so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and that "first,”"second,” etc. are distinguished Objects are usually of one type, and the number of objects is not limited. For example, the first object can be one or multiple.
  • “and/or” in the description and claims means at least one of the connected objects, The character “/" generally indicates that the related objects are in an "or” relationship.
  • the execution subject of the image processing method provided by the embodiments of the present application may be the image processing device provided by the embodiments of the present application, or an electronic device integrating the image processing device, where the image processing device may be implemented in hardware or software.
  • Figure 1 shows a flow chart of an image processing method according to an embodiment of the present application. An example is taken of applying this method to an electronic device, including:
  • Step 110 Obtain the first brightness map corresponding to the first image and the first color difference map corresponding to the first image.
  • the electronic device takes an image of the target scene as the first image.
  • the target scene includes text content.
  • text content is displayed on a large screen, and the user takes a picture of the large screen; for another example, the content on a certain paper product manual is: Text content, user photographed the product manual.
  • the text content in the first image has clarity problems, such as surrounding blur, color change, noise, etc.
  • this step based on the captured first image, corresponding image processing is performed to obtain the first brightness map and the first color difference map of the first image.
  • the first brightness map is used to reflect the brightness information of each pixel of the first image
  • the first color difference map is used to reflect the color difference information of each pixel of the first image.
  • the data format of the first image is red (Reb, R) green (Green, G) blue (Blue, B) format.
  • R, G, and B are used to represent the R color channel value, G color channel value, and B color channel value of the pixel respectively.
  • Step 120 Obtain the first feature information of the text content in the first brightness map, and adjust the clarity of the text content in the first brightness map based on the first feature information to obtain the adjusted first brightness map.
  • the first feature information of the text content is obtained based on the first brightness map.
  • the first feature information includes stroke information of the text content, outline information of the text content, overall information of the text content; and so on.
  • the first feature information is a feature map.
  • the clarity of the text content is adjusted to improve the clarity of the text. Clarity of text content.
  • this embodiment adjusts the clarity of the text content to the clarity of the text content under an ideal state. For example, based on professional equipment, under ideal circumstances, the clarity of text content in images captured can be achieved.
  • Step 130 Generate a second image based on the first color difference map and the adjusted first brightness map.
  • a second image can be obtained.
  • the second image has the same color difference information as the first image, that is, the color is the same.
  • the difference is that in the second image
  • the text content is clearer than the text content in the first image.
  • the first brightness map and the first color difference map corresponding to the first image are respectively obtained.
  • the first feature information of the text content is extracted from the first brightness map, so as to adjust the clarity of the text content according to the first feature information to make the text content clear.
  • a second image is generated.
  • the second image is generated based on the original color difference of the first image and can retain the color of the original image. It can be seen that based on the embodiment of the present application, only the brightness of the image is processed, and the color difference of the image is not processed. On the basis of ensuring the clarity of the text content in the image, the color of the image will not be changed, thereby ensuring the clarity of the image. high quality.
  • step 120 includes:
  • Sub-step A1 Split the first brightness image into N1 sub-brightness images, where N1 is a positive integer.
  • the first brightness image is cropped into N1 sub-brightness images according to a preset order.
  • the image size is: image width (W) x image height (H).
  • the size of the general captured image is "3000x4000” and the size of the sub-brightness image is "512x512". Images of this size are more conducive to capturing text content. Among them, the greater the number of cropped sub-luminance images, the more refined the processing, but it will also occupy computing resources and limit computing efficiency.
  • Sub-step A2 Obtain the characteristic information of the text content in N1 sub-brightness images.
  • Sub-step A3 According to the characteristic information of the text content in the N1 sub-luminance images, correspondingly adjust the clarity of the text content in the N1 sub-luminance images.
  • the clarity of its text content is adjusted based on the extracted feature information to improve the clarity of the text content in each sub-luminance map.
  • Sub-step A4 Synthesize the adjusted first brightness map based on the adjusted N1 sub-brightness maps.
  • the first brightness map is restored according to a preset order.
  • a large picture is split into multiple small pictures, so as to improve the text content clarity of each small picture.
  • This adjustment plan is more detailed to ensure the clarity of the text content in the entire picture after adjustment.
  • This embodiment can also greatly reduce the occupation of memory and computing resources.
  • step 120 includes:
  • Sub-step B1 Based on N2 pieces of size information, adjust the size of the first brightness map N2 times to obtain N2 first brightness maps, where N2 is a positive integer.
  • the size of the first brightness map can be adjusted to obtain the feature information of the first brightness maps of different sizes, and then the feature information is fused to obtain the final fusion
  • the obtained feature information is used as the first feature information to ensure that the obtained feature information is more comprehensive.
  • a sub-brightness map is used as a processing object.
  • the text feature extraction module extracts feature information of the text content.
  • the text feature extraction module is shown in the figure.
  • a "3x3" convolutional layer plus activation operation (indicated by the arrow in the figure)
  • This will not enlarge the receptive field too much and allow the network to focus on the strokes of the text.
  • the general text size is more than twelve pixels.
  • the "3x3" convolution operation can calculate the adjacent "3x3" pixel area during calculation.
  • the text can be better extracted through the four-layer 3x3 convolution operation in Figure 2.
  • Content characteristic information is used to represent the feature map corresponding to the input sub-luminance map
  • the feature map 202 is used to represent the feature map corresponding to the output feature information.
  • the input and output feature maps of the text feature extraction module are the same size, both [W, H, C].
  • W is used to represent the width of the feature map
  • H is used to represent the height of the feature map.
  • the values of W and H are consistent
  • C represents the number of channels of the feature map, usually "8, 16, 32".
  • the values of W corresponding to the adjusted multiple sizes are "512, 256, 128", and the feature maps of the above sizes can Better capture of text content.
  • the feature map can be scaled to different sizes after undergoing different types of convolution operations to obtain feature maps of different sizes.
  • Sub-step B2 Obtain the characteristic information of the text content in the N2 first brightness images.
  • multiple corresponding text feature extraction modules can be used. Different text feature extraction modules process feature maps with different sizes.
  • the feature map sizes processed by the three text feature extraction modules 302 are: [W, H, C], [W/2, H/2, C], [W/4, H/4, C].
  • Sub-step B3 Fusion of the feature information of the text content in the N2 first brightness images to obtain the first feature information.
  • the multiple output feature maps are upsampled to the original size.
  • upsampling is performed through interpolation, which requires less calculation and is efficient.
  • FIG. 3 first directly perform a feature concatenation (concat) operation on the two feature maps 303 corresponding to the sizes [256, 256, C] and [128, 128, C] to obtain a feature map 304 with a size of [ 512, 512, 2C], and then fuse the feature map 304 with the output feature map of size [512, 512, C] through the concat operation, so that the feature information of different dimensions of the text content can be effectively preserved.
  • the final output size is [512, 512, 3C] feature map 305.
  • the feature information of the text content can be extracted based on feature maps of multiple sizes. This can handle the details of the text strokes and the entire text content well, which is beneficial to the clarity of the text content. Make adjustments.
  • the multi-size feature map fusion steps provided in the previous embodiment can be repeated, thereby connecting multiple fusion steps in series to increase the depth of the network and improve the expression of the model. ability.
  • the sub-brightness map 401 corresponds to before adjusting the sharpness
  • the sub-brightness map 402 corresponds to after adjusting the sharpness
  • the size of the feature map output by each multi-size feature fusion module is [512, 512, 3C].
  • the transformed size is [512, 512, C].
  • the length and width of the feature map here are both "512", which is consistent with the size of the input feature map.
  • the output feature map contains text details and overall text features. Since the network has increased depth, the final output feature map has a larger feature receptive field, and its feature map is similar to The input sizes are consistent, so the final output feature map can also take into account global brightness, contrast and other information, and its size is [512, 512, C].
  • the concat operation is used in this application for the rapid convergence of the model and a jump link between the input and the output.
  • the specific operation is: put two feature maps of size [512, 512, C] according to the The three dimensions are directly spliced into a thicker feature map with size [512, 512, 2C].
  • the input image needs to go through the convolution layer first, and its feature size is modified to [512, 512, C].
  • this embodiment on the one hand, after multiple feature extractions of multi-size feature maps, more detailed features of the text content can be extracted; on the other hand, combined with the characteristic information in the input original feature map, the final result is The characteristic information of the text content is more comprehensive. It can be seen that this embodiment uses the characteristics of the text image to extract the detailed features of the text content and reconstruct the text details, which is beneficial to improving the clarity of the text.
  • step 120 includes:
  • Sub-step C1 Obtain the second feature information of the text content in the first brightness map.
  • Sub-step C2 According to the second feature information, adjust the clarity of the text content in the first brightness map to obtain a second brightness map.
  • this embodiment may use the Document Super Definition Network (DocSR) for image processing to output the second image.
  • DocSR Document Super Definition Network
  • a model corresponding to the document ultra-clear network can be trained.
  • the model outputs the prediction map P1.
  • the prediction map P1 is obtained by adjusting the clarity of the text content based on the second feature information.
  • the prediction map P1 corresponds to a sub-luminance map.
  • Sub-step C3 Obtain a third brightness map corresponding to the first brightness map, the first brightness map pair corresponds to the pixels of the third brightness image, and the clarity of the text content in the third brightness map meets the first preset condition.
  • shooting is performed based on the same scene to obtain a corresponding third brightness map based on the captured image.
  • use professional equipment for shooting For example, you can use equipment with better optical properties, such as SLR shooting. Such equipment is generally larger and has better optical imaging effects.
  • the clarity of the text content can reach the first preset condition.
  • the first preset condition is the clarity of the text content in the captured image under ideal shooting conditions.
  • Sub-step C4 Obtain the difference information between the second brightness map and the third brightness map.
  • the difference values of all areas in a brightness map are used as the difference information in this step.
  • Sub-step C5 When the difference information satisfies the second preset condition, determine the acquired second feature information as the first feature information.
  • the second preset condition is a minimum value.
  • each sub-luminance image in a brightness image is used as a training sample to complete model training.
  • the number of small images can be increased to ensure the diversity of samples. change.
  • the second feature information output by the model is relatively accurate and can be used as the first feature information, and the first feature information is used in actual image processing.
  • the model is trained so that in subsequent usage scenarios, the clarity of the text content in the adjusted first brightness map output by the model is consistent with The clarity of the text content in the ideal image is close to that of the ideal image.
  • step C4 includes:
  • Sub-step D1 Obtain the first absolute value of the difference between the two corresponding pixel values in the second brightness map and the third brightness map, obtain the corresponding first mean value based on the first absolute value, and use the first mean value as the first mean value.
  • One difference Obtain the first absolute value of the difference between the two corresponding pixel values in the second brightness map and the third brightness map, obtain the corresponding first mean value based on the first absolute value, and use the first mean value as the first mean value.
  • L 1 is used to represent the first difference between p1 and y2;
  • the first difference value takes effect on the entire image p1 to remove noise in the entire image and improve the overall details.
  • Sub-step D2 Obtain the first stroke gradient map corresponding to the second brightness map, the second stroke gradient map corresponding to the third brightness map, and obtain the two pixel values corresponding to the first stroke gradient map and the second stroke gradient map. the second absolute value of the difference, obtain the corresponding second mean value according to the second absolute value, and use the second mean value as the second difference value.
  • values are supplemented in the four directions of up, down, left, and right, and the supplemented value area is cropped at the same time.
  • the left and right cropped complement areas are subtracted, the up and down cropped complement areas are subtracted, and the obtained results are superimposed, and finally the stroke gradient map is obtained.
  • L 2 is used to represent the second difference between p1 and y2; grad1 and grad2 are used to represent the stroke gradient maps of p1 and y2 respectively; cnt is used to represent the number of pixels of p1 or y2.
  • the background area of the image is relatively flat and the text area has a relatively obvious gradient.
  • the edge area of the text is found through shift subtraction, and the gradient difference between the predicted image and the ideal image is calculated. .
  • Sub-step D3 According to the second stroke gradient map, expand the first area corresponding to the text content into a second area, identify Identify the third area corresponding to the second area in the second brightness map, and obtain the third absolute value of the difference between the two pixel values corresponding to the second area and the third area, and obtain the corresponding third area based on the third absolute value. Three means, and use the third mean as the third difference.
  • the first area where the text content is located can be found, so that the first area can be expanded to obtain the expanded second area.
  • the first region is expanded.
  • L 3 is used to represent the third difference between p1 and y2; mask_cnt is used to represent the number of pixels in the second area of y2.
  • the difference between the predicted image and the ideal image is calculated based on the text area, thereby constraining the convergence of the entire model to focus on the text area, which in turn helps improve the clarity of the text.
  • Sub-step D4 Perform weighting processing on the first difference, the second difference and the third difference to obtain difference information.
  • sum_loss is used to represent the difference information between p1 and y2.
  • a, b, c are the weights of each difference.
  • the values of a, b, c ensure that L 1 , L 2 , L 3 are in On the same order of magnitude.
  • sum_loss is backpropagated and sum_loss is calculated in a loop, so that the model is trained in the direction of minimum sum_loss. After one hundred epoch iterations, the output p1 and the ideal y2 are relatively similar.
  • the trained model can effectively enhance the details of text strokes to improve the clarity of text, thereby improving image quality.
  • this application can improve the clarity of the captured text content in scenes where text content is captured without affecting the color information of the entire image.
  • this application comprehensively considers: the strokes of the text are independent of each other, the blur of the text is often reflected in the unclear strokes of a single text, and the proportion of a single text in the whole picture. Small, non-text areas tend to have image characteristics such as relatively flat and uniform, and a suitable network model is designed to process the captured images.
  • the execution subject may be an image processing device.
  • an image processing device executing an image processing method is used as an example to describe the image processing device provided by the embodiments of the present application.
  • FIG. 9 shows a block diagram of an image processing device according to another embodiment of the present application.
  • the device includes:
  • the acquisition module 10 is used to acquire the first brightness map corresponding to the first image and the first color difference map corresponding to the first image;
  • the adjustment module 20 is used to obtain the first characteristic information of the text content in the first brightness map, and adjust the clarity of the text content in the first brightness map according to the first feature information to obtain the adjusted first brightness map;
  • the generation module 30 is configured to generate a second image based on the first color difference map and the adjusted first brightness map.
  • the first brightness map and the first color difference map corresponding to the first image are respectively obtained.
  • the first feature information of the text content is extracted from the first brightness map, so as to adjust the clarity of the text content according to the first feature information to make the text content clear.
  • a second image is generated.
  • the second image is generated based on the original color difference of the first image and can retain the color of the original image. It can be seen that based on the embodiment of the present application, only the brightness of the image is processed, and the color difference of the image is not processed. On the basis of ensuring the clarity of the text content in the image, the color of the image will not be changed, thereby ensuring the clarity of the image. high quality.
  • the adjustment module 20 includes:
  • the splitting unit is used to split the first brightness map into N1 sub-brightness maps, where N1 is a positive integer;
  • the first acquisition unit is used to acquire the characteristic information of the text content in N1 sub-luminance images
  • the first adjustment unit is used to correspondingly adjust the clarity of the text content in the N1 sub-brightness images based on the characteristic information of the text content in the N1 sub-brightness images;
  • the synthesis unit is used to synthesize the adjusted first brightness map based on the adjusted N1 sub-brightness maps.
  • the adjustment module 20 includes:
  • the second adjustment unit is used to adjust the size of the first brightness map N2 times based on N2 pieces of size information to obtain N2 first brightness maps, where N2 is a positive integer;
  • the second acquisition unit is used to acquire the characteristic information of the text content in the N2 first brightness images
  • the fusion unit is used to fuse the feature information of the text content in the N2 first brightness images to obtain the first feature information.
  • the adjustment module 20 includes:
  • the third acquisition unit is used to acquire the second characteristic information of the text content in the first brightness map
  • the third adjustment unit is used to adjust the clarity of the text content in the first brightness map according to the second feature information to obtain the second brightness map;
  • the fourth acquisition unit is used to acquire a third brightness map corresponding to the first brightness map, the first brightness map pair corresponds to the pixels of the third brightness image, and the clarity of the text content in the third brightness map meets the first preset condition;
  • the fifth acquisition unit is used to acquire the difference information between the second brightness map and the third brightness map
  • the determining unit is configured to determine the acquired second feature information as the first feature information when the difference information satisfies the second preset condition.
  • the fifth acquisition unit includes:
  • the first obtaining subunit is used to obtain the first absolute value of the difference between the two corresponding pixel values in the second brightness map and the third brightness map, obtain the corresponding first mean value according to the first absolute value, and obtain the first absolute value of the difference between the second brightness map and the third brightness map.
  • a mean value is used as the first difference;
  • the second acquisition subunit is used to obtain the first stroke gradient map corresponding to the second brightness map, the second stroke gradient map corresponding to the third brightness map, and obtain the corresponding first stroke gradient map and the second stroke gradient map.
  • the third acquisition subunit is used to expand the first area corresponding to the text content into a second area according to the second stroke gradient map, identify the third area corresponding to the second area in the second brightness map, and obtain the second area
  • the third absolute value of the difference between the two pixel values corresponding to the third area obtains the corresponding third mean value based on the third absolute value, and uses the third mean value as the third difference value;
  • the weighting subunit is used to weight the first difference, the second difference and the third difference to obtain difference information.
  • the image processing device in the embodiment of the present application may be an electronic device or a component in the electronic device, such as an integrated circuit or a chip.
  • the electronic device may be a terminal or other devices other than the terminal.
  • the electronic device can be a mobile phone, a tablet computer, a notebook computer, a handheld computer, a vehicle-mounted electronic device, a mobile Internet device (MID), or an augmented reality (Augmented Reality, AR)/virtual reality (Virtual Reality, VR) ) equipment, robots, wearable devices, ultra-mobile personal computers (Ultra-Mobile Personal Computer, UMPC), netbooks or personal digital assistants (Personal Digital Assistant, PDA), etc., and can also be servers, network attached storage (Network Attached Storage, NAS), personal computer (Personal Computer, PC), television (TeleVision, TV), teller machine or self-service machine, etc., the embodiments of this application are not specifically limited.
  • the image processing device in the embodiment of the present application may be a device with an action system.
  • the action system can be an Android action system, an ios action system, or other possible action systems, which are not specifically limited in the embodiments of this application.
  • the image processing device provided by the embodiments of the present application can implement various processes implemented by the above method embodiments. To avoid duplication, they will not be described again here.
  • this embodiment of the present application also provides an electronic device 100, including a processor 101, a memory 102, and programs or instructions stored on the memory 102 and executable on the processor 101.
  • a processor 101 When the program or instruction is executed by the processor 101, each step of any of the above image processing method embodiments is implemented, and the same technical effect can be achieved. To avoid duplication, the details will not be described here.
  • the electronic devices in the embodiments of the present application include the above-mentioned mobile electronic devices and non-mobile electronic devices.
  • Figure 11 is a schematic diagram of the hardware structure of an electronic device that implements an embodiment of the present application.
  • the electronic device 1000 includes but is not limited to: radio frequency unit 1001, network module 1002, audio output unit 1003, input unit 1004, sensor 1005, display unit 1006, user input unit 1007, interface unit 1008, memory 1009, processor 1010, etc. part.
  • the electronic device 1000 may also include a power supply (such as a battery) that supplies power to various components.
  • the power supply may be logically connected to the processor 1010 through a power management system, thereby managing charging, discharging, and function through the power management system. Consumption management and other functions.
  • the structure of the electronic device shown in Figure 11 does not constitute a limitation on the electronic device.
  • the electronic device may include more or less components than shown in the figure, or combine certain components, or arrange different components, which will not be described again here. .
  • the processor 1010 is used to obtain the first brightness map corresponding to the first image and the first color difference map corresponding to the first image; obtain the first characteristic information of the text content in the first brightness map, and According to the first characteristic information, adjust the clarity of the text content in the first brightness map to obtain the adjusted first brightness map; according to the first color difference map, and the adjusted first brightness map Luminance map to generate a second image.
  • the first brightness map and the first color difference map corresponding to the first image are respectively obtained.
  • the first feature information of the text content is extracted from the first brightness map, so as to adjust the clarity of the text content according to the first feature information to make the text content clear.
  • a second image is generated.
  • the second image is generated based on the original color difference of the first image and can retain the color of the original image. It can be seen that based on the embodiment of the present application, only the brightness of the image is processed, and the color difference of the image is not processed. On the basis of ensuring the clarity of the text content in the image, the color of the image will not be changed, thereby ensuring the clarity of the image. high quality.
  • the processor 1010 is also configured to split the first brightness map into N1 sub-brightness maps, where N1 is a positive integer; obtain the characteristic information of the text content in the N1 sub-brightness maps; according to the The characteristic information of the text content in the N1 sub-luminance pictures corresponds to adjusting the clarity of the text content in the N1 sub-luminance pictures; according to the adjusted N1 sub-luminance pictures, synthesize the adjusted third A brightness map.
  • the processor 1010 is also configured to adjust the size of the first brightness map N2 times based on N2 pieces of size information to obtain N2 pieces of the first brightness map, where N2 is a positive integer; obtain the The characteristic information of the text content in the N2 first brightness pictures; the characteristic information of the text content in the N2 first brightness pictures is fused to obtain the first characteristic information.
  • the processor 1010 is also configured to obtain second characteristic information of the text content in the first brightness map; and adjust the clarity of the text content in the first brightness map according to the second characteristic information. , obtain a second brightness map; obtain a third brightness map corresponding to the first brightness map, the first brightness map pair corresponds to the third brightness image pixel, and the text content in the third brightness map The clarity satisfies the first preset condition; the difference information between the second brightness map and the third brightness map is obtained; when the difference information satisfies the second preset condition, the acquired The second characteristic information is determined to be the first characteristic information.
  • the processor 1010 is further configured to obtain a first absolute value of the difference between the two corresponding pixel values in the second brightness map and the third brightness map, and obtain the first absolute value according to the first absolute value. corresponds to the first mean, and the a mean value as the first difference; obtain the first stroke gradient map corresponding to the second brightness map, the second stroke gradient map corresponding to the third brightness map, and obtain the first stroke gradient map and the third stroke gradient map.
  • the second absolute value of the difference between the two corresponding pixel values in the two-stroke gradient map obtain the corresponding second mean value according to the second absolute value, and use the second mean value as the second difference value; according to the second absolute value
  • the second stroke gradient map is used to expand the first area corresponding to the text content into a second area, identify the third area corresponding to the second area in the second brightness map, and obtain the relationship between the second area and the second stroke gradient map.
  • the third absolute value of the difference between the two pixel values corresponding to the third area obtain the corresponding third mean value according to the third absolute value, and use the third mean value as the third difference value; for the The first difference, the second difference and the third difference are weighted to obtain the difference information.
  • this application can improve the clarity of the captured text content in scenes where text content is captured without affecting the color information of the entire image.
  • this application comprehensively considers: the strokes of text are independent of each other, the blur of text is often reflected in the unclear strokes of a single text, the proportion of a single text in the entire image is relatively small, and non-text areas are often relatively flat and uniform. and other image features, a suitable network model is designed to process the captured images.
  • the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042.
  • the graphics processor 10041 is used for recording data generated by an image capture device in a video image capture mode or an image capture mode. (such as a camera) to process the image data of still pictures or video images.
  • the display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1007 includes at least one of a touch panel 10071 and other input devices 10072 .
  • Touch panel 10071 also known as touch screen.
  • the touch panel 10071 may include two parts: a touch detection device and a touch controller.
  • Other input devices 10072 may include but are not limited to physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and action sticks, which will not be described again here.
  • Memory 1009 may be used to store software programs as well as various data, including but not limited to application programs and action systems.
  • the processor 1010 can integrate an application processor and a modem processor.
  • the application processor mainly processes action systems, user pages, application programs, etc.
  • the modem processor mainly processes wireless communications. It can be understood that the above modem processor may not be integrated into the processor 1010.
  • Memory 1009 may be used to store software programs as well as various data.
  • the memory 1009 may mainly include a first storage area for storing programs or instructions and a second storage area for storing data, wherein the first storage area may store an operating system, an application program or instructions required for at least one function (such as a sound playback function, Image playback function, etc.) etc.
  • memory 1009 may include volatile memory or nonvolatile memory, or memory 1009 may include both volatile and nonvolatile memory.
  • the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory.
  • Volatile memory can be random access memory (Random Access Memory, RAM), static random access memory (Static RAM, SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory Access memory (Double Data Rate SDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synch link DRAM, SLDRAM) and direct memory bus random access memory (Direct Rambus RAM, DRRAM).
  • RAM Random Access Memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • synchronous dynamic random access memory Synchronous DRAM, SDRAM
  • Double data rate synchronous dynamic random access memory Access memory Double Data Rate SDRAM, DDRSDRAM
  • Enhanced SDRAM, ESDRAM synchronous dynamic random access memory
  • Synch link DRAM, SLDRAM direct memory bus random access memory
  • Direct Rambus RAM Direct Rambus RAM
  • the processor 1010 may include one or more processing units; optionally, the processor 1010 integrates an application processor and a modem processor, where the application processor mainly handles operations related to the operating system, user interface, application programs, etc., Modem processors mainly process wireless communication signals, such as baseband processors. It can be understood that the above modem processor may not be integrated into the processor 1010.
  • Embodiments of the present application also provide a readable storage medium.
  • Programs or instructions are stored on the readable storage medium.
  • the program or instructions are executed by a processor, each process of the above image processing method embodiment is implemented and the same can be achieved. The technical effects will not be repeated here to avoid repetition.
  • the processor is the processor in the electronic device described in the above embodiment.
  • the readable storage medium includes computer readable storage media, such as computer read-only memory ROM, random access memory RAM, magnetic disk or optical disk, etc.
  • An embodiment of the present application further provides a chip.
  • the chip includes a processor and a communication interface.
  • the communication interface is coupled to the processor.
  • the processor is used to run programs or instructions to implement the above image processing method embodiments. Each process can achieve the same technical effect. To avoid duplication, it will not be described again here.
  • chips mentioned in the embodiments of this application may also be called system-on-chip, system-on-a-chip, system-on-a-chip or system-on-chip, etc.
  • Embodiments of the present application provide a computer program product.
  • the program product is stored in a storage medium.
  • the program product is executed by at least one processor to implement each process of the above image processing method embodiment, and can achieve the same technical effect. , to avoid repetition, will not be repeated here.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Quality & Reliability (AREA)
  • Image Processing (AREA)

Abstract

本申请公开了一种图像处理方法、装置、电子设备和可读存储介质,属于人工智能技术领域。其中,所述方法包括:获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。

Description

图像处理方法、装置、电子设备和可读存储介质
相关申请的交叉引用
本申请要求在2022年08月03日提交中国专利局、申请号为202210927005.3、名称为“图像处理方法、装置、电子设备和可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于人工智能技术领域,具体涉及一种图像处理方法、装置、电子设备和可读存储介质。
背景技术
目前,基于电子设备拍摄的图像中,可能会出现一些文字内容,如一些产品信息等。在拍摄的图像中,可能因为拍摄环境、拍摄角度等因素,导致图像中的文字内容不够清晰,因此需要用户对图像进行处理,以使得图像中的文字内容能够清晰一些。
在现有技术中,常见的处理方法如,用户调整图像的对比度、用户调整图像的颜色等,以使得图像中的文字内容更清晰。而现有技术中的这些方法,都会改变图像本身的属性,从而降低图像质量。
可见,现有技术中改善图像中的文字内容的清晰度的方法,因改变图像本身的属性,导致图像质量有所降低。
发明内容
本申请实施例的目的是提供一种图像处理方法,能够解决现有技术中改善图像中的文字内容的清晰度的方法,因改变图像本身的属性,导致图像质量有所降低的问题。
第一方面,本申请实施例提供了一种图像处理方法,该方法包括获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。
第二方面,本申请实施例提供了一种图像处理装置,该装置包括:获取模块,用于获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;调整模块,用于获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;生成模块,用于根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法。
第六方面,本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如第一方面所述的方法。
第七方面,本申请实施例提供了一种电子设备,该电子设备被配置成用于执行如第一方面所述的方法。
这样,在本申请的实施例中,针对包括文字内容的第一图像,分别获取第一图像对应的第一亮度图和第一色差图。首先,针对第一亮度图提取文字内容的第一特征信息,以根据第一特征信息对文字内容的清晰度进行调整,以使得文字内容清晰。然后,基于调整后的第一亮度图,结合第一色差图,生成第二图像,第二图像是基于第一图像原有的色差进行还原生成的,可以保留原图像的颜色。可见,基于本申请的实施例,只对图像的亮度进行了处理,并没有处理图像的色差,在确保图像中的文字内容的清晰度的基础上,不会改变图像的颜色,从而确保图像的高质量。
附图说明
图1是本申请实施例的图像处理方法的流程图;
图2至图4是本申请实施例的模型示意图;
图5至图8是本申请实施例的图像处理方法的说明示意图;
图9是本申请实施例的图像处理装置的框图;
图10是本申请实施例的电子设备的硬件结构示意图之一;
图11是本申请实施例的电子设备的硬件结构示意图之二。
具体实施方式
下面将结合本申请实施例的附图,对本申请实施例的技术方案进行清楚地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请的实施例,本领域普通技术人员获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一, 字符“/”,一般表示前后关联对象是一种“或”的关系。
本申请实施例提供的图像处理方法,其执行主体可以是本申请实施例提供的图像处理装置,或者集成了该图像处理装置的电子设备,其中该图像处理装置可以采用硬件或软件的方式实现。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像处理方法进行详细地说明。
图1示出了本申请一个实施例的图像处理方法的流程图,以该方法应用于电子设备进行举例,包括:
步骤110:获取第一图像对应的第一亮度图,以及第一图像对应的第一色差图。
可选地,电子设备针对目标场景,拍摄一张图像,作为第一图像。
其中,基于本实施例所实现的图像处理方法,目标场景中包括文字内容,如会议室中,大屏幕上显示文字内容,用户拍摄大屏幕;又如,某纸质的产品说明书上的内容为文字内容,用户拍摄该产品说明书。
在本实施例中,因拍摄环境、拍摄角度等因素,如在靠后的位置拍摄等,导致第一图像中的文字内容存在清晰度的问题,如四周模糊、色变、噪声等。
在该步骤中,基于拍摄的第一图像,进行相应的图像处理,以得到第一图像的第一亮度图和第一色差图。
其中,第一亮度图用于体现第一图像各个像素的亮度信息,第一色差图用于体现第一图像各个像素的色差信息。
其中,第一图像的数据格式为红(Reb,R)绿(Green,G)蓝(Blue,B)格式。
可参考地,亮度信息Y的计算公式为:
Y=0.299*R+0.587*G+0.114*B
色差信息U的计算公式为:
U=-0.169*R-0.331*G+0.500*B
色差信息V的计算公式为:
V=0.500*R-0.439*G-0.081*B
其中,在以上公式中,R、G、B分别用于表示像素的R颜色通道值、G颜色通道值,B颜色通道值。
步骤120:获取第一亮度图中的文字内容的第一特征信息,并根据第一特征信息,调整第一亮度图中的文字内容的清晰度,得到调整后的第一亮度图。
在该步骤中,基于第一亮度图,获取文字内容的第一特征信息。
可选地,第一特征信息包括文字内容的笔画信息、文字内容的轮廓信息、文字内容的整体信息;等等。
可选地,第一特征信息为特征图。
进一步地,基于提取到的第一特征信息,对文字内容的清晰度进行调整,以提高文 字内容的清晰度。
可选地,本实施例将文字内容的清晰度调整至理想状态下文字内容的清晰度。例如,基于专业设备,在理想的环境下,拍摄的图像中文字内容所能达到的清晰度。
步骤130:根据第一色差图,以及调整后的第一亮度图,生成第二图像。
在该步骤中,基于调整后的第一亮度图,结合第一色差图,可以得到第二图像,第二图像与第一图像的色差信息相同,即颜色相同,不同的是,第二图像中的文字内容相比于第一图像中的文字内容,更加清晰。
可选地,将第一亮度图和第一色差图转换成RGB数据,转换公式包括:
R=Y+1.402*V;
G=Y-0.344*U-0.792*V;
B=Y+1.772*U。
进一步地,结合转换公式,生成RGB数据格式的第二图像。
这样,在本申请的实施例中,针对包括文字内容的第一图像,分别获取第一图像对应的第一亮度图和第一色差图。首先,针对第一亮度图提取文字内容的第一特征信息,以根据第一特征信息对文字内容的清晰度进行调整,以使得文字内容清晰。然后,基于调整后的第一亮度图,结合第一色差图,生成第二图像,第二图像是基于第一图像原有的色差进行还原生成的,可以保留原图像的颜色。可见,基于本申请的实施例,只对图像的亮度进行了处理,并没有处理图像的色差,在确保图像中的文字内容的清晰度的基础上,不会改变图像的颜色,从而确保图像的高质量。
在本申请另一个实施例的图像处理方法的流程中,步骤120,包括:
子步骤A1:将第一亮度图拆分为N1张子亮度图,N1为正整数。
在该步骤中,按照预设顺序,将第一亮度图裁剪为N1张子亮度图。
其中,图像尺寸为:图像宽(W)x图像高(H)。
可选地,基于一般拍摄图像的尺寸为“3000x4000”,子亮度图的尺寸为“512x512”,该尺寸大小的图像更利于捕捉文字内容。其中,裁剪的子亮度图的数量越多,处理越精细,但也会占用运算资源,限制运算效率。
子步骤A2:获取N1张子亮度图中的文字内容的特征信息。
在该步骤中,针对每一张子亮度图,提取其中的文字内容的特征信息。
子步骤A3:根据N1张子亮度图中的文字内容的特征信息,对应调整N1张子亮度图中的文字内容的清晰度。
在该步骤中,针对每一张子亮度图,基于提取的特征信息,调整其文字内容的清晰度,以提高每张子亮度图中的文字内容的清晰度。
子步骤A4:根据调整后的N1张子亮度图,合成调整后的第一亮度图。
在该步骤中,基于调整后的各张子亮度图,按照预设顺序,还原成第一亮度图。
在本实施例中,将一张大图,拆成成多张小图,以对每张小图进行文字内容清晰度 的调整,这样的调整方案更加细致,以确保调整后的整张图中文字内容的清晰程度。另外,针对大图进行处理时,消耗的内存、算力是巨大的,本实施例还能够极大地减少内存以及运算资源的占用。
在本申请另一个实施例的图像处理方法的流程中,步骤120,包括:
子步骤B1:基于N2个尺寸信息,对第一亮度图的尺寸分别进行N2次调整,得到N2张第一亮度图,N2为正整数。
在本实施例中,为了获取更全面的第一特征信息,可调整第一亮度图的尺寸,以分别获取不同尺寸的第一亮度图的特征信息,再进行特征信息的融合,以将最终融合得到的特征信息,作为第一特征信息,从而确保所获取的特征信息更加全面。
参考上一实施例,以一张子亮度图作为一个处理对象。
可选地,由文字特征提取模块提取文字内容的特征信息。
参见图2,文字特征提取模块如图所示。采用“3x3”的卷积层加激活操作(图中箭头指示),这样不会过大地放大感受野,能使网络聚焦在文字的笔画上。一般的文字大小为十二个像素以上,“3x3”的卷积操作在计算时能够计算相邻的“3x3”像素区域,经过图2中的四层3x3卷积操作能较好地提取出文字内容的特征信息。其中,在图2中,特征图201用于表示输入的子亮度图对应的特征图,特征图202用于表示输出的特征信息对应的特征图。
其中,参见图2,文字特征提取模块的输入和输出的特征图是一样大小的,均为【W,H,C】,W用于表示特征图的宽,H用于表示特征图的高,W和H的数值一致,C表示特征图的通道数,通常为“8、16、32”。
可选地,结合文字的大小,在输入特征图尺寸为“512x512”的情况下,调整后的多个尺寸对应的W的值为“512、256、128”,以上几个尺寸的特征图能够更好地捕捉文字内容。
可选地,特征图经过不同类型的卷积操作后,可缩放到不同尺寸,以得到不同尺寸的特征图。其中,不同尺寸的特征图,包含的特征信息不同。例如,卷积步长(stride)=“2”卷积,输出的特征图中包含更多的全局信息。
例如,参见图3,尺寸为【W,H,C】的特征图301,分别经卷积层加激活stride=“1”、卷积层加激活stride=“2”、卷积层加激活stride=“3”的操作,得到三个尺寸,分别为【W,H,C】、【W/2,H/2,C】、【W/4,H/4,C】。
子步骤B2:获取N2张第一亮度图中的文字内容的特征信息。
可选地,为了提取不同尺寸特征图对应的特征信息,可采用对应的多个文字特征提取模块,不同的文字特征提取模块处理的特征图的尺寸不同。
例如,参见图3,三个文字特征提取模块302处理的特征图尺寸分别为:【W,H,C】、【W/2,H/2,C】、【W/4,H/4,C】。
子步骤B3:对N2张第一亮度图中的文字内容的特征信息进行融合,得到第一特征 信息。
在该步骤中,需要将输出的不同尺寸的特征图进行融合。
可选地,将输出的多个特征图做上采样到原始尺寸,这里通过插值的方式进行上采样,计算量少且高效。
例如,参见图3,先把尺寸为【256,256,C】、【128,128,C】对应的两个特征图303直接进行特征拼接(concat)操作,得到特征图304,其尺寸为【512,512,2C】,再将特征图304与输出的尺寸为【512,512,C】的特征图,通过concat操作的方式融合,从而能够有效地保留好文字内容的不同维度的特征信息,最终输出尺寸为【512,512,3C】的特征图305。
在本实施例中,可基于多个尺寸的特征图进行文字内容特征信息的提取,这样能够很好地处理好文字笔画的细节,也能处理好整个文字内容,有利于对文字内容的清晰度进行调整。
在本申请另一个实施例的图像处理方法中,可将上一实施例中提供的多尺寸特征图融合步骤重复进行,从而将多次融合步骤进行串联,以增加网络的深度,提升模型的表达能力。
例如,参见图4,以一张子亮度图作为一个处理对象为例,子亮度图401对应为调整清晰度之前,子亮度图402对应为调整清晰度之后。
在图4中,基于子亮度图401,转换为对应的特征图403,经第一个多尺寸特征融合模块404进行第一次融合后,再经第二个多尺寸特征融合模块405进行第二次融合,输出的特征图406与原始的特征图403进行concat操作,以得到最后的特征图407,经转换得到子亮度图402。
其中,在图4中,每个多尺寸特征融合模块输出的特征图的尺寸为【512,512,3C】,经过卷积加激活的操作,变换尺寸为【512,512,C】。这里的特征图的长和宽均为“512”,和输入的特征图的尺寸是一致的。
在本实施例中,输出的特征图是包含文字细节和文字整体的特征的,由于网络有加大的深度,在最后输出的特征图中,已有较大的特征感受野,其特征图与输入尺寸一致,因此最终输出的特征图也能很好的兼顾全局的亮度、对比度等信息,其尺寸为【512,512,C】。
值得一提的是,本申请中采用concat操作,是为了模型的快速收敛,输入与输出之间进行跳跃链接,具体操作为:把两张尺寸为【512,512,C】的特征图按照第三维度直接拼接成一个更厚的特征图,尺寸为【512,512,2C】。
例如,参见图4,两张尺寸为【512,512,C】的特征图,一张为输入对应的特征图403,另一张输出的特征图407,针对两张特征图进行concat操作。
其中,对于特征图403,由于子亮度图401的尺寸为【512,512,1】,因此送入的图片需要先经过卷积层,修改其特征尺寸为【512,512,C】。
在本实施例中,一方面,经过多次多尺寸特征图的特征提取,可以提取到更多的文字内容的细节特征,另一方面,结合输入的原始特征图中的特性信息,使得最终得到的文字内容的特征信息更加全面。可见,本实施例利用文字图像的特征,能够提取出文字内容的细节特征,做好文字细节的重建,有利于提升文字的清晰度。
在本申请另一个实施例的图像处理方法的流程中,步骤120,包括:
子步骤C1:获取第一亮度图中的文字内容的第二特征信息。
子步骤C2:根据第二特征信息,调整第一亮度图中的文字内容的清晰度,得到第二亮度图。
可选地,本实施例可采用文档超清网络(DocSR)进行图像处理,以输出第二图像。
可选地,在输出较为清晰的第二图像之前,可对文档超清网络对应的模型进行训练。
可参考地,在训练过程中,模型输出预测图P1。
其中,预测图P1是基于第二特征信息对文字内容的清晰度进行调整后的得到的。
可选地,预测图P1对应的是子亮度图。
子步骤C3:获取与第一亮度图对应的第三亮度图,第一亮度图对与第三亮度图像素对应,且第三亮度图中的文字内容的清晰度满足第一预设条件。
在该步骤中,基于同一场景进行拍摄,以根据拍摄图像获取对应的第三亮度图。
可选地,使用专业设备进行拍摄,如可使用较好光学属性的设备进行拍摄,比如单反拍摄,此类设备一般体型较大、光学成像效果较好。
从而,该步骤中,在拍摄图像对应的第三亮度图中,文字内容的清晰度可达到第一预设条件。
可选地,第一预设条件为理想拍摄状态下,拍摄图像中文字内容的清晰度。
子步骤C4:获取第二亮度图与第三亮度图之间的差异信息。
可选地,以预测图P1为例,在第三亮度图中,找到对应区域y2,计算二者之间的差异值。
进一步地,将一张亮度图中所有区域的差异值,作为该步骤中的差异信息。
子步骤C5:在差异信息满足第二预设条件的情况,将获取到的第二特征信息,确定为第一特征信息。
可选地,第二预设条件为极小值。
可选地,计算P1与y2之间的差异值,把差异值进行反向传播;然后循环计算二者之间的差异值,使得模型向差异值极小的方向训练。经过一百个轮次(epoch)的迭代后,使得P1与y2之间的相似度极高。
进一步地,将一张亮度图中的各张子亮度图均作为训练样本,以完成模型训练。
其中,在训练模型的过程中,对大图像进行裁剪时,裁剪得到的小图像之间可以有重叠部分,而且,在确保运算效率的前提下,可增加小图像的数量,以确保样本的多样化。
因此,在对模型训练之后,模型输的第二特征信息较为准确,可作为第一特征信息,第一特征信息用于实际图像处理中。
在本实施例中,基于预测图与理想图之间的差异,对模型进行训练,以使得在后续的使用场景中,由模型输出的调整后的第一亮度图中的文字内容的清晰度与理想图中的文字内容的清晰度接近。
在本申请另一个实施例的图像处理方法的流程中,步骤C4,包括:
子步骤D1:获取第二亮度图与第三亮度图中相对应的两个像素值的差值的第一绝对值,根据第一绝对值获取对应的第一均值,并将第一均值作为第一差值。
在本实施例中,以p1和y2之间的差异进行详细说明。
在该步骤中,参见公式一:
其中,在公式一中,L1用于表示p1与y2之间的第一差值;cnt用于表示p1或y2的像素数。例如,cnt=512x512。
在该步骤中,第一差值对p1整图生效,用以去除整图中的噪声、提升整体的细节。
子步骤D2:获取第二亮度图对应的第一笔画梯度图、第三亮度图对应的第二笔画梯度图,以及获取第一笔画梯度图与第二笔画梯度图中相对应的两个像素值的差值的第二绝对值,根据第二绝对值获取对应的第二均值,并将第二均值作为第二差值。
在该步骤中,对于p1,在上、下、左、右四个方向上分别补值,同时裁剪补值区域。
例如,参见图5,对于p1,尺寸为“512x512”,对应的原始区域为501,在右方向上做补值(图中右侧细条矩形),新裁剪得到补值区域502(虚线所示)。
进一步地,左右裁剪的补值区域进行相减、上下裁剪的补值区域进行相减,将得到的结果进行叠加,最终得到笔画梯度图。
例如,参见图6所示的文字“一”、“二”、“三”对应的笔画梯度图。
对于y2同理。
在该步骤中,参见公式二:
其中,在公式二中,L2用于表示p1与y2之间的第二差值;grad1和grad2分别用于表示p1和y2的笔画梯度图;cnt用于表示p1或y2的像素数。
在该步骤中,利用图像的背景区域相对比较平坦,文字区域具有较明显的梯度的特点,通过移位相减的方式把文字的边缘区域找到,并计算预测图与理想图之间的梯度差异。
子步骤D3:根据第二笔画梯度图,将文字内容对应的第一区域扩大为第二区域、识 别第二亮度图中与第二区域对应的第三区域,以及获取第二区域与第三区域相对应的两个像素值的差值的第三绝对值,根据第三绝对值获取对应的第三均值,并将第三均值作为第三差值。
在该步骤中,基于上一步骤得到y2的笔画梯度图,可以找到文字内容所在的第一区域,从而可以对第一区域进行扩大,以得到扩大后的第二区域。
可选地,对第一区域进行膨胀处理。
例如,参见图7,将笔画梯度图作为原图像,把原图像701二值化成“0”、“1”值,其中,“0”为黑色区域,“1”为白色区域,使用一个“3x3”的模板702去依次查找所有的值为“1”的区域,并把周围的八个值都付为“1”,得到膨胀后的图像703。例如,原图像中的文字“一”801,以及膨胀后的文字“一”802之间的对比如图8所示。
进一步地,计算y2的文字区域(即第二区域)mask,再计算相同区域下,p1与y2之间的绝对值的平均值。
在该步骤中,参见公式三:
其中,在公式三中,L3用于表示p1与y2之间的第三差值;mask_cnt用于表示y2的第二区域的像素数。
在该步骤中,根据文字区域计算预测图与理想图之间的的差异,从而约束整个模型的收敛关注到文字区域,进而有利于提升文字的清晰度。
子步骤D4:对第一差值、第二差值和第三差值进行加权处理,得到差异信息。
由于以上多个差值分别关注到不同的维度信息,因此对多个差值做加权处理,确保单个差值不会过大地影响模型的收敛方向。
参见公式四:
sum_loss=a*L1+b*L2+c*L3
在公式四中,sum_loss用于表示p1与y2之间的差异信息,a、b、c为每个差值的权值,a、b、c的取值确保L1、L2、L3在同一个数量级上。
进一步地,把sum_loss进行反向传播,循环计算sum_loss,使得模型向sum_loss极小的方向训练。经过一百个epoch的迭代后,输出的p1和理想的y2就比较相似了。
在本实施例中,在模型训练时不仅关注到整个文字内容的全局信息,也能关注到文字的笔画边缘、文字的整个形态等信息。因此在模型训练时,可以按照本实施例中的各个约束项很好地提升整个文字内容的成片效果。最终,训练好的模型能有效地增强文字笔画的细节,以提升文字的清晰度,从而提升图像质量。
综上,本申请能够在针对文字内容进行拍摄的场景中,提升所拍摄的文字内容的清晰度,同时不影响整个图像的颜色信息。其中,本申请综合考虑:文字的笔画都是相互独立的、文字的模糊往往表现在单个文字的笔画不清晰上、单个文字在全图中的比例比 较小、非文字区域往往都是相对平坦均匀等图像特征,设计了适合的网络模型,用于对拍摄图像进行处理。
本申请实施例提供的图像处理方法,执行主体可以为图像处理装置。本申请实施例中以图像处理装置执行图像处理方法为例,说明本申请实施例提供的图像处理装置。
图9示出了本申请另一个实施例的图像处理装置的框图,该装置包括:
获取模块10,用于获取第一图像对应的第一亮度图,以及第一图像对应的第一色差图;
调整模块20,用于获取第一亮度图中的文字内容的第一特征信息,并根据第一特征信息,调整第一亮度图中的文字内容的清晰度,得到调整后的第一亮度图;
生成模块30,用于根据第一色差图,以及调整后的第一亮度图,生成第二图像。
这样,在本申请的实施例中,针对包括文字内容的第一图像,分别获取第一图像对应的第一亮度图和第一色差图。首先,针对第一亮度图提取文字内容的第一特征信息,以根据第一特征信息对文字内容的清晰度进行调整,以使得文字内容清晰。然后,基于调整后的第一亮度图,结合第一色差图,生成第二图像,第二图像是基于第一图像原有的色差进行还原生成的,可以保留原图像的颜色。可见,基于本申请的实施例,只对图像的亮度进行了处理,并没有处理图像的色差,在确保图像中的文字内容的清晰度的基础上,不会改变图像的颜色,从而确保图像的高质量。
可选地,调整模块20,包括:
拆分单元,用于将第一亮度图拆分为N1张子亮度图,N1为正整数;
第一获取单元,用于获取N1张子亮度图中的文字内容的特征信息;
第一调整单元,用于根据N1张子亮度图中的文字内容的特征信息,对应调整N1张子亮度图中的文字内容的清晰度;
合成单元,用于根据调整后的N1张子亮度图,合成调整后的第一亮度图。
可选地,调整模块20,包括:
第二调整单元,用于基于N2个尺寸信息,对第一亮度图的尺寸分别进行N2次调整,得到N2张第一亮度图,N2为正整数;
第二获取单元,用于获取N2张第一亮度图中的文字内容的特征信息;
融合单元,用于对N2张第一亮度图中的文字内容的特征信息进行融合,得到第一特征信息。
可选地,调整模块20,包括:
第三获取单元,用于获取第一亮度图中的文字内容的第二特征信息;
第三调整单元,用于根据第二特征信息,调整第一亮度图中的文字内容的清晰度,得到第二亮度图;
第四获取单元,用于获取与第一亮度图对应的第三亮度图,第一亮度图对与第三亮度图像素对应,且第三亮度图中的文字内容的清晰度满足第一预设条件;
第五获取单元,用于获取第二亮度图与第三亮度图之间的差异信息;
确定单元,用于在差异信息满足第二预设条件的情况,将获取到的第二特征信息,确定为第一特征信息。
可选地,第五获取单元,包括:
第一获取子单元,用于获取第二亮度图与第三亮度图中相对应的两个像素值的差值的第一绝对值,根据第一绝对值获取对应的第一均值,并将第一均值作为第一差值;
第二获取子单元,用于获取第二亮度图对应的第一笔画梯度图、第三亮度图对应的第二笔画梯度图,以及获取第一笔画梯度图与第二笔画梯度图中相对应的两个像素值的差值的第二绝对值,根据第二绝对值获取对应的第二均值,并将第二均值作为第二差值;
第三获取子单元,用于根据第二笔画梯度图,将文字内容对应的第一区域扩大为第二区域、识别第二亮度图中与第二区域对应的第三区域,以及获取第二区域与第三区域相对应的两个像素值的差值的第三绝对值,根据第三绝对值获取对应的第三均值,并将第三均值作为第三差值;
加权子单元,用于对第一差值、第二差值和第三差值进行加权处理,得到差异信息。
本申请实施例中的图像处理装置可以是电子设备,也可以是电子设备中的部件,例如集成电路或芯片。该电子设备可以是终端,也可以为除终端之外的其他设备。示例性的,电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、移动上网装置(Mobile Internet Device,MID)、增强现实(Augmented Reality,AR)/虚拟现实(Virtual Reality,VR)设备、机器人、可穿戴设备、超级移动个人计算机(Ultra-Mobile Personal Computer,UMPC)、上网本或者个人数字助理(Personal Digital Assistant,PDA)等,还可以为服务器、网络附属存储器(Network Attached Storage,NAS)、个人计算机(Personal Computer,PC)、电视机(TeleVision,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例的图像处理装置可以为具有动作系统的装置。该动作系统可以为安卓(Android)动作系统,可以为ios动作系统,还可以为其他可能的动作系统,本申请实施例不作具体限定。
本申请实施例提供的图像处理装置能够实现上述方法实施例实现的各个过程,为避免重复,这里不再赘述。
可选地,如图10所示,本申请实施例还提供一种电子设备100,包括处理器101,存储器102,存储在存储器102上并可在所述处理器101上运行的程序或指令,该程序或指令被处理器101执行时实现上述任一图像处理方法实施例的各个步骤,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,本申请实施例的电子设备包括上述所述的移动电子设备和非移动电子设备。
图11为实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图11中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器1010,用于获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。
这样,在本申请的实施例中,针对包括文字内容的第一图像,分别获取第一图像对应的第一亮度图和第一色差图。首先,针对第一亮度图提取文字内容的第一特征信息,以根据第一特征信息对文字内容的清晰度进行调整,以使得文字内容清晰。然后,基于调整后的第一亮度图,结合第一色差图,生成第二图像,第二图像是基于第一图像原有的色差进行还原生成的,可以保留原图像的颜色。可见,基于本申请的实施例,只对图像的亮度进行了处理,并没有处理图像的色差,在确保图像中的文字内容的清晰度的基础上,不会改变图像的颜色,从而确保图像的高质量。
可选地,处理器1010,还用于将所述第一亮度图拆分为N1张子亮度图,N1为正整数;获取所述N1张子亮度图中的文字内容的特征信息;根据所述N1张子亮度图中的文字内容的特征信息,对应调整所述N1张子亮度图中的文字内容的清晰度;根据调整后的所述N1张子亮度图,合成调整后的所述第一亮度图。
可选地,处理器1010,还用于基于N2个尺寸信息,对所述第一亮度图的尺寸分别进行N2次调整,得到N2张所述第一亮度图,N2为正整数;获取所述N2张第一亮度图中的文字内容的特征信息;对所述N2张第一亮度图中的文字内容的特征信息进行融合,得到所述第一特征信息。
可选地,处理器1010,还用于获取所述第一亮度图中的文字内容的第二特征信息;根据所述第二特征信息,调整所述第一亮度图中的文字内容的清晰度,得到第二亮度图;获取与所述第一亮度图对应的第三亮度图,所述第一亮度图对与所述第三亮度图像素对应,且所述第三亮度图中的文字内容的清晰度满足第一预设条件;获取所述第二亮度图与所述第三亮度图之间的差异信息;在所述差异信息满足第二预设条件的情况,将获取到的所述第二特征信息,确定为所述第一特征信息。
可选地,处理器1010,还用于获取所述第二亮度图与所述第三亮度图中相对应的两个像素值的差值的第一绝对值,根据所述第一绝对值获取对应的第一均值,并将所述第 一均值作为第一差值;获取所述第二亮度图对应的第一笔画梯度图、所述第三亮度图对应的第二笔画梯度图,以及获取所述第一笔画梯度图与所述第二笔画梯度图中相对应的两个像素值的差值的第二绝对值,根据所述第二绝对值获取对应的第二均值,并将所述第二均值作为第二差值;根据所述第二笔画梯度图,将文字内容对应的第一区域扩大为第二区域、识别所述第二亮度图中与所述第二区域对应的第三区域,以及获取所述第二区域与所述第三区域相对应的两个像素值的差值的第三绝对值,根据所述第三绝对值获取对应的第三均值,并将所述第三均值作为第三差值;对所述第一差值、所述第二差值和所述第三差值进行加权处理,得到所述差异信息。
综上,本申请能够在针对文字内容进行拍摄的场景中,提升所拍摄的文字内容的清晰度,同时不影响整个图像的颜色信息。其中,本申请综合考虑:文字的笔画都是相互独立的、文字的模糊往往表现在单个文字的笔画不清晰上、单个文字在全图中的比例比较小、非文字区域往往都是相对平坦均匀等图像特征,设计了适合的网络模型,用于对拍摄图像进行处理。
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频图像捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频图像的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072中的至少一种。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、动作杆,在此不再赘述。存储器1009可用于存储软件程序以及各种数据,包括但不限于应用程序和动作系统。处理器1010可集成应用处理器和调制解调处理器,其中,应用处理器主要处理动作系统、用户页面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
存储器1009可用于存储软件程序以及各种数据。存储器1009可主要包括存储程序或指令的第一存储区和存储数据的第二存储区,其中,第一存储区可存储操作系统、至少一个功能所需的应用程序或指令(比如声音播放功能、图像播放功能等)等。此外,存储器1009可以包括易失性存储器或非易失性存储器,或者,存储器1009可以包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存 取存储器(Double Data Rate SDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synch link DRAM,SLDRAM)和直接内存总线随机存取存储器(Direct Rambus RAM,DRRAM)。本申请实施例中的存储器1009包括但不限于这些和任意其它适合类型的存储器。
处理器1010可包括一个或多个处理单元;可选的,处理器1010集成应用处理器和调制解调处理器,其中,应用处理器主要处理涉及操作系统、用户界面和应用程序等的操作,调制解调处理器主要处理无线通信信号,如基带处理器。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器ROM、随机存取存储器RAM、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
本申请实施例提供一种计算机程序产品,该程序产品被存储在存储介质中,该程序产品被至少一个处理器执行以实现如上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以计算机软件产品的形式体现出来,该计算机软件产品存储在一个 存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。

Claims (15)

  1. 一种图像处理方法,其中,所述方法包括:
    获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;
    获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;
    根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。
  2. 根据权利要求1所述的方法,其中,所述获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图,包括:
    将所述第一亮度图拆分为N1张子亮度图,N1为正整数;
    获取所述N1张子亮度图中的文字内容的特征信息;
    根据所述N1张子亮度图中的文字内容的特征信息,对应调整所述N1张子亮度图中的文字内容的清晰度;
    根据调整后的所述N1张子亮度图,合成调整后的所述第一亮度图。
  3. 根据权利要求1所述的方法,其中,所述获取所述第一亮度图中的文字内容的第一特征信息,包括:
    基于N2个尺寸信息,对所述第一亮度图的尺寸分别进行N2次调整,得到N2张所述第一亮度图,N2为正整数;
    获取所述N2张第一亮度图中的文字内容的特征信息;
    对所述N2张第一亮度图中的文字内容的特征信息进行融合,得到所述第一特征信息。
  4. 根据权利要求1所述的方法,其中,所述获取所述第一亮度图中的文字内容的第一特征信息,包括:
    获取所述第一亮度图中的文字内容的第二特征信息;
    根据所述第二特征信息,调整所述第一亮度图中的文字内容的清晰度,得到第二亮度图;
    获取与所述第一亮度图对应的第三亮度图,所述第一亮度图对与所述第三亮度图像素对应,且所述第三亮度图中的文字内容的清晰度满足第一预设条件;
    获取所述第二亮度图与所述第三亮度图之间的差异信息;
    在所述差异信息满足第二预设条件的情况,将获取到的所述第二特征信息,确定为所述第一特征信息。
  5. 根据权利要求4所述的方法,其中,所述获取所述第二亮度图与所述第三亮度图之间的差异信息,包括:
    获取所述第二亮度图与所述第三亮度图中相对应的两个像素值的差值的第一绝对值,根据所述第一绝对值获取对应的第一均值,并将所述第一均值作为第一差值;
    获取所述第二亮度图对应的第一笔画梯度图、所述第三亮度图对应的第二笔画梯度图,以及获取所述第一笔画梯度图与所述第二笔画梯度图中相对应的两个像素值的差值的第二绝对值,根据所述第二绝对值获取对应的第二均值,并将所述第二均值作为第二差值;
    根据所述第二笔画梯度图,将文字内容对应的第一区域扩大为第二区域,识别所述第二亮度图中与所述第二区域对应的第三区域,以及获取所述第二区域与所述第三区域相对应的两个像素值的差值的第三绝对值,根据所述第三绝对值获取对应的第三均值,并将所述第三均值作为第三差值;
    对所述第一差值、所述第二差值和所述第三差值进行加权处理,得到所述差异信息。
  6. 一种图像处理装置,其中,所述装置包括:
    获取模块,用于获取第一图像对应的第一亮度图,以及所述第一图像对应的第一色差图;
    调整模块,用于获取所述第一亮度图中的文字内容的第一特征信息,并根据所述第一特征信息,调整所述第一亮度图中的文字内容的清晰度,得到调整后的所述第一亮度图;
    生成模块,用于根据所述第一色差图,以及调整后的所述第一亮度图,生成第二图像。
  7. 根据权利要求6所述的装置,其中,所述调整模块,包括:
    拆分单元,用于将所述第一亮度图拆分为N1张子亮度图,N1为正整数;
    第一获取单元,用于获取所述N1张子亮度图中的文字内容的特征信息;
    第一调整单元,用于根据所述N1张子亮度图中的文字内容的特征信息,对应调整所述N1张子亮度图中的文字内容的清晰度;
    合成单元,用于根据调整后的所述N1张子亮度图,合成调整后的所述第一亮度图。
  8. 根据权利要求6所述的装置,其中,所述调整模块,包括:
    第二调整单元,用于基于N2个尺寸信息,对所述第一亮度图的尺寸分别进行N2次调整,得到N2张所述第一亮度图,N2为正整数;
    第二获取单元,用于获取所述N2张第一亮度图中的文字内容的特征信息;
    融合单元,用于对所述N2张第一亮度图中的文字内容的特征信息进行融合,得到 所述第一特征信息。
  9. 根据权利要求6所述的装置,其中,所述调整模块,包括:
    第三获取单元,用于获取所述第一亮度图中的文字内容的第二特征信息;
    第三调整单元,用于根据所述第二特征信息,调整所述第一亮度图中的文字内容的清晰度,得到第二亮度图;
    第四获取单元,用于获取与所述第一亮度图对应的第三亮度图,所述第一亮度图对与所述第三亮度图像素对应,且所述第三亮度图中的文字内容的清晰度满足第一预设条件;
    第五获取单元,用于获取所述第二亮度图与所述第三亮度图之间的差异信息;
    确定单元,用于在所述差异信息满足第二预设条件的情况,将获取到的所述第二特征信息,确定为所述第一特征信息。
  10. 根据权利要求9所述的装置,其中,所述第五获取单元,包括:
    第一获取子单元,用于获取所述第二亮度图与所述第三亮度图中相对应的两个像素值的差值的第一绝对值,根据所述第一绝对值获取对应的第一均值,并将所述第一均值作为第一差值;
    第二获取子单元,用于获取所述第二亮度图对应的第一笔画梯度图、所述第三亮度图对应的第二笔画梯度图,以及获取所述第一笔画梯度图与所述第二笔画梯度图中相对应的两个像素值的差值的第二绝对值,根据所述第二绝对值获取对应的第二均值,并将所述第二均值作为第二差值;
    第三获取子单元,用于根据所述第二笔画梯度图,将文字内容对应的第一区域扩大为第二区域、识别所述第二亮度图中与所述第二区域对应的第三区域,以及获取所述第二区域与所述第三区域相对应的两个像素值的差值的第三绝对值,根据所述第三绝对值获取对应的第三均值,并将所述第三均值作为第三差值;
    加权子单元,用于对所述第一差值、所述第二差值和所述第三差值进行加权处理,得到所述差异信息。
  11. 一种电子设备,其中,包括处理器和存储器,所述存储器存储可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1~5任一项所述的图像处理方法的步骤。
  12. 一种可读存储介质,其中,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1~5任一项所述的图像处理方法的步骤。
  13. 一种芯片,其中,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1~5任一项所述的图像处理方法的步骤。
  14. 一种计算机程序产品,其中,所述程序产品被存储在非瞬态的存储介质中,所述程序产品被至少一个处理器执行以实现如权利要求1~5任一项所述的图像处理方法的步骤。
  15. 一种电子设备,其中,所述电子设备被配置成用于执行如权利要求1~5任一项所述的图像处理方法的步骤。
PCT/CN2023/109785 2022-08-03 2023-07-28 图像处理方法、装置、电子设备和可读存储介质 Ceased WO2024027583A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210927005.3 2022-08-03
CN202210927005.3A CN115294055A (zh) 2022-08-03 2022-08-03 图像处理方法、装置、电子设备和可读存储介质

Publications (1)

Publication Number Publication Date
WO2024027583A1 true WO2024027583A1 (zh) 2024-02-08

Family

ID=83825809

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/109785 Ceased WO2024027583A1 (zh) 2022-08-03 2023-07-28 图像处理方法、装置、电子设备和可读存储介质

Country Status (2)

Country Link
CN (1) CN115294055A (zh)
WO (1) WO2024027583A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115294055A (zh) * 2022-08-03 2022-11-04 维沃移动通信有限公司 图像处理方法、装置、电子设备和可读存储介质
CN117152022B (zh) * 2023-10-25 2024-08-09 荣耀终端有限公司 图像处理方法及电子设备

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289668A (zh) * 2011-09-07 2011-12-21 谭洪舟 基于像素邻域特征的自适应文字图像的二值化处理方法
US20130322746A1 (en) * 2012-05-31 2013-12-05 Apple Inc. Systems and methods for ycc image processing
CN109035175A (zh) * 2018-08-22 2018-12-18 深圳市联合视觉创新科技有限公司 基于色彩纠正与脉冲耦合神经网络的人脸图像增强方法
CN109712097A (zh) * 2019-01-04 2019-05-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备
CN112102204A (zh) * 2020-09-27 2020-12-18 苏州科达科技股份有限公司 图像增强方法、装置及电子设备
CN112330574A (zh) * 2020-11-30 2021-02-05 深圳市慧鲤科技有限公司 人像修复方法、装置、电子设备及计算机存储介质
CN115294055A (zh) * 2022-08-03 2022-11-04 维沃移动通信有限公司 图像处理方法、装置、电子设备和可读存储介质

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR100484170B1 (ko) * 2002-10-25 2005-04-19 삼성전자주식회사 디지털 화질 개선방법 및 장치
CN110390643B (zh) * 2018-04-20 2022-04-26 杭州海康威视数字技术股份有限公司 一种车牌增强方法、装置及电子设备
CN108846814B (zh) * 2018-06-11 2021-07-06 广州视源电子科技股份有限公司 图像处理方法、装置、可读存储介质及计算机设备
CN109726722B (zh) * 2018-12-20 2020-10-02 上海众源网络有限公司 一种字符分割方法及装置
CN112487848B (zh) * 2019-09-12 2024-04-26 京东方科技集团股份有限公司 文字识别方法和终端设备
CN114116079A (zh) * 2021-11-19 2022-03-01 深圳市华胜软件技术有限公司 文字显示方法、装置、存储介质及电子设备

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102289668A (zh) * 2011-09-07 2011-12-21 谭洪舟 基于像素邻域特征的自适应文字图像的二值化处理方法
US20130322746A1 (en) * 2012-05-31 2013-12-05 Apple Inc. Systems and methods for ycc image processing
CN109035175A (zh) * 2018-08-22 2018-12-18 深圳市联合视觉创新科技有限公司 基于色彩纠正与脉冲耦合神经网络的人脸图像增强方法
CN109712097A (zh) * 2019-01-04 2019-05-03 Oppo广东移动通信有限公司 图像处理方法、装置、存储介质及电子设备
CN112102204A (zh) * 2020-09-27 2020-12-18 苏州科达科技股份有限公司 图像增强方法、装置及电子设备
CN112330574A (zh) * 2020-11-30 2021-02-05 深圳市慧鲤科技有限公司 人像修复方法、装置、电子设备及计算机存储介质
CN115294055A (zh) * 2022-08-03 2022-11-04 维沃移动通信有限公司 图像处理方法、装置、电子设备和可读存储介质

Also Published As

Publication number Publication date
CN115294055A (zh) 2022-11-04

Similar Documents

Publication Publication Date Title
WO2021208600A1 (zh) 一种图像处理方法、智能设备及计算机可读存储介质
WO2020192483A1 (zh) 图像显示方法和设备
US12464226B2 (en) Photographing method and apparatus for intelligent framing recommendation
WO2021189733A1 (zh) 图像处理方法及装置、电子设备、存储介质
WO2023151511A1 (zh) 模型训练方法、图像去摩尔纹方法、装置及电子设备
WO2024027583A1 (zh) 图像处理方法、装置、电子设备和可读存储介质
WO2018113224A1 (zh) 一种图像缩小方法及装置
US20240422284A1 (en) Composite image generation based on image segmentation
CN111667556A (zh) 表格矫正方法及装置
CN108513069A (zh) 图像处理方法、装置、存储介质及电子设备
US9807315B1 (en) Lookup table interpolation in a film emulation camera system
CN115170581A (zh) 人像分割模型的生成方法、人像分割模型及人像分割方法
CN112598571B (zh) 一种图像缩放方法、装置、终端及存储介质
CN106548117A (zh) 一种人脸图像处理方法和装置
Guo et al. Low-light color imaging via cross-camera synthesis
CN114785957A (zh) 拍摄方法及其装置
CN116453131B (zh) 文档图像矫正方法、电子设备及存储介质
CN117768774A (zh) 图像处理器、图像处理方法、拍摄装置和电子设备
CN110009563B (zh) 图像处理方法和装置、电子设备及存储介质
CN115272127B (zh) 模型训练方法和装置、电子设备和可读存储介质
CN121056693A (zh) 动态照片处理方法、电子设备及存储介质
CN115883986A (zh) 图像处理方法及其装置
CN115589456A (zh) 拍摄方法及其装置
CN119071531A (zh) 图像处理方法、装置及电子设备
WO2026092388A1 (zh) 图像处理方法、装置、电子设备及可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23849291

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 23849291

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11-07-2025)

122 Ep: pct application non-entry in european phase

Ref document number: 23849291

Country of ref document: EP

Kind code of ref document: A1