WO2022247630A1 - Image processing method and apparatus, electronic device and storage medium - Google Patents

Image processing method and apparatus, electronic device and storage medium Download PDF

Info

Publication number
WO2022247630A1
WO2022247630A1 PCT/CN2022/092072 CN2022092072W WO2022247630A1 WO 2022247630 A1 WO2022247630 A1 WO 2022247630A1 CN 2022092072 W CN2022092072 W CN 2022092072W WO 2022247630 A1 WO2022247630 A1 WO 2022247630A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
reference image
pixel
optical flow
point
Prior art date
Application number
PCT/CN2022/092072
Other languages
French (fr)
Chinese (zh)
Inventor
陈秋伯
陈铭津
Original Assignee
北京字跳网络技术有限公司
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 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2022247630A1 publication Critical patent/WO2022247630A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4053Super resolution, i.e. output image resolution higher than sensor resolution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/02
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/40Scaling the whole image or part thereof
    • G06T3/4023Decimation- or insertion-based scaling, e.g. pixel or line decimation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • Embodiments of the present disclosure relate to the technical field of image processing, and in particular, to an image processing method, device, electronic equipment, storage medium, computer program product, and computer program.
  • the solution in the prior art is to optimize the target photo through multiple photos to generate a high-resolution image after obtaining the target photo taken by the native camera, so as to improve the image quality.
  • the solutions in the prior art still have the problems of poor image imaging effect and low detail recognition due to loss of image information.
  • Embodiments of the present disclosure provide an image processing method, device, electronic equipment, storage medium, computer program product, and computer program to overcome the problems of poor imaging effect and low image detail recognition when generating high-resolution images.
  • an embodiment of the present disclosure provides an image processing method, including:
  • the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include a reference image and a non-reference image; calculating from the non-reference image to the The optical flow of the reference image; based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by adding the The reference pixel in the non-reference image is interpolated with the reference pixel in the reference image, and the non-reference image and the reference image are pixel fused to generate a target image.
  • an image processing device including:
  • An acquisition unit configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
  • a first determining unit configured to calculate an optical flow from the non-reference image to the reference image
  • a second determining unit based on the optical flow from the non-reference image to the reference image, to determine a reference pixel in the non-reference image corresponding to a reference pixel in the reference image;
  • a generating unit configured to perform interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate a target image.
  • an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
  • the memory stores computer-executable instructions
  • the at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the image processing method described in the above first aspect and various possible designs of the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the above first aspect and the first Aspects of various possible designs of the described image processing method.
  • an embodiment of the present disclosure provides a computer program product, including a computer program.
  • the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
  • an embodiment of the present disclosure provides a computer program.
  • the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
  • the image processing method, device, electronic equipment, storage medium, computer program product, and computer program provided in this embodiment obtain multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images shot for the same scene,
  • the multi-frame initial image includes a reference image and a non-reference image; calculate an optical flow from the non-reference image to the reference image; determine the optical flow from the non-reference image to the reference image based on the optical flow from the non-reference image to the reference image the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by interpolating the reference pixel in the non-reference image with the reference pixel in the reference image, the The non-reference image is pixel fused with the reference image to generate the target image, because in the process of generating the target image, each interpolation pixel in the target image uses the corresponding reference pixel and non-reference pixel in the reference image The corresponding reference pixels in the benchmark image are obtained by pixel fusion. Therefore, the original pixel information
  • FIG. 1 is a diagram of an application scenario provided by an embodiment of the present disclosure
  • Fig. 2 is a schematic diagram of a method for generating a high-resolution image in the prior art
  • FIG. 3 is a first schematic flow diagram of an image processing method provided by an embodiment of the present disclosure
  • FIG. 4 is a schematic diagram of an interpolation calculation for a reference image provided by an embodiment of the present disclosure
  • FIG. 5 is a schematic diagram of determining a reference pixel point provided by an embodiment of the present disclosure
  • FIG. 6 is a second schematic flow diagram of an image processing method provided by an embodiment of the present disclosure.
  • Fig. 7 is a flow chart of the process of determining the reference point coordinates corresponding to the first interpolation pixel point
  • FIG. 8 is a schematic diagram of a first interpolation pixel point and its corresponding edge pixel point provided by an embodiment of the present disclosure
  • FIG. 9 is a schematic diagram of a first preset range provided by an embodiment of the present disclosure.
  • FIG. 10 is a schematic diagram of a second preset range provided by an embodiment of the present disclosure.
  • FIG. 11 is a structural block diagram of an image processing device provided by an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 13 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 1 is a diagram of an application scenario provided by an embodiment of the present disclosure.
  • the image processing method provided by an embodiment of the present disclosure can be applied to a smart terminal, such as a smart phone.
  • a smart terminal such as a smart phone.
  • the smart phone prompts the user not to move the phone by displaying the prompt message "Resolution is being improved, please do not move” so as to facilitate the collection of more images.
  • the smartphone processes the low-resolution image through a built-in program or software to generate a frame of high-resolution image and display it, so that users can get photos with clearer images and better image details.
  • FIG. 2 is a schematic diagram of a method for generating a high-resolution image in the prior art.
  • the method used is to use one frame of images in the multi-frame images as a reference frame, calculate the optical flow from the reference frame to the non-reference frame, and then according to the optical flow calculation results, the images of other non-reference frames are transformed by pseudo-warp Align to the reference frame and perform interpolation fusion to generate an interpolated image.
  • FIG. 3 is a first schematic flowchart of an image processing method provided by an embodiment of the present disclosure.
  • the method of this embodiment can be applied in a smart terminal, and the image processing method includes:
  • Step S101 acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images shot for the same scene, and the multiple frames of initial images include reference images and non-reference images.
  • the smart terminal is, for example, a smart phone, which is provided with one or more cameras.
  • Acquiring multiple frames of initial images may be continuously changing multiple frames of pictures in the same scene captured by one or more cameras of the smartphone.
  • the action of taking multiple frames of pictures through the smartphone may be triggered by a user's shooting operation.
  • the user presses the "photograph" button and the smartphone takes 10 pictures in a short period of time (for example, within 0.5 seconds). photos and save them to generate multiple frames of initial images.
  • the mobile phone is shaken by the user, there is a certain degree of continuously changing offset between the pictures taken by the smart phone.
  • the action of taking multiple frames of pictures through the smartphone may also be triggered by the user's multiple shooting operations within a short period of time. The process of generating multiple frames of initial images is similar and will not be repeated here.
  • the multi-frame initial images include a reference image and a non-reference image, wherein, for example, the reference image may be an image with better imaging effect or a higher-resolution image among the multi-frame initial images, the reference image Images and non-reference images can be determined after processing multiple frames of initial images by preset algorithms, such as evaluating the clarity of each initial image, determining the picture to be processed with the highest image, determined to be a non-reference image.
  • the reference image and the non-reference image in the multi-frame initial image may also be determined according to preset rules, for example, the first frame image or the last frame image in the multi-frame initial image is determined as the reference image, The process will not be repeated here.
  • Step S102 calculating the optical flow from the non-reference image to the reference image.
  • Optical flow is the projection of the motion of an object in three-dimensional space on a two-dimensional image plane. It is generated by the relative speed of the object and the camera, and reflects the motion direction and speed of the image pixel corresponding to the object in a very small time.
  • the optical flow from the non-reference image to the reference image is calculated, that is, the position mapping of each pixel in the non-reference image to the reference image is calculated through the preset optical flow algorithm, that is, for the non-reference image
  • the calculation is performed at the position of the pixel in the reference image that is most similar to the pixel in the non-reference image, and the obtained optical flow is the information that characterizes the position map.
  • the optical flow algorithm is an existing technology known to those skilled in the art, and the specific type of the optical flow algorithm is not limited this time, and details will not be described one by one.
  • Step S103 based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image.
  • the reference pixel contains the sub-pixel information corresponding to the reference pixel due to the continuously changing offset between non-reference images. Therefore, the interpolation pixel determined according to the reference pixel can better express Image detail, making interpolated high-resolution images look more realistic.
  • FIG. 4 is a schematic diagram of determining a reference pixel point provided by an embodiment of the present disclosure.
  • the method for determining a reference pixel point corresponding to a reference pixel point can be performed by performing optical flow calculation on a reference image , get the optical flow from the non-reference image to the reference image, and then map the reference pixel to the non-reference image according to the optical flow calculation result, and determine the mapping point between the reference pixel and the non-reference image in the non-reference image
  • the pixel points within the preset distance are used as the reference pixel points.
  • the optical flow calculation method is a prior art known to those skilled in the art, and will not be repeated here.
  • Step S104 by interpolating the reference pixel points in the non-reference image and the reference pixel points in the reference image, performing pixel fusion on the non-reference image and the reference image to generate a target image.
  • the reference pixel corresponding to each interpolation pixel are one or more original pixels originally in other non-reference images, and the interpolation pixels correspond to the pixel fusion of the reference pixels and the corresponding reference pixels, and the generated pixels are the interpolation pixels.
  • the interpolated pixels contain the original sub-pixel information in different non-reference images, so the high-resolution target image composed of interpolated pixels, compared with the prior art, after aligning the non-reference images through pseudo-transformation, and then performing In the scheme of obtaining the target image by pixel fusion, the interpolation image generated by the method provided in this embodiment better utilizes the image information in the initial image, so that the image details of the interpolation image are better.
  • the method of performing pixel fusion on multiple pixel points can be implemented by performing weighted average of the pixel values of each pixel point, and the process will not be repeated here.
  • the multiple frames of initial images include reference images and non-reference images; calculating from non-reference images to reference The optical flow of the image; based on the optical flow from the non-reference image to the reference image, determine the reference pixels in the non-reference image corresponding to the reference pixels in the reference image; by combining the reference pixels in the non-reference image with the reference pixel
  • the reference pixels in the target image are interpolated, and the non-reference image and the reference image are pixel-fused to generate the target image.
  • each interpolation pixel in the target image uses the corresponding Therefore, the original pixel information of each frame image in the multi-frame image to be processed is fully utilized, and the loss of part of image information and the introduction of error are avoided. The problem of improving the imaging effect and image details of the final generated target image.
  • FIG. 5 is a second schematic flowchart of an image processing method provided by an embodiment of the present disclosure. Steps S102-S103 are refined in this embodiment, and the image processing method includes:
  • Step S201 acquiring continuously changing multiple frames of initial images, wherein the multiple frames of initial images include a reference image and a non-reference image.
  • Step S202 obtain the preset resolution information, and determine the reference pixel in the reference image according to the resolution information and the size information of the reference image, the reference pixel is obtained by interpolating the original pixel in the reference image, the reference pixel The number of points is greater than the number of original pixel points.
  • FIG. 6 is a schematic diagram of interpolation calculation for a reference image provided by an embodiment of the present disclosure.
  • the reference image is an image containing 4 pixels and a resolution of 2X2
  • the reference image is After the interpolation calculation, the determined high-resolution image is an image including 16 pixels with a resolution of 4 ⁇ 4, and each pixel in the high-resolution image is a reference pixel.
  • the target image can be generated, and after interpolation calculation is performed on the reference image, the position of each reference pixel in the reference image can be determined.
  • the position of the reference pixel in the reference image is recorded in the interpolation image information. More specifically, the interpolated image information includes the coordinate values of each reference pixel in the interpolated image.
  • the interpolation calculation of the reference image can be determined according to the preset resolution information, or dynamically determined according to the frame number of the initial image.
  • the reference image is determined according to the resolution information and the size information of the reference image
  • the number of reference pixels is greater than the number of original pixels, which means that after the reference image is interpolated, the resolution of the corresponding high-resolution image is greater than the resolution of the initial reference image, and the image interpolation
  • the specific steps of calculation are the prior art known to those skilled in the art, and will not be repeated here.
  • Step S203 calculating the optical flow from the non-reference image to the reference image.
  • Step S204 based on the optical flow from the non-reference image to the reference image, determine the coordinates of the reference point corresponding to the image position where the reference pixel is located in the non-reference image.
  • the reference image includes a plurality of reference pixels.
  • the optical flow calculation can be performed on each reference pixel in the manner of loop sequential processing or parallel processing. The following is to perform optical flow calculation on one of the reference pixels , the process of determining the coordinates of the reference point corresponding to the image position where the reference pixel is located will be introduced in detail.
  • Fig. 7 is the flowchart of the process of determining the coordinates of the reference point corresponding to the position of the image where the reference pixel is located. As shown in Fig. 7, the process includes:
  • the coordinates of the reference pixel point can be obtained through the resolution information and the size information of the reference image, and the interpolation image information can be generated through the resolution information and the size information of the reference image, and the interpolation image information includes each reference pixel in the reference image
  • the coordinates of the points and the interpolation of image information has been introduced in detail in the foregoing embodiments, and will not be repeated here.
  • the reference image according to the coordinates of the reference pixel, determine several original pixel points closest to the coordinate, that is, edge pixel points.
  • FIG. 8 is a schematic diagram of a reference pixel point and its corresponding edge pixel points provided by an embodiment of the present disclosure. As shown in FIG.
  • the four original pixel points closest to it are respectively calculated, That is, A, B, C, and D, so that the original pixels in the four reference images of A, B, C, and D are determined as edge pixels.
  • the change of the position of the first reference pixel O there may be less than 4 adjacent pixel points, and the examples will not be repeated here.
  • a and b are the coordinate values of the coordinates (a, b) of the first reference pixel point O, and floor() is a function of rounding down.
  • one implementation of determining the offset vector of edge pixels in the non-reference image is, for example, to calculate the vector information between the reference image and the non-reference image through the optical flow algorithm, wherein the vector information is used to represent Pixels in the reference image and offset vectors between pixels at corresponding positions in the non-reference image; according to the motion vector information, determine the offset vector of the edge pixels in the non-reference image.
  • the optical flow algorithm is realized by the optical flow function OF(), and the general expression of optical flow calculation is shown in formula (2):
  • (x, y) is the coordinates of the pixel in the reference image
  • r is the index of the reference frame
  • t is the index of the non-reference frame
  • N is the frame number of the non-reference image.
  • OF() is the optical flow function
  • OF(x,y) is the optical flow calculation result of the pixel.
  • the decimal part represents the sub-pixel position to which it is mapped.
  • the mapping of pixels in the reference image to non-reference images can be realized by formula (2).
  • the optical flow calculation is performed on the edge pixels respectively, the optical flow calculation results of each edge pixel are determined, and the weighted average calculation is performed to obtain an average offset, that is, an offset vector.
  • an offset vector exemplary, the offset The calculation method of the vector is shown in formula (3):
  • offset is the offset vector
  • medium() is the weighted average calculation
  • OF(A), OF(B), OF(C), OF(D) are the optical flow of edge pixels A, B, C, and D respectively Calculation results.
  • the reference coordinate point in the non-reference image can be determined.
  • the implementation method is shown in formula (4):
  • center1 round((a,b)-offset) (4)
  • a and b are the coordinate values of the coordinates (a, b) of the first reference pixel point O, round() is a rounding function, and the reference coordinate point is center1.
  • Step S205 determining all the pixels within the first preset range of the reference point coordinates in the non-reference image as reference pixels.
  • FIG. 9 is a schematic diagram of a first preset range provided by an embodiment of the present disclosure.
  • the mapping of the reference pixel point 91 in the non-reference image and the offset vector determine each location in the non-reference image
  • the reference point coordinates 92 determine the pixel points within the first preset range of the reference point coordinates 92 in each non-reference image, and determine the one or more pixel points as reference points 93 pixels.
  • the first preset range is determined according to the variance of the offset vector of the edge pixel points in the non-reference image and a preset weight coefficient.
  • the implementation method of determining the pixel points within the first preset range of the coordinates of the reference point in the non-reference image can be realized by adding a window, wherein the first preset range is determined by the size of the windowing radius . More specifically, the method of determining the window radius is shown in formula (5) and formula (6):
  • weight min(variance(OF(A),OF(B),OF(C),OF(D)),weight_max)/weight_max(6)
  • r1 is the window radius
  • weight is the window weight coefficient
  • variance() is the variance function
  • min() is the minimum value function
  • r1_th1, r1_th2 and weight_max are the preset thresholds
  • r1_th1, r1_th2, and weight_max are determined by factors such as the image size, image content, and texture information of the initial image, and can be obtained through experiments, and the determination methods will not be described here.
  • the reference pixel points within the first preset range are obtained by determining the first preset range. Due to the determination process of the first preset range, through the parameters Setting, taking into account the influence of factors such as image size, image content, texture information, etc., the first preset range determined by this can better determine the reference pixel point with better correlation with the reference pixel point, and then improve the reference pixel point. The effectiveness of the points can improve the image details and image expressiveness of the target image for subsequent synthesis.
  • step S205 in order to further improve the correlation between the reference pixel and the reference pixel, and improve the accuracy of the subsequent pixel fusion of the non-reference image and the reference image, it also includes:
  • Fig. 10 is a schematic diagram of a second preset range provided by an embodiment of the present disclosure.
  • the pixel can be used as a reference pixel for subsequent pixel fusion to determine the pixel value of the corresponding interpolation pixel, wherein the target image is composed of interpolation pixels, and the positions of the reference pixel and the interpolation pixel coincide.
  • mapping coordinates 94 will be generated, and some reference pixel points 91 corresponding to the mapping coordinates 94 are relatively close and some are far away.
  • the image information represented by it is also quite different from the real image information at the position corresponding to the reference pixel point 91.
  • Using such reference pixels for pixel fusion will result in distortion of the final interpolated pixels, affecting the accuracy of pixel fusion, and further affecting the image details and image effects of the target image.
  • the reference pixel with a higher correlation with the reference pixel is determined as an effective reference pixel, And use effective reference pixel points to perform subsequent pixel fusion.
  • the method of determining the effective reference pixel point may be to determine the reference pixel point whose mapping coordinates fall within the second preset range of the reference pixel point as the effective reference pixel point, wherein, confirming that the second preset range Methods include:
  • image texture information and/or noise information corresponding to the reference pixel wherein the image texture information is used to characterize the image texture structure near the reference pixel, and the noise information is used to characterize the noise level of the initial image; according to the Image texture information, and/or noise information, determine a second preset range.
  • the method for determining the second preset range can be realized by formula (7), formula (8) and formula (9):
  • r2 (1-weight)*r2_th1+(weight)*r2_th2 (7)
  • r2_th1, r2_th2, scale are the preset thresholds
  • weight is the weight coefficient
  • r2_th2>r2_th1> 1, scale>1
  • the specific value is determined by the experimental debugging
  • variance() is the variance function
  • F(A), F (B), F(C), and F(D) are the coordinates of edge pixels A, B, C, and D in the reference image respectively
  • noise is the noise level
  • Vari is the second preset range.
  • the second preset range is determined through the image texture information and/or noise information corresponding to the reference pixel, and effective reference information for subsequent fusion calculations is determined within the second preset range, further Improves the image detail and image effects of the resulting target image.
  • Step S208 performing weighted calculation on the pixel values of effective reference pixels among the reference pixels corresponding to the reference pixel, determining the pixel values of the interpolation pixels, and constructing the target image based on the pixel values of each interpolation pixel.
  • weighted calculation is performed on the pixel value of the effective reference pixel to determine the pixel value of the interpolation pixel corresponding to the corresponding reference pixel.
  • the method for determining the pixel value of the interpolated pixel point can be realized by formula (10):
  • O i represents the i-th interpolation pixel in the target image
  • P m is the pixel value of the m-th effective reference pixel
  • W m is the weight of the m-th effective reference pixel
  • n is the number of effective reference pixels
  • the target image can be generated by determining the pixel value of each interpolation pixel in the target image through parallel processing or polling and sequential processing.
  • steps S201 and S203 is the same as the implementation of steps S101 and S102 in the embodiment shown in FIG. 3 of the present application, and will not be repeated here.
  • FIG. 11 is a structural block diagram of an image processing device provided in an embodiment of the present disclosure.
  • the image processing device 3 includes:
  • the acquiring unit 31 is configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
  • the first determination unit 32 is used to calculate the optical flow from the non-reference image to the reference image
  • the second determination unit 33 determines the reference pixel in the non-reference image corresponding to the reference pixel in the reference image;
  • the generation unit 34 is used to interpolate the reference pixels in the non-reference image and the reference pixels in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate the target image.
  • the second determining unit 33 is specifically configured to: determine the coordinates of the reference point in the non-reference image corresponding to the image position where the reference pixel is located based on the optical flow from the non-reference image to the reference image ; Determining all pixels within the first preset range of the reference point coordinates in the non-reference image as reference pixel points.
  • the second determination unit 33 when the second determination unit 33 determines the coordinates of the reference point in the non-reference image corresponding to the image position where the reference pixel is located based on the optical flow from the non-reference image to the reference image, it specifically uses In: obtaining the coordinates of the reference pixel point; in the reference image, determining the edge pixel point corresponding to the coordinate of the reference pixel point, wherein the edge pixel point is used to represent at least one pixel point adjacent to the reference pixel point; based on non-reference pixel point The optical flow from the image to the reference image determines the offset vector of the edge pixels in the non-reference image; according to the coordinates and offset vector of the reference pixel, the coordinates of the reference point are determined.
  • the second determining unit 33 is further configured to: determine the first preset coordinates of the reference point according to the variance of the offset vector of the edge pixel in the non-reference image and the preset weight coefficient scope.
  • the second determining unit 33 determines the offset vector of edge pixels in the non-reference image based on the optical flow from the non-reference image to the reference image, it is specifically configured to: through the optical flow Algorithm to calculate the vector information between the reference image and the non-reference image, wherein the vector information is used to characterize the pixels in the reference image, and the offset vector between the pixels of the corresponding positions in the non-reference image; according to the motion vector information to determine the offset vector of edge pixels in the non-reference image.
  • the second determination unit 33 is further configured to: determine the mapping coordinates of the reference pixel points in the reference image; , is determined to be an effective reference pixel point; when the generation unit 34 performs pixel fusion on the non-reference image and the reference image to generate the target image, it is specifically used to: the pixel value of the effective reference pixel point in the reference pixel point corresponding to the reference pixel point Carry out weighted calculation to determine the pixel value of the corresponding interpolation pixel point of the reference pixel point; according to the pixel value of the interpolation pixel point, the target image is formed.
  • the acquisition unit 31 is further configured to: acquire image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the image texture structure near the reference pixel point, The noise information is used to characterize the noise level of the initial image; the second determination unit 33 is further configured to: determine the second preset range according to the image texture information corresponding to the reference pixel and/or the noise information.
  • the acquisition unit 31 is further configured to: acquire preset resolution information; determine the reference pixel in the reference image according to the resolution information and the size information of the reference image, and the reference pixel is the reference pixel
  • the original pixel points in the reference image are obtained by interpolation, and the number of reference pixel points is greater than the number of original pixel points.
  • the device provided in this embodiment can be used to implement the technical solutions of the above method embodiments, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.
  • FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG. 12 , the electronic device 4 includes at least one processor 401 and a memory 402;
  • memory 402 stores computer-executable instructions
  • At least one processor 401 executes the computer-executed instructions stored in the memory 402, so that the at least one processor 401 executes the screen sharing method in the embodiment shown in FIGS. 3-10 .
  • processor 401 and the memory 402 are connected through a bus 403 .
  • the electronic device 900 may be a terminal device or a server.
  • the terminal equipment may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable Media Player, referred to as PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc.
  • PDA Personal Digital Assistant
  • PMP portable multimedia players
  • mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals)
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG. 13 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
  • an electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may be stored in a program in a read-only memory (Read Only Memory, ROM for short) 902 or from a storage device. 908 loads the programs in the random access memory (Random Access Memory, RAM for short) 903 to execute various appropriate actions and processes. In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored.
  • the processing device 901, ROM 902, and RAM 903 are connected to each other through a bus 904.
  • An input/output (I/O) interface 905 is also connected to the bus 904 .
  • an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; ), a speaker, a vibrator, etc.
  • a storage device 908 including, for example, a magnetic tape, a hard disk, etc.
  • the communication means 909 may allow the electronic device 900 to perform wireless or wired communication with other devices to exchange data. While FIG. 13 shows electronic device 900 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
  • embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts.
  • the computer program may be downloaded and installed from a network via communication means 909, or from storage means 908, or from ROM 902.
  • the processing device 901 When the computer program is executed by the processing device 901, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
  • the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two.
  • a computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
  • Computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (Erasable Programmable ROM, referred to as EPROM or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc ROM, referred to as CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device .
  • the program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, radio frequency (Radio Frequency, RF for short), etc., or any suitable combination of the above.
  • the above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the methods shown in the above-mentioned embodiments.
  • Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language.
  • the program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external A computer (connected via the Internet, eg, using an Internet service provider).
  • LAN Local Area Network
  • WAN Wide Area Network
  • each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions.
  • the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved.
  • each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
  • exemplary types of hardware logic components include: Field Programmable Gate Array (Field Programmable Gate Array, FPGA for short), Application Specific Integrated Circuit (ASIC for short), Application Specific Standard Products ( Application Specific Standard Product (ASSP for short), System on Chip (SOC for short), Complex Programmable Logic Device (CPLD for short), etc.
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing.
  • machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read only memory
  • EPROM or flash memory erasable programmable read only memory
  • CD-ROM compact disk read only memory
  • magnetic storage or any suitable combination of the foregoing.
  • an image processing method including:
  • the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include a reference image and a non-reference image; calculating from the non-reference image to the The optical flow of the reference image; based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by adding the The reference pixel in the non-reference image is interpolated with the reference pixel in the reference image, and the non-reference image and the reference image are pixel fused to generate a target image.
  • a reference pixel in the non-reference image corresponding to a reference pixel in the reference image is determined , comprising: based on the optical flow from the non-reference image to the reference image, determining the reference point coordinates corresponding to the image position where the reference pixel is located in the non-reference image; , all pixels located within the first preset range of coordinates of the reference point are determined as reference pixel points.
  • based on the optical flow from the non-reference image to the reference image determine the reference point coordinates corresponding to the image position where the reference pixel is located in the non-reference image , comprising: acquiring the coordinates of a reference pixel; in the reference image, determining an edge pixel corresponding to the coordinate of the reference pixel, wherein the edge pixel is used to represent a pixel adjacent to the reference pixel At least one pixel; based on the optical flow from the non-reference image to the reference image, determine the offset vector of the edge pixel in the non-reference image; according to the coordinates of the reference pixel and the The above offset vector is used to determine the coordinates of the reference point.
  • the method further includes: determining the coordinates of the reference point according to the variance of the offset vector of the edge pixel in the non-reference image and a preset weight coefficient the first preset range of .
  • determining the offset vector of the edge pixel in the non-reference image includes: passing light A stream algorithm, calculating vector information between a reference image and a non-reference image, wherein the vector information is used to characterize the pixels in the reference image, and the offset between pixels at corresponding positions in the non-reference image vector: determining an offset vector of the edge pixel in the non-reference image according to the vector information.
  • the method further includes: determining the mapping coordinates of the reference pixel points in the reference image; placing the mapping coordinates within a second preset range of the reference pixel points
  • the reference pixels within are determined as valid reference pixels; performing pixel fusion on the non-reference image and the reference image to generate a target image, including: valid reference pixels in the reference pixels corresponding to the reference pixels Weighted calculation is performed on the pixel values of the points to determine the pixel values of the corresponding interpolation pixel points of the reference pixel point; and the target image is formed according to the pixel values of the interpolation pixel points.
  • the method further includes: acquiring image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the reference pixel point Nearby image texture structure, the noise information is used to characterize the noise level of the image to be processed; the second preset range is determined according to the image texture information and/or noise information corresponding to the reference pixel.
  • the reference pixel in the non-reference image corresponding to the reference pixel in the reference image before determining the reference pixel in the non-reference image corresponding to the reference pixel in the reference image, it further includes: acquiring preset resolution information; according to the resolution Ratio information and size information of the reference image to determine the reference pixels in the reference image, the reference pixels are obtained by interpolating the original pixels in the reference image, the number of the reference pixels is greater than The number of original pixels.
  • an image processing device including:
  • An acquisition unit configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
  • a first determining unit configured to calculate an optical flow from the non-reference image to the reference image
  • a second determining unit based on the optical flow from the non-reference image to the reference image, to determine a reference pixel in the non-reference image corresponding to a reference pixel in the reference image;
  • a generating unit configured to perform interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate a target image.
  • the second determination unit is specifically configured to: determine, based on the optical flow from the non-reference image into the reference image, that in the non-reference image is related to the reference pixel The coordinates of the reference point corresponding to the position of the image where the point is located; determining all pixel points within the first preset range of the coordinates of the reference point in the non-reference image as reference pixel points.
  • the second determining unit is based on the optical flow from the non-reference image to the reference image, and determines the image position of the reference pixel in the non-reference image For the corresponding reference point coordinates, it is specifically used to: obtain the coordinates of the reference pixel points; in the reference image, determine the edge pixel points corresponding to the coordinates of the reference pixel points, wherein the edge pixel points are used to represent At least one pixel point adjacent to the reference pixel point; based on the optical flow from the non-reference image to the reference image, determine the offset vector of the edge pixel point in the non-reference image; according to the The coordinates of the reference pixel point and the offset vector are used to determine the coordinates of the reference point.
  • the second determination unit is further configured to: determine the first preset value of the coordinates of the reference point according to the variance of the offset vector of the edge pixel point in the non-reference image and the preset weight coefficient. set range.
  • the second determination unit determines the offset vector of the edge pixel in the non-reference image based on the optical flow from the non-reference image to the reference image When, it is specifically used to: calculate the vector information between the reference image and the non-reference image through the optical flow algorithm, wherein the vector information is used to characterize the pixels in the reference image, and the pixel points at the corresponding positions in the non-reference image The offset vector between them; according to the motion vector information, determine the offset vector of the edge pixel in the non-reference image.
  • the second determining unit is further configured to: determine the mapping coordinates of the reference pixel points in the reference image; point, determined as an effective reference pixel point; when the generation unit performs pixel fusion on the non-reference image and the reference image to generate the target image, it is specifically used to: performing weighted calculation on the pixel value of the reference pixel, and determining the pixel value of the interpolation pixel corresponding to the reference pixel; and constructing the target image according to the pixel value of the interpolation pixel.
  • the acquisition unit is further configured to: acquire image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the image texture structure near the reference pixel point , the noise information is used to characterize the noise level of the initial image; the second determination unit is further configured to: determine the second preset range according to the image texture information corresponding to the reference pixel and/or the noise information.
  • the obtaining unit is further configured to: obtain preset resolution information; determine reference pixels in the reference image according to the resolution information and size information of the reference image points, the reference pixel points are obtained by interpolating original pixel points in the reference image, and the number of the reference pixel points is greater than the number of the original pixel points.
  • an electronic device including: at least one processor and a memory;
  • the memory stores computer-executable instructions
  • the at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the image processing method described in the above first aspect and various possible designs of the first aspect.
  • a computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, Realize the image processing method described in the above first aspect and various possible designs of the first aspect.
  • an embodiment of the present disclosure provides a computer program product, including a computer program.
  • the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
  • an embodiment of the present disclosure provides a computer program.
  • the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.

Abstract

An image processing method and apparatus, an electronic device and a storage medium. The method comprises: obtaining a plurality of initial image frames, the plurality of initial image frames being a plurality of different image frames photographed for a same scene, and the plurality of initial image frames comprising a reference image and a non-reference image; calculating an optical flow from the non-reference image to the reference image; determining, on the basis of the optical flow from the non-reference image to the reference image, a reference pixel point in the non-reference image corresponding to a reference pixel point in the reference image; and by interpolating the reference pixel point in the non-reference image and the reference pixel point in the reference image, performing pixel fusion on the non-reference image and the reference image to generate a target image. Original pixel information of each image frame in multiple image frames to be processed is fully utilized in the process of generating the target image, such that the loss of part image information is avoided, thereby improving the imaging effect and image details of the finally generated target image.

Description

图像处理方法、装置、电子设备及存储介质Image processing method, device, electronic device and storage medium
本申请要求于2021年05月28日提交中国专利局、申请号为202110590685.X、申请名称为“图像处理方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202110590685.X and the application name "image processing method, device, electronic equipment and storage medium" submitted to the China Patent Office on May 28, 2021, the entire content of which is passed References are incorporated in this application.
技术领域technical field
本公开实施例涉及图像处理技术领域,尤其涉及一种图像处理方法、装置、电子设备、存储介质、计算机程序产品及计算机程序。Embodiments of the present disclosure relate to the technical field of image processing, and in particular, to an image processing method, device, electronic equipment, storage medium, computer program product, and computer program.
背景技术Background technique
随着电子影像和图像处理技术的发展,基于智能终端的拍照功能越来越强大,但同时,用户对拍摄照片的质量要求也越来越高,受限于感光元件尺寸、镜头及模组等硬件单元在性能、成本、部署空间等方面的限制,智能手机通过原生相机系统拍摄的照片质量较差,导致拍摄的照片细节辨识度差、信噪比低。With the development of electronic imaging and image processing technology, the camera function based on smart terminals is becoming more and more powerful, but at the same time, users have higher and higher requirements for the quality of photos taken, which is limited by the size of photosensitive elements, lenses and modules, etc. Due to the limitations of hardware units in terms of performance, cost, and deployment space, the quality of photos taken by smartphones through the native camera system is poor, resulting in poor detail recognition and low signal-to-noise ratio in the photos taken.
目前,现有技术中的方案,是在得到原生相机拍摄的目标照片后,通过多张照片对目标照片进行优化,生成高分辨率图像,以提高图片质量。然而,现有技术中的方案,仍存在由于图像信息丢失而导致的图像成像效果差,细节辨识度低的问题。At present, the solution in the prior art is to optimize the target photo through multiple photos to generate a high-resolution image after obtaining the target photo taken by the native camera, so as to improve the image quality. However, the solutions in the prior art still have the problems of poor image imaging effect and low detail recognition due to loss of image information.
发明内容Contents of the invention
本公开实施例提供一种图像处理方法、装置、电子设备、存储介质、计算机程序产品及计算机程序,以克服在生成高分辨率图像时成像效果差,图像细节辨识度低的问题。Embodiments of the present disclosure provide an image processing method, device, electronic equipment, storage medium, computer program product, and computer program to overcome the problems of poor imaging effect and low image detail recognition when generating high-resolution images.
第一方面,本公开实施例提供一种图像处理方法,包括:In a first aspect, an embodiment of the present disclosure provides an image processing method, including:
获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;计算从所述非基准图像到所述基准图像的光流;基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。Acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include a reference image and a non-reference image; calculating from the non-reference image to the The optical flow of the reference image; based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by adding the The reference pixel in the non-reference image is interpolated with the reference pixel in the reference image, and the non-reference image and the reference image are pixel fused to generate a target image.
第二方面,本公开实施例提供一种图像处理装置,包括:In a second aspect, an embodiment of the present disclosure provides an image processing device, including:
获取单元,用于获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;An acquisition unit, configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
第一确定单元,用于计算从所述非基准图像到所述基准图像的光流;a first determining unit, configured to calculate an optical flow from the non-reference image to the reference image;
第二确定单元,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;A second determining unit, based on the optical flow from the non-reference image to the reference image, to determine a reference pixel in the non-reference image corresponding to a reference pixel in the reference image;
生成单元,用于通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。A generating unit, configured to perform interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate a target image.
第三方面,本公开实施例提供一种电子设备,包括:至少一个处理器和存储器;In a third aspect, an embodiment of the present disclosure provides an electronic device, including: at least one processor and a memory;
所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的图像处理方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the image processing method described in the above first aspect and various possible designs of the first aspect.
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium, where computer-executable instructions are stored in the computer-readable storage medium, and when the processor executes the computer-executable instructions, the above first aspect and the first Aspects of various possible designs of the described image processing method.
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
第六方面,本公开实施例提供一种计算机程序,该计算机程序被处理器执行时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a sixth aspect, an embodiment of the present disclosure provides a computer program. When the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
本实施例提供的图像处理方法、装置、电子设备、存储介质、计算机程序产品及计算机程序,通过获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;计算从所述非基准图像到所述基准图像的光流;基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像,由于在生成目标图像的过程中,目标图像中的每一插值像素点,均是利用基准图像中对应的基准像素点和非基准图像中对应的参考像素点进行像素融合而得到的,因此,充分利用了待处理多帧图像中,各帧图像的原始像素信息,避免了部分图像信息丢失和引入误差的问题,提高了最终生成的目标图像的成像效果和图像细节。The image processing method, device, electronic equipment, storage medium, computer program product, and computer program provided in this embodiment obtain multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images shot for the same scene, The multi-frame initial image includes a reference image and a non-reference image; calculate an optical flow from the non-reference image to the reference image; determine the optical flow from the non-reference image to the reference image based on the optical flow from the non-reference image to the reference image the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by interpolating the reference pixel in the non-reference image with the reference pixel in the reference image, the The non-reference image is pixel fused with the reference image to generate the target image, because in the process of generating the target image, each interpolation pixel in the target image uses the corresponding reference pixel and non-reference pixel in the reference image The corresponding reference pixels in the benchmark image are obtained by pixel fusion. Therefore, the original pixel information of each frame image in the multi-frame image to be processed is fully utilized, and the problems of partial image information loss and error introduction are avoided, and the final image quality is improved. The imaging effect and image details of the generated target image.
附图说明Description of drawings
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术 描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present disclosure or the technical solutions in the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are For some embodiments of the present disclosure, for those skilled in the art, other drawings can also be obtained according to these drawings on the premise of not paying creative efforts.
图1为本公开实施例提供的一种应用场景图;FIG. 1 is a diagram of an application scenario provided by an embodiment of the present disclosure;
图2为现有技术中一种生成高分辨率图像的方法示意图;Fig. 2 is a schematic diagram of a method for generating a high-resolution image in the prior art;
图3为本公开实施例提供的图像处理方法流程示意图一;FIG. 3 is a first schematic flow diagram of an image processing method provided by an embodiment of the present disclosure;
图4为本公开实施例提供的一种对基准图像进行插值计算的示意图;FIG. 4 is a schematic diagram of an interpolation calculation for a reference image provided by an embodiment of the present disclosure;
图5为本公开实施例提供的一种确定参考像素点的示意图;FIG. 5 is a schematic diagram of determining a reference pixel point provided by an embodiment of the present disclosure;
图6为本公开实施例提供的图像处理方法流程示意图二;FIG. 6 is a second schematic flow diagram of an image processing method provided by an embodiment of the present disclosure;
图7为确定与第一插值像素点对应的参考点坐标的过程的流程图;Fig. 7 is a flow chart of the process of determining the reference point coordinates corresponding to the first interpolation pixel point;
图8为本公开实施例提供的一种第一插值像素点和与其对应的边缘像素点的示意图;FIG. 8 is a schematic diagram of a first interpolation pixel point and its corresponding edge pixel point provided by an embodiment of the present disclosure;
图9为本公开实施例提供的一种第一预设范围的示意图;FIG. 9 is a schematic diagram of a first preset range provided by an embodiment of the present disclosure;
图10为本公开实施例提供的一种第二预设范围的示意图;FIG. 10 is a schematic diagram of a second preset range provided by an embodiment of the present disclosure;
图11为本公开实施例提供的图像处理装置的结构框图;FIG. 11 is a structural block diagram of an image processing device provided by an embodiment of the present disclosure;
图12为本公开实施例提供的一种电子设备的结构示意图;FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure;
图13为本公开实施例提供的电子设备的硬件结构示意图。FIG. 13 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments It is a part of the embodiments of the present disclosure, but not all of them. Based on the embodiments in the present disclosure, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present disclosure.
图1为本公开实施例提供的一种应用场景图,本公开实施例提供的图像处理方法可以应用于智能终端,例如智能手机,参考图1,在通过智能手机进行拍摄的应用场景中,用户使用智能手机,通过一次拍摄操作,生成多帧低分辨率的图像,此过程中,智能手机通过显示“正在改善分辨率,请勿移动”的提示信息,提示用户不要移动手机,以便于采集多帧同一场景下连续变化的图像。之后,智能手机通过内置的程序或软件,对该低分辨率图像进行处理,生成一帧高分辨率的图像,并进行显示,使用户能够得到图像更清晰、图像细节更好的照片。FIG. 1 is a diagram of an application scenario provided by an embodiment of the present disclosure. The image processing method provided by an embodiment of the present disclosure can be applied to a smart terminal, such as a smart phone. Referring to FIG. Use a smart phone to generate multiple frames of low-resolution images through one shooting operation. During this process, the smart phone prompts the user not to move the phone by displaying the prompt message "Resolution is being improved, please do not move" so as to facilitate the collection of more images. Frame continuously changing images of the same scene. Afterwards, the smartphone processes the low-resolution image through a built-in program or software to generate a frame of high-resolution image and display it, so that users can get photos with clearer images and better image details.
图2为现有技术中一种生成高分辨率图像的方法示意图,如图2所示,现有技术中,在对多帧低分辨率图像进行处理,生成高分辨率图像的过程中,通常采用的方法是,将多帧图 像中的一帧图像作为参考帧,计算参考帧至非参考帧的光流,再根据光流计算结果,将其他非参考帧的图像通过仿设变换(warp)对齐至参考帧并进行插值融合,生成插值图像。然而在将其他帧图像对齐至参考帧的过程中,由于仿设变换的算法本身会引入一定误差,因此,在各其他帧图像对齐之后,各其他帧图像已经不是原始图像,因此存在原始的亚像素信息损失的问题,导致之后利用对齐后的多帧图片进行插值融合,生成的高分辨率的插值图像,存在成像效果差,图像细节辨识度低的问题。FIG. 2 is a schematic diagram of a method for generating a high-resolution image in the prior art. As shown in FIG. 2 , in the prior art, in the process of processing multiple frames of low-resolution images to generate a high-resolution image, usually The method used is to use one frame of images in the multi-frame images as a reference frame, calculate the optical flow from the reference frame to the non-reference frame, and then according to the optical flow calculation results, the images of other non-reference frames are transformed by pseudo-warp Align to the reference frame and perform interpolation fusion to generate an interpolated image. However, in the process of aligning other frame images to the reference frame, since the algorithm of pseudo-transformation itself will introduce certain errors, after each other frame image is aligned, each other frame image is no longer the original image, so there are original sub-images. The problem of pixel information loss leads to the use of aligned multi-frame images for interpolation and fusion, resulting in high-resolution interpolation images, which have poor imaging effects and low image detail recognition.
图3为本公开实施例提供的图像处理方法流程示意图一。本实施例的方法可以应用在智能终端中,该图像处理方法包括:FIG. 3 is a first schematic flowchart of an image processing method provided by an embodiment of the present disclosure. The method of this embodiment can be applied in a smart terminal, and the image processing method includes:
步骤S101,获取多帧初始图像,其中,多帧初始图像是针对同一场景拍摄的多帧不同图像,多帧初始图像中包括基准图像和非基准图像。Step S101 , acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images shot for the same scene, and the multiple frames of initial images include reference images and non-reference images.
示例性地,智能终端例如为智能手机,待智能手机上设置有一个或多个摄像头。获取多帧初始图像,可以是通过智能手机的一个或多个摄像头,拍摄的在同一个场景下的连续变化的多帧图片。多帧图片之间具有连续变化的偏移。更具体地,通过智能手机拍摄多帧图片的动作,可以是通过用户的一次拍摄操作所触发的,例如,用户按下“拍照”按键,智能手机在短时间内(例如0.5秒内)拍摄10张照片,并进行保存,生成多帧初始图像。由于用户手持手机会产生晃动,因此智能手机拍摄的各图片之间存在一定程度的连续变化的偏移。当然,通过智能手机拍摄多帧图片的动作,也可以是通过用户短时间内的多次拍摄操作所触发的,生成多帧初始图像的过程类似,此处不再进行赘述。Exemplarily, the smart terminal is, for example, a smart phone, which is provided with one or more cameras. Acquiring multiple frames of initial images may be continuously changing multiple frames of pictures in the same scene captured by one or more cameras of the smartphone. There are continuously changing offsets between multiple frames of pictures. More specifically, the action of taking multiple frames of pictures through the smartphone may be triggered by a user's shooting operation. For example, the user presses the "photograph" button, and the smartphone takes 10 pictures in a short period of time (for example, within 0.5 seconds). photos and save them to generate multiple frames of initial images. Since the mobile phone is shaken by the user, there is a certain degree of continuously changing offset between the pictures taken by the smart phone. Of course, the action of taking multiple frames of pictures through the smartphone may also be triggered by the user's multiple shooting operations within a short period of time. The process of generating multiple frames of initial images is similar and will not be repeated here.
进一步地,在多帧初始图像中,包括基准图像和非基准图像,其中,示例性地,基准图像可以是多帧初始图像中,成像效果较好的图像,或者清晰度较高的图像,基准图像和非基准图像可以通过预设的算法对多帧初始图像进行处理后确定,例如评估各初始图像的清晰度,将清晰度最高的待处理图片,确定为基准图像,将初始图像中的其他图像,确定为非基准图像。当然,多帧初始图像中的基准图像和非基准图像,也可以是根据预设的规则确定的,例如将多帧初始图像中的第一帧图像,或者最后一帧图像,确定为基准图像,此处不再对该过程进行赘述。Further, the multi-frame initial images include a reference image and a non-reference image, wherein, for example, the reference image may be an image with better imaging effect or a higher-resolution image among the multi-frame initial images, the reference image Images and non-reference images can be determined after processing multiple frames of initial images by preset algorithms, such as evaluating the clarity of each initial image, determining the picture to be processed with the highest image, determined to be a non-reference image. Of course, the reference image and the non-reference image in the multi-frame initial image may also be determined according to preset rules, for example, the first frame image or the last frame image in the multi-frame initial image is determined as the reference image, The process will not be repeated here.
步骤S102,计算从非基准图像到基准图像的光流。Step S102, calculating the optical flow from the non-reference image to the reference image.
光流(Optical Flow)是物体在三维空间中的运动在二维像平面上的投影。它是由物体和相机的相对速度产生的,反映了物体在极小时间内对应的图像像素的运动方向和速度。在本实施例中,计算从非基准图像到基准图像的光流,即通过预设的光流算法,计算非基准图像中每一像素到基准图像的位置映射,也即,对于非基准图像中的每一像素点,在基准图像中和此非基准图像中的像素点最相似的像素点的位置进行计算,而得到的光流,即为表征该位 置映射的信息。其中,光流算法为本领域技术人员知晓的现有技术,此次不对光流算法的具体类型进行限制,也不再一一赘述。Optical flow is the projection of the motion of an object in three-dimensional space on a two-dimensional image plane. It is generated by the relative speed of the object and the camera, and reflects the motion direction and speed of the image pixel corresponding to the object in a very small time. In this embodiment, the optical flow from the non-reference image to the reference image is calculated, that is, the position mapping of each pixel in the non-reference image to the reference image is calculated through the preset optical flow algorithm, that is, for the non-reference image For each pixel of , the calculation is performed at the position of the pixel in the reference image that is most similar to the pixel in the non-reference image, and the obtained optical flow is the information that characterizes the position map. Wherein, the optical flow algorithm is an existing technology known to those skilled in the art, and the specific type of the optical flow algorithm is not limited this time, and details will not be described one by one.
步骤S103,基于从非基准图像到基准图像中的光流,确定非基准图像中与基准图像中基准像素点相对应的参考像素点。Step S103, based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image.
示例性地,在确定非基准图像到基准图像中的光流后,根据基准图像中基准像素点的位置,分别在其他的非基准图像中,确定与该基准像素点有关的像素点,即参考像素点。其中,参考像素点包含了该基准像素点对应的,由于非基准图像之间的连续变化的偏移而产生的亚像素信息,因此,根据参考像素点确定的插值像素点,能够更好的表现图像细节,使插值后的高分辨率图像的视觉表现更加真实。Exemplarily, after determining the optical flow from the non-reference image to the reference image, according to the position of the reference pixel in the reference image, determine the pixels related to the reference pixel in other non-reference images, that is, the reference pixel. Among them, the reference pixel contains the sub-pixel information corresponding to the reference pixel due to the continuously changing offset between non-reference images. Therefore, the interpolation pixel determined according to the reference pixel can better express Image detail, making interpolated high-resolution images look more realistic.
示例性地,图4为本公开实施例提供的一种确定参考像素点的示意图,如图4所示,确定与基准像素点对应的参考像素点的方法,可以通过对基准图像进行光流计算,得到非基准图像到基准图像的光流,再根据光流计算结果,将基准像素点映射到非基准图像中,确定在非基准图像中,与该基准像素点在该非基准图像的映射点相距预设距离内的像素点,并将上述相距预设距离内的像素点,作为参考像素点。其中,光流计算的方法为本领域技术人员所知晓的现有技术,此处不再赘述。Exemplarily, FIG. 4 is a schematic diagram of determining a reference pixel point provided by an embodiment of the present disclosure. As shown in FIG. 4 , the method for determining a reference pixel point corresponding to a reference pixel point can be performed by performing optical flow calculation on a reference image , get the optical flow from the non-reference image to the reference image, and then map the reference pixel to the non-reference image according to the optical flow calculation result, and determine the mapping point between the reference pixel and the non-reference image in the non-reference image The pixel points within the preset distance are used as the reference pixel points. Wherein, the optical flow calculation method is a prior art known to those skilled in the art, and will not be repeated here.
步骤S104,通过将非基准图像中的参考像素点与基准图像中的基准像素点进行插值计算,对非基准图像与基准图像进行像素融合,生成目标图像。Step S104 , by interpolating the reference pixel points in the non-reference image and the reference pixel points in the reference image, performing pixel fusion on the non-reference image and the reference image to generate a target image.
具体地,为生成高分辨率的目标图像,需要对基准图像插值所生成的高分辨率的目标图像中每一插值像素点,进行像素信息填充,其中,每一插值像素点对应的参考像素点,是原本在其他非基准图像中的一个或多个原始像素点,插值像素点对应的将基准像素点和对应的参考像素点进行像素融合,所生成的像素点,即为插值像素点。插值像素点包含了不同非基准图像中的原始的亚像素信息,因此由插值像素点构成的高分辨率目标图像,相比现有技术中对非基准图像通过仿设变换进行对齐后,再进行像素融合得到目标图像的方案,本实施例提供的方法生成的插值图像,更好的利用了初始图像中的图像信息,使插值图像的图像细节更好。Specifically, in order to generate a high-resolution target image, it is necessary to fill in pixel information for each interpolation pixel in the high-resolution target image generated by the interpolation of the reference image, wherein the reference pixel corresponding to each interpolation pixel , are one or more original pixels originally in other non-reference images, and the interpolation pixels correspond to the pixel fusion of the reference pixels and the corresponding reference pixels, and the generated pixels are the interpolation pixels. The interpolated pixels contain the original sub-pixel information in different non-reference images, so the high-resolution target image composed of interpolated pixels, compared with the prior art, after aligning the non-reference images through pseudo-transformation, and then performing In the scheme of obtaining the target image by pixel fusion, the interpolation image generated by the method provided in this embodiment better utilizes the image information in the initial image, so that the image details of the interpolation image are better.
其中,对多个像素点进行像素融合的方法,可以通过各像素点的像素值进行加权平均的方式实现,此处不再对该过程进行赘述。Wherein, the method of performing pixel fusion on multiple pixel points can be implemented by performing weighted average of the pixel values of each pixel point, and the process will not be repeated here.
在本实施例中,通过获取多帧初始图像,其中,多帧初始图像是针对同一场景拍摄的多帧不同图像,多帧初始图像中包括基准图像和非基准图像;计算从非基准图像到基准图像的光流;基于从非基准图像到基准图像中的光流,确定非基准图像中与基准图像中基准像素点相对应的参考像素点;通过将非基准图像中的参考像素点与基准图像中的基准像素点进行插 值计算,对非基准图像与基准图像进行像素融合,生成目标图像,由于在生成目标图像的过程中,目标图像中的每一插值像素点,均是利用基准图像中对应的基准像素点和非基准图像中对应的参考像素点进行像素融合而得到的,因此,充分利用了待处理多帧图像中,各帧图像的原始像素信息,避免了部分图像信息丢失和引入误差的问题,提高了最终生成的目标图像的成像效果和图像细节。In this embodiment, by acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images; calculating from non-reference images to reference The optical flow of the image; based on the optical flow from the non-reference image to the reference image, determine the reference pixels in the non-reference image corresponding to the reference pixels in the reference image; by combining the reference pixels in the non-reference image with the reference pixel The reference pixels in the target image are interpolated, and the non-reference image and the reference image are pixel-fused to generate the target image. Because in the process of generating the target image, each interpolation pixel in the target image uses the corresponding Therefore, the original pixel information of each frame image in the multi-frame image to be processed is fully utilized, and the loss of part of image information and the introduction of error are avoided. The problem of improving the imaging effect and image details of the final generated target image.
图5为本公开实施例提供的图像处理方法流程示意图二。本实施例中对步骤S102-S103进行细化,该图像处理方法包括:FIG. 5 is a second schematic flowchart of an image processing method provided by an embodiment of the present disclosure. Steps S102-S103 are refined in this embodiment, and the image processing method includes:
步骤S201,获取连续变化的多帧初始图像,其中,多帧初始图像包括基准图像和非基准图像。Step S201, acquiring continuously changing multiple frames of initial images, wherein the multiple frames of initial images include a reference image and a non-reference image.
步骤S202,获取预设的分辨率信息,并根据分辨率信息和基准图像的尺寸信息,确定基准图像中的基准像素点,基准像素点是对基准图像中的原始像素点插值得到的,基准像素点的数量大于原始像素点的数量。Step S202, obtain the preset resolution information, and determine the reference pixel in the reference image according to the resolution information and the size information of the reference image, the reference pixel is obtained by interpolating the original pixel in the reference image, the reference pixel The number of points is greater than the number of original pixel points.
示例性地,在基准图像的基础上,对基准图像进行插值计算,能够生成一帧高分辨率图像,根据高分辨率图像确定基准图像中的基准像素点。图6为本公开实施例提供的一种对基准图像进行插值计算的示意图,如图6所示,示例性地,基准图像为包含4个像素点,分辨率为2X2的图像,对基准图像进行插值计算后,确定的高分辨率图像为包含16个像素点,分辨率为4X4的图像,高分辨率图像中的各像素点,即为基准像素点。之后,对该高分辨率图像中的各像素点进行像素信息填充后,即可生成目标图像,对基准图像进行插值计算后,可以确定基准图像中各基准像素点在基准图像中的位置,该基准像素点在基准图像中的位置记录在插值图像信息。更具体地,插值图像信息中包括插值图像中各基准像素点的坐标值。Exemplarily, on the basis of the reference image, interpolation calculation is performed on the reference image to generate a frame of high-resolution image, and the reference pixel points in the reference image are determined according to the high-resolution image. FIG. 6 is a schematic diagram of interpolation calculation for a reference image provided by an embodiment of the present disclosure. As shown in FIG. 6 , for example, the reference image is an image containing 4 pixels and a resolution of 2X2, and the reference image is After the interpolation calculation, the determined high-resolution image is an image including 16 pixels with a resolution of 4×4, and each pixel in the high-resolution image is a reference pixel. Afterwards, after filling the pixel information of each pixel in the high-resolution image, the target image can be generated, and after interpolation calculation is performed on the reference image, the position of each reference pixel in the reference image can be determined. The position of the reference pixel in the reference image is recorded in the interpolation image information. More specifically, the interpolated image information includes the coordinate values of each reference pixel in the interpolated image.
其中,对基准图像进行插值计算,可根据预设的分辨率信息确定,也可根据初始图像的帧数动态确定,此处不进行限制,根据分辨率信息和基准图像的尺寸信息,确定基准图像中的基准像素点后,基准像素点的数量大于原始像素点的数量,相当于对基准图像进行插值计算后,所对应的高分辨率图像的分辨率大于初始的基准图像的分辨率,图像插值计算的具体步骤为本领域人员所知晓的现有技术,此处不再赘述。Among them, the interpolation calculation of the reference image can be determined according to the preset resolution information, or dynamically determined according to the frame number of the initial image. There is no limitation here, and the reference image is determined according to the resolution information and the size information of the reference image After the reference pixels, the number of reference pixels is greater than the number of original pixels, which means that after the reference image is interpolated, the resolution of the corresponding high-resolution image is greater than the resolution of the initial reference image, and the image interpolation The specific steps of calculation are the prior art known to those skilled in the art, and will not be repeated here.
步骤S203,计算从非基准图像到基准图像的光流。Step S203, calculating the optical flow from the non-reference image to the reference image.
步骤S204,基于从非基准图像到基准图像中的光流,确定非基准图像中,与基准像素点所在图像位置对应的参考点坐标。Step S204, based on the optical flow from the non-reference image to the reference image, determine the coordinates of the reference point corresponding to the image position where the reference pixel is located in the non-reference image.
其中,基准图像中包括多个基准像素点,示例性地,可以采用循环依次处理或并行处理的方式,对每一基准像素点进行光流计算,下面以对其中一个基准像素点进行光流计算,确定与该基准像素点所在图像位置对应的参考点坐标的过程进行详细介绍。Wherein, the reference image includes a plurality of reference pixels. For example, the optical flow calculation can be performed on each reference pixel in the manner of loop sequential processing or parallel processing. The following is to perform optical flow calculation on one of the reference pixels , the process of determining the coordinates of the reference point corresponding to the image position where the reference pixel is located will be introduced in detail.
图7为确定与基准像素点所在图像位置对应的参考点坐标的过程的流程图,如图7所示,该过程包括:Fig. 7 is the flowchart of the process of determining the coordinates of the reference point corresponding to the position of the image where the reference pixel is located. As shown in Fig. 7, the process includes:
S2041,获取基准像素点的坐标。S2041. Acquire the coordinates of the reference pixel.
S2042,在基准图像中,确定与基准像素点的坐标对应的边缘像素点,其中,边缘像素点用于表征与基准像素点临近的至少一个像素点。S2042. In the reference image, determine an edge pixel point corresponding to the coordinates of the reference pixel point, where the edge pixel point is used to represent at least one pixel point adjacent to the reference pixel point.
示例性地,基准像素点的坐标可以通过分辨率信息和基准图像的尺寸信息获得,通过分辨率信息和基准图像的尺寸信息,可以生成插值图像信息,插值图像信息中包括基准图像中各基准像素点的坐标,插值图像信息的实现方式已在前述实施例中进行了详细介绍,此处不再赘述。进一步地,在基准图像中,根据基准像素点的坐标,确定距离该坐标最近的若干原始像素点,即边缘像素点。图8为本公开实施例提供的一种基准像素点和与其对应的边缘像素点的示意图,如图8所示,根据基准像素点O的坐标,分别计算距离其最近的四个原始像素点,即A、B、C、D,从而将A、B、C、D四个基准图像中的原始像素点确定为边缘像素点。当然,根据第一基准像素点O位置的变化,与其相邻的像素点也可能少于4个,此处不再一一举例赘述。For example, the coordinates of the reference pixel point can be obtained through the resolution information and the size information of the reference image, and the interpolation image information can be generated through the resolution information and the size information of the reference image, and the interpolation image information includes each reference pixel in the reference image The implementation of the coordinates of the points and the interpolation of image information has been introduced in detail in the foregoing embodiments, and will not be repeated here. Further, in the reference image, according to the coordinates of the reference pixel, determine several original pixel points closest to the coordinate, that is, edge pixel points. FIG. 8 is a schematic diagram of a reference pixel point and its corresponding edge pixel points provided by an embodiment of the present disclosure. As shown in FIG. 8 , according to the coordinates of the reference pixel point O, the four original pixel points closest to it are respectively calculated, That is, A, B, C, and D, so that the original pixels in the four reference images of A, B, C, and D are determined as edge pixels. Certainly, according to the change of the position of the first reference pixel O, there may be less than 4 adjacent pixel points, and the examples will not be repeated here.
更具体地,A、B、C、D的具体计算方式可以如式(1)所示:More specifically, the specific calculation methods of A, B, C, and D can be shown in formula (1):
A=(floor(a),floor(b))A=(floor(a),floor(b))
B=(floor(a)+1,floor(b))B=(floor(a)+1,floor(b))
C=(floor(a),floor(b)+1)C=(floor(a),floor(b)+1)
D=(floor(a)+1,floor(b)+1)      (1)D=(floor(a)+1,floor(b)+1) (1)
其中,a、b为第一基准像素点O的坐标(a,b)的坐标值,floor()为向下取整函数。Wherein, a and b are the coordinate values of the coordinates (a, b) of the first reference pixel point O, and floor() is a function of rounding down.
S2043,基于从非基准图像到基准图像中的光流,确定边缘像素点在非基准图像中的偏移矢量。S2043. Based on the optical flow from the non-reference image to the reference image, determine the offset vector of the edge pixel points in the non-reference image.
示例性地,确定边缘像素点在非基准图像中的偏移矢量的一种实现方式例如为:通过光流算法,计算基准图像至非基准图像之间的矢量信息,其中,矢量信息用于表征基准图像中的像素点,在非基准图像中的对应位置的像素点之间的偏移矢量;根据运动矢量信息,确定边缘像素点在非基准图像中的偏移矢量。其中,光流算法通过光流函数OF()实现,光流计算的一般表达式如式(2)所示:Exemplarily, one implementation of determining the offset vector of edge pixels in the non-reference image is, for example, to calculate the vector information between the reference image and the non-reference image through the optical flow algorithm, wherein the vector information is used to represent Pixels in the reference image and offset vectors between pixels at corresponding positions in the non-reference image; according to the motion vector information, determine the offset vector of the edge pixels in the non-reference image. Among them, the optical flow algorithm is realized by the optical flow function OF(), and the general expression of optical flow calculation is shown in formula (2):
F t(x,y)=F r((x,y)+OF(x,y)),t∈[1,N]    (2) F t (x,y)=F r ((x,y)+OF(x,y)),t∈[1,N] (2)
其中,(x,y)为基准图像中像素点的坐标,r为基准帧的索引,t为非基准帧的索引,N为非参考图像的帧数。OF()为光流函数,OF(x,y)为像素点的光流计算结果,当该光流计算结果包含小数时,其小数部分表示映射到的亚像素位置。通过式(2)可以实现基准图像中的像素 点向非基准图像的映射。Among them, (x, y) is the coordinates of the pixel in the reference image, r is the index of the reference frame, t is the index of the non-reference frame, and N is the frame number of the non-reference image. OF() is the optical flow function, and OF(x,y) is the optical flow calculation result of the pixel. When the optical flow calculation result contains decimals, the decimal part represents the sub-pixel position to which it is mapped. The mapping of pixels in the reference image to non-reference images can be realized by formula (2).
进一步地,分别对边缘像素点进行光流计算,确定各边缘像素点的光流计算结果,并进行加权平均计算,可以得到一个平均偏移量,即偏移矢量,示例性地,该偏移矢量的计算方法如式(3)所示:Further, the optical flow calculation is performed on the edge pixels respectively, the optical flow calculation results of each edge pixel are determined, and the weighted average calculation is performed to obtain an average offset, that is, an offset vector. Exemplarily, the offset The calculation method of the vector is shown in formula (3):
offset=medium(OF(A),OF(B),OF(C),OF(D))      (3)offset=medium(OF(A),OF(B),OF(C),OF(D)) (3)
其中,offset为偏移矢量,medium()为加权平均计算,OF(A)、OF(B)、OF(C)、OF(D)分别为边缘像素点A、B、C、D的光流计算结果。Among them, offset is the offset vector, medium() is the weighted average calculation, OF(A), OF(B), OF(C), OF(D) are the optical flow of edge pixels A, B, C, and D respectively Calculation results.
S2044,根据基准像素点的坐标与偏移矢量,确定参考点坐标。S2044. Determine the coordinates of the reference point according to the coordinates of the reference pixel point and the offset vector.
进一步地,根据偏移矢量对第一基准像素点的坐标做偏移处理,即可确定在非基准图像中的参考坐标点,示例性地,实现方法如式(4)所示:Further, by performing offset processing on the coordinates of the first reference pixel point according to the offset vector, the reference coordinate point in the non-reference image can be determined. Exemplarily, the implementation method is shown in formula (4):
center1=round((a,b)-offset)     (4)center1=round((a,b)-offset) (4)
其中,a、b为第一基准像素点O的坐标(a,b)的坐标值,round()为四舍五入取整函数,参考坐标点为center1。Wherein, a and b are the coordinate values of the coordinates (a, b) of the first reference pixel point O, round() is a rounding function, and the reference coordinate point is center1.
步骤S205,将非基准图像中,位于参考点坐标的第一预设范围内的所有像素点,确定为参考像素点。Step S205, determining all the pixels within the first preset range of the reference point coordinates in the non-reference image as reference pixels.
图9为本公开实施例提供的一种第一预设范围的示意图,参考图9,进一步地,在根据基准像素点91在非基准图像的映射以及偏移矢量,确定每一位于非基准图像中参考点坐标92后,根据参考点坐标92,分别确定每一非基准图像中,位于参考点坐标92第一预设范围内的像素点,并将该一个或多个像素点,确定为参考像素点93。其中,示例性地,第一预设范围是根据边缘像素点在非基准图像中的偏移矢量的方差,以及预设的权重系数确定的。FIG. 9 is a schematic diagram of a first preset range provided by an embodiment of the present disclosure. With reference to FIG. 9 , further, according to the mapping of the reference pixel point 91 in the non-reference image and the offset vector, determine each location in the non-reference image After specifying the reference point coordinates 92, according to the reference point coordinates 92, respectively determine the pixel points within the first preset range of the reference point coordinates 92 in each non-reference image, and determine the one or more pixel points as reference points 93 pixels. Wherein, for example, the first preset range is determined according to the variance of the offset vector of the edge pixel points in the non-reference image and a preset weight coefficient.
示例性地,确定非基准图像中,位于参考点坐标第一预设范围内的像素点的实现方法,可以通过加窗的方式实现,其中,通过加窗半径的大小,确定第一预设范围。更具体地,确定加窗半径的方法,如式(5)和式(6)所示:Exemplarily, the implementation method of determining the pixel points within the first preset range of the coordinates of the reference point in the non-reference image can be realized by adding a window, wherein the first preset range is determined by the size of the windowing radius . More specifically, the method of determining the window radius is shown in formula (5) and formula (6):
r1=(1-weight)*r1_th1+(weight)*r1_th2    (5)r1=(1-weight)*r1_th1+(weight)*r1_th2 (5)
weight=min(variance(OF(A),OF(B),OF(C),OF(D)),weight_max)/weight_max(6)weight=min(variance(OF(A),OF(B),OF(C),OF(D)),weight_max)/weight_max(6)
其中,r1为加窗半径,weight为加窗权重系数,variance()是方差函数,min()是最小值函数,r1_th1、r1_th2和weight_max为预设阈值,且r1_th2>r1_th1>1,weight_max>0,r1_th1、r1_th2和weight_max由初始图像的图像尺寸、图像内容、纹理信息等因素确定,可以通过实验而获得,此处不对其确定方法进行赘述。Among them, r1 is the window radius, weight is the window weight coefficient, variance() is the variance function, min() is the minimum value function, r1_th1, r1_th2 and weight_max are the preset thresholds, and r1_th2>r1_th1>1, weight_max>0 , r1_th1, r1_th2, and weight_max are determined by factors such as the image size, image content, and texture information of the initial image, and can be obtained through experiments, and the determination methods will not be described here.
本实施例中,在通过光流计算确定参考点坐标后,通过确定第一预设范围,而获得第一预设范围内的参考像素点,由于第一预设范围的确定过程,通过参数的设置,考虑了图像尺 寸、图像内容、纹理信息等因素的影响,以此确定的第一预设范围,能够更好的确定出与基准像素点相关性更好的参考像素点,进而提高参考像素点的有效性,提高后续合成的目标图像的图像细节和图像表现力。In this embodiment, after the coordinates of the reference point are determined through optical flow calculation, the reference pixel points within the first preset range are obtained by determining the first preset range. Due to the determination process of the first preset range, through the parameters Setting, taking into account the influence of factors such as image size, image content, texture information, etc., the first preset range determined by this can better determine the reference pixel point with better correlation with the reference pixel point, and then improve the reference pixel point. The effectiveness of the points can improve the image details and image expressiveness of the target image for subsequent synthesis.
可选地,在步骤S205之后,为了进一步地的提高参考像素点与基准像素点的相关性,提高后续对非基准图像与基准图像进行像素融合的准确性,还包括:Optionally, after step S205, in order to further improve the correlation between the reference pixel and the reference pixel, and improve the accuracy of the subsequent pixel fusion of the non-reference image and the reference image, it also includes:
S206,确定参考像素点在基准图像中的映射坐标。S206. Determine the mapping coordinates of the reference pixel point in the reference image.
S207,将映射坐标中落入基准像素点的第二预设范围内的参考像素点,确定为有效参考像素点。S207. Determine the reference pixel points in the mapping coordinates that fall within the second preset range of the reference pixel points as valid reference pixel points.
图10为本公开实施例提供的一种第二预设范围的示意图,参考图10,示例性地,在确定以参考点坐标为中心点的第一预设范围后,该范围内的所有原始像素点,可以作为参考像素点,进行后续的像素融合,从而确定对应的插值像素点的像素值,其中,目标图像是由插值像素点构成的,基准像素点与插值像素点的位置重合。然而,在第一预设范围内的参考像素点93向基准图像映射后,会生成对应的映射坐标94,该映射坐标94所对应的基准像素点91有的较近,而有的较远,对于较远的映射坐标94所对应的参考像素点93,由于偏离插值像素点较远,因此其所表征的图像信息,与基准像素点91所对应位置的真实的图像信息,也有较大差异,使用此类参考像素点进行像素点融合,会导致最终生成的插值像素点的失真,影响像素融合准确性,进而影响目标图像的图像细节和图像效果。Fig. 10 is a schematic diagram of a second preset range provided by an embodiment of the present disclosure. Referring to Fig. 10 , for example, after the first preset range with the coordinates of the reference point as the center point is determined, all original The pixel can be used as a reference pixel for subsequent pixel fusion to determine the pixel value of the corresponding interpolation pixel, wherein the target image is composed of interpolation pixels, and the positions of the reference pixel and the interpolation pixel coincide. However, after the reference pixel points 93 in the first preset range are mapped to the reference image, corresponding mapping coordinates 94 will be generated, and some reference pixel points 91 corresponding to the mapping coordinates 94 are relatively close and some are far away. For the reference pixel point 93 corresponding to the farther mapping coordinate 94, since it is far away from the interpolation pixel point, the image information represented by it is also quite different from the real image information at the position corresponding to the reference pixel point 91. Using such reference pixels for pixel fusion will result in distortion of the final interpolated pixels, affecting the accuracy of pixel fusion, and further affecting the image details and image effects of the target image.
因此,为了进一步地的提高参考像素点与基准像素点的相关性,提高后续计算插值像素点的准确性,将参考像素点中与基准像素点相关性较高的,确定为有效参考像素点,并利用有效参考像素点,进行后续的像素融合。Therefore, in order to further improve the correlation between the reference pixel and the reference pixel, and improve the accuracy of the subsequent calculation of the interpolation pixel, the reference pixel with a higher correlation with the reference pixel is determined as an effective reference pixel, And use effective reference pixel points to perform subsequent pixel fusion.
其中,示例性地,确定有效参考像素点的方式,可以将映射坐标落入基准像素点的第二预设范围的参考像素点,确定为有效参考像素点,其中,确认第二预设范围的方法包括:Wherein, for example, the method of determining the effective reference pixel point may be to determine the reference pixel point whose mapping coordinates fall within the second preset range of the reference pixel point as the effective reference pixel point, wherein, confirming that the second preset range Methods include:
获取基准像素点对应的图像纹理信息,和/或噪声信息,其中,图像纹理信息用于表征基准像素点附近的图像纹理结构,噪声信息用于表征初始图像的噪声水平;根据基准像素点对应的图像纹理信息,和/或噪声信息,确定第二预设范围。Obtain image texture information and/or noise information corresponding to the reference pixel, wherein the image texture information is used to characterize the image texture structure near the reference pixel, and the noise information is used to characterize the noise level of the initial image; according to the Image texture information, and/or noise information, determine a second preset range.
具体地,确定第二预设范围的方法可以通过式(7)、式(8)和式(9)实现:Specifically, the method for determining the second preset range can be realized by formula (7), formula (8) and formula (9):
r2=(1-weight)*r2_th1+(weight)*r2_th2     (7)r2=(1-weight)*r2_th1+(weight)*r2_th2 (7)
Figure PCTCN2022092072-appb-000001
Figure PCTCN2022092072-appb-000001
Vari=variance(F(A),F(B),F(C),F(D))     (9)Vari=variance(F(A),F(B),F(C),F(D)) (9)
其中,r2_th1、r2_th2、scale是预设的阈值,weight为权重系数,r2_th2>r2_th1>=1, scale>1,具体值由实验调试而确定,variance()是方差函数,F(A)、F(B)、F(C)、F(D)分别是基准图像中边缘像素点A、B、C、D的坐标,noise是噪声程度,是系统输入值,Vari为第二预设范围。Among them, r2_th1, r2_th2, scale are the preset thresholds, weight is the weight coefficient, r2_th2>r2_th1>=1, scale>1, the specific value is determined by the experimental debugging, variance() is the variance function, F(A), F (B), F(C), and F(D) are the coordinates of edge pixels A, B, C, and D in the reference image respectively, noise is the noise level, and is the system input value, and Vari is the second preset range.
本实施例中,通过基准像素点对应的图像纹理信息,和/或噪声信息,确定第二预设范围,并在第二预设范围内确定出用于后续融合计算的有效参考信息,进一步地提高生成的目标图像的图像细节和图像效果。In this embodiment, the second preset range is determined through the image texture information and/or noise information corresponding to the reference pixel, and effective reference information for subsequent fusion calculations is determined within the second preset range, further Improves the image detail and image effects of the resulting target image.
步骤S208,对基准像素点对应的参考像素点中的有效参考像素点的像素值进行加权计算,确定插值像素点的像素值,并基于各插值像素点的像素值,构成目标图像。Step S208, performing weighted calculation on the pixel values of effective reference pixels among the reference pixels corresponding to the reference pixel, determining the pixel values of the interpolation pixels, and constructing the target image based on the pixel values of each interpolation pixel.
示例性地,在确定有效参考像素点的像素值后,对有效参考像素点的像素值进行加权计算,即可确定对应的基准像素点对应的插值像素点的像素值。示例性地,确定插值像素点的像素值的方法,可以通过式(10)实现:Exemplarily, after the pixel value of the effective reference pixel is determined, weighted calculation is performed on the pixel value of the effective reference pixel to determine the pixel value of the interpolation pixel corresponding to the corresponding reference pixel. Exemplarily, the method for determining the pixel value of the interpolated pixel point can be realized by formula (10):
Figure PCTCN2022092072-appb-000002
Figure PCTCN2022092072-appb-000002
其中,O i表示目标图像中第i个插值像素点,P m为第m个有效参考像素点的像素值,W m为第m个有效参考像素点的权重,n为有效参考像素点的个数,当然,可以理解的是,若不执行步骤S205,即通过参考像素点直接进行融合计算,确定基准像素点对应的插值像素点的方案中,在此处P m和W m分别表示参考像素点的像素值和参考像素点的权重,n为参考像素点的个数。 Among them, O i represents the i-th interpolation pixel in the target image, P m is the pixel value of the m-th effective reference pixel, W m is the weight of the m-th effective reference pixel, and n is the number of effective reference pixels Of course, it can be understood that if step S205 is not executed, that is, in the scheme of directly performing fusion calculation through reference pixel points to determine the interpolation pixel point corresponding to the reference pixel point, P m and W m here represent the reference pixel points respectively The pixel value of the point and the weight of the reference pixel, n is the number of reference pixels.
通过并行处理或者轮询依次处理的方式,确定目标图像中每一插值像素点的像素值,即可生成目标图像。The target image can be generated by determining the pixel value of each interpolation pixel in the target image through parallel processing or polling and sequential processing.
本实施例中,步骤S201、S203的实现方式与本申请图3所示实施例中的步骤S101、S102的实现方式相同,在此不再一一赘述。In this embodiment, the implementation of steps S201 and S203 is the same as the implementation of steps S101 and S102 in the embodiment shown in FIG. 3 of the present application, and will not be repeated here.
对应于上文实施例的图像处理方法,图11为本公开实施例提供的图像处理装置的结构框图。为了便于说明,仅示出了与本公开实施例相关的部分。参照图11,图像处理装置3,包括:Corresponding to the image processing method in the above embodiments, FIG. 11 is a structural block diagram of an image processing device provided in an embodiment of the present disclosure. For ease of description, only the parts related to the embodiments of the present disclosure are shown. Referring to Figure 11, the image processing device 3 includes:
获取单元31,用于获取多帧初始图像,其中,多帧初始图像是针对同一场景拍摄的多帧不同图像,多帧初始图像中包括基准图像和非基准图像;The acquiring unit 31 is configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
第一确定单元32,用于计算从非基准图像到基准图像的光流;The first determination unit 32 is used to calculate the optical flow from the non-reference image to the reference image;
第二确定单元33,基于从非基准图像到基准图像中的光流,确定非基准图像中与基准图像中基准像素点相对应的参考像素点;The second determination unit 33, based on the optical flow from the non-reference image to the reference image, determines the reference pixel in the non-reference image corresponding to the reference pixel in the reference image;
生成单元34,用于通过将非基准图像中的参考像素点与基准图像中的基准像素点进行插 值计算,对非基准图像与基准图像进行像素融合,生成目标图像。The generation unit 34 is used to interpolate the reference pixels in the non-reference image and the reference pixels in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate the target image.
在本公开的一个实施例中,第二确定单元33,具体用于:基于从非基准图像到基准图像中的光流,确定非基准图像中,与基准像素点所在图像位置对应的参考点坐标;将非基准图像中,位于参考点坐标的第一预设范围内的所有像素点,确定为参考像素点。In one embodiment of the present disclosure, the second determining unit 33 is specifically configured to: determine the coordinates of the reference point in the non-reference image corresponding to the image position where the reference pixel is located based on the optical flow from the non-reference image to the reference image ; Determining all pixels within the first preset range of the reference point coordinates in the non-reference image as reference pixel points.
在本公开的一个实施例中,第二确定单元33在基于从非基准图像到基准图像中的光流,确定非基准图像中,与基准像素点所在图像位置对应的参考点坐标时,具体用于:获取基准像素点的坐标;在基准图像中,确定与基准像素点的坐标对应的边缘像素点,其中,边缘像素点用于表征与基准像素点临近的至少一个像素点;基于从非基准图像到基准图像中的光流,确定边缘像素点在非基准图像中的偏移矢量;根据基准像素点的坐标与偏移矢量,确定参考点坐标。In one embodiment of the present disclosure, when the second determination unit 33 determines the coordinates of the reference point in the non-reference image corresponding to the image position where the reference pixel is located based on the optical flow from the non-reference image to the reference image, it specifically uses In: obtaining the coordinates of the reference pixel point; in the reference image, determining the edge pixel point corresponding to the coordinate of the reference pixel point, wherein the edge pixel point is used to represent at least one pixel point adjacent to the reference pixel point; based on non-reference pixel point The optical flow from the image to the reference image determines the offset vector of the edge pixels in the non-reference image; according to the coordinates and offset vector of the reference pixel, the coordinates of the reference point are determined.
在本公开的一个实施例中,第二确定单元33还用于:根据边缘像素点在非基准图像中的偏移矢量的方差,以及预设的权重系数,确定参考点坐标的第一预设范围。In an embodiment of the present disclosure, the second determining unit 33 is further configured to: determine the first preset coordinates of the reference point according to the variance of the offset vector of the edge pixel in the non-reference image and the preset weight coefficient scope.
在本公开的一个实施例中,第二确定单元33在基于从非基准图像到基准图像中的光流,确定边缘像素点在非基准图像中的偏移矢量时,具体用于:通过光流算法,计算基准图像至非基准图像之间的矢量信息,其中,矢量信息用于表征基准图像中的像素点,在非基准图像中的对应位置的像素点之间的偏移矢量;根据运动矢量信息,确定边缘像素点在非基准图像中的偏移矢量。In one embodiment of the present disclosure, when the second determining unit 33 determines the offset vector of edge pixels in the non-reference image based on the optical flow from the non-reference image to the reference image, it is specifically configured to: through the optical flow Algorithm to calculate the vector information between the reference image and the non-reference image, wherein the vector information is used to characterize the pixels in the reference image, and the offset vector between the pixels of the corresponding positions in the non-reference image; according to the motion vector information to determine the offset vector of edge pixels in the non-reference image.
在本公开的一个实施例中,第二确定单元33还用于:确定参考像素点在基准图像中的映射坐标;将映射坐标中落入基准像素点的第二预设范围内的参考像素点,确定为有效参考像素点;生成单元34在对非基准图像与基准图像进行像素融合,生成目标图像时,具体用于:对基准像素点对应的参考像素点中的有效参考像素点的像素值进行加权计算,确定基准像素点的对应的插值像素点的像素值;根据插值像素点的像素值,构成目标图像。In an embodiment of the present disclosure, the second determination unit 33 is further configured to: determine the mapping coordinates of the reference pixel points in the reference image; , is determined to be an effective reference pixel point; when the generation unit 34 performs pixel fusion on the non-reference image and the reference image to generate the target image, it is specifically used to: the pixel value of the effective reference pixel point in the reference pixel point corresponding to the reference pixel point Carry out weighted calculation to determine the pixel value of the corresponding interpolation pixel point of the reference pixel point; according to the pixel value of the interpolation pixel point, the target image is formed.
在本公开的一个实施例中,获取单元31,还用于:获取基准像素点对应的图像纹理信息,和/或噪声信息,其中,图像纹理信息用于表征基准像素点附近的图像纹理结构,噪声信息用于表征初始图像的噪声水平;第二确定单元33,还用于:根据基准像素点对应的图像纹理信息,和/或噪声信息,确定第二预设范围。In an embodiment of the present disclosure, the acquisition unit 31 is further configured to: acquire image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the image texture structure near the reference pixel point, The noise information is used to characterize the noise level of the initial image; the second determination unit 33 is further configured to: determine the second preset range according to the image texture information corresponding to the reference pixel and/or the noise information.
在本公开的一个实施例中,获取单元31,还用于:获取预设的分辨率信息;根据分辨率信息和基准图像的尺寸信息,确定基准图像中的基准像素点,基准像素点是对基准图像中的原始像素点插值得到的,基准像素点的数量大于原始像素点的数量。In an embodiment of the present disclosure, the acquisition unit 31 is further configured to: acquire preset resolution information; determine the reference pixel in the reference image according to the resolution information and the size information of the reference image, and the reference pixel is the reference pixel The original pixel points in the reference image are obtained by interpolation, and the number of reference pixel points is greater than the number of original pixel points.
本实施例提供的装置,可用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。The device provided in this embodiment can be used to implement the technical solutions of the above method embodiments, and its implementation principle and technical effect are similar, so this embodiment will not repeat them here.
图12为本公开实施例提供的一种电子设备的结构示意图,如图12所示,该电子设备4包括至少一个处理器401和存储器402;FIG. 12 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure. As shown in FIG. 12 , the electronic device 4 includes at least one processor 401 and a memory 402;
存储器402存储计算机执行指令; memory 402 stores computer-executable instructions;
至少一个处理器401执行存储器402存储的计算机执行指令,使得至少一个处理器401执行如图3-图10所示实施例中的屏幕共享方法。At least one processor 401 executes the computer-executed instructions stored in the memory 402, so that the at least one processor 401 executes the screen sharing method in the embodiment shown in FIGS. 3-10 .
其中,处理器401和存储器402通过总线403连接。Wherein, the processor 401 and the memory 402 are connected through a bus 403 .
相关说明可以对应参见图3-图10所对应的实施例中的步骤所对应的相关描述和效果进行理解,此处不做过多赘述。Relevant descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the embodiments corresponding to FIG. 3 to FIG. 10 , and details are not repeated here.
参考图13,其示出了适于用来实现本公开实施例的电子设备900的结构示意图,该电子设备900可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图13示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Referring to FIG. 13 , it shows a schematic structural diagram of an electronic device 900 suitable for implementing the embodiments of the present disclosure. The electronic device 900 may be a terminal device or a server. Among them, the terminal equipment may include but not limited to mobile phones, notebook computers, digital broadcast receivers, personal digital assistants (Personal Digital Assistant, PDA for short), tablet computers (Portable Android Device, PAD for short), portable multimedia players (Portable Media Player, referred to as PMP), mobile terminals such as vehicle-mounted terminals (such as vehicle-mounted navigation terminals), and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in FIG. 13 is only an example, and should not limit the functions and scope of use of the embodiments of the present disclosure.
如图13所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(Read Only Memory,简称ROM)902中的程序或者从存储装置908加载到随机访问存储器(Random Access Memory,简称RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。As shown in FIG. 13, an electronic device 900 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 901, which may be stored in a program in a read-only memory (Read Only Memory, ROM for short) 902 or from a storage device. 908 loads the programs in the random access memory (Random Access Memory, RAM for short) 903 to execute various appropriate actions and processes. In the RAM 903, various programs and data necessary for the operation of the electronic device 900 are also stored. The processing device 901, ROM 902, and RAM 903 are connected to each other through a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904 .
通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图13示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。Generally, the following devices can be connected to the I/O interface 905: an input device 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; ), a speaker, a vibrator, etc.; a storage device 908 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 909. The communication means 909 may allow the electronic device 900 to perform wireless or wired communication with other devices to exchange data. While FIG. 13 shows electronic device 900 having various means, it is to be understood that implementing or having all of the means shown is not a requirement. More or fewer means may alternatively be implemented or provided.
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装, 或者从ROM 902被安装。在该计算机程序被处理装置901执行时,执行本公开实施例的方法中限定的上述功能。In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication means 909, or from storage means 908, or from ROM 902. When the computer program is executed by the processing device 901, the above-mentioned functions defined in the methods of the embodiments of the present disclosure are performed.
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable ROM,简称EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(Compact Disc ROM,简称CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、射频(Radio Frequency,简称RF)等等,或者上述的任意合适的组合。It should be noted that the above-mentioned computer-readable medium in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programming read-only memory (Erasable Programmable ROM, referred to as EPROM or flash memory), optical fiber, portable compact disk read-only memory (Compact Disc ROM, referred to as CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave carrying computer-readable program code therein. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can transmit, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device . The program code contained on the computer readable medium can be transmitted by any appropriate medium, including but not limited to: electric wire, optical cable, radio frequency (Radio Frequency, RF for short), etc., or any suitable combination of the above.
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device, or may exist independently without being incorporated into the electronic device.
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by the electronic device, the electronic device is made to execute the methods shown in the above-mentioned embodiments.
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out the operations of the present disclosure can be written in one or more programming languages, or combinations thereof, including object-oriented programming languages—such as Java, Smalltalk, C++, and conventional Procedural Programming Language - such as "C" or a similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or it can be connected to an external A computer (connected via the Internet, eg, using an Internet service provider).
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品 的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that contains one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified functions or operations , or may be implemented by a combination of dedicated hardware and computer instructions.
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。The units involved in the embodiments described in the present disclosure may be implemented by software or by hardware. Wherein, the name of the unit does not constitute a limitation of the unit itself under certain circumstances, for example, the first obtaining unit may also be described as "a unit for obtaining at least two Internet Protocol addresses".
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(Field Programmable Gate Array,简称FPGA)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、专用标准产品(Application Specific Standard Product,简称ASSP)、片上系统(System on Chip,简称SOC)、复杂可编程逻辑设备(Complex Programmable Logic Device,简称CPLD)等等。The functions described herein above may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: Field Programmable Gate Array (Field Programmable Gate Array, FPGA for short), Application Specific Integrated Circuit (ASIC for short), Application Specific Standard Products ( Application Specific Standard Product (ASSP for short), System on Chip (SOC for short), Complex Programmable Logic Device (CPLD for short), etc.
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media would include one or more wire-based electrical connections, portable computer discs, hard drives, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, compact disk read only memory (CD-ROM), optical storage, magnetic storage, or any suitable combination of the foregoing.
第一方面,根据本公开的一个或多个实施例,提供了一种图像处理方法,包括:In a first aspect, according to one or more embodiments of the present disclosure, an image processing method is provided, including:
获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;计算从所述非基准图像到所述基准图像的光流;基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。Acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include a reference image and a non-reference image; calculating from the non-reference image to the The optical flow of the reference image; based on the optical flow from the non-reference image to the reference image, determine the reference pixel in the non-reference image corresponding to the reference pixel in the reference image; by adding the The reference pixel in the non-reference image is interpolated with the reference pixel in the reference image, and the non-reference image and the reference image are pixel fused to generate a target image.
根据本公开的一个或多个实施例,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点,包括:基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标;将所述非基准图像中,位于所述参考点坐标的第一预设范围内的所有像素点,确定为参考像素点。According to one or more embodiments of the present disclosure, based on the optical flow from the non-reference image to the reference image, a reference pixel in the non-reference image corresponding to a reference pixel in the reference image is determined , comprising: based on the optical flow from the non-reference image to the reference image, determining the reference point coordinates corresponding to the image position where the reference pixel is located in the non-reference image; , all pixels located within the first preset range of coordinates of the reference point are determined as reference pixel points.
根据本公开的一个或多个实施例,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标,包括:获取基准像素点的坐标;在所述基准图像中,确定与所述基准像素点的坐标对应的边缘像素点,其中,所述边缘像素点用于表征与所述基准像素点临近的至少一个像素点;基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量;根据所述基准像素点的坐标与所述偏移矢量,确定参考点坐标。According to one or more embodiments of the present disclosure, based on the optical flow from the non-reference image to the reference image, determine the reference point coordinates corresponding to the image position where the reference pixel is located in the non-reference image , comprising: acquiring the coordinates of a reference pixel; in the reference image, determining an edge pixel corresponding to the coordinate of the reference pixel, wherein the edge pixel is used to represent a pixel adjacent to the reference pixel At least one pixel; based on the optical flow from the non-reference image to the reference image, determine the offset vector of the edge pixel in the non-reference image; according to the coordinates of the reference pixel and the The above offset vector is used to determine the coordinates of the reference point.
根据本公开的一个或多个实施例,所述方法还包括:根据所述边缘像素点在所述非基准图像中的偏移矢量的方差,以及预设的权重系数,确定所述参考点坐标的第一预设范围。According to one or more embodiments of the present disclosure, the method further includes: determining the coordinates of the reference point according to the variance of the offset vector of the edge pixel in the non-reference image and a preset weight coefficient the first preset range of .
根据本公开的一个或多个实施例,基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量,包括:通过光流算法,计算基准图像至非基准图像之间的矢量信息,其中,所述矢量信息用于表征基准图像中的像素点,在所述非基准图像中的对应位置的像素点之间的偏移矢量;根据所述矢量信息,确定所述边缘像素点在所述非基准图像中的偏移矢量。According to one or more embodiments of the present disclosure, based on the optical flow from the non-reference image to the reference image, determining the offset vector of the edge pixel in the non-reference image includes: passing light A stream algorithm, calculating vector information between a reference image and a non-reference image, wherein the vector information is used to characterize the pixels in the reference image, and the offset between pixels at corresponding positions in the non-reference image vector: determining an offset vector of the edge pixel in the non-reference image according to the vector information.
根据本公开的一个或多个实施例,所述方法还包括:确定所述参考像素点在所述基准图像中的映射坐标;将映射坐标中落入所述基准像素点的第二预设范围内的参考像素点,确定为有效参考像素点;对所述非基准图像与所述基准图像进行像素融合,生成目标图像,包括:对所述基准像素点对应的参考像素点中的有效参考像素点的像素值进行加权计算,确定所述基准像素点的对应的插值像素点的像素值;根据所述插值像素点的像素值,构成目标图像。According to one or more embodiments of the present disclosure, the method further includes: determining the mapping coordinates of the reference pixel points in the reference image; placing the mapping coordinates within a second preset range of the reference pixel points The reference pixels within are determined as valid reference pixels; performing pixel fusion on the non-reference image and the reference image to generate a target image, including: valid reference pixels in the reference pixels corresponding to the reference pixels Weighted calculation is performed on the pixel values of the points to determine the pixel values of the corresponding interpolation pixel points of the reference pixel point; and the target image is formed according to the pixel values of the interpolation pixel points.
根据本公开的一个或多个实施例,所述方法还包括:获取所述基准像素点对应的图像纹理信息,和/或噪声信息,其中,所述图像纹理信息用于表征所述基准像素点附近的图像纹理结构,所述噪声信息用于表征待处理图像的噪声水平;根据所述基准像素点对应的图像纹理信息,和/或噪声信息,确定所述第二预设范围。According to one or more embodiments of the present disclosure, the method further includes: acquiring image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the reference pixel point Nearby image texture structure, the noise information is used to characterize the noise level of the image to be processed; the second preset range is determined according to the image texture information and/or noise information corresponding to the reference pixel.
根据本公开的一个或多个实施例,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点之前,还包括:获取预设的分辨率信息;根据所述分辨率信息和所述基准图像的尺寸信息,确定所述基准图像中的基准像素点,所述基准像素点是对所述基准图像中的原始像素点插值得到的,所述基准像素点的数量大于所述原始像素点的数量。According to one or more embodiments of the present disclosure, before determining the reference pixel in the non-reference image corresponding to the reference pixel in the reference image, it further includes: acquiring preset resolution information; according to the resolution Ratio information and size information of the reference image to determine the reference pixels in the reference image, the reference pixels are obtained by interpolating the original pixels in the reference image, the number of the reference pixels is greater than The number of original pixels.
第二方面,根据本公开的一个或多个实施例,提供了一种图像处理装置,包括:In a second aspect, according to one or more embodiments of the present disclosure, an image processing device is provided, including:
获取单元,用于获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;An acquisition unit, configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
第一确定单元,用于计算从所述非基准图像到所述基准图像的光流;a first determining unit, configured to calculate an optical flow from the non-reference image to the reference image;
第二确定单元,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;A second determining unit, based on the optical flow from the non-reference image to the reference image, to determine a reference pixel in the non-reference image corresponding to a reference pixel in the reference image;
生成单元,用于通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。A generating unit, configured to perform interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate a target image.
根据本公开的一个或多个实施例,第二确定单元,具体用于:基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标;将所述非基准图像中,位于所述参考点坐标的第一预设范围内的所有像素点,确定为参考像素点。According to one or more embodiments of the present disclosure, the second determination unit is specifically configured to: determine, based on the optical flow from the non-reference image into the reference image, that in the non-reference image is related to the reference pixel The coordinates of the reference point corresponding to the position of the image where the point is located; determining all pixel points within the first preset range of the coordinates of the reference point in the non-reference image as reference pixel points.
根据本公开的一个或多个实施例,第二确定单元在基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标时,具体用于:获取基准像素点的坐标;在所述基准图像中,确定与所述基准像素点的坐标对应的边缘像素点,其中,所述边缘像素点用于表征与所述基准像素点临近的至少一个像素点;基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量;根据所述基准像素点的坐标与所述偏移矢量,确定参考点坐标。According to one or more embodiments of the present disclosure, the second determining unit is based on the optical flow from the non-reference image to the reference image, and determines the image position of the reference pixel in the non-reference image For the corresponding reference point coordinates, it is specifically used to: obtain the coordinates of the reference pixel points; in the reference image, determine the edge pixel points corresponding to the coordinates of the reference pixel points, wherein the edge pixel points are used to represent At least one pixel point adjacent to the reference pixel point; based on the optical flow from the non-reference image to the reference image, determine the offset vector of the edge pixel point in the non-reference image; according to the The coordinates of the reference pixel point and the offset vector are used to determine the coordinates of the reference point.
根据本公开的一个或多个实施例,第二确定单元还用于:根据边缘像素点在非基准图像中的偏移矢量的方差,以及预设的权重系数,确定参考点坐标的第一预设范围。According to one or more embodiments of the present disclosure, the second determination unit is further configured to: determine the first preset value of the coordinates of the reference point according to the variance of the offset vector of the edge pixel point in the non-reference image and the preset weight coefficient. set range.
根据本公开的一个或多个实施例,第二确定单元在基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量时,具体用于:通过光流算法,计算基准图像至非基准图像之间的矢量信息,其中,矢量信息用于表征基准图像中的像素点,在非基准图像中的对应位置的像素点之间的偏移矢量;根据运动矢量信息,确定边缘像素点在非基准图像中的偏移矢量。According to one or more embodiments of the present disclosure, the second determination unit determines the offset vector of the edge pixel in the non-reference image based on the optical flow from the non-reference image to the reference image When, it is specifically used to: calculate the vector information between the reference image and the non-reference image through the optical flow algorithm, wherein the vector information is used to characterize the pixels in the reference image, and the pixel points at the corresponding positions in the non-reference image The offset vector between them; according to the motion vector information, determine the offset vector of the edge pixel in the non-reference image.
根据本公开的一个或多个实施例,第二确定单元还用于:确定参考像素点在基准图像中的映射坐标;将映射坐标中落入基准像素点的第二预设范围内的参考像素点,确定为有效参考像素点;生成单元在对所述非基准图像与所述基准图像进行像素融合,生成目标图像时,具体用于:对所述基准像素点对应的参考像素点中的有效参考像素点的像素值进行加权计算,确定所述基准像素点的对应的插值像素点的像素值;根据所述插值像素点的像素值,构成目标图像。According to one or more embodiments of the present disclosure, the second determining unit is further configured to: determine the mapping coordinates of the reference pixel points in the reference image; point, determined as an effective reference pixel point; when the generation unit performs pixel fusion on the non-reference image and the reference image to generate the target image, it is specifically used to: performing weighted calculation on the pixel value of the reference pixel, and determining the pixel value of the interpolation pixel corresponding to the reference pixel; and constructing the target image according to the pixel value of the interpolation pixel.
根据本公开的一个或多个实施例,获取单元,还用于:获取基准像素点对应的图像纹理信息,和/或噪声信息,其中,图像纹理信息用于表征基准像素点附近的图像纹理结构,噪声信息用于表征初始图像的噪声水平;第二确定单元,还用于:根据基准像素点对应的图像纹理信息,和/或噪声信息,确定第二预设范围。According to one or more embodiments of the present disclosure, the acquisition unit is further configured to: acquire image texture information corresponding to the reference pixel point, and/or noise information, wherein the image texture information is used to characterize the image texture structure near the reference pixel point , the noise information is used to characterize the noise level of the initial image; the second determination unit is further configured to: determine the second preset range according to the image texture information corresponding to the reference pixel and/or the noise information.
根据本公开的一个或多个实施例,获取单元,还用于:获取预设的分辨率信息;根据所述分辨率信息和所述基准图像的尺寸信息,确定所述基准图像中的基准像素点,所述基准像素点是对所述基准图像中的原始像素点插值得到的,所述基准像素点的数量大于所述原始像素点的数量。According to one or more embodiments of the present disclosure, the obtaining unit is further configured to: obtain preset resolution information; determine reference pixels in the reference image according to the resolution information and size information of the reference image points, the reference pixel points are obtained by interpolating original pixel points in the reference image, and the number of the reference pixel points is greater than the number of the original pixel points.
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:至少一个处理器和存储器;In a third aspect, according to one or more embodiments of the present disclosure, an electronic device is provided, including: at least one processor and a memory;
所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如上第一方面以及第一方面各种可能的设计所述的图像处理方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the image processing method described in the above first aspect and various possible designs of the first aspect.
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a fourth aspect, according to one or more embodiments of the present disclosure, a computer-readable storage medium is provided, the computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, Realize the image processing method described in the above first aspect and various possible designs of the first aspect.
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a fifth aspect, an embodiment of the present disclosure provides a computer program product, including a computer program. When the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
第六方面,本公开实施例提供一种计算机程序,该计算机程序被处理器执行时,实现如上第一方面以及第一方面各种可能的设计所述的图像处理方法。In a sixth aspect, an embodiment of the present disclosure provides a computer program. When the computer program is executed by a processor, the image processing method described in the above first aspect and various possible designs of the first aspect is implemented.
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is only a preferred embodiment of the present disclosure and an illustration of the applied technical principles. Those skilled in the art should understand that the disclosure scope involved in this disclosure is not limited to the technical solution formed by the specific combination of the above-mentioned technical features, but also covers the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of equivalent features. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。In addition, while operations are depicted in a particular order, this should not be understood as requiring that the operations be performed in the particular order shown or performed in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while the above discussion contains several specific implementation details, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.

Claims (13)

  1. 一种图像处理方法,其特征在于,包括:An image processing method, characterized in that, comprising:
    获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;Acquiring multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include a reference image and a non-reference image;
    计算从所述非基准图像到所述基准图像的光流;calculating optical flow from said non-reference image to said reference image;
    基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;determining a reference pixel in the non-reference image corresponding to a reference pixel in the reference image based on an optical flow from the non-reference image to the reference image;
    通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。A target image is generated by performing interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, and performing pixel fusion on the non-reference image and the reference image.
  2. 根据权利要求1所述的方法,其特征在于,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点,包括:The method according to claim 1, characterized in that, based on the optical flow from the non-reference image to the reference image, determining the reference pixel corresponding to the reference pixel in the reference image in the non-reference image pixels, including:
    基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标;Based on the optical flow from the non-reference image to the reference image, determine the reference point coordinates corresponding to the image position where the reference pixel is located in the non-reference image;
    将所述非基准图像中,位于所述参考点坐标的第一预设范围内的所有像素点,确定为参考像素点。Determining all pixel points in the non-reference image within a first preset range of coordinates of the reference point as reference pixel points.
  3. 根据权利要求2所述的方法,其特征在于,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中,与所述基准像素点所在图像位置对应的参考点坐标,包括:The method according to claim 2, characterized in that, based on the optical flow from the non-reference image to the reference image, the reference image corresponding to the image position where the reference pixel is located in the non-reference image is determined. Point coordinates, including:
    获取基准像素点的坐标;Obtain the coordinates of the reference pixel point;
    在所述基准图像中,确定与所述基准像素点的坐标对应的边缘像素点,其中,所述边缘像素点用于表征与所述基准像素点临近的至少一个像素点;In the reference image, determine an edge pixel point corresponding to the coordinates of the reference pixel point, wherein the edge pixel point is used to represent at least one pixel point adjacent to the reference pixel point;
    基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量;determining an offset vector of the edge pixel in the non-reference image based on the optical flow from the non-reference image to the reference image;
    根据所述基准像素点的坐标与所述偏移矢量,确定参考点坐标。Determine the reference point coordinates according to the coordinates of the reference pixel point and the offset vector.
  4. 根据权利要求3所述的方法,其特征在于,所述方法还包括:The method according to claim 3, further comprising:
    根据所述边缘像素点在所述非基准图像中的偏移矢量的方差,以及预设的权重系数,确定所述参考点坐标的第一预设范围。A first preset range of coordinates of the reference point is determined according to a variance of an offset vector of the edge pixel point in the non-reference image and a preset weight coefficient.
  5. 根据权利要求3所述的方法,其特征在于,基于从所述非基准图像到所述基准图像中的光流,确定所述边缘像素点在所述非基准图像中的偏移矢量,包括:The method according to claim 3, wherein, based on the optical flow from the non-reference image to the reference image, determining the offset vector of the edge pixel in the non-reference image comprises:
    通过光流算法,计算基准图像至非基准图像之间的矢量信息,其中,所述矢量信息用于表征基准图像中的像素点,在所述非基准图像中的对应位置的像素点之间的偏移矢量;Through the optical flow algorithm, calculate the vector information between the reference image and the non-reference image, wherein the vector information is used to characterize the pixels in the reference image, and the pixels between the corresponding positions in the non-reference image offset vector;
    根据所述矢量信息,确定所述边缘像素点在所述非基准图像中的偏移矢量。According to the vector information, an offset vector of the edge pixel point in the non-reference image is determined.
  6. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, further comprising:
    确定所述参考像素点在所述基准图像中的映射坐标;determining the mapping coordinates of the reference pixel point in the reference image;
    将映射坐标中落入所述基准像素点的第二预设范围内的参考像素点,确定为有效参考像素点;Determining the reference pixel points falling within the second preset range of the reference pixel points in the mapping coordinates as valid reference pixel points;
    对所述非基准图像与所述基准图像进行像素融合,生成目标图像,包括:Perform pixel fusion on the non-reference image and the reference image to generate a target image, including:
    对所述基准像素点对应的参考像素点中的有效参考像素点的像素值进行加权计算,确定所述基准像素点的对应的插值像素点的像素值;performing weighted calculation on the pixel values of effective reference pixels among the reference pixels corresponding to the reference pixel, and determining the pixel value of the corresponding interpolation pixel of the reference pixel;
    根据所述插值像素点的像素值,构成目标图像。A target image is formed according to the pixel values of the interpolated pixel points.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, further comprising:
    获取所述基准像素点对应的图像纹理信息,和/或噪声信息,其中,所述图像纹理信息用于表征所述基准像素点附近的图像纹理结构,所述噪声信息用于表征待处理图像的噪声水平;Acquiring image texture information and/or noise information corresponding to the reference pixel, wherein the image texture information is used to characterize the image texture structure near the reference pixel, and the noise information is used to characterize the image to be processed noise level;
    根据所述基准像素点对应的图像纹理信息,和/或噪声信息,确定所述第二预设范围。The second preset range is determined according to image texture information and/or noise information corresponding to the reference pixel.
  8. 根据权利要求1至7任一项所述的方法,其特征在于,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点之前,还包括:The method according to any one of claims 1 to 7, wherein before determining the reference pixel in the non-reference image corresponding to the reference pixel in the reference image, further comprising:
    获取预设的分辨率信息;Obtain preset resolution information;
    根据所述分辨率信息和所述基准图像的尺寸信息,确定所述基准图像中的基准像素点,所述基准像素点是对所述基准图像中的原始像素点插值得到的,所述基准像素点的数量大于所述原始像素点的数量。Determine a reference pixel in the reference image according to the resolution information and the size information of the reference image, the reference pixel is obtained by interpolating the original pixel in the reference image, the reference pixel The number of dots is greater than the number of original pixel dots.
  9. 一种图像处理装置,其特征在于,包括:An image processing device, characterized in that it comprises:
    获取单元,用于获取多帧初始图像,其中,所述多帧初始图像是针对同一场景拍摄的多帧不同图像,所述多帧初始图像中包括基准图像和非基准图像;An acquisition unit, configured to acquire multiple frames of initial images, wherein the multiple frames of initial images are multiple frames of different images taken for the same scene, and the multiple frames of initial images include reference images and non-reference images;
    第一确定单元,用于计算从所述非基准图像到所述基准图像的光流;a first determining unit, configured to calculate an optical flow from the non-reference image to the reference image;
    第二确定单元,基于从所述非基准图像到所述基准图像中的光流,确定所述非基准图像中与所述基准图像中基准像素点相对应的参考像素点;A second determining unit, based on the optical flow from the non-reference image to the reference image, to determine a reference pixel in the non-reference image corresponding to a reference pixel in the reference image;
    生成单元,用于通过将所述非基准图像中的所述参考像素点与所述基准图像中的基准像素点进行插值计算,对所述非基准图像与所述基准图像进行像素融合,生成目标图像。A generating unit, configured to perform interpolation calculation on the reference pixel in the non-reference image and the reference pixel in the reference image, perform pixel fusion on the non-reference image and the reference image, and generate a target image.
  10. 一种电子设备,其特征在于,包括:至少一个处理器和存储器;An electronic device, characterized by comprising: at least one processor and a memory;
    所述存储器存储计算机执行指令;the memory stores computer-executable instructions;
    所述至少一个处理器执行所述存储器存储的计算机执行指令,使得所述至少一个处理器执行如权利要求1至8任一项所述的图像处理方法。The at least one processor executes the computer-executed instructions stored in the memory, so that the at least one processor executes the image processing method according to any one of claims 1 to 8.
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至8任一项所述的图像处理方法。A computer-readable storage medium, characterized in that the computer-readable storage medium stores computer-executable instructions, and when the processor executes the computer-executable instructions, the method described in any one of claims 1 to 8 is realized. image processing method.
  12. 一种计算机程序产品,其特征在于,包括计算机程序,该计算机程序被处理器执行时实现权利要求1至8任一项所述的图像处理方法。A computer program product, characterized by comprising a computer program, which implements the image processing method according to any one of claims 1 to 8 when the computer program is executed by a processor.
  13. 一种计算机程序,其特征在于,所述计算机程序被处理器执行时,实现如权利要求1至8任一项所述的图像处理方法。A computer program, characterized in that, when the computer program is executed by a processor, the image processing method according to any one of claims 1 to 8 is realized.
PCT/CN2022/092072 2021-05-28 2022-05-10 Image processing method and apparatus, electronic device and storage medium WO2022247630A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110590685.X 2021-05-28
CN202110590685.XA CN115409696A (en) 2021-05-28 2021-05-28 Image processing method, image processing device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022247630A1 true WO2022247630A1 (en) 2022-12-01

Family

ID=84155102

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/092072 WO2022247630A1 (en) 2021-05-28 2022-05-10 Image processing method and apparatus, electronic device and storage medium

Country Status (2)

Country Link
CN (1) CN115409696A (en)
WO (1) WO2022247630A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116228834A (en) * 2022-12-20 2023-06-06 阿波罗智联(北京)科技有限公司 Image depth acquisition method and device, electronic equipment and storage medium
CN116630220A (en) * 2023-07-25 2023-08-22 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463786A (en) * 2014-12-03 2015-03-25 中国科学院自动化研究所 Mobile robot figure stitching method and device
CN106952226A (en) * 2017-03-06 2017-07-14 武汉大学 A kind of F MSA super resolution ratio reconstruction methods
US20200118269A1 (en) * 2018-10-15 2020-04-16 Siemens Healthcare Gmbh Evaluating a condition of a person

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463786A (en) * 2014-12-03 2015-03-25 中国科学院自动化研究所 Mobile robot figure stitching method and device
CN106952226A (en) * 2017-03-06 2017-07-14 武汉大学 A kind of F MSA super resolution ratio reconstruction methods
US20200118269A1 (en) * 2018-10-15 2020-04-16 Siemens Healthcare Gmbh Evaluating a condition of a person

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
BU LIJING; ZHENG XINJIE; XIAO YIMING; ZHANG ZHENGPENG: "Improve SA Method of Satellite Video of Super-Resolution Image Reconstruction", JOURNAL OF GEOMATICS SCIENCE AND TECHNOLOGY, vol. 34, no. 1, 31 December 2017 (2017-12-31), pages 59 - 63+69, XP009541485, ISSN: 1673-6338 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116228834A (en) * 2022-12-20 2023-06-06 阿波罗智联(北京)科技有限公司 Image depth acquisition method and device, electronic equipment and storage medium
CN116228834B (en) * 2022-12-20 2023-11-03 阿波罗智联(北京)科技有限公司 Image depth acquisition method and device, electronic equipment and storage medium
CN116630220A (en) * 2023-07-25 2023-08-22 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium
CN116630220B (en) * 2023-07-25 2023-11-21 江苏美克医学技术有限公司 Fluorescent image depth-of-field fusion imaging method, device and storage medium

Also Published As

Publication number Publication date
CN115409696A (en) 2022-11-29

Similar Documents

Publication Publication Date Title
CN111242881B (en) Method, device, storage medium and electronic equipment for displaying special effects
WO2022247630A1 (en) Image processing method and apparatus, electronic device and storage medium
WO2022237811A1 (en) Image processing method and apparatus, and device
CN110796664B (en) Image processing method, device, electronic equipment and computer readable storage medium
CN110728622B (en) Fisheye image processing method, device, electronic equipment and computer readable medium
JP2022505118A (en) Image processing method, equipment, hardware equipment
CN110070495B (en) Image processing method and device and electronic equipment
WO2022068326A1 (en) Image frame prediction method and electronic device
US11494961B2 (en) Sticker generating method and apparatus, and medium and electronic device
CN116310036A (en) Scene rendering method, device, equipment, computer readable storage medium and product
WO2023193613A1 (en) Highlight shading method and apparatus, and medium and electronic device
WO2023025085A1 (en) Audio processing method and apparatus, and device, medium and program product
CN110070482B (en) Image processing method, apparatus and computer readable storage medium
WO2023040563A1 (en) Image processing method and device
CN113963000B (en) Image segmentation method, device, electronic equipment and program product
CN114049403A (en) Multi-angle three-dimensional face reconstruction method and device and storage medium
CN113837918A (en) Method and device for realizing rendering isolation by multiple processes
CN111489428B (en) Image generation method, device, electronic equipment and computer readable storage medium
CN111353929A (en) Image processing method and device and electronic equipment
KR102534449B1 (en) Image processing method, device, electronic device and computer readable storage medium
CN112668474B (en) Plane generation method and device, storage medium and electronic equipment
CN115937010B (en) Image processing method, device, equipment and medium
WO2021004171A1 (en) Method and apparatus for achieving water ripple image
RU2802724C1 (en) Image processing method and device, electronic device and machine readable storage carrier
WO2023020283A1 (en) Image processing method and apparatus, device, medium and program product

Legal Events

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

Ref document number: 22810357

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE