CN111429384A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN111429384A
CN111429384A CN202010294902.6A CN202010294902A CN111429384A CN 111429384 A CN111429384 A CN 111429384A CN 202010294902 A CN202010294902 A CN 202010294902A CN 111429384 A CN111429384 A CN 111429384A
Authority
CN
China
Prior art keywords
image
block
original
pixel
target
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.)
Granted
Application number
CN202010294902.6A
Other languages
Chinese (zh)
Other versions
CN111429384B (en
Inventor
张晓盟
刘春婷
接丹枫
陈欢
彭晓峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to CN202010294902.6A priority Critical patent/CN111429384B/en
Publication of CN111429384A publication Critical patent/CN111429384A/en
Application granted granted Critical
Publication of CN111429384B publication Critical patent/CN111429384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20172Image enhancement details
    • G06T2207/20192Edge enhancement; Edge preservation

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Image Processing (AREA)

Abstract

本申请提供一种图像处理方法及装置,该方法包括:在原始图像中确定至少一个第一分块图像;在原始图像的边缘进行像素填充,得到第一中间图像;在第一中间图像中确定至少一个第二分块图像,第一分块图像和第二分块图像一一对应,第一分块图像位于对应的第二分块图像的中心位置;对至少一个第二分块图像进行处理,得到目标图像,目标图像的目标尺寸和原始图像的原始尺寸相同。用于保障原始图像和目标图像的尺寸相同,使目标图像的边缘像素的连续,保障目标图像的稳定性,提高图像处理的效率。

Figure 202010294902

The present application provides an image processing method and device. The method includes: determining at least one first segmented image in an original image; performing pixel filling at the edge of the original image to obtain a first intermediate image; determining in the first intermediate image at least one second segmented image, the first segmented image and the second segmented image are in one-to-one correspondence, and the first segmented image is located at the center of the corresponding second segmented image; processing the at least one second segmented image , get the target image, the target size of the target image is the same as the original size of the original image. It is used to ensure that the size of the original image and the target image are the same, so that the edge pixels of the target image are continuous, ensure the stability of the target image, and improve the efficiency of image processing.

Figure 202010294902

Description

Image processing method and device
Technical Field
The present application relates to the field of image processing, and in particular, to an image processing method and apparatus.
Background
Currently, in image processing, improper algorithms may cause discontinuity of edge pixels of an output image.
The reason is that when a user uses a camera (e.g., a mobile phone, a camera, etc.) to photograph a real object, an original image with large noise is obtained, and many block-based noise reduction algorithms are used to perform noise reduction processing on the original image with large noise. When the noise reduction processing is performed on an original image with larger noise by using a block-based noise reduction algorithm, the size of the original image needs to be divided into whole parts by the preset block size. When the size of the original image can be divided by the preset block size, the following two schemes are generally adopted: in the first scheme, the original image is artificially expanded and complemented, so that the complemented image can be divided into whole parts by the preset block size; in the second scheme, other algorithms are adopted to process the residual images which cannot be divided into whole parts by the preset block size in the original image. In the first scheme, the complemented image includes edge patches with a new structure, so that the block-based noise reduction algorithm may have problems in searching for similar blocks, thereby causing discontinuity of edge pixels of the output image. In the second scheme, when other algorithms are used to process the remaining images in the original image that cannot be divided into whole by the preset block size, a new algorithm branch is introduced, which is not beneficial to the parallel processing between blocks, resulting in lower processing efficiency and incapability of ensuring the stability of the output image.
In a related block operation-based technique, a method of improving edge pixel continuity of an image includes: when the original image obtained by the photographic equipment cannot be divided into blocks with specific sizes, performing cutting processing on the original image to obtain a cut image, wherein the cut image can be divided into blocks with specific sizes; and filtering the cut image to obtain a target image corresponding to the original image. In the above method, the original image is subjected to cropping processing, changing the size of the original image, resulting in a reduction in the size of the output image.
Disclosure of Invention
The application provides an image processing method and device, which are used for guaranteeing that the sizes of an original image and a target image are the same, enabling edge pixels of the target image to be continuous, guaranteeing the stability of the target image and improving the image processing efficiency.
In a first aspect, the present application provides an image processing method, including:
determining at least one first block image in an original image;
performing pixel filling on the edge of the original image to obtain a first intermediate image;
determining at least one second block image in a first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is located in the center of the corresponding second block image;
and processing at least one second block image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image.
In a possible embodiment, determining at least one first block image in the original image comprises:
according to a preset block size, carrying out block processing on an original image to obtain at least one first block image, wherein overlapping pixels exist in part of the first block image in the at least one first block image.
In one possible embodiment, the original image comprises M rows and N columns of the first block image, M and N being integers greater than or equal to 1, respectively, wherein,
partial image overlap exists between the jth column of first block images and the jth +1 column of first block images in the N columns of first block images, wherein j is an integer from 1 to N-1; or,
partial image overlapping exists between the ith row and the jth first block image in the M rows and the N columns of the first block images and the ith row and the jth +1 first block image, wherein i is an integer from 1 to M, and j is an integer from 1 to N-1.
In a possible implementation, the pixel filling is performed at the edge of the original image, resulting in a first intermediate image, comprising:
adding filling pixels at the edge of the original image to obtain a first intermediate image; the position of the filling pixel is symmetrical to the position of the first pixel in the original image, and the color value of the filling pixel is the same as that of the first pixel.
In a possible implementation, processing the at least one second tile image to obtain the target image includes:
performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image;
acquiring the weight, the position and the color value of at least one pixel included in each third block image;
and obtaining a target image according to the weight, the position and the color value of each pixel.
In one possible implementation, obtaining the target image according to the weight, the position and the color value of each pixel comprises:
determining a target color value of each pixel according to the weight and the color value of each pixel;
filling the target color value of each pixel to a corresponding position to obtain a second intermediate image;
and cutting the second intermediate image to obtain a target image.
In a possible implementation, the performing a cutting process on the second intermediate image to obtain the target image includes:
acquiring the position of each pixel in the original image and/or the original size of the original image;
and cutting the second intermediate image according to the position and/or the original size of each pixel in the original image to obtain the target image.
In a second aspect, the present application provides an image processing apparatus comprising: a determination module and a processing module, wherein,
the determining module is used for determining at least one first block image in the original image;
the processing module is used for carrying out pixel filling on the edge of the original image to obtain a first intermediate image;
the determining module is used for determining at least one second block image in the first intermediate image, the first block image and the second block image are in one-to-one correspondence, and the first block image is located at the center position of the corresponding second block image;
the processing module is used for processing at least one second block image to obtain a target image, and the target size of the target image is the same as the original size of the original image.
In a possible implementation, the determining module is specifically configured to:
according to a preset block size, carrying out block processing on an original image to obtain at least one first block image, wherein overlapping pixels exist in part of the first block image in the at least one first block image.
In one possible embodiment, the original image comprises M rows and N columns of the first block image, M and N being integers greater than or equal to 1, respectively, wherein,
partial image overlap exists between the jth column of first block images and the jth +1 column of first block images in the N columns of first block images, wherein j is an integer from 1 to N-1; or,
partial image overlapping exists between the ith row and the jth first block image in the M rows and the N columns of the first block images and the ith row and the jth +1 first block image, wherein i is an integer from 1 to M, and j is an integer from 1 to N-1.
In a possible implementation, the processing module is specifically configured to:
adding filling pixels at the edge of the original image to obtain a first intermediate image; the position of the filling pixel is symmetrical to the position of the first pixel in the original image, and the color value of the filling pixel is the same as that of the first pixel.
In a possible implementation, the processing module is specifically configured to:
performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image;
acquiring the weight, the position and the color value of at least one pixel included in each third block image;
and obtaining a target image according to the weight, the position and the color value of each pixel.
In a possible implementation, the processing module is specifically configured to:
determining a target color value of each pixel according to the weight and the color value of each pixel;
filling the target color value of each pixel to a corresponding position to obtain a second intermediate image;
and cutting the second intermediate image to obtain a target image.
In a possible implementation, the processing module is specifically configured to:
acquiring the position of each pixel in the original image and/or the original size of the original image;
and cutting the second intermediate image according to the position and/or the original size of each pixel in the original image to obtain the target image.
In a third aspect, the present application provides an image processing apparatus comprising: a processor and a memory;
the memory stores computer-executable instructions;
the processor executes the computer-executable instructions stored by the memory, causing the processor to perform the image processing method of any of the first aspects.
In a fourth aspect, the present application provides a readable storage medium comprising a program or instructions, which when run on a computer, performs the image processing method of any one of the above first aspects.
The application provides an image processing method and device, and the method comprises the following steps: determining at least one first block image in an original image; performing pixel filling on the edge of the original image to obtain a first intermediate image; determining at least one second block image in the first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is located in the center of the corresponding second block image; and processing the at least one second block image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image. In the method, the target size of the target image is the same as the original size of the original image, so that the size of the target image is ensured to be the same as that of the original image, and the target image is obtained by processing at least one second block image, so that the edge pixels of the target image are continuous, the stability of the target image is ensured, and the image processing efficiency is improved.
Drawings
In order to more clearly illustrate the technical solutions in the present application or the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a first schematic flowchart of an image processing method provided in the present application;
fig. 2 is a schematic flowchart of a second image processing method provided in the present application;
FIG. 3 is a schematic diagram of at least one first tile image provided herein;
FIG. 4 is another schematic diagram of at least one first tile image provided herein;
FIG. 5 is a schematic diagram of a fill pixel provided herein;
FIG. 6 is a schematic diagram of a second tile image provided herein;
fig. 7 is a schematic structural diagram of an image control apparatus provided in the present application;
fig. 8 is a schematic diagram of a hardware structure of an image processing apparatus according to the present application.
Detailed Description
To make the purpose, technical solutions and advantages of the present application clearer, the technical solutions in the present application will be clearly and completely described below with reference to the drawings in the present application, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail below with specific examples. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
Fig. 1 is a first schematic flow chart of an image processing method provided in the present application. As shown in fig. 1, the image processing method provided by the present embodiment includes:
s101: at least one first block image is determined in the original image.
Alternatively, the execution subject of the image processing method of the present application may be an image capturing apparatus, or may be an image processing device provided in the image capturing apparatus, and the image processing device may be implemented by a combination of software and/or hardware.
The image capturing device may be a camera, a video camera, or a mobile phone with a shooting function, a tablet computer, or the like.
Specifically, the size of each first block image is the same as a preset block size, where the block size may be the size of a preset shape. For example, the predetermined shape may be a square, a rectangle, or the like.
Further, overlapping pixels exist in a part of the first block images in the at least one first block image.
For example, in fig. 5, a first block image includes: the pixels 111, 112, 113, 114, 121, 122, 123, 124, 131, 132, 133, 134, 141, 142, 143, 144, another first block image includes: 114. 211, 212, 214, 124, 221, 222, 224, 324, 231, 232, 224, 424, 241, 232, 244. The pixels 114, 124, 134, and 144 are overlapped pixels of the first block image and the second block image.
S102: and carrying out pixel filling on the edge of the original image to obtain a first intermediate image.
Alternatively, pixels inside the edge of the original image may be filled out of the edge of the original image, thereby forming a first intermediate image, wherein the size of the first intermediate image is larger than the original size of the original image, and the original size is the size of the original image. In particular, reference may be made to the original image and the first intermediate image shown in the embodiment of fig. 5.
S103: and determining at least one second block image in the first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is positioned in the center position of the corresponding second block image.
Specifically, the corresponding second block image may be determined in the first intermediate image from the first block image so that the first block image is located at the center position of the corresponding second block image.
It should be noted that at least one second block image has the same size, and each second block image has overlapping pixels with its neighboring second block image.
S104: and processing the at least one second block image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image.
The target size is the size of the target image, and the original size is the size of the original image.
In a possible implementation, processing the at least one second tile image to obtain the target image includes: performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image; acquiring the weight, the position and the color value of at least one pixel included in each third block image; and obtaining a target image according to the weight, the position and the color value of each pixel.
Alternatively, the preset block image processing algorithm may be block-based operation processing, and the preset block image processing algorithm may process at least one second block image in parallel, so as to obtain a third block image corresponding to each second block image.
Further, a target color value of each pixel may be determined based on the weight and color value of each pixel; and then obtaining a target image according to the target color value and the position of each pixel.
Unlike the prior art, in the prior art, when an original image cannot be divided into parts with a pre-block size, a plurality of first integer blocks and a residual image are obtained by processing the original image according to the pre-block size, wherein the residual image is an image except for the plurality of first integer blocks in the original image. In the first prior art solution, manual complementation of the remaining image is required to obtain a plurality of second integer patches. In the second solution of the prior art, an algorithm branch capable of processing the remaining images needs to be added in the block-based operation processing, so that the block-based operation processing cannot process a plurality of first integer blocks and the remaining images in parallel, and further the image processing time is long, so that the image processing efficiency is low, and the stability of the output image cannot be guaranteed. In the application, the preset block image processing algorithm can process each second block image in parallel without adding redundant algorithm branches, so that the image processing time is reduced, the image processing efficiency is improved, and the stability of the target image can be guaranteed.
The image processing method provided by the embodiment comprises the following steps: determining at least one first block image in an original image; performing pixel filling on the edge of the original image to obtain a first intermediate image; determining at least one second block image in the first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is located in the center of the corresponding second block image; and processing the at least one second block image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image. In the method, the target size of the target image is the same as the original size of the original image, so that the size of the target image is ensured to be the same as that of the original image, and the target image is obtained by processing at least one second block image, so that the edge pixels of the target image are continuous, the stability of the target image is ensured, and the image processing efficiency is improved.
On the basis of the above embodiment, the following describes in detail the image processing method provided by the present application with reference to the embodiment of fig. 2, specifically, please refer to the embodiment of fig. 2.
Fig. 2 is a schematic flowchart of a second image processing method provided in the present application. As shown in fig. 2, the image processing method provided by the present embodiment includes:
s201: according to a preset block size, carrying out block processing on an original image to obtain at least one first block image, wherein overlapping pixels exist in part of the first block image in the at least one first block image.
Optionally, the preset block size is equal to the size of the preset shape, where the preset shape may be the preset shape in S101, and the preset shape includes at least one pixel.
In a possible implementation manner, the original image comprises M rows and N columns of first block images, wherein M and N are respectively integers greater than or equal to 1, a part of image overlap exists between a jth column of first block images and a jth +1 column of first block images in the N columns of first block images, and j is any integer between 1 and N-1; or partial image overlapping exists between the ith row and the jth first block image in the M rows and the N columns of the first block images and the ith row and j +1 first block image, wherein i is an integer from 1 to M, and j is an integer from 1 to N-1.
Fig. 3 is a schematic diagram illustrating that partial image overlap exists between a jth column of first block images and a j +1 th column of first block images in N columns of first block images. Fig. 4 is a schematic diagram illustrating that partial image overlap exists between the ith row and jth block image and the ith row and j +1 first block image in the M rows and N columns of first block images.
Specifically, at least one first segmented image determined in the original image will be described with reference to fig. 3 and 4, taking M ═ 3, N ═ 5, and j ═ 4 as examples. Fig. 3 is a schematic diagram of at least one first block image provided in the present application. As shown in fig. 3, includes: an original image 31 and 15 first segmented images 32, each first segmented image 32 having a preset segment size. Alternatively, in practical applications, the original image may be divided into 3 rows (i is 1, 2, 3) and 4 columns (j is 1, 2, 3, 4) of first block images by the block size, where the 3 rows and 4 columns of first block images do not overlap with each other; next, according to the above block size, the remaining image 33 in the original image and a part of pixels in the 4 th column of the first block image are determined as a fifth column of the first block image, so that three first block images included in the fifth column of the first block image have the above block size. In fig. 5, overlapping pixels exist in the i-th 1-row j-4-column first block image and the i-th 1-row j-5-column first block image (included in the superimposed image 34), overlapping pixels exist in the i-th 2-row j-4-column first block image and the i-th 2-row j-5-column first block image (included in the superimposed image 35), and overlapping pixels exist in the i-th 3-row j-4-column first block image and the i-th 3-row j-5-column first block image (included in the superimposed image 36).
Fig. 4 is another schematic diagram of at least one first block image provided in the present application. As shown in fig. 4, an original image 31 and 15 first block images 32. Each of the first segmented images 32 has a preset segment size. Alternatively, in practical applications, the original image may be divided according to the above block size along the upper edge of the original image, to obtain an i-1 th row first block image, where overlapping pixels exist between the i-1 st row j-1 st column first block image and the i-1 st row j-2 st column first block image (included in the overlapped image 33); then, dividing the original image according to the above block size along the lower edge of the first block image in the i-th 1 row to obtain the first block image in the i-th 2 row, j-th 2 column of the first block image and the i-th 2 row, j-3 column of the first block image, where there are overlapping pixels (included in the overlapping image 34); finally, the original image is divided according to the above block size along the lower edge of the first block image of the i-th 2 row, so as to obtain the first block image of the i-th 3 row, wherein the first block image of the i-th 3 row, j-3 column and the first block image of the i-th 3 row, j-4 column have overlapped pixels (included in the overlapped image 35).
S202: and adding filling pixels at the edge of the original image to obtain a first intermediate image, wherein the positions of the filling pixels are symmetrical to the position of the first pixel in the original image, and the color values of the filling pixels are the same as the color value of the first pixel.
Optionally, the number of pixels may be preset, and a first intermediate image is obtained by adding filling pixels to the edge of the original image. The number of the preset pixels may be 1, 2, 3, and the like, and specifically, the number of the preset pixels is not limited in the present application.
Next, a first intermediate image obtained by adding the filling pixels will be described with reference to fig. 5, taking the preset number of pixels as 1 as an example. Fig. 5 is a schematic diagram of a filled pixel provided in the present application, as shown in fig. 5, including: an original image 51 and a first intermediate image 52, wherein the original image 51 comprises 4 first block images, each comprising 16 pixels. Pixels outside the edges of the original image 51 are filled pixels. For example, the filled pixel 112 is symmetrical in position and has the same color value as the first pixel 112 in the original image. Note that the position of the filled pixel is symmetrical to the position of the first pixel in the original image. For example, if the position of the first pixel 111 is (1, 1), the position of the upper left fill pixel is (-1, -1), the position of the upper fill pixel is (1, -1), and the position of the left fill pixel is (-1, 1).
S203: and determining at least one second block image in the first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is positioned in the center position of the corresponding second block image.
Specifically, please refer to fig. 6 for a schematic diagram of the second block image on the basis of fig. 5. Fig. 6 is a schematic diagram of a second block image provided in the present application. As shown in fig. 6, includes: a first segmented image 61 and a second segmented image 62. The pixels in the second block image 62 include pixels in the first block image 61, fill pixels ( pixels 111, 112, 113, 114, 211, 111, 121, 131, 141; 131), and pixels in other block images, and the first block image 61 is located at the center position of the second block image 62. Wherein the pixels in the other block images include: pixels 211, 221, 231, 241, 411, 311, 312, 313, 314.
Specifically, overlapping pixels exist in a part of the at least one second block image.
S204: and performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image.
S205: and acquiring the weight, the position and the color value of at least one pixel included in each third block image.
Specifically, the weight of each pixel is the position weight corresponding to the second block image corresponding to the pixel. The position weight corresponding to the second block image where the pixel is located is a function of the position of the pixel in the weight distribution. And the second block image corresponding to the pixel is the second block image corresponding to the third block image where the pixel is located. In general, the greater the pixel location is from the center of the second tile, the lower the weight.
It should be noted that each pixel may have multiple weights. For example, in fig. 6, the four second block images (including the second block image 62) each include the pixels 143, 144, 241, 313, 314, 411, and each of the pixels 143, 144, 241, 313, 314, 411 has 4 weights because each of the second block images has a corresponding weight.
S206: a target color value for each pixel is determined based on the weight and color value for each pixel.
Alternatively, the target color value for each pixel may be determined by the following formula:
Figure BDA0002451817850000101
wherein,
Figure BDA0002451817850000111
is the target color value for the pixel at the y-th position,
Figure BDA0002451817850000112
is the x-th position weight of the y-th position pixel,
Figure BDA0002451817850000113
is the color value of the pixel at the y-th position.
S207: and filling the target color value of each pixel to the corresponding position to obtain a second intermediate image.
S208: and cutting the second intermediate image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image.
In a possible implementation, the performing a cutting process on the second intermediate image to obtain the target image includes:
acquiring the original size of an original image and/or the position of each pixel in the original image;
and cutting the second intermediate image according to the original size and/or the position of each pixel in the original image to obtain the target image.
Specifically, the second intermediate image may be cut according to the position of each pixel in the original image to obtain a target image; the second intermediate image can also be cut according to the original size and the position of each pixel in the original image to obtain the target image.
The image processing method provided by the embodiment comprises the following steps: according to a preset block size, carrying out block processing on an original image to obtain at least one first block image, wherein overlapping pixels exist in part of the first block image in the at least one first block image; adding filling pixels at the edge of the original image to obtain a first intermediate image; the position of the filling pixel is symmetrical to the position of the first pixel in the original image, and the color value of the filling pixel is the same as that of the first pixel; determining at least one second block image in the first intermediate image, wherein the first block image and the second block image are in one-to-one correspondence, and the first block image is located in the center of the corresponding second block image; performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image; acquiring the weight, the position and the color value of at least one pixel included in each third block image; determining a target color value of each pixel according to the weight and the color value of each pixel; filling the target color value of each pixel to a corresponding position to obtain a second intermediate image; and cutting the second intermediate image to obtain a target image, wherein the target size of the target image is the same as the original size of the original image. In the method, the target size of the target image is the same as the original size of the original image, the sizes of the target image and the original image are guaranteed to be the same, and the filling pixels are added to the edge of the original image to obtain the first intermediate image without changing the internal structure (pixels) of the original image, so that the edge pixels of the target image are continuous, and the stability and the efficiency of image processing are improved.
Further, since the image processing method in the present application can be completed through the above-described S201 to S208, the image processing method provided by the present application is made simple and easy to implement.
Fig. 7 is a schematic structural diagram of an image control apparatus provided in the present application. As shown in fig. 7, the image control apparatus 10 includes: a determination module 11 and a processing module 12, wherein,
the determining module 11 is configured to determine at least one first block image in the original image;
the processing module 12 is configured to perform pixel filling on an edge of the original image to obtain a first intermediate image;
the determining module 11 is configured to determine at least one second block image in the first intermediate image, where the first block image and the second block image correspond to each other one to one, and the first block image is located at a center position of the corresponding second block image;
the processing module 12 is configured to process at least one second tile image to obtain a target image, where a target size of the target image is the same as an original size of the original image.
The image processing apparatus 10 provided in the present application can execute the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects thereof are similar, and are not described herein again.
In a possible implementation, the determining module 11 is specifically configured to:
according to a preset block size, carrying out block processing on an original image to obtain at least one first block image, wherein overlapping pixels exist in part of the first block image in the at least one first block image.
In one possible embodiment, the original image comprises M rows and N columns of the first block image, M and N being integers greater than or equal to 1, respectively, wherein,
partial image overlap exists between the jth column of first block images and the jth +1 column of first block images in the N columns of first block images, wherein j is an integer from 1 to N-1; or,
partial image overlapping exists between the ith row and the jth first block image in the M rows and the N columns of the first block images and the ith row and the jth +1 first block image, wherein i is an integer from 1 to M, and j is an integer from 1 to N-1.
In a possible implementation, the processing module 12 is specifically configured to:
adding filling pixels at the edge of the original image to obtain a first intermediate image; the position of the filling pixel is symmetrical to the position of the first pixel in the original image, and the color value of the filling pixel is the same as that of the first pixel.
In a possible implementation, the processing module 12 is specifically configured to:
performing image processing on each second block image through a preset block image processing algorithm to obtain at least one third block image;
acquiring the weight, the position and the color value of at least one pixel included in each third block image;
and obtaining a target image according to the weight, the position and the color value of each pixel.
In a possible implementation, the processing module 12 is specifically configured to:
determining a target color value of each pixel according to the weight and the color value of each pixel;
filling the target color value of each pixel to a corresponding position to obtain a second intermediate image;
and cutting the second intermediate image to obtain a target image.
In a possible implementation, the processing module 12 is specifically configured to:
acquiring the position of each pixel in the original image and/or the original size of the original image;
and cutting the second intermediate image according to the position and/or the original size of each pixel in the original image to obtain the target image.
Fig. 8 is a schematic diagram of a hardware structure of an image processing apparatus according to the present application. As shown in fig. 8, the image processing apparatus 20 includes: the processor 21 and the memory 22 are connected,
the processor 21 and the memory 22 are connected by a bus 23.
In particular implementations, processor 21 executes computer-executable instructions stored by memory 22 that cause processor 21 to perform an image processing apparatus as described above.
For a specific implementation process of the processor 21, reference may be made to the above method embodiments, which implement similar principles and technical effects, and this embodiment is not described herein again.
In the embodiment shown in fig. 8, it should be understood that the Processor may be a Central Processing Unit (CPU), other general purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as disk storage.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The application also provides a computer readable storage medium, in which computer executable instructions are stored, and when the processor executes the computer executable instructions, the image processing method is realized.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile memory device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in the apparatus.
The division of the unit is only a logical division, and other division ways are possible in actual implementation, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. 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 and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1.一种图像处理方法,其特征在于,包括:1. an image processing method, is characterized in that, comprises: 在原始图像中确定至少一个第一分块图像;determining at least one first segmented image in the original image; 在所述原始图像的边缘进行像素填充,得到第一中间图像;Pixel filling is performed at the edge of the original image to obtain a first intermediate image; 在所述第一中间图像中确定至少一个第二分块图像,所述第一分块图像和所述第二分块图像一一对应,所述第一分块图像位于对应的第二分块图像的中心位置;At least one second sub-block image is determined in the first intermediate image, the first sub-block image and the second sub-block image are in one-to-one correspondence, and the first sub-block image is located in the corresponding second sub-block the center position of the image; 对所述至少一个第二分块图像进行处理,得到目标图像,所述目标图像的目标尺寸和所述原始图像的原始尺寸相同。The at least one second segmented image is processed to obtain a target image, and the target size of the target image is the same as the original size of the original image. 2.根据权利要求1所述的方法,其特征在于,所述在原始图像中确定至少一个第一分块图像,包括:2. The method according to claim 1, wherein the determining at least one first segmented image in the original image comprises: 根据预先设定的分块尺寸,对所述原始图像进行分块处理,得到所述至少一个第一分块图像,所述至少一个第一分块图像中的部分第一分块图像存在重叠像素。According to the preset block size, the original image is divided into blocks to obtain the at least one first block image, and some of the first block images in the at least one first block image have overlapping pixels . 3.根据权利要求2所述的方法,其特征在于,所述原始图像包括M行N列第一分块图像,M和N分别为大于或等于1的整数,其中,3 . The method according to claim 2 , wherein the original image comprises a first block image with M rows and N columns, and M and N are integers greater than or equal to 1 respectively, wherein, N列第一分块图像中的第j列第一分块图像和第j+1列第一分块图像存在部分图像重叠,其中,j为1至N-1之间的整数;或者,There is partial image overlap between the first block image in column j and the first block image in column j+1 in the first block images in N columns, where j is an integer between 1 and N-1; or, M行N列第一分块图像中的第i行第j的第一分块图像和第i行第j+1的第一分块图像存在部分图像重叠,其中,i为1至M之间的整数,j为1至N-1之间的整数。In the first segmented image of M rows and N columns, the first segmented image of the ith row jth and the first segmented image of the ith row j+1 have partial image overlap, where i is between 1 and M , and j is an integer between 1 and N-1. 4.根据权利要求1至3任一项所述的方法,其特征在于,所述在所述原始图像的边缘进行像素填充,得到第一中间图像,包括:4. The method according to any one of claims 1 to 3, wherein the performing pixel filling on the edge of the original image to obtain a first intermediate image, comprising: 在所述原始图像的边缘增加填充像素,得到所述第一中间图像;其中,所述填充像素的位置和所述原始图像中的第一像素的位置对称,所述填充像素的色彩值和所述第一像素的色彩值相同。Filling pixels are added at the edge of the original image to obtain the first intermediate image; wherein, the positions of the filling pixels are symmetrical with the positions of the first pixels in the original image, and the color value of the filling pixels is the same as that of the first intermediate image. The color values of the first pixels are the same. 5.根据权利要求1至4任一项所述的方法,其特征在于,对所述至少一个第二分块图像进行处理,得到目标图像,包括:5. The method according to any one of claims 1 to 4, wherein the at least one second block image is processed to obtain a target image, comprising: 通过预设块图像处理算法,对每个所述第二分块图像进行图像处理,得到至少一个第三分块图像;Perform image processing on each of the second block images by using a preset block image processing algorithm to obtain at least one third block image; 获取每个所述第三分块图像包括的至少一个像素的权重、位置和色彩值;acquiring the weight, position and color value of at least one pixel included in each of the third segmented images; 根据每个像素的权重、位置和色彩值,得到所述目标图像。According to the weight, position and color value of each pixel, the target image is obtained. 6.根据权利要求5所述的方法,其特征在于,根据每个像素的权重、位置和色彩值,得到所述目标图像,包括:6. The method according to claim 5, wherein obtaining the target image according to the weight, position and color value of each pixel, comprising: 根据每个像素的权重和色彩值,确定每个像素的目标色彩值;Determine the target color value of each pixel according to the weight and color value of each pixel; 将每个像素的目标色彩值填充至对应的位置处,得到第二中间图像;Filling the target color value of each pixel to the corresponding position to obtain a second intermediate image; 对所述第二中间图像进行切割处理,得到所述目标图像。The second intermediate image is cut to obtain the target image. 7.根据权利要求6所述的方法,其特征在于,对所述第二中间图像进行切割处理,得到所述目标图像,包括:7. The method according to claim 6, wherein the second intermediate image is cut to obtain the target image, comprising: 获取所述原始图像中每个像素的位置和/或所述原始图像的原始尺寸;obtaining the position of each pixel in the original image and/or the original size of the original image; 根据所述原始图像中每个像素的位置和/或所述原始尺寸,切割所述第二中间图像,得到所述目标图像。The target image is obtained by cutting the second intermediate image according to the position and/or the original size of each pixel in the original image. 8.一种图像处理装置,其特征在于,包括:确定模块和处理模块,其中,8. An image processing device, comprising: a determination module and a processing module, wherein, 所述确定模块用于,在原始图像中确定至少一个第一分块图像;The determining module is used for determining at least one first segmented image in the original image; 所述处理模块用于,在所述原始图像的边缘进行像素填充,得到第一中间图像;The processing module is configured to perform pixel filling at the edge of the original image to obtain a first intermediate image; 所述确定模块用于,在所述第一中间图像中确定至少一个第二分块图像,所述第一分块图像和所述第二分块图像一一对应,所述第一分块图像位于对应的第二分块图像的中心位置;The determining module is configured to determine at least one second segmented image in the first intermediate image, the first segmented image and the second segmented image are in one-to-one correspondence, and the first segmented image is located at the center of the corresponding second block image; 所述处理模块用于,对所述至少一个第二分块图像进行处理,得到目标图像,所述目标图像的目标尺寸和所述原始图像的原始尺寸相同。The processing module is configured to process the at least one second block image to obtain a target image, where the target size of the target image is the same as the original size of the original image. 9.一种图像处理装置,其特征在于,包括:处理器和存储器;9. An image processing device, comprising: a processor and a memory; 所述存储器存储计算机执行指令;the memory stores computer-executable instructions; 所述处理器执行所述存储器存储的计算机执行指令,使得所述处理器执行如权利要求1至7任一项所述的图像处理方法。The processor executes the computer-executable instructions stored in the memory, so that the processor executes the image processing method according to any one of claims 1 to 7. 10.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至7任一项所述的图像处理方法。10. A computer-readable storage medium, characterized in that, computer-executable instructions are stored in the computer-readable storage medium, and when a processor executes the computer-executable instructions, the computer-executable instructions as claimed in any one of claims 1 to 7 are implemented. The described image processing method.
CN202010294902.6A 2020-04-15 2020-04-15 Image processing method and device Active CN111429384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010294902.6A CN111429384B (en) 2020-04-15 2020-04-15 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010294902.6A CN111429384B (en) 2020-04-15 2020-04-15 Image processing method and device

Publications (2)

Publication Number Publication Date
CN111429384A true CN111429384A (en) 2020-07-17
CN111429384B CN111429384B (en) 2022-11-08

Family

ID=71558005

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010294902.6A Active CN111429384B (en) 2020-04-15 2020-04-15 Image processing method and device

Country Status (1)

Country Link
CN (1) CN111429384B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114519690A (en) * 2020-11-19 2022-05-20 京东方科技集团股份有限公司 Image processing method and device, image detection method and system, and storage medium
CN115937050A (en) * 2023-03-02 2023-04-07 图兮数字科技(北京)有限公司 Image processing method, device, electronic device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110243472A1 (en) * 2010-03-30 2011-10-06 Chang Wei-Na Image processing device and spatial noise reducing method
CN106910166A (en) * 2016-08-31 2017-06-30 湖南拓视觉信息技术有限公司 A kind of image processing method and device
CN107610047A (en) * 2017-08-02 2018-01-19 深圳市易成自动驾驶技术有限公司 Fragmental image processing method, apparatus and computer-readable recording medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110243472A1 (en) * 2010-03-30 2011-10-06 Chang Wei-Na Image processing device and spatial noise reducing method
CN106910166A (en) * 2016-08-31 2017-06-30 湖南拓视觉信息技术有限公司 A kind of image processing method and device
CN107610047A (en) * 2017-08-02 2018-01-19 深圳市易成自动驾驶技术有限公司 Fragmental image processing method, apparatus and computer-readable recording medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114519690A (en) * 2020-11-19 2022-05-20 京东方科技集团股份有限公司 Image processing method and device, image detection method and system, and storage medium
CN115937050A (en) * 2023-03-02 2023-04-07 图兮数字科技(北京)有限公司 Image processing method, device, electronic device and storage medium
CN115937050B (en) * 2023-03-02 2023-10-13 图兮数字科技(北京)有限公司 Image processing method, device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111429384B (en) 2022-11-08

Similar Documents

Publication Publication Date Title
US10395341B2 (en) Panoramic image generation method and apparatus for user terminal
KR102010712B1 (en) Distortion Correction Method and Terminal
CN113469072B (en) Remote sensing image change detection method and system based on GSoP and twin fusion network
WO2021018199A1 (en) Convolutional neural network-based image processing method and apparatus
AU2017317847B2 (en) Intra-prediction video coding method and device
JP2015225665A (en) Image noise removal method and image noise removal device
CN111340077A (en) Disparity map acquisition method and device based on attention mechanism
WO2022042124A1 (en) Super-resolution image reconstruction method and apparatus, computer device, and storage medium
CN111091572B (en) Image processing method and device, electronic equipment and storage medium
CN111429384B (en) Image processing method and device
CN107220930B (en) Fisheye image processing method, computer device and computer readable storage medium
CN113298187B (en) Image processing method and device and computer readable storage medium
Licciardo et al. Stream processor for real-time inverse Tone Mapping of Full-HD images
WO2024002064A1 (en) Method and apparatus for constructing three-dimensional model, and electronic device and storage medium
CN110443751B (en) Image deformation method, device and equipment based on drawing lines and storage medium
CN114493988A (en) Image blurring method, image blurring device and terminal equipment
CN114202466A (en) Image noise reduction method, device, electronic device and storage medium
CN107977923B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
CN114463225B (en) Bilateral filtering method and device
GB2551426A (en) Hardware optimisation for generating 360° images
CN112866692B (en) HEVC-based coding unit dividing method and device and electronic equipment
CN108198125A (en) A kind of image processing method and device
US9230305B2 (en) Summed area computation using ripmap of partial sums
WO2022221982A1 (en) Image reconstruction method and apparatus, terminal device, and storage medium
US10332239B2 (en) Apparatus and method for parallel polyphase image interpolation

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