CN112419179B - Method, apparatus, device and computer readable medium for repairing image - Google Patents
Method, apparatus, device and computer readable medium for repairing image Download PDFInfo
- Publication number
- CN112419179B CN112419179B CN202011299862.0A CN202011299862A CN112419179B CN 112419179 B CN112419179 B CN 112419179B CN 202011299862 A CN202011299862 A CN 202011299862A CN 112419179 B CN112419179 B CN 112419179B
- Authority
- CN
- China
- Prior art keywords
- image
- target
- sample
- region
- area
- 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.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 58
- 238000012545 processing Methods 0.000 claims abstract description 45
- 238000007781 pre-processing Methods 0.000 claims abstract description 37
- 230000004048 modification Effects 0.000 claims abstract description 36
- 238000012986 modification Methods 0.000 claims abstract description 36
- 238000001514 detection method Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 9
- 230000008569 process Effects 0.000 claims description 8
- 238000012549 training Methods 0.000 claims description 6
- 238000010276 construction Methods 0.000 claims description 5
- 230000008439 repair process Effects 0.000 abstract description 10
- 238000005516 engineering process Methods 0.000 abstract description 4
- 238000010586 diagram Methods 0.000 description 7
- 230000000694 effects Effects 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 238000004891 communication Methods 0.000 description 6
- 238000001914 filtration Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000009466 transformation Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 241000287127 Passeridae Species 0.000 description 1
- 238000013528 artificial neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 238000009792 diffusion process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000004321 preservation Methods 0.000 description 1
- 239000000047 product Substances 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000013589 supplement Substances 0.000 description 1
- 230000009469 supplementation Effects 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/77—Retouching; Inpainting; Scratch removal
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T5/00—Image enhancement or restoration
- G06T5/90—Dynamic range modification of images or parts thereof
- G06T5/94—Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20084—Artificial neural networks [ANN]
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- General Health & Medical Sciences (AREA)
- Molecular Biology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Data Mining & Analysis (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Biomedical Technology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Image Processing (AREA)
Abstract
Embodiments of the present disclosure disclose methods, apparatuses, electronic devices, and computer-readable media for repairing images. One embodiment of the method comprises the following steps: preprocessing an image to be repaired to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; determining at least one target region in the first image; processing the target area of the at least one target area to obtain a target modification area; constructing a second image based on at least one target modification region corresponding to the at least one target region; and carrying out image enhancement on the second image to obtain a target image. According to the embodiment, the image with missing or unobvious image characteristics is repaired, the repaired image content is more complete and the image quality is better by reasonably applying the repair technology.
Description
Technical Field
Embodiments of the present disclosure relate to the field of image processing, and in particular, to a method, apparatus, device, and computer readable medium for repairing an image.
Background
During the acquisition, transmission and preservation of images, image features may be lost or not apparent due to various factors (which may be electromagnetic interference, for example). Portions of image detail may be ignored in the process of global repair of an image. And related image restoration techniques do not solve this problem well.
Disclosure of Invention
The disclosure is in part intended to introduce concepts in a simplified form that are further described below in the detailed description. The disclosure is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter. Some embodiments of the present disclosure propose methods, apparatuses, devices, and computer-readable media for repairing images to solve the technical problems mentioned in the background section above.
In a first aspect, some embodiments of the present disclosure provide a method of repairing an image, the method comprising: preprocessing an image to be repaired to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; determining at least one target region in the first image; processing the target area of the at least one target area to obtain a target modification area; constructing a second image based on at least one target modification region corresponding to the at least one target region; and carrying out image enhancement on the second image to obtain a target image.
In a second aspect, some embodiments of the present disclosure provide an apparatus for repairing an image, the apparatus comprising: the preprocessing unit is configured to preprocess an image to be restored to obtain a first image, wherein the image to be restored is an image with missing or unobvious image characteristics; a determining unit configured to determine at least one target area in the first image; the processing unit is configured to process the target area for at least one target area to obtain a target modification area; a construction unit configured to construct a second image based on at least one target modification region corresponding to the at least one target region; and the enhancement unit is configured to carry out image enhancement on the second image to obtain a target image.
In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; and a storage device having one or more programs stored thereon, which when executed by the one or more processors, cause the one or more processors to implement a method of repairing an image as in the first aspect.
In a fourth aspect, some embodiments of the present disclosure provide a computer readable medium having a computer program stored thereon, wherein the program when executed by a processor implements a method of repairing an image as in the first aspect.
One of the above embodiments of the present disclosure has the following advantageous effects: firstly, preprocessing an image to be repaired to obtain a first image. The step is to repair the whole image, so that the repair effect of the image can be integrally grasped. Since repair of a full map may result in loss of local detail, detail repair of the local is required. Then, at least one target area in the first image is determined, and a target modification area of each target area is obtained, so that further restoration of the local image is realized, and specific details of the image can be enhanced. And finally, carrying out image enhancement on the second image constructed by the target modification area to obtain a target image, and realizing the supplementation and enhancement of the image characteristics of the image to be repaired. According to the embodiment, the image with missing or unobvious image characteristics is repaired, the repaired image content is more complete and the image quality is better by reasonably applying the repair technology.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a schematic illustration of one application scenario of a method of repairing an image according to some embodiments of the present disclosure;
FIG. 2 is a flow chart of some embodiments of a method of repairing an image according to the present disclosure;
FIG. 3 is a flow chart of other embodiments of a method of repairing an image according to the present disclosure;
FIG. 4 is a flow chart of yet other embodiments of a method of repairing an image according to the present disclosure;
FIG. 5 is a schematic structural view of some embodiments of an apparatus for repairing an image according to the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device suitable for use in implementing some embodiments of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings. Embodiments of the present disclosure and features of embodiments may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The present disclosure will be described in detail below with reference to the accompanying drawings in conjunction with embodiments.
Fig. 1 is a schematic diagram of one application scenario of a method of repairing an image according to some embodiments of the present disclosure.
In the application scenario of fig. 1, first, the electronic device 101 may receive an image 102 to be repaired. Then, the electronic device 101 performs preprocessing on the image to be restored 102 to obtain a first image 103. The first image 103 is an image subjected to global restoration. Further processing of the first image 103 is required. Next, a target area 104 in the first image 103 is determined. The target area 104 is processed to obtain a target modified area 105. A second image 106 is constructed based on the target modification region 105. This allows finer processing of the local details of the image. Finally, the second image 106 is subjected to image enhancement, resulting in a target image 107. Image enhancement is to further enhance image features.
The electronic device 101 may be hardware or software. When the electronic device is hardware, the electronic device may be implemented as a distributed cluster formed by a plurality of servers or terminal devices, or may be implemented as a single server or a single terminal device. When the electronic device is embodied as software, it may be installed in the above-listed hardware device. It may be implemented as a plurality of software or software modules, for example, for providing distributed services, or as a single software or software module. The present invention is not particularly limited herein.
It should be understood that the number of electronic devices in fig. 1 is merely illustrative. There may be any number of electronic devices as desired for an implementation.
With continued reference to fig. 2, a flow 200 of some embodiments of a method of repairing an image according to the present disclosure is shown. The method for repairing the image comprises the following steps:
Step 201, preprocessing an image to be repaired to obtain a first image.
In some embodiments, an execution subject of the method of repairing an image (e.g., the electronic device 101 shown in fig. 1) may receive an image to be repaired through a wired connection or a wireless connection. The image to be repaired may be an image with missing or insignificant image features. It should be noted that the wireless connection may include, but is not limited to, 3G/4G/5G connection, wiFi connection, bluetooth connection, wiMAX connection, zigbee connection, UWB (ultra wideband) connection, and other now known or later developed wireless connection.
In some embodiments, the image to be repaired is generally an image that loses some necessary image features or has insignificant image features. The image to be repaired may be an image obtained by old photographing equipment or an image obtained by scanning a previous old photograph. The image to be repaired may be any image. As an example, the image to be repaired may be an image of a pig, sparrow, house, or the like, on which a human face is displayed.
In some embodiments, the preprocessing described above is the overall restoration of the image to be restored. As an example, an image to be repaired may be repaired by existing image repair software.
At step 202, at least one target region in a first image is determined.
In some embodiments, based on the first image in step 201, the executing body (e.g., the electronic device shown in fig. 1) may determine at least one target area in the first image. Typically, a target object image is present in the target area. The execution subject may determine the target area in the first image by target detection.
And 203, processing the target area for the target area of the at least one target area to obtain a target modification area.
In some embodiments, the execution subject may derive the target modified region by performing image processing operations such as adjusting contrast, sharpening, etc. on the target region, as examples. Therefore, the details of the target area are repaired again in a targeted manner, and the image characteristic repair of the image part is realized.
Step 204, constructing a second image based on at least one target modification area corresponding to the at least one target area.
In some embodiments, the first image of the re-detail processed target area is the resulting second image.
And step 205, performing image enhancement on the second image to obtain a target image.
In some embodiments, image enhancement may be achieved by several algorithms: gray linear transformation, histogram equalization transformation, homomorphic filtering and other algorithms. Image enhancement is to further enhance image features so that image details are more clear.
The method provided by some embodiments of the present disclosure aims at performing image restoration on an image to be restored within a full image range, and the obtained first image mainly considers the overall effect of the image. And then, the detail of the target area is repaired again in a targeted manner. Finally, image enhancement is performed with the aim of improving the visual effect of the image, purposefully emphasizing the overall or local characteristics of the image for the application of the given image. The original unclear image is changed into clear or some specific image features are emphasized, the differences among different object features in the image are enlarged, and the uninteresting features are restrained. Therefore, the image quality and the information quantity can be improved, the image interpretation and recognition effects are enhanced, and the requirements of certain special analysis are met. The method realizes the restoration of the image with missing or unobvious image features, and the restored image content is more complete and the image quality is better by reasonably applying the restoration technology.
With further reference to FIG. 3, a flow 300 of further embodiments of a method of repairing an image is shown. The flow 300 of the method of repairing an image includes the steps of:
Step 301, inputting an image to be repaired into a preprocessing model to obtain a first image.
In some embodiments, as an example, the algorithm of the preprocessing model may include: diffusion-based methods, texture synthesis-based methods, data-driven image restoration-based methods, and the like.
In an alternative implementation of some embodiments, the pre-processing model is obtained by: acquiring a plurality of sample images and sample target images corresponding to each sample image in the plurality of sample images, wherein the sample images are images with missing or unobvious image features, and the sample target images are images with complete image features corresponding to the sample images; taking each sample image in the plurality of sample images as input, taking a sample target image corresponding to each sample image in the plurality of sample images as output, and training to obtain a preprocessing model.
In an alternative implementation of some embodiments, the sample target image is obtained by: identifying a sample target object within the sample image; adding color based on the sample target object to obtain a sample color image; performing color balance processing on the sample color image to obtain a sample color balance image; defogging the sample color balance image to obtain a sample defogging image; adjusting the definition of the defogging image of the sample to obtain a clear image of the sample; and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image. As an example, adding color to the sample image may be accomplished by online software; color balancing of color images may also be accomplished by image processing software; the defogging operation of the sample can be completed through an end-to-end neural network model, and can also be realized according to an atmospheric degradation model; the algorithm for making the image clear can be wiener filtering, fourier transformation, etc.; the method for increasing the pixels of the sample clear image, namely the super-division of the image, is an interpolation method, a method based on sparse representation (dictionary learning), and the like. The image restoration process is to color the image to obtain a sample color image. And performing color balance on the sample color image to obtain a sample color balance image. This step is for the color transition in the image to be more natural. Then defogging operation is carried out on the sample color balance image to obtain a sample defogging image, so that the foggy image is clearer and the image without foggy is not affected by the operation of the step. After defogging, the definition of the defogging image of the sample needs to be adjusted to obtain the clear image of the sample, and the image quality is better. And finally, adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image, wherein the step is the super-division operation of the image and is the supplement of pixels of image details.
Step 302, inputting the first image into the target detection model, and obtaining at least one target area of the first image.
In some embodiments, the object detection model is used to identify at least one object image in the first image and to set a corresponding object region for each of the at least one object image. As an example, the object detection model may enable determination of the object region through an object detection network. As an example, the target detection network may be an R-CNN network, SPPNet network, fast R-CNN network, or the like.
Step 303, for a target area in at least one target area, inputting the target area into the area processing model, and obtaining a target modification area corresponding to the target area.
In some embodiments, the region processing model is used to repair image features of the target object image within the target region. The target modification area is obtained by further detail processing of the target area in the image. As an example, the region processing model may be a convolutional self-encoding based image restoration model, a generating countermeasure network based image restoration model, and a recurrent neural network based image restoration model.
Step 304, constructing a second image based on at least one target modification area corresponding to the at least one target area.
In some embodiments, the second image is an image obtained by further detail restoration of the target area based on the first image.
And step 305, performing image enhancement on the second image to obtain a target image.
In some embodiments, the specific implementation of the steps 304 and 305 and the technical effects thereof may refer to the steps 204 and 205 in the corresponding embodiment of fig. 2, which are not described herein again.
As can be seen in fig. 3, the flow 300 of the method of repairing an image in some embodiments corresponding to fig. 3 embodies the operation of how to obtain a first image, determine a target area, and modify the target area, as compared to the description of some embodiments corresponding to fig. 2. The model is preprocessed to the first image. The image features can be controlled in their entirety. In addition, the order of image restoration in the pre-model is also important, and different operation orders may bring about different results. The operation steps of repairing the image can be reasonably distributed by training the pre-model. And obtaining a target area through a target detection model. By using the target detection model, the region needing special restoration can be well found, so that the details of the restored image can be more fully embodied. And obtaining a target modification area through the area processing model. Image restoration is carried out on the area, so that the restoration is more targeted and the restoration effect is better.
With further reference to fig. 4, a flow 400 of further embodiments of a method of repairing an image is shown. The flow 400 of the method of repairing an image includes the steps of:
step 401, preprocessing an image to be repaired to obtain a first image.
At step 402, at least one target region in a first image is determined.
And step 403, adjusting the definition of the target area to obtain the target clear area.
In some embodiments, the adjustment of the sharpness of the target area may be achieved by non-neighborhood filtering, least squares filtering, and the like.
And step 404, adding pixels of the target clear region to obtain a target modification region.
In some embodiments, as an Example, the pixels of the target region may be added by a local embedding (Neighbor Embedding) -Based method, an Example-Based (Example-Based) super-resolution reconstruction method, or the like.
Step 405, constructing a second image based on at least one target modification area corresponding to the at least one target area.
And step 406, performing image enhancement on the second image to obtain a target image.
In some embodiments, the specific implementation of the steps 401, 402, 405, 406 and the technical effects thereof may refer to the steps 201, 202, 204, 205 in the corresponding embodiment of fig. 2, which are not described herein again.
As can be seen in fig. 4, flow 400 of the method of repairing an image in some embodiments corresponding to fig. 4 embodies one implementation of repairing a target area, as compared to the description of some embodiments corresponding to fig. 3. The detail adjustment of the target area is completed by adjusting the definition of the target area and increasing the pixels of the target area. Therefore, the image details can be well supplemented, and the problem that local details of the image can be lost after the whole image is repaired is solved.
With further reference to fig. 5, as an implementation of the method shown in the above figures, the present disclosure provides some embodiments of an apparatus for repairing an image, which apparatus embodiments correspond to those method embodiments shown in fig. 2, and which apparatus is particularly applicable in various electronic devices.
As shown in fig. 5, an apparatus 500 for repairing an image of some embodiments includes: a preprocessing unit 501 configured to preprocess an image to be repaired to obtain a first image, where the image to be repaired is an image with missing or insignificant image features; a determining unit 502 configured to determine at least one target area in the first image; a processing unit 503 configured to process the target area with respect to the target area of the at least one target area, to obtain a target modified area; a construction unit 504 configured to construct a second image based on at least one target modification region corresponding to the at least one target region; the enhancement unit 505 is configured to perform image enhancement on the second image, so as to obtain a target image.
In an alternative implementation of some embodiments, the preprocessing unit 501 is further configured to: inputting the image to be repaired into a preprocessing model to obtain a first image.
In an alternative implementation of some embodiments, the pre-processing model is obtained by: acquiring a plurality of sample images and sample target images corresponding to each sample image in the plurality of sample images, wherein the sample images are images with missing or unobvious image features, and the sample target images are images with complete image features corresponding to the sample images; taking each sample image in the plurality of sample images as input, taking a sample target image corresponding to each sample image in the plurality of sample images as output, and training to obtain a preprocessing model.
In an alternative implementation of some embodiments, the sample target image is obtained by: identifying a sample target object within the sample image; adding color based on the sample target object to obtain a sample color image; performing color balance processing on the sample color image to obtain a sample color balance image; defogging the sample color balance image to obtain a sample defogging image; adjusting the definition of the defogging image of the sample to obtain a clear image of the sample; and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image.
In an alternative implementation of some embodiments, the determining unit 502 is further configured to: the first image is input into a target detection model to obtain at least one target area of the first image, the target detection model is used for identifying at least one target object image in the first image, and a corresponding target area is set for each target object image in the at least one target object image.
In an alternative implementation of some embodiments, the processing unit 503 is further configured to: and inputting the target region into a region processing model for the target region in at least one target region to obtain a target modification region corresponding to the target region, wherein the region processing model is used for repairing the image characteristics of the target object image in the target region.
In an alternative implementation of some embodiments, the processing unit 503 is further configured to: adjusting the definition of the target area to obtain a target clear area; and adding pixels of the target clear region to obtain a target modification region.
It will be appreciated that the elements described in the apparatus 500 correspond to the various steps in the method described with reference to fig. 2. Thus, the operations, features and resulting benefits described above with respect to the method are equally applicable to the apparatus 500 and the units contained therein, and are not described in detail herein.
Referring now to fig. 6, a schematic diagram of an electronic device (e.g., server or terminal device of fig. 1) 600 suitable for use in implementing some embodiments of the present disclosure is shown. The electronic devices in some embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, as well as stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 6 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of the present disclosure.
As shown in fig. 6, the electronic device 600 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 601, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 602 or a program loaded from a storage means 608 into a Random Access Memory (RAM) 603. In the RAM603, various programs and data required for the operation of the electronic apparatus 600 are also stored. The processing device 601, the ROM 602, and the RAM603 are connected to each other through a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
In general, the following devices may be connected to the I/O interface 605: input devices 606 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, and the like; an output device 607 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 608 including, for example, magnetic tape, hard disk, etc.; and a communication device 609. The communication means 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. While fig. 6 shows an electronic device 600 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead. Each block shown in fig. 6 may represent one device or a plurality of devices as needed.
In particular, according to some embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, some embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via communications device 609, or from storage device 608, or from ROM 602. The above-described functions defined in the methods of some embodiments of the present disclosure are performed when the computer program is executed by the processing device 601.
It should be noted that, the computer readable medium described in some embodiments of the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In some embodiments of the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In some embodiments of the present disclosure, however, the computer-readable signal medium may comprise a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device. The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: preprocessing an image to be repaired to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; determining at least one target region in the first image; processing the target area of the at least one target area to obtain a target modification area; constructing a second image based on at least one target modification region corresponding to the at least one target region; and carrying out image enhancement on the second image to obtain a target image.
Computer program code for carrying out operations for some embodiments of the present disclosure may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in some embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The described units may also be provided in a processor, for example, described as: a processor includes a preprocessing unit, a determination unit, a processing unit, a construction unit, and an enhancement unit. The names of these units do not constitute a limitation on the unit itself in some cases, and for example, the preprocessing unit may also be described as "a unit that preprocesses an image to be restored".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
According to one or more embodiments of the present disclosure, there is provided a method of repairing an image, including: preprocessing an image to be repaired to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; determining at least one target region in the first image; processing the target area of the at least one target area to obtain a target modification area; constructing a second image based on at least one target modification region corresponding to the at least one target region; and carrying out image enhancement on the second image to obtain a target image.
According to one or more embodiments of the present disclosure, preprocessing an image to be repaired to obtain a first image, including: inputting the image to be repaired into a preprocessing model to obtain a first image.
According to one or more embodiments of the present disclosure, the pre-processing model is obtained by: acquiring a plurality of sample images and sample target images corresponding to each sample image in the plurality of sample images, wherein the sample images are images with missing or unobvious image features, and the sample target images are images with complete image features corresponding to the sample images; taking each sample image in the plurality of sample images as input, taking a sample target image corresponding to each sample image in the plurality of sample images as output, and training to obtain a preprocessing model.
According to one or more embodiments of the present disclosure, a sample target image is obtained by: identifying a sample target object within the sample image; adding color based on the sample target object to obtain a sample color image; performing color balance processing on the sample color image to obtain a sample color balance image; defogging the sample color balance image to obtain a sample defogging image; adjusting the definition of the defogging image of the sample to obtain a clear image of the sample; and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image.
According to one or more embodiments of the present disclosure, determining at least one target region in a first image includes: the first image is input into a target detection model to obtain at least one target area of the first image, the target detection model is used for identifying at least one target object image in the first image, and a corresponding target area is set for each target object image in the at least one target object image.
According to one or more embodiments of the present disclosure, for a target area of at least one target area, processing the target area to obtain a target modified area includes: and inputting the target region into a region processing model for repairing the image characteristics of the target object image in the target region to obtain a target modification region corresponding to the target region.
According to one or more embodiments of the present disclosure, inputting a target region into a region processing model, resulting in a target modified region corresponding to the target region, includes: adjusting the definition of the target area to obtain a target clear area; and adding pixels of the target clear region to obtain a target modification region.
According to one or more embodiments of the present disclosure, there is provided an apparatus for repairing an image, including: the preprocessing unit is configured to preprocess an image to be restored to obtain a first image, wherein the image to be restored is an image with missing or unobvious image characteristics; a determining unit configured to determine at least one target area in the first image; the processing unit is configured to process the target area for at least one target area to obtain a target modification area; a construction unit configured to construct a second image based on at least one target modification region corresponding to the at least one target region; and the enhancement unit is configured to carry out image enhancement on the second image to obtain a target image.
According to one or more embodiments of the present disclosure, the preprocessing unit is further configured to: inputting the image to be repaired into a preprocessing model to obtain a first image.
According to one or more embodiments of the present disclosure, the pre-processing model is obtained by: acquiring a plurality of sample images and sample target images corresponding to each sample image in the plurality of sample images, wherein the sample images are images with missing or unobvious image features, and the sample target images are images with complete image features corresponding to the sample images; taking each sample image in the plurality of sample images as input, taking a sample target image corresponding to each sample image in the plurality of sample images as output, and training to obtain a preprocessing model.
According to one or more embodiments of the present disclosure, a sample target image is obtained by: identifying a sample target object within the sample image; adding color based on the sample target object to obtain a sample color image; performing color balance processing on the sample color image to obtain a sample color balance image; defogging the sample color balance image to obtain a sample defogging image; adjusting the definition of the defogging image of the sample to obtain a clear image of the sample; and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image.
According to one or more embodiments of the present disclosure, the determining unit is further configured to: the first image is input into a target detection model to obtain at least one target area of the first image, the target detection model is used for identifying at least one target object image in the first image, and a corresponding target area is set for each target object image in the at least one target object image.
According to one or more embodiments of the present disclosure, the processing unit is further configured to: and inputting the target region into a region processing model for the target region in at least one target region to obtain a target modification region corresponding to the target region, wherein the region processing model is used for repairing the image characteristics of the target object image in the target region.
According to one or more embodiments of the present disclosure, the processing unit is further configured to: adjusting the definition of the target area to obtain a target clear area; and adding pixels of the target clear region to obtain a target modification region.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by those skilled in the art that the scope of the invention in the embodiments of the present disclosure is not limited to the specific combination of the above technical features, but encompasses other technical features formed by any combination of the above technical features or their equivalents without departing from the spirit of the invention. Such as the above-described features, are mutually substituted with (but not limited to) the features having similar functions disclosed in the embodiments of the present disclosure.
Claims (8)
1. A method of repairing an image, comprising:
Inputting an image to be repaired into a preprocessing model to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; the preprocessing model is obtained based on a sample image and a sample target image;
determining at least one target region in the first image;
Processing the target area of the at least one target area to obtain a target modification area;
constructing a second image based on at least one target modification region corresponding to the at least one target region;
Performing image enhancement on the second image to obtain a target image;
the sample target image is obtained through the following steps:
identifying a sample target object within the sample image;
Adding color based on the sample target object to obtain a sample color image;
Performing color balance processing on the sample color image to obtain a sample color balance image;
Defogging the sample color balance image to obtain a sample defogging image;
adjusting the definition of the defogging image of the sample to obtain a clear image of the sample;
and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image.
2. The method of claim 1, wherein the pre-processing model is obtained by:
Acquiring a plurality of sample images and sample target images corresponding to each sample image in the plurality of sample images, wherein the sample images are images with missing or unobvious image features, and the sample target images are images with complete image features corresponding to the sample images;
And taking each sample image in the plurality of sample images as input, taking a sample target image corresponding to each sample image in the plurality of sample images as output, and training to obtain the preprocessing model.
3. The method of claim 1, wherein the determining at least one target region in the first image comprises:
And inputting the first image into a target detection model to obtain at least one target area of the first image, wherein the target detection model is used for identifying at least one target object image in the first image and setting a corresponding target area for each target object image in the at least one target object image.
4. A method according to claim 3, wherein said processing said target area for said at least one target area to obtain a target modified area comprises:
and inputting the target region into a region processing model for the target region in the at least one target region to obtain a target modification region corresponding to the target region, wherein the region processing model is used for repairing the image characteristics of the target object image in the target region.
5. The method of claim 4, wherein the inputting the target region into a region processing model results in a target modified region corresponding to the target region, comprising:
adjusting the definition of the target area to obtain a target clear area;
and adding pixels of the target clear region to obtain the target modification region.
6. An apparatus for acquiring an image, comprising:
The preprocessing unit is configured to input an image to be repaired into the preprocessing model to obtain a first image, wherein the image to be repaired is an image with missing or unobvious image characteristics; the preprocessing model is obtained based on a sample image and a sample target image;
A determining unit configured to determine at least one target area in the first image;
The processing unit is configured to process the target area of the at least one target area to obtain a target modification area;
a construction unit configured to construct a second image based on at least one target modification region corresponding to the at least one target region;
an enhancement unit configured to perform image enhancement on the second image to obtain a target image;
the sample target image is obtained through the following steps:
identifying a sample target object within the sample image;
Adding color based on the sample target object to obtain a sample color image;
Performing color balance processing on the sample color image to obtain a sample color balance image;
Defogging the sample color balance image to obtain a sample defogging image;
adjusting the definition of the defogging image of the sample to obtain a clear image of the sample;
and adding pixels of the sample clear image to obtain a sample target image corresponding to the sample image.
7. An electronic device, comprising:
one or more processors;
a storage device having one or more programs stored thereon,
When executed by the one or more processors, causes the one or more processors to implement the method of any of claims 1 to 5.
8. A computer readable medium having stored thereon a computer program, wherein the program when executed by a processor implements the method of any of claims 1 to 5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011299862.0A CN112419179B (en) | 2020-11-18 | 2020-11-18 | Method, apparatus, device and computer readable medium for repairing image |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011299862.0A CN112419179B (en) | 2020-11-18 | 2020-11-18 | Method, apparatus, device and computer readable medium for repairing image |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112419179A CN112419179A (en) | 2021-02-26 |
CN112419179B true CN112419179B (en) | 2024-07-05 |
Family
ID=74773467
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011299862.0A Active CN112419179B (en) | 2020-11-18 | 2020-11-18 | Method, apparatus, device and computer readable medium for repairing image |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112419179B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113344832A (en) * | 2021-05-28 | 2021-09-03 | 杭州睿胜软件有限公司 | Image processing method and device, electronic equipment and storage medium |
CN114332334A (en) * | 2021-12-31 | 2022-04-12 | 中国电信股份有限公司 | Image processing method, image processing device, storage medium and electronic equipment |
CN114782418B (en) * | 2022-06-16 | 2022-09-16 | 深圳市信润富联数字科技有限公司 | Detection method and device for ceramic tile surface defects and storage medium |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445415A (en) * | 2020-03-30 | 2020-07-24 | 北京市商汤科技开发有限公司 | Image restoration method and device, electronic equipment and storage medium |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101142739B1 (en) * | 2009-10-29 | 2012-05-03 | 삼성전자주식회사 | Apparatus and method for inpainting image by restricting reference image region |
KR101539013B1 (en) * | 2014-03-19 | 2015-07-24 | 한림대학교 산학협력단 | Apparatus and method for inpainting image |
CN108921806B (en) * | 2018-08-07 | 2020-08-07 | Oppo广东移动通信有限公司 | Image processing method, image processing device and terminal equipment |
CN110415178A (en) * | 2019-06-06 | 2019-11-05 | 长春理工大学 | A kind of underwater picture clarification method estimated based on electromagnetic wave energy residue ratio and bias light |
CN110288036B (en) * | 2019-06-28 | 2021-11-09 | 北京字节跳动网络技术有限公司 | Image restoration method and device and electronic equipment |
CN110458769B (en) * | 2019-07-22 | 2023-04-07 | 天津大学 | Color polarization image restoration method based on elimination of inter-channel crosstalk |
CN111784602B (en) * | 2020-06-28 | 2022-09-23 | 江西理工大学 | Method for generating countermeasure network for image restoration |
CN111784712B (en) * | 2020-07-17 | 2023-03-14 | 北京字节跳动网络技术有限公司 | Image processing method, device, equipment and computer readable medium |
-
2020
- 2020-11-18 CN CN202011299862.0A patent/CN112419179B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111445415A (en) * | 2020-03-30 | 2020-07-24 | 北京市商汤科技开发有限公司 | Image restoration method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN112419179A (en) | 2021-02-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107633218B (en) | Method and apparatus for generating image | |
CN112419179B (en) | Method, apparatus, device and computer readable medium for repairing image | |
CN112419151B (en) | Image degradation processing method and device, storage medium and electronic equipment | |
CN110021052B (en) | Method and apparatus for generating fundus image generation model | |
US11514263B2 (en) | Method and apparatus for processing image | |
CN110288625B (en) | Method and apparatus for processing image | |
CN112381717A (en) | Image processing method, model training method, device, medium, and apparatus | |
CN111784712A (en) | Image processing method, device, equipment and computer readable medium | |
CN112330788A (en) | Image processing method, image processing device, readable medium and electronic equipment | |
CN114898177B (en) | Defect image generation method, model training method, device, medium and product | |
CN112418249A (en) | Mask image generation method and device, electronic equipment and computer readable medium | |
CN112418054B (en) | Image processing method, apparatus, electronic device, and computer readable medium | |
CN110751251B (en) | Method and device for generating and transforming two-dimensional code image matrix | |
CN110765304A (en) | Image processing method, image processing device, electronic equipment and computer readable medium | |
CN109816670B (en) | Method and apparatus for generating image segmentation model | |
CN112070888B (en) | Image generation method, device, equipment and computer readable medium | |
CN113688928B (en) | Image matching method and device, electronic equipment and computer readable medium | |
CN116188641A (en) | Digital person generation method and device, electronic equipment and storage medium | |
CN116188254A (en) | Fourier domain-based super-resolution image processing method, device, equipment and medium | |
CN114972876A (en) | Knowledge distillation technology-based image processing method, device, equipment and medium | |
CN111815535B (en) | Image processing method, apparatus, electronic device, and computer readable medium | |
CN111369472B (en) | Image defogging method and device, electronic equipment and medium | |
CN114972021A (en) | Image processing method and device, electronic equipment and storage medium | |
CN114399696A (en) | Target detection method and device, storage medium and electronic equipment | |
CN112418233A (en) | Image processing method, image processing device, readable medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |