CN110913193B - Image processing method, device, apparatus and computer readable storage medium - Google Patents
Image processing method, device, apparatus and computer readable storage medium Download PDFInfo
- Publication number
- CN110913193B CN110913193B CN201911177918.2A CN201911177918A CN110913193B CN 110913193 B CN110913193 B CN 110913193B CN 201911177918 A CN201911177918 A CN 201911177918A CN 110913193 B CN110913193 B CN 110913193B
- Authority
- CN
- China
- Prior art keywords
- image
- processed
- image processing
- pixel region
- pixel
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N9/00—Details of colour television systems
- H04N9/64—Circuits for processing colour signals
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Processing (AREA)
Abstract
The invention discloses an image processing method, equipment, a device and a computer readable storage medium, wherein the image processing method comprises the following steps: acquiring a first pixel area in an image to be processed and an auxiliary image; determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on a functional algorithm and the first pixel region of the auxiliary image; and determining the second pixel area of the image to be processed based on the partial image processing result and the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, thereby obtaining a processed image. The invention solves the technical problem that the algorithm for processing the image is difficult to process an ideal designated area or an irregular area by acting the functional algorithm on the partial area in the image to be processed by the aid of the first pixel area of the auxiliary image.
Description
Technical Field
The present invention relates to the field of image processing, and in particular, to an image processing method, an image processing apparatus, an image processing device, and a computer-readable storage medium.
Background
A very big feature of image processing research is that it is a useful discipline closely linked to the actual application, and all algorithms exist for problems encountered in practice. Whether an algorithm is newly proposed or a certain algorithm is used, the algorithm can be directly utilized, and a program is written to check the processing effect of the algorithm, so that most of means of multi-image processing use the algorithm to process images, the application research of image processing is still very popular nowadays, and greater requirements are put on the efficiency and the practicability of the image processing.
In the prior art, when an image needs to be processed, most algorithms for processing the image process are based on all contents of the whole image, and an ideal designated area or an irregular area cannot be processed.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide an image processing method, equipment, a device and a computer readable storage medium, aiming at solving the technical problem that an algorithm for processing an image is difficult to process an ideal specified area or an irregular area.
In order to achieve the above object, the present invention provides an image processing method including the steps of:
acquiring a first pixel area in an image to be processed and an auxiliary image;
determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on a functional algorithm and the first pixel region of the auxiliary image;
and determining the second pixel area of the image to be processed based on the partial image processing result and the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, thereby obtaining a processed image.
Optionally, the first pixel region includes a red value region, a green value region, or a blue value region, and the step of determining, based on the functional algorithm and the first pixel region of the auxiliary image, a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the image to be processed includes:
determining an image processing result corresponding to the functional algorithm;
determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed based on the image processing result and the first pixel region of the auxiliary image.
Optionally, the step of determining, based on the image processing result and a first pixel region of the auxiliary image, a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the image to be processed includes:
determining a processing scaling factor of the image to be processed based on a first pixel region of the auxiliary image;
and determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on the image processing result and the processing scale factor.
Optionally, the first pixel region includes a black value region, and the step of determining the processing scaling factor of the image to be processed based on the first pixel region of the auxiliary image includes:
after the step of obtaining the first pixel region in the image to be processed and the auxiliary image, the method further comprises the following steps:
determining an image processing result corresponding to the functional algorithm;
and if the first pixel area is the black value area, determining an original image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the black value area, and replacing the second pixel area of the image to be processed with an image corresponding to the original image processing result.
Optionally, the determining, based on the partial image processing result and the image to be processed, the second pixel region of the image to be processed to replace the second pixel region of the image to be processed with an image corresponding to the partial image processing result, so as to obtain a processed image includes:
acquiring a pixel color value of the image to be processed;
and determining the second pixel area of the image to be processed based on the partial image processing result and the pixel color value of the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, and obtaining the processed image.
Optionally, the step of obtaining the first pixel region in the to-be-processed image and the auxiliary image includes:
and determining a red value area, a green value area, a blue value area or a black value area in the auxiliary image according to a preset drawing mode.
Optionally, the step of acquiring the first pixel region in the image to be processed and the auxiliary image includes:
acquiring an image to be processed and a preset auxiliary image;
transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode to obtain the auxiliary image;
a first pixel region in the auxiliary image is acquired.
Optionally, the image processing apparatus includes:
the acquisition device is used for acquiring a first pixel area in the image to be processed and the auxiliary image;
first determining means for determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed, based on a functional algorithm and the first pixel region of the auxiliary image;
and the second determining device is used for determining the second pixel area of the image to be processed based on the partial image processing result and the image to be processed so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, and thus a processed image is obtained.
Further, to achieve the above object, the present invention also provides an image processing apparatus comprising: a memory, a processor and an image processing program stored on the memory and executable on the processor, the image processing program when executed by the processor implementing the steps of the image processing method as described above.
In addition, to achieve the above object, the present invention further provides a computer-readable storage medium, wherein an image processing program is stored on the computer-readable storage medium, and when the image processing program is executed by a processor, the image processing program realizes the steps of the image processing method as described above.
The method comprises the steps of obtaining a first pixel area in an image to be processed and an auxiliary image; determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on a functional algorithm and the first pixel region of the auxiliary image; the second pixel area of the image to be processed is determined based on the partial image processing result and the image to be processed, the second pixel area of the image to be processed is replaced by the image corresponding to the partial image processing result, the processed image is obtained, and the functional algorithm is acted on the partial area in the image to be processed by means of the first pixel area of the auxiliary image, so that the image processing on the designated area or the irregular area is realized, the technical problem that the algorithm for processing the image is difficult to process the ideal designated area or the irregular area is solved, and great convenience is brought to the irregular image processing.
Drawings
FIG. 1 is a schematic diagram of an image processing apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of an image processing method according to the present invention;
fig. 3 is a schematic system diagram of an image processing apparatus according to an embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic diagram of an image processing apparatus in a hardware operating environment according to an embodiment of the present invention.
The image processing device in the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, a portable computer and the like.
As shown in fig. 1, the image processing apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the image processing apparatus configuration shown in fig. 1 does not constitute a limitation of the image processing apparatus, and may include more or less components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and an image processing program.
In the image processing apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call up an image processing program stored in the memory 1005.
In the present embodiment, an image processing apparatus includes: a memory 1005, a processor 1001 and an image processing program stored in the memory 1005 and executable on the processor 1001, wherein the processor 1001, when calling the image processing program stored in the memory 1005, performs the following operations:
acquiring a first pixel area in an image to be processed and an auxiliary image;
determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on a functional algorithm and the first pixel region of the auxiliary image;
and determining the second pixel area of the image to be processed based on the partial image processing result and the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, thereby obtaining a processed image.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
determining an image processing result corresponding to the functional algorithm;
determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed based on the image processing result and the first pixel region of the auxiliary image.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
determining a processing scaling factor of the image to be processed based on a first pixel region of the auxiliary image;
and determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on the image processing result and the processing scale factor.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
after the step of obtaining the first pixel region in the image to be processed and the auxiliary image, the method further comprises the following steps:
determining an image processing result corresponding to the functional algorithm;
and if the first pixel area is the black value area, determining an original image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the black value area, and replacing the second pixel area of the image to be processed with an image corresponding to the original image processing result.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
acquiring a pixel color value of the image to be processed;
and determining the second pixel area of the image to be processed based on the partial image processing result and the pixel color value of the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, and obtaining the processed image.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
and determining a red value area, a green value area, a blue value area or a black value area in the auxiliary image according to a preset drawing mode.
Further, the processor 1001 may call an image processing program stored in the memory 1005, and also perform the following operations:
acquiring an image to be processed and a preset auxiliary image;
transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode to obtain the auxiliary image;
a first pixel region in the auxiliary image is acquired.
The present invention further provides an image processing method, referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of the image processing method of the present invention, in this embodiment, the image processing method includes the following steps:
step S10, acquiring a first pixel area in the image to be processed and the auxiliary image;
in this embodiment, before an image is processed, a to-be-processed image and an auxiliary image are first obtained, where the to-be-processed image is an object of image processing, the auxiliary image is used for an auxiliary function algorithm to perform processing on the to-be-processed image, and a size of the auxiliary image is consistent with a size of the to-be-processed image, and a first pixel region in the auxiliary image is also used for the auxiliary function algorithm to perform processing on the to-be-processed image, and sources of the to-be-processed image and the auxiliary image in this embodiment are not limited. The image to be processed is an object to be processed by the image processing method in this embodiment, the source of the image to be processed is not limited, and the image to be processed may be from any frame of image in a game, may also be from any frame of image in a video, may also be from a photo taken by a camera, or may be from a database, a photo library, a local memory, a network memory, or the like, may be a bitmap, a vector diagram, or the like, or may also be a landscape image, a portrait photo, a frame of image in a game, or a medical image, and the like, which is not limited in this embodiment. The auxiliary image is an image used for assisting processing of an image to be processed, the auxiliary image includes a first pixel region, the auxiliary image may include only one first pixel region or may include a plurality of first pixel regions, the first pixel region includes a red value region and/or a green value region and/or a blue value region and/or a black value region, for example, the auxiliary image may include only a red value region, may also include a red value region and a black value region, and may also include a red value region, a green value region, a blue value region and a black value region; the R channel value range of the red value area in the auxiliary image is 0-1 or 0-255 and other channel values are 0, the G channel value range of the green value area is 0-1 or 0-255 and other channel values are 0, the B channel value range of the blue value area is 0-1 or 0-255 and other channel values are 0, and the R channel value, the G channel value and the B channel value of the black value area are all 0.
A step S20 of determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed, based on a functional algorithm and the first pixel region of the auxiliary image;
the functional algorithm is a functional algorithm for processing an image to be processed to have a certain functional effect, and the functional algorithm is generally realized by writing an algorithm program, and includes a pixel point translation algorithm, an image expansion algorithm, an image scaling algorithm, an image warping algorithm, a sine wave transformation algorithm, and the like, and a source of the functional algorithm may be a preset algorithm library or written by a developer, and the like, and the source of the functional algorithm is not limited in this embodiment.
In this embodiment, after the first pixel region in the image to be processed and the auxiliary image is obtained, the functional algorithm is firstly applied to all the auxiliary images, and all the pixel points in the auxiliary image are correspondingly processed by the functional algorithm. For example, assuming that the functional algorithm is a pixel translation algorithm, the result of translating all pixels is applied to the auxiliary image first. However, due to the other pixel regions in the auxiliary image except the first pixel region, when the functional algorithm is applied to the auxiliary image, the other pixel regions are invalidated, leaving only the result of the functional algorithm with the first pixel region of the auxiliary image, i.e., the partial image processing result. It can be understood that, at the edge of the image to be processed, the functional algorithm includes a method for performing specific processing on the edge of the image to be processed, for example, when all pixels in the image to be processed are shifted to the left, the pixels in the rightmost column retain the initial values in the image to be processed.
The auxiliary image and the image to be processed are consistent in size, so that the position of the second pixel area in the image to be processed is consistent with the position of the first pixel area, a partial image processing result corresponding to the second pixel area can be obtained through the first pixel area in the auxiliary image and the function algorithm, and the image processing operation corresponding to the function algorithm is executed on the second pixel area of the subsequent image to be processed, so that the image to be processed is indirectly processed. The function of the functional algorithm in the area outside the first pixel area of the auxiliary image is not effective, and finally, a partial processing result can be obtained through the first pixel area of the auxiliary image. For example, assuming that the first pixel area is a red value area, a partial processing result in a second pixel area in the to-be-processed image that is the same as the red value area is determined by the red value area, and other partial image processing results in the to-be-processed image that are the same as the positions of other color value areas are invalidated, so that the functional algorithm only changes the to-be-processed image portion that is the same as the position of the first pixel area.
Further, the first pixel region of the auxiliary image may be stored in association with the functional algorithm, so that when the to-be-processed image is processed, the functional algorithm corresponding to the first pixel region may be called to act on the first pixel region of the auxiliary image when the pixel point in the first pixel region is traversed. For example, when the red value region of the first pixel region is stored in the computer system in advance in association with the pixel left shift algorithm, and the pixel in the red value region is traversed currently, the pixel left shift algorithm is directly called in the computer system to act on the first pixel region of the auxiliary image, so as to obtain a partial image result.
Step S30, determining the second pixel region of the image to be processed based on the partial image processing result and the image to be processed, so as to replace the second pixel region of the image to be processed with the image corresponding to the partial image processing result, thereby obtaining a processed image.
In this embodiment, after the second pixel region of the image to be processed is obtained, the partial image processing result is applied to the image to be processed, and the second pixel region in the image to be processed is determined, so that the image of the second pixel region in the image to be processed is replaced by the image corresponding to the partial image processing result, and finally, the image in which the position of the second pixel region in the image to be processed is processed by the functional algorithm can be obtained. The images of the other areas except the second pixel area are not changed, that is, the images of the other areas except the second pixel area are not processed by the functional algorithm, and the images of the other areas except the second pixel area are kept consistent with the image to be processed, that is, the original image.
Specifically, the first pixel region includes a red value region and/or a green value region and/or a blue value region, if the first pixel region includes a red value region and a green value region, and a function algorithm corresponding to the red value region is a first function algorithm, and a function algorithm corresponding to the green value region is a second function algorithm, and the first function algorithm is applied to the auxiliary image through the red value region, the first function algorithm is not applied to a region other than the red value region in the auxiliary image, the second function algorithm is applied to the auxiliary image through the green value region, and the second function algorithm is not applied to a region other than the green value region in the auxiliary image. Thus, finally, a first partial image processing result, on which the first functional algorithm acts, and a second partial image processing result, on which the second functional algorithm acts, are determined from the auxiliary image. And applying the first partial image processing result and the second partial image processing result to the image to be processed to finally obtain a second pixel area corresponding to the position of the red value area and a second pixel area corresponding to the position of the green value area, so that the image to be processed can be finally obtained, the second pixel area corresponding to the position of the red value area in the processed image is processed by the first functional algorithm, and the second pixel area corresponding to the position of the green value area in the processed image is processed by the second functional algorithm.
The image processing method provided by this embodiment obtains a to-be-processed image and a first pixel region in an auxiliary image, then determines a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the to-be-processed image based on a functional algorithm and the first pixel region of the auxiliary image, finally determines the second pixel region of the to-be-processed image based on the partial image processing result and the to-be-processed image, so as to replace the second pixel region of the to-be-processed image with an image corresponding to the partial image processing result, so as to obtain a processed image, and by using the first pixel region of the auxiliary image, the functional algorithm is applied to a partial region in the to-be-processed image, so as to implement image processing on a specified region or an irregular region, thereby solving a technical problem that the algorithm for processing an ideal specified region or an irregular region is difficult, provides great convenience for irregular image processing.
A second embodiment of the image processing method of the present invention is proposed based on the first embodiment, and in this embodiment, step S20 includes:
step a, determining an image processing result corresponding to the functional algorithm;
in this embodiment, before the functional algorithm is applied to the auxiliary image, an algorithm result of the functional algorithm processing image, that is, an image processing result, is first calculated.
And b, determining a partial image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the first pixel area of the auxiliary image.
In this embodiment, after obtaining the image processing result based on the functional algorithm, the image processing result is applied to all of the auxiliary images, that is, the functional algorithm is applied to all of the auxiliary images according to the image processing result, so that the functional algorithm is applied to all of the auxiliary images, and all the pixels in the auxiliary images are correspondingly processed by the functional algorithm. However, when the image processing result is applied to the auxiliary image, the image processing result applied to the other pixel region is invalidated by the other pixel regions except the first pixel region in the auxiliary image, and only the partial image processing result corresponding to the first pixel region of the auxiliary image is left. And the auxiliary image indirectly acts on the image to be processed according to the known image processing result, and other image processing results except the partial image processing result in the image processing result are invalidated through the first pixel region in the auxiliary image, so that the remained partial image processing result can be subsequently acted on the image to be processed.
Further, in an embodiment, the step of determining, based on the image processing result and a first pixel region of the auxiliary image, a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the image to be processed includes:
step c, determining a processing proportion coefficient of the image to be processed based on a first pixel area of the auxiliary image;
and d, determining a partial image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the processing scale factor.
In this embodiment, after obtaining an image processing result based on a functional algorithm, obtaining an R channel value, a G channel value, or a B channel value of an auxiliary image as a processing scaling factor of the functional algorithm on an image to be processed, that is, the processing scaling factor is the R channel value, the G channel value, or the B channel value of the auxiliary image, and when a first pixel region is a red value region, the processing scaling factor is the R channel value of the auxiliary image; when the first pixel area is a green value area, the processing scale factor is a G channel value of the auxiliary image, and when the first pixel area is a blue value area, the processing scale factor is a B channel value of the auxiliary image.
After the processing proportion coefficient is obtained, the image processing result is applied to the auxiliary image to obtain a partial image processing result, specifically, the image processing result is multiplied by the processing proportion coefficient, and the result obtained by multiplying the image processing result by the processing proportion coefficient is the partial image processing result, so that all pixel points in the auxiliary image are correspondingly processed by the functional algorithm. When the first pixel region is a red value region, the processing scaling factor is the R channel value of the auxiliary image, and the R channel values of the other pixel regions except the first pixel region are 0, that is, the processing scaling factors of the other pixel regions except the first pixel region are 0.
Further, in an embodiment, the first pixel region includes a black value region, and the step of determining the processing scaling factor of the image to be processed based on the first pixel region of the auxiliary image includes:
step e, after the step of obtaining the first pixel area in the image to be processed and the auxiliary image, further comprising: determining an image processing result corresponding to the functional algorithm;
in this embodiment, before the functional algorithm is applied to the auxiliary image, an algorithm result of the functional algorithm processing image, that is, an image processing result, is first calculated.
And f, if the first pixel area is the black value area, determining an original image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the black value area, and replacing the second pixel area of the image to be processed with an image corresponding to the original image processing result.
In the present embodiment, when the first pixel region is a black value region, the processing scaling factor may be an R channel value, a G channel value, or a B channel value, regardless of the R channel value, the G channel value, or the B channel value, the processing scaling factor of the first pixel region is 0, that is, the processing scaling factor of the black value region is 0, so that when the first pixel region is the black value region, the processing scaling factor is multiplied by the black value region and is equal to 0, that is, a partial processing result corresponding to the black value region obtained by multiplying the processing scaling factor by the black value region is 0, and thus the black partial processing result is invalidated, and thus an original image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed is determined to be replaced in the second pixel region of the image to be processed by the original image processing result, the partial image processing result corresponding to the position of the black value region is 0, and the partial image corresponding to the position of the black value region in the image to be processed is kept unchanged.
It is understood that the processing scaling factor is an R channel value or a G channel value or a B channel value of the auxiliary image, and when the first pixel region is a red color value region, the processing scaling factor is an R channel value of the auxiliary image; when the first pixel region is a green value region, the processing scale factor is a G channel value of the auxiliary image, and when the first pixel region is a blue value region, the processing scale factor is a B channel value of the auxiliary image.
In the image processing method provided by this embodiment, the image processing result corresponding to the functional algorithm is determined, and then the partial image processing result of the second pixel region corresponding to the position of the first pixel region in the image to be processed is determined based on the image processing result and the first pixel region of the auxiliary image, and the functional algorithm is applied to the partial region in the image to be processed by using the first pixel region of the auxiliary image, so as to implement image processing on the specified region or the irregular region.
A third embodiment of the image processing method of the present invention is proposed based on the first embodiment, and in this embodiment, step S30 includes:
step g, acquiring a pixel color value of the image to be processed;
and h, determining the second pixel area of the image to be processed based on the partial image processing result and the pixel color value of the image to be processed, so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, and obtaining the processed image.
In this embodiment, a pixel color value of the image to be processed is obtained, and a result obtained by summing the partial image processing result and the pixel color value of the image to be processed is a color value of a pixel point in the second pixel region, so that the partial image processing result is applied to the image to be processed, an image in the second pixel region in the image to be processed is replaced by an image corresponding to the partial image processing result, and finally, an image in which the position of the second pixel region in the image to be processed is processed by the functional algorithm can be obtained. The images of the other areas except the second pixel area are not changed, that is, the images of the other areas except the second pixel area are not processed by the functional algorithm, and the images of the other areas except the second pixel area are kept consistent with the image to be processed, that is, the original image.
Further, in an embodiment, the step of acquiring the first pixel region in the to-be-processed image and the auxiliary image includes:
and i, determining a red value area, a green value area, a blue value area or a black value area in the auxiliary image according to a preset drawing mode.
In this embodiment, the preset mapping manner includes mapping software or an algorithm program, and the mapping software may be Photoshop (the strongest image processing software, mainly processing a digital image formed by pixels) or Coreldraw (a piece of mapping and typesetting software, mainly processing a vector file), and the like, and an auxiliary image may be created by the preset mapping manner, and a red value region, a green value region, a blue value region, or a black value region in the auxiliary image may be created, and the auxiliary image may include a red value region, a green value region, a blue value region, or a black value region. The making process may be that a black image is first taken, and then any area in the black image is replaced by red, blue or green to make a red value area or a green value area. Generally, the color value of the edge of the first pixel area is lower, and gradually increases from the edge to the middle of the first pixel area.
Further, in an embodiment, the step of acquiring the first pixel region in the image to be processed and the auxiliary image includes:
step j, acquiring an image to be processed and a preset auxiliary image; transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode to obtain the auxiliary image; a first pixel region in the auxiliary image is acquired.
In this embodiment, the auxiliary image and the to-be-processed image need to be kept consistent in size, so the preset auxiliary image and the to-be-processed image are first acquired, and the size of the preset auxiliary image is changed to be consistent with the to-be-processed image through a preset image editing manner such as cutting or scaling.
The image processing method provided by this embodiment determines the second pixel region of the image to be processed by obtaining the pixel color value of the image to be processed, and based on the partial image processing result and the pixel color value of the image to be processed, replaces the second pixel region of the image to be processed with the image corresponding to the partial image processing result to obtain the processed image, and finally implements image processing on the designated region or the irregular region by using the partial image processing result obtained by the first pixel region of the auxiliary image to replace the partial image in the image to be processed with the image corresponding to the partial image processing result, thereby solving the technical problem that the algorithm for processing the image is difficult to process the ideal designated region or the irregular region, and providing great convenience for the irregular image processing.
Further, referring to fig. 3, an embodiment of the present invention also proposes an image processing apparatus including:
the acquisition device is used for acquiring a first pixel area in the image to be processed and the auxiliary image;
first determining means for determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed, based on a functional algorithm and the first pixel region of the auxiliary image;
and the second determining device is used for determining the second pixel area of the image to be processed based on the partial image processing result and the image to be processed so as to replace the second pixel area of the image to be processed with the image corresponding to the partial image processing result, and thus a processed image is obtained.
Optionally, the first determining means comprises:
the first determining unit is used for determining an image processing result corresponding to the functional algorithm;
a second determination unit configured to determine a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the image to be processed based on the image processing result and the first pixel region of the auxiliary image.
Optionally, the second determining unit includes:
a first determining subunit, configured to determine a processing scaling factor of the image to be processed based on a first pixel region of the auxiliary image;
a second determining subunit, configured to determine, based on the image processing result and the processing scaling factor, a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed.
Optionally, the first determining subunit includes:
the third determining subunit is used for determining an image processing result corresponding to the functional algorithm;
a fourth determining subunit, configured to determine, based on the image processing result and the black value region, an original image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed, if the first pixel region is the black value region, so as to replace the second pixel region of the image to be processed with an image corresponding to the original image processing result.
Optionally, the second determining means comprises:
the first acquisition unit is used for acquiring pixel color values of the image to be processed;
and a fifth determining subunit, configured to determine, based on the partial image processing result and the pixel color values of the image to be processed, the second pixel region of the image to be processed, so as to replace the second pixel region of the image to be processed with an image corresponding to the partial image processing result, so as to obtain a processed image.
Optionally, the obtaining device includes:
and the sixth determining subunit is configured to determine, according to a preset drawing manner, a red value region, a green value region, a blue value region, or a black value region in the auxiliary image.
Optionally, the obtaining device includes:
the second acquisition unit is used for acquiring the image to be processed and a preset auxiliary image;
the transformation unit is used for transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode so as to obtain the auxiliary image;
a third obtaining unit, configured to obtain a first pixel region in the auxiliary image.
Furthermore, an embodiment of the present invention also provides a computer-readable storage medium, where one or more programs are stored, and the one or more programs are further executable by one or more processors for implementing the steps of the embodiments of the image processing method.
The specific implementation of the computer-readable storage medium of the present invention is substantially the same as the embodiments of the image processing method described above, and is not described herein again.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (7)
1. An image processing method, characterized by comprising the steps of:
acquiring a first pixel area in an image to be processed and an auxiliary image;
determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on a functional algorithm and the first pixel region of the auxiliary image;
acquiring a pixel color value of the image to be processed;
determining the second pixel area of the image to be processed based on the partial image processing result and the pixel color value of the image to be processed, and replacing the second pixel area of the image to be processed with the image corresponding to the partial image processing result to obtain a processed image;
wherein the step of acquiring the first pixel region in the image to be processed and the auxiliary image comprises:
acquiring an image to be processed and a preset auxiliary image;
transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode to obtain an auxiliary image;
a first pixel region in the auxiliary image is acquired.
2. The image processing method according to claim 1, wherein the first pixel region includes a red value region, a green value region, or a blue value region, and the step of determining, based on the functional algorithm and the first pixel region of the auxiliary image, a partial image processing result of a second pixel region corresponding to a position of the first pixel region in the image to be processed includes:
determining an image processing result corresponding to the functional algorithm;
determining a processing scaling factor of the image to be processed based on a first pixel region of the auxiliary image, wherein the processing scaling factor comprises an R channel value or a G channel value or a B channel value of the first pixel region of the auxiliary image;
and determining a partial image processing result of a second pixel region corresponding to the position of the first pixel region in the image to be processed based on the image processing result and the processing scale factor.
3. The image processing method of claim 2, wherein the first pixel region comprises a black value region, and the step of determining the processing scaling factor for the image to be processed based on the first pixel region of the auxiliary image comprises:
after the step of obtaining the first pixel region in the image to be processed and the auxiliary image, the method further comprises the following steps:
determining an image processing result corresponding to the functional algorithm;
and if the first pixel area is the black value area, determining an original image processing result of a second pixel area corresponding to the position of the first pixel area in the image to be processed based on the image processing result and the black value area, and replacing the second pixel area of the image to be processed with an image corresponding to the original image processing result.
4. The image processing method according to claim 1, wherein the first pixel region includes a red value region, a green value region, a blue value region, or a black value region, and the step of acquiring the first pixel region in the image to be processed and the auxiliary image is preceded by:
and determining a red value area, a green value area, a blue value area or a black value area in the auxiliary image according to a preset drawing mode.
5. An image processing apparatus characterized by comprising:
the acquisition device is used for acquiring a first pixel area in the image to be processed and the auxiliary image;
first determining means for determining a partial image processing result of a second pixel region corresponding to a position of a first pixel region in the image to be processed, based on a functional algorithm and the first pixel region of the auxiliary image;
the first acquisition unit is used for acquiring pixel color values of the image to be processed;
a fifth determining subunit, configured to determine, based on the partial image processing result and the pixel color value of the image to be processed, the second pixel region of the image to be processed, and replace the second pixel region of the image to be processed with an image corresponding to the partial image processing result, so as to obtain a processed image;
wherein the acquisition means comprises:
the second acquisition unit is used for acquiring the image to be processed and a preset auxiliary image;
the transformation unit is used for transforming the size of the preset auxiliary image to be consistent with the image to be processed in a preset image editing mode so as to obtain an auxiliary image;
a third obtaining unit, configured to obtain a first pixel region in the auxiliary image.
6. An image processing apparatus characterized by comprising: memory, a processor and an image processing program stored on the memory and executable on the processor, the image processing program, when executed by the processor, implementing the steps of the image processing method according to any one of claims 1 to 4.
7. A computer-readable storage medium, characterized in that an image processing program is stored thereon, which when executed by a processor implements the steps of the image processing method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911177918.2A CN110913193B (en) | 2019-11-25 | 2019-11-25 | Image processing method, device, apparatus and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911177918.2A CN110913193B (en) | 2019-11-25 | 2019-11-25 | Image processing method, device, apparatus and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110913193A CN110913193A (en) | 2020-03-24 |
CN110913193B true CN110913193B (en) | 2021-10-12 |
Family
ID=69819836
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911177918.2A Active CN110913193B (en) | 2019-11-25 | 2019-11-25 | Image processing method, device, apparatus and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110913193B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113590250B (en) * | 2021-07-29 | 2024-02-27 | 网易(杭州)网络有限公司 | Image processing method, device, equipment and storage medium |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR102529957B1 (en) * | 2016-09-26 | 2023-05-08 | 삼성전자주식회사 | Display apparatus and recording media |
CN107818549A (en) * | 2017-10-27 | 2018-03-20 | 上海京颐科技股份有限公司 | Image processing method, device, equipment and computer-readable medium |
CN110070502B (en) * | 2019-03-25 | 2021-04-27 | 成都品果科技有限公司 | Method and device for grinding human face image into skin and storage medium |
CN110298898B (en) * | 2019-05-30 | 2023-05-23 | 北京百度网讯科技有限公司 | Method for changing color of automobile image body and algorithm structure thereof |
-
2019
- 2019-11-25 CN CN201911177918.2A patent/CN110913193B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110913193A (en) | 2020-03-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9857953B2 (en) | Image color and tone style transfer | |
US10789681B2 (en) | Image editing and repair | |
CN110321788B (en) | Training data processing method, device, equipment and computer readable storage medium | |
CN110728722B (en) | Image color migration method and device, computer equipment and storage medium | |
JP2010278708A (en) | Image processing apparatus and method, and computer program | |
CN110263301B (en) | Method and device for determining color of text | |
CN106228194B (en) | Image lookup method and device | |
CN111489322A (en) | Method and device for adding sky filter to static picture | |
CN110913193B (en) | Image processing method, device, apparatus and computer readable storage medium | |
CN115294055A (en) | Image processing method, image processing device, electronic equipment and readable storage medium | |
CN110956584A (en) | Pathological microscopic image interactive display method, medium and equipment | |
JP2007164513A (en) | Image processor | |
US10123052B2 (en) | Elimination of artifacts from lossy encoding of digital images by color channel expansion | |
US10834287B1 (en) | Obscuring marker-outlined free-form areas of a document | |
CN109685861B (en) | Picture compression method, device and equipment and computer readable storage medium | |
CN114693697A (en) | Image processing method, device, equipment and computer readable storage medium | |
US11264416B2 (en) | Image processing apparatus and image processing method | |
CN114519753A (en) | Image generation method, system, electronic device, storage medium and product | |
CN105279727B (en) | Image processing method and device | |
CN111292342A (en) | Method, device and equipment for cutting text in image and readable storage medium | |
CN113096007A (en) | Image color-retention filter processing method and device, display equipment and storage medium | |
CN117934287B (en) | Super-resolution reconstruction method of depth image, terminal equipment and storage medium | |
CN116452471B (en) | Processing method and device for ultra-high definition image, terminal equipment and computer medium | |
JP5862370B2 (en) | Image processing apparatus, image processing method, and program | |
CN109615648B (en) | Depth of field data conversion method, device, equipment and computer readable storage medium |
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 |