WO2022193507A1 - Image processing method and apparatus, device, storage medium, program, and program product - Google Patents

Image processing method and apparatus, device, storage medium, program, and program product Download PDF

Info

Publication number
WO2022193507A1
WO2022193507A1 PCT/CN2021/106895 CN2021106895W WO2022193507A1 WO 2022193507 A1 WO2022193507 A1 WO 2022193507A1 CN 2021106895 W CN2021106895 W CN 2021106895W WO 2022193507 A1 WO2022193507 A1 WO 2022193507A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
color block
optical flow
color
segmentation result
Prior art date
Application number
PCT/CN2021/106895
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 WO2022193507A1 publication Critical patent/WO2022193507A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • G06T7/215Motion-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/56Extraction of image or video features relating to colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/75Organisation of the matching processes, e.g. simultaneous or sequential comparisons of image or video features; Coarse-fine approaches, e.g. multi-scale approaches; using context analysis; Selection of dictionaries
    • G06V10/751Comparing pixel values or logical combinations thereof, or feature values having positional relevance, e.g. template matching

Definitions

  • the present disclosure relates to the technical field of computer vision, and in particular, to an image processing method and apparatus, device, storage medium, program and program product.
  • the optical flow method is an important method of image analysis. It uses the correlation between adjacent frames in the image sequence to find the corresponding relationship between the previous frame and the current frame, so as to calculate the relationship between adjacent frames.
  • a method for the motion information of the target object Optical flow expresses the change of the image in the temporal domain. Since the optical flow contains the motion information of the target object in the image, it can be used by the observer to determine the motion of the target object.
  • the study of optical flow has become an important part of computer vision and related research fields. Accurately determining the optical flow between adjacent frames in an image sequence is of great significance in video frame interpolation and video compression.
  • Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product.
  • An aspect of the embodiments of the present disclosure provides an image processing method, including:
  • a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained.
  • the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset threshold value, for The color patches in the first color patch segmentation result and the color patches in the second color patch segmentation result are matched to obtain the color between the first color patch segmentation result and the second color patch segmentation result.
  • block matching result and determine the first optical flow between the first image and the second image according to the color patch matching result, so that the first image and the second image can be accurately determined optical flow between.
  • the method further includes: according to the first image corresponding to the first image feature and the second image feature corresponding to the second image, optimize the first optical flow between the first image and the second image, and obtain a relationship between the first image and the second image the second optical flow.
  • the first image and the second image are adjacent frames in the target video; the second light between the obtained first image and the second image
  • the method further includes: according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the third image feature between the first image and the second image Two optical flows, determining the intermediate frame of the first image and the second image.
  • the block segmentation result includes: performing edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image; an edge extraction result, performing color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; and performing color block segmentation on the second image according to the second edge extraction result , to obtain the second color block segmentation result corresponding to the second image.
  • a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image are obtained.
  • color block segmentation is performed on the first image to obtain a first color block segmentation result corresponding to the first image
  • color block segmentation is performed on the second image. block segmentation to obtain the second color block segmentation result corresponding to the second image, so that the edge information in the first image can be used to more accurately determine the color block segmentation result of the first image.
  • the edge information in the second image is used to more accurately determine the color block segmentation result of the second image.
  • the matching of the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result is performed to obtain the first color block segmentation result and
  • the color patch matching result between the second color patch segmentation results includes: performing feature extraction on the first image and the second image respectively to obtain the fifth image feature corresponding to the first image and the The sixth image feature corresponding to the second image; according to the first color block segmentation result and the fifth image feature, the first color block feature matrix corresponding to the first image is obtained; according to the second color block segmentation The result and the sixth image feature to obtain a second color block feature matrix corresponding to the second image; according to the first color block feature matrix and the second color block feature matrix, the first color block feature matrix
  • the color patch in the segmentation result is matched with the color patch in the second color patch segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
  • color patch matching can be performed based on the visual features of the color patches in the first image and the second image, and an accurate color patch matching result can be obtained.
  • the obtaining a first color block feature matrix corresponding to the first image according to the first color block segmentation result and the fifth image feature includes: according to the first color block feature matrix color block segmentation result, perform superpixel pooling on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and the sixth image to obtain the second color block feature matrix corresponding to the second image, including: performing superpixel pooling on the sixth image feature according to the second color block segmentation result, to obtain the second color block corresponding to the second image.
  • the second color patch feature matrix includes: according to the first color block feature matrix color block segmentation result, perform superpixel pooling on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and the sixth image to obtain the second color block feature matrix corresponding to the second image, including: performing superpixel pooling on the sixth image feature according to the second color block segmentation result, to obtain the second color block corresponding to the second image.
  • a first color block feature matrix corresponding to the first image is obtained, and according to the second color block segmentation result, Perform superpixel pooling on the sixth image feature to obtain a second color block feature matrix corresponding to the second image, thereby obtaining a color block feature matrix with higher precision.
  • the color block and the second color block in the first color block segmentation result are divided Matching the color blocks in the segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result, including: according to the first color patch feature matrix and the first color patch feature matrix A two-color block feature matrix to determine the similarity between the feature of the first color block in the first color block segmentation result and the feature of the second color block in the second color block segmentation result, wherein the The first color block is any color block in the first color block segmentation result, and the second color block is any color block in the second color block segmentation result; according to the first color block The similarity between the feature and the feature of the second color block determines the matching degree between the first color block and the second color block; according to the color block in the first color block segmentation result and The matching degree between the color patches in the second color patch segmentation result is obtained as a color patch matching result between the first color patch
  • the color patch between the first image and the second image can be accurately determined by using the similarity in visual features between the color patch of the first image and the color patch of the second image match results.
  • determining the difference between the first color block and the second color block according to the similarity between the feature of the first color block and the feature of the second color block includes: according to one or both of the size difference and the position difference between the first color block and the second color block, and the characteristics of the first color block and the first color block.
  • the similarity between the features of the two color blocks determines the matching degree between the first color block and the second color block.
  • the difference between the color blocks of the first image and the color blocks of the second image can be adjusted on the basis of visual features.
  • the matching degree can be further improved, so that the accuracy of the determined color patch matching result can be further improved.
  • the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
  • the comparison between the first image and the second image is performed.
  • the first optical flow is optimized to obtain the second optical flow between the first image and the second image, including: according to the first optical flow between the first image and the second image, determining the correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image;
  • the first optical flow is optimized to obtain a second optical flow between the first image and the second image.
  • the first image feature corresponding to the first image and the second image corresponding to the second image are determined according to the first optical flow between the first image and the second image
  • the correlation between the features, and according to the correlation, the first optical flow between the first image and the second image is optimized to obtain the relationship between the first image and the second image
  • the second optical flow of so that the correlation between the first image feature and the second image feature determined according to the first optical flow is used to optimize the first optical flow, so that the optimized second optical flow can be improved. accuracy.
  • the first optical flow between the first image and the second image is optimized according to the correlation to obtain the first image and the second image
  • the second optical flow between the images includes: performing multiple iterative optimizations on the first optical flow between the first image and the second image according to the correlation to obtain the first image and the second optical flow. the second optical flow between the second images.
  • the accuracy of the optical flow obtained by optimization can be further improved, and the nonlinearity and large motion range can be determined more accurately. optical flow between images.
  • the first optical flow between the first image and the second image is iteratively optimized for multiple times according to the correlation, so as to obtain the relationship between the first image and the second image.
  • the second optical flow between the second images includes: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image pixel value to obtain the confidence map corresponding to the first optical flow; weight the first optical flow according to the confidence map to obtain the optical flow to be optimized for the first optimization corresponding to the first optical flow ;
  • the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1 ⁇ t ⁇ T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2;
  • the first optical flow is iteratively optimized for multiple times, so that the iterative optimization can be obtained.
  • the second optical flow can more accurately reflect the motion information between the first image and the second image.
  • the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image.
  • determining the intermediate frame between the first image and the second image includes: determining, according to the second optical flow from the first image to the second image, from the first image to the second image.
  • a third optical flow from the first image to the intermediate frame determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image Optical flow; determining the intermediate frame according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image.
  • the third optical flow from the first image to the intermediate frame and the second optical flow from the first image to the intermediate frame can be accurately determined.
  • the fourth optical flow from the image to the intermediate frame based on the third optical flow and the fourth optical flow determined thereby, and the third image feature and the fourth image feature, can accurately determine the first image and the second image. intermediate frame.
  • the determining, according to the second optical flow from the first image to the second image, the third optical flow from the first image to the intermediate frame includes: A third optical flow from the first image to the intermediate frame is determined according to the second optical flow from the first image to the second image and a first parameter, wherein the first parameter is A ratio of a first time interval to a second time interval, where the first time interval is the time interval between the first image and the intermediate frame, and the second time interval is the first image and the time interval between the second images; the determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image, comprising: A fourth optical flow from the second image to the intermediate frame is determined based on the second optical flow from the second image to the first image, and the first parameter.
  • the intermediate frame corresponding to the required moment can be accurately determined.
  • intermediate frames at multiple moments between the first image and the second image can also be determined, so that multiple frames can be inserted between the first image and the second image to obtain a smoother and smoother video.
  • determining the intermediate frame comprising: determining a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image; according to the third optical flow and the third image feature, determine the second forward mapping result corresponding to the image feature of the intermediate frame; determine the third forward mapping result corresponding to the intermediate frame according to the fourth optical flow and the second image; according to the The fourth optical flow and the fourth image feature determine a fourth forward mapping result corresponding to the image feature of the intermediate frame; according to the first forward mapping result, the second forward mapping result, the The third forward mapping result and the fourth forward mapping result determine the intermediate frame.
  • the intermediate frame can be accurately determined by using the forward mapping result of the image of the intermediate frame and the forward mapping result of the image feature.
  • the first image and the second image are video frames of an animation video.
  • the image processing method Since the image processing method has a low dependence on texture matching between pixels in the process of determining the optical flow between images, the processing of the first image and the second image in the animation video lacking texture can The optical flow between the first image and the second image is accurately determined.
  • An aspect of the embodiments of the present disclosure provides an image processing apparatus, including:
  • a color block segmentation part configured to perform color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first color block.
  • a preset threshold the matching part is configured to match the color patches in the first color patch segmentation result with the color patches in the second color patch segmentation result, and obtain the first color patch segmentation result and the color patch in the second color patch segmentation result.
  • a color patch matching result between the second color patch segmentation results; a first determining part is configured to determine a first optical flow between the first image and the second image according to the color patch matching result.
  • the apparatus further includes: an optimization part configured to perform an optimization on the first image according to the first image feature corresponding to the first image and the second image feature corresponding to the second image The first optical flow between the image and the second image is optimized to obtain a second optical flow between the first image and the second image.
  • the first image and the second image are adjacent frames in the target video; the apparatus further includes: a second determining part configured to The third image feature and the fourth image feature corresponding to the second image, and the second optical flow between the first image and the second image, determine the difference between the first image and the second image intermediate frame.
  • the color block segmentation part is configured to: perform edge extraction on the first image and the second image respectively, to obtain a first edge extraction result corresponding to the first image and the second image The corresponding second edge extraction result; according to the first edge extraction result, color block segmentation is performed on the first image to obtain the first color block segmentation result corresponding to the first image; according to the second edge extraction As a result, color block segmentation is performed on the second image to obtain a second color block segmentation result corresponding to the second image.
  • the matching part is configured to: perform feature extraction on the first image and the second image respectively, so as to obtain the fifth image feature corresponding to the first image and the second image feature.
  • the color blocks in the color block are matched with the color blocks in the second color block segmentation result, and the color block matching result between the first color block segmentation result and the second color block segmentation result is obtained.
  • the matching part is configured to: perform superpixel pooling on the fifth image feature according to the first color block segmentation result to obtain the first color corresponding to the first image block feature matrix; according to the second color block segmentation result, perform superpixel pooling on the sixth image feature to obtain a second color block feature matrix corresponding to the second image.
  • the matching part is configured to: determine the first color block in the first color block segmentation result according to the first color block feature matrix and the second color block feature matrix The similarity between the feature of the second color block and the feature of the second color block in the second color block segmentation result, wherein, the first color block is any color block in the first color block segmentation result, so The second color block is any color block in the second color block segmentation result; according to the similarity between the characteristics of the first color block and the characteristics of the second color block, the first color block is determined.
  • the matching degree between the color block and the second color block according to the matching degree between the color block in the first color block segmentation result and the color block in the second color block segmentation result, the obtained The color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
  • the matching part is configured to: according to one or both of a size difference and a position difference between the first color block and the second color block, and the first color block The similarity between the feature of a color block and the feature of the second color block determines the matching degree between the first color block and the second color block.
  • the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
  • the optimization part is configured to: determine, according to the first optical flow between the first image and the second image, the first image feature corresponding to the first image and the the correlation between the second image features corresponding to the second image; according to the correlation, optimize the first optical flow between the first image and the second image to obtain the first image and a second optical flow between the second image.
  • the optimization part is configured to: according to the correlation, perform multiple iterative optimizations on the first optical flow between the first image and the second image to obtain the a second optical flow between the first image and the second image.
  • the optimization part is configured to: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the second image The pixel value of the image is obtained, and the confidence map corresponding to the first optical flow is obtained; the first optical flow is weighted according to the confidence map to obtain the first optimization corresponding to the first optical flow to be optimized.
  • the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T
  • the optimized optical flow of the T-th optimization is determined as the second optical flow between the first image and the second image.
  • the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image.
  • the second optical flow from the two images to the first image; the second determining part is configured to: determine the second optical flow from the first image to the second image according to the second optical flow from the first image to the second image a third optical flow of the intermediate frame; determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image; according to the The third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, determine the intermediate frame.
  • the second determining part is configured to: determine the distance from the first image to the second image according to the second optical flow from the first image to the second image and the first parameter The third optical flow of the intermediate frame, wherein the first parameter is the ratio of the first time interval to the second time interval, and the first time interval is the difference between the first image and the intermediate frame.
  • time interval, the second time interval is the time interval between the first image and the second image; according to the second optical flow from the second image to the first image, and the first A parameter that determines a fourth optical flow from the second image to the intermediate frame.
  • the second determining part is configured to: determine a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image;
  • the third optical flow and the third image feature are used to determine the second forward mapping result corresponding to the image feature of the intermediate frame; according to the fourth optical flow and the second image, the first forward mapping result corresponding to the intermediate frame is determined.
  • the first image and the second image are video frames of an animation video.
  • An aspect of an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the memory Stored executable instructions to perform the above method.
  • An aspect of the embodiments of the present disclosure provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • An aspect of the embodiments of the present disclosure provides a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, the processor in the electronic device executes to implement the above method.
  • a computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program product realizes the above when read and executed by a computer. method.
  • a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to
  • the first preset threshold is to match the color blocks in the first color block segmentation result with the color blocks in the second color block segmentation result, and obtain the first color block segmentation result and the second color block.
  • the color patch matching result between the block segmentation results, and the first optical flow between the first image and the second image is determined according to the color patch matching result, so that the first optical flow can be accurately determined optical flow between the image and the second image. Since the image processing method provided by the embodiment of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between the images, the image processing method provided by the embodiment of the present disclosure can also accurately determine the lack of Optical flow between textured images.
  • FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure.
  • FIG. 2 shows a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
  • FIG. 3 shows a schematic diagram of a color patch matching module provided by an embodiment of the present disclosure.
  • FIG. 4 shows a schematic diagram of an optical flow optimization module provided by an embodiment of the present disclosure.
  • FIG. 5 shows a block diagram of an image processing apparatus provided by an embodiment of the present disclosure.
  • FIG. 6 shows a block diagram of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 7 shows a block diagram of another electronic device provided by an embodiment of the present disclosure.
  • Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product.
  • a first color corresponding to the first image is obtained.
  • the block segmentation result and the second color block segmentation result corresponding to the second image wherein, for any color block in the first color block segmentation result and the second color block segmentation result, in the color block
  • the absolute value of the difference between the pixel values of any two pixels is less than or equal to the first preset threshold, and the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result are analyzed.
  • the image processing method provided by the embodiment of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between the images, the image processing method provided by the embodiment of the present disclosure can also accurately determine the lack of Optical flow between textured images.
  • FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure.
  • the image processing method may be executed by a terminal device or a server or other processing device.
  • the terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, or a wearable devices, etc.
  • the image processing method may be implemented by a processor invoking computer-readable instructions stored in a memory. As shown in FIG. 1 , the image processing method includes steps S11 to S13.
  • step S11 color block segmentation is performed on the first image and the second image respectively to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, For any one color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset value. Set the threshold.
  • step S12 the color patches in the first color patch segmentation result and the color patches in the second color patch segmentation result are matched to obtain the first color patch segmentation result and the second color patch Patch matching results between segmentation results.
  • step S13 a first optical flow between the first image and the second image is determined according to the color patch matching result.
  • the first image and the second image may be two related images.
  • the first image and the second image may be two images belonging to the same sequence of images, in another example, the first image and the second image may be of the same location at adjacent times or Two images acquired from the same subject.
  • the first image and the second image may be two video frames in the target video.
  • the target video may be an animation video or a game video, or may be a real-life video lacking texture, or may be any other type of video, which is not limited herein.
  • the live video refers to a video obtained by video collection of the real world.
  • the first image and the second image are video frames of an animation video. Since the image processing method provided by the embodiments of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between images, the first image and the second image in the animation video lacking texture are less dependent on the texture matching between the pixels. By performing optical flow estimation, the optical flow between the first image and the second image can be accurately determined.
  • the first color block segmentation result may represent the color block segmentation result of the first image
  • the second color block segmentation result may represent the color block segmentation result of the second image.
  • the first image may be denoted as I 0
  • the second image may be denoted as I 1
  • the pixel value of the pixel x in the first image I 0 may be denoted by I 0 (x)
  • the value of the pixel x in the second image I 1 may be denoted by I 0 (x).
  • the pixel value can be represented by I 1 (x).
  • the first color block segmentation result and the second color block segmentation result may be represented by data forms such as graphs, matrices, and arrays, which are not limited herein.
  • the first color block segmentation result may be a map of the same size as the first image.
  • the label values of pixels belonging to different color blocks may be different, and the label values of pixels belonging to the same color block may be the same.
  • the first color block segmentation result includes K 0 color blocks, that is, the first image includes K 0 color blocks, where K 0 ⁇ 2.
  • the label value of each pixel belonging to the first color block is 1, and the label value of each pixel belonging to the second color block is 2, ..., belonging to the K 0th color
  • the label value of each pixel of the block is K 0 .
  • the second color patch segmentation result is similar to the first color patch segmentation result.
  • S 0 (i) may represent the i-th color patch in the first image
  • S 1 (j) may represent the j-th color patch in the second image.
  • the absolute value of the difference between the pixel values of any two pixels is less than or equal to the first preset threshold, that is, different pixels in the same color block pixel values are closer.
  • different pixels in any color block have the same semantic information, that is, each pixel in the same color block has the same semantic information.
  • the semantic information of each pixel in color block 1 is arm
  • the semantic information of each pixel in color block 2 is head
  • the semantic information of each pixel in color block 3 is hat
  • the semantic information of each pixel in color block 4 is hat
  • the semantic information of each pixel is an umbrella, and so on.
  • different pixels in the same color block may also have different semantic information, as long as the absolute value of the difference between the pixel values of any two pixels in the same color block is less than or equal to the first preset value You can set a threshold.
  • the size of any one color block in the first color block segmentation result and the second color block segmentation result is greater than or equal to a second preset threshold.
  • the second preset threshold may be 50 pixels.
  • color blocks whose size is smaller than the second preset threshold may be ignored, that is, the first color block segmentation result and the second color block segmentation result may not include color blocks whose size is smaller than the second preset threshold.
  • the size of the color block may not be limited.
  • each pixel in any color block belongs to the same connected domain.
  • any color block may include one or more connected domains.
  • the block segmentation result includes: performing edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image; an edge extraction result, performing color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; and performing color block segmentation on the second image according to the second edge extraction result , to obtain the second color block segmentation result corresponding to the second image.
  • the first edge extraction result represents the edge extraction result of the first image
  • the second edge extraction result represents the edge extraction result of the second image.
  • the first edge extraction result may include location information of the pixel where the edge is located in the first image
  • the second edge extraction result may include location information of the pixel where the edge is located in the second image.
  • a 5 ⁇ 5 Laplacian of Gaussian can be used to perform edge extraction on the first image and the second image, respectively, to obtain the first image corresponding to the first image.
  • An edge extraction result and a second edge extraction result corresponding to the second image can be used to perform edge extraction on the first image and the second image, which is not limited herein.
  • the Trapped-ball algorithm may be used to perform color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; according to For the second edge extraction result, a Trapped-ball algorithm may be used to perform color block segmentation on the second image, to obtain a second color block segmentation result corresponding to the second image.
  • color block segmentation may also be performed on the first image and the second image by methods such as superpixel segmentation, which is not limited herein.
  • a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image are obtained.
  • color block segmentation is performed on the first image to obtain a first color block segmentation result corresponding to the first image
  • color block segmentation is performed on the second image. block segmentation to obtain the second color block segmentation result corresponding to the second image, so that the edge information in the first image can be used to more accurately determine the color block segmentation result of the first image.
  • the edge information in the second image is used to more accurately determine the color block segmentation result of the second image.
  • color block segmentation may be performed based on pixel values of pixels and the positional relationship between pixels.
  • the color patch matching result between the first color patch segmentation result and the second color patch segmentation result may represent information of color patches matched in the first image and the second image. That is, according to the color patch matching result, it can be determined which color patch of the first image matches with which color patch of the second image.
  • the matching of the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result is performed to obtain the first color block segmentation result and
  • the color patch matching result between the second color patch segmentation results includes: performing feature extraction on the first image and the second image respectively to obtain the fifth image feature corresponding to the first image and the The sixth image feature corresponding to the second image; according to the first color block segmentation result and the fifth image feature, the first color block feature matrix corresponding to the first image is obtained; according to the second color block segmentation The result and the sixth image feature to obtain a second color block feature matrix corresponding to the second image; according to the first color block feature matrix and the second color block feature matrix, the first color block feature matrix
  • the color patch in the segmentation result is matched with the color patch in the second color patch segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
  • a pre-trained VGGNet may be used to perform feature extraction on the first image and the second image, respectively, to obtain the fifth image feature corresponding to the first image and the first image feature corresponding to the second image.
  • the fifth image feature and the sixth image feature may respectively include N levels, where N is greater than or equal to 1.
  • the pre-trained VGGNet may include 19 layers, that is, the pre-trained VGGNet may be VGG-19; after the first image is input into the pre-trained VGGNet, relu1_2, relu2_2, relu3_4 and relu4_4 The outputs of these four layers are respectively used as the fifth image feature corresponding to the first image, that is, the fifth image feature may include 4-level image features; after the second image is input into the pre-trained VGGNet, relu1_2, relu2_2 The outputs of the four layers of , relu3_4 and relu4_4 are respectively used as the sixth image feature corresponding to the second image, that is, the sixth image feature may include 4-level image features.
  • the image features output by relu1_2 may include 64 channels, the image features output by relu2_2 may include 128 channels, the image features output by relu3_4 may include 256 channels, and the image features output by relu4_4 may include 512 channels.
  • the first color block feature matrix F 0 may be K 0 ⁇ A matrix of N, where the ith row of the first color patch feature matrix F 0 corresponds to the feature of the ith color patch in the first color patch segmentation result S 0 , that is, each color patch in the first image I 0 N-dimensional features can be included.
  • the second color block feature matrix F 1 may be K 1 ⁇ N matrix, where the jth row of the second color patch feature matrix F1 corresponds to the feature of the jth color patch in the second color patch segmentation result S1, that is, each color patch in the second image I1 A block may include N-dimensional features.
  • the fifth image feature corresponding to the first image and the sixth image feature corresponding to the second image are obtained.
  • a first color block feature matrix corresponding to the first image is obtained, and according to the second color block segmentation result and the sixth image feature, the obtained color block is obtained.
  • the second color block feature matrix corresponding to the second image according to the first color block feature matrix and the second color block feature matrix, the color blocks in the first color block segmentation result and the second color block feature matrix
  • the color patches in the color patch segmentation result are matched to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result, so that it can be based on the first image and the first color patch.
  • the visual features of the color patches in the two images are color patch matched, so that an accurate color patch matching result can be obtained.
  • the obtaining a first color block feature matrix corresponding to the first image according to the first color block segmentation result and the fifth image feature includes: according to the first color block The block segmentation result is to perform super-pixel pooling (Super-pixel pooling) on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and For the sixth image feature, obtaining a second color block feature matrix corresponding to the second image includes: performing superpixel pooling on the sixth image feature according to the second color block segmentation result to obtain the second color block feature matrix.
  • the second color block feature matrix corresponding to the second image includes: according to the first color block The block The block segmentation result is to perform super-pixel pooling (Super-pixel pooling) on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and For the sixth image feature, obtaining a second color block feature matrix corresponding to the second image includes: performing superpixel pooling on the sixth image feature according to the second color block segmentation result to
  • a first color block feature matrix corresponding to the first image is obtained, and according to the second color block feature matrix
  • superpixel pooling is performed on the sixth image feature to obtain a second color block feature matrix corresponding to the second image, so that a higher-precision color block feature matrix can be obtained.
  • the first color block feature matrix and the second color block feature matrix may also be obtained by means of average pooling, full connection, etc., which are not limited herein.
  • the color block and the second color block in the first color block segmentation result are divided according to the first color block feature matrix and the second color block feature matrix.
  • Matching the color blocks in the result to obtain a color block matching result between the first color block segmentation result and the second color block segmentation result including: according to the first color block feature matrix and the second color block feature matrix A color patch feature matrix, determining the similarity between the feature of the first color patch in the first color patch segmentation result and the feature of the second color patch in the second color patch segmentation result, wherein the first color patch A color block is any color block in the first color block segmentation result, and the second color block is any color block in the second color block segmentation result; according to the characteristics of the first color block
  • the similarity between the features of the second color block and the second color block is used to determine the matching degree between the first color block and the second color block; according to the color block in the first color block segmentation result and all The matching degree between the color patches in the second color patch segmentation result is obtained, and the color patch
  • the matching degree between the first color block and the second color block is determined according to the similarity between the feature of the first color block and the feature of the second color block , including: according to one or both of the size difference and the position difference between the first color block and the second color block, and the characteristics of the first color block and the second color block
  • the similarity between the features determines the matching degree between the first color block and the second color block.
  • the matching between the color patches of the first image and the color patches of the second image can be adjusted on the basis of visual features by utilizing one or both of the size difference and the position difference Therefore, the accuracy of the determined color patch matching result can be further improved.
  • the size difference represents the difference in size between the first color patch and the second color patch.
  • the size difference may be the absolute value of the difference in the number of pixels between the first color block and the second color block.
  • the size difference may be the absolute value of the difference in area between the first color patch and the second color patch.
  • the positional difference represents a positional difference between the first color patch and the second color patch.
  • the positional difference may be an absolute value of a difference in coordinates of corresponding pixels between the first color patch and the second color patch.
  • the position difference may be the absolute value of the difference between the coordinates of the barycenters of the rectangular bounding boxes of the first color patch and the second color patch.
  • the position difference may be the absolute value of the difference between the coordinates of the geometric centers of the first color patch and the second color patch.
  • the fit is inversely related to the size difference. That is, the larger the size difference is, the smaller the matching degree is; the smaller the size difference is, the larger the matching degree is.
  • the matching degree is negatively correlated with the position difference. That is, the larger the position difference is, the smaller the matching degree is; the smaller the position difference is, the larger the matching degree is.
  • a size penalty term between the first color block and the second color block may be constructed according to the size difference between the first color block and the second color block; according to the difference between the first color block and the second color block The position difference between the first color block and the second color block is constructed, and the distance penalty term is constructed.
  • Equation 2 the following (Equation 2) can be used to determine the distance penalty term L dist (i,j) between color patch i and color patch j:
  • P 0 (i) represents the coordinates of the barycenter of the rectangular bounding box of color patch i
  • P 1 (j) represents the coordinates of the barycenter of the rectangular bounding box of color patch j
  • H represents the height of the first image, and the The height is equal to the height of the second image
  • W represents the width of the first image, and the width of the first image is equal to the width of the second image.
  • Equation 3 the following (equation 3) can be used to determine the size penalty term L size (i, j) between color patch i and color patch j:
  • Equation 4 can be used to determine the matching degree C(i,j) between color patch i and color patch j:
  • ⁇ dist represents the coefficient corresponding to the distance penalty term
  • ⁇ size represents the coefficient corresponding to the size penalty term.
  • ⁇ dist 0.2
  • ⁇ size 0.5.
  • those skilled in the art can flexibly set ⁇ dist and ⁇ size according to actual application scenario requirements and/or experience, which are not limited herein.
  • the distance penalty term may be used only when the displacement between the first image and the second image is greater than a preset length, where the preset length is equal to the diagonal length of the first image Product with preset coefficients.
  • the preset coefficient may be 0.15. In other examples, it may not be considered whether the displacement between the first image and the second image is greater than a preset length.
  • the color patch in the second image that matches the color patch i in the first image can be determined according to the following (Equation 5) and a patch in the first image that matches patch j in the second image
  • a pair of color patches that match each other in the first image and the second image can be determined.
  • a matching color patch pair can be denoted as (i,j), where, For each matching patch pair (i,j), the inter-block optical flow can be computed.
  • the displacement of the center of gravity of the rectangular bounding box of color patch j relative to the center of gravity of the rectangular bounding box of color patch i can be determined
  • the optical flow at pixel x can be calculated Among them, x ⁇ S 0 (i)
  • u() represents the displacement amount in the x-axis direction
  • v() represents the displacement amount in the y-axis direction.
  • the method of variational refinement can be used to find Its energy function is expressed as follows (Equation 6):
  • the optical flow between the two color blocks can be determined as 0.
  • equation 7 can be used to determine the first optical flow from the first image to the second image:
  • the optical flow between the first image and the second image and between matched color patches may be determined.
  • the first optical flow can be obtained by splicing together the optical flows between the matched color blocks.
  • the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
  • the method further includes: according to the first image corresponding to the first image feature and the second image feature corresponding to the second image, optimize the first optical flow between the first image and the second image, and obtain a relationship between the first image and the second image the second optical flow.
  • a method such as deep learning may be used to optimize the first optical flow between the first image and the second image.
  • a Transformer-type neural network may be used to iteratively optimize the optical flow between the first image and the second image to obtain the second optical flow.
  • the first image feature may be an image feature extracted from the first image by a residual network (ResNet), and the second image feature may be an image feature extracted from the second image by a residual network .
  • the first image feature corresponding to the first image and the second image feature corresponding to the second image may also be extracted through other feature extraction networks, which is not limited herein.
  • the second image feature of optimizes the first optical flow between the first image and the second image to obtain the second optical flow between the first image and the second image, thus Improve the accuracy of the determined optical flow. For an application scenario with nonlinearity and a large motion range, by adopting this implementation manner, the accuracy of the determined optical flow can be greatly improved.
  • the difference between the first image and the second image is Optimizing the first optical flow to obtain a second optical flow between the first image and the second image, comprising: determining according to the first optical flow between the first image and the second image The correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image; according to the correlation, the correlation between the first image and the second image is The first optical flow is optimized to obtain a second optical flow between the first image and the second image.
  • the first image feature can be written as The second image feature can be denoted as The first image feature can be determined by the following (Equation 8) with the second image feature correlation between
  • ⁇ (x) represents the square area with pixel x as the geometric center
  • p represents the pixel belonging to ⁇ (x)
  • p represents the pixel belonging to ⁇ (x)
  • the first image feature features at pixel p in represents the second image feature middle pixel features at.
  • the size of ⁇ (x) can be 3 ⁇ 3 or 5 ⁇ 5, etc.
  • the first image feature corresponding to the first image and the second image feature corresponding to the second image are determined according to the first optical flow between the first image and the second image and the first optical flow between the first image and the second image is optimized according to the correlation to obtain the correlation between the first image and the second image.
  • the second optical flow whereby the correlation between the first image feature and the second image feature determined according to the first optical flow is used to optimize the first optical flow, so that the second optical flow obtained by optimization can be improved. accuracy.
  • the first optical flow between the first image and the second image is optimized to obtain an optical flow between the first image and the second image.
  • the second optical flow includes: performing multiple iterative optimization on the first optical flow between the first image and the second image according to the correlation to obtain the first image and the second image the second optical flow in between.
  • the accuracy of the optimized optical flow can be further improved, and the nonlinear and large motion amplitude can be more accurately determined.
  • the first optical flow from the first image to the second image can be denoted as f 0 ⁇ 1
  • the first optical flow from the second image to the first image can be denoted as f 1 ⁇ 0
  • the second optical flow of the two images may be denoted as f 0 ′ ⁇ 1
  • the second optical flow from the second image to the first image may be denoted as f 1 ′ ⁇ 0 .
  • the first optical flow between the first image and the second image is optimized for multiple iterations to obtain the first image and the second image
  • the second optical flow between the two includes: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image, obtaining the confidence map corresponding to the first optical flow; weight the first optical flow according to the confidence map to obtain the optical flow to be optimized corresponding to the first optical flow;
  • the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T, the t-th optimization is determined.
  • the optimized optical flow of the t-time optimization is taken as the optical flow to be optimized for the t+1th optimization, where 1 ⁇ t ⁇ T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2;
  • Optical flow is determined as a second optical flow between the first image and the second image.
  • the first optical flow is iteratively optimized for multiple times, so that the first optical flow obtained by the iterative optimization can be optimized.
  • the two optical flow can more accurately reflect the motion information between the first image and the second image.
  • the optical flow to be optimized for the first optimization can be recorded as The optimized optical flow of the first optimization (that is, the optical flow obtained after the first optimization) can be recorded as The optical flow to be optimized for the t-th optimization can be recorded as The optimized optical flow of the t-th optimization can be written as The optimized optical flow of the T-th optimization (ie, the second optical flow) can be recorded as which is
  • the confidence map corresponding to the first optical flow can be obtained.
  • the confidence map corresponding to the first optical flow can be Among them, the confidence map corresponding to the first optical flow Including the confidence of the first optical flow at each pixel.
  • the confidence map corresponding to the first optical flow The weights can be normalized to [0,1].
  • the optical flow to be optimized for the first optimization corresponding to the first optical flow It can be determined by using the following (equation 9):
  • E.g Represents the optical flow to be optimized for the t(t>0) optimization, that is, the optimized optical flow for the t-1 optimization, represents the first image feature, represents the first image feature with the second image feature correlation between, then, it can be and Enter ConvGRU to get the optical flow increment of the t-th optimization
  • Equation 10 the following (Equation 10) can be used to obtain the optical flow increment of the t-th optimization
  • the second optical flow obtained after T times of optimization can be determined by the following (Equation 11):
  • the second optical flow or the first optical flow obtained in the embodiment of the present disclosure may be used for video frame insertion, video compression, video coding, target detection, target tracking, or object segmentation, etc., which is not limited herein.
  • the first image and the second image are adjacent frames in the target video; the second light between the obtained first image and the second image
  • the method further includes: according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the third image feature between the first image and the second image Two optical flows, determining the intermediate frame of the first image and the second image.
  • a convolutional neural network can be used to perform feature extraction on the first image and the second image respectively, to obtain the third image feature corresponding to the first image and the fourth image corresponding to the second image feature.
  • the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the second image the second optical flow from the image to the first image; the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the first image and the first image
  • determining the intermediate frame between the first image and the second image includes: determining, according to the second optical flow from the first image to the second image, the frame from the first image to the second image.
  • the third optical flow from the first image to the intermediate frame can be accurately determined.
  • the fourth optical flow to the intermediate frame based on the third optical flow and the fourth optical flow determined thereby, and the third image feature and the fourth image feature, can accurately determine the middle of the first image and the second image frame.
  • the determining the third optical flow from the first image to the intermediate frame according to the second optical flow from the first image to the second image includes: according to the second optical flow from the first image to the second image a second optical flow from the first image to the second image, and a first parameter to determine a third optical flow from the first image to the intermediate frame, wherein the first parameter is a first time interval The ratio of the first time interval to the second time interval, the first time interval being the time interval between the first image and the intermediate frame, and the second time interval being the difference between the first image and the second image the time interval between; the determining, according to the second optical flow from the second image to the first image, the fourth optical flow from the second image to the intermediate frame, comprising: according to the optical flow from the second image to the intermediate frame A second optical flow from the second image to the first image, and the first parameter, determines a fourth optical flow from the second image to the intermediate frame.
  • the intermediate frame corresponding to the required time can be accurately determined.
  • intermediate frames at multiple moments between the first image and the second image can also be determined, so that multiple frames can be inserted between the first image and the second image to obtain a smoother and smoother video.
  • Equation 12 the following (Equation 12) can be used to determine the third optical flow f 0 ⁇ r from the first image to the intermediate frame and the fourth optical flow f 1 ⁇ from the second image to the intermediate frame r :
  • r represents the first parameter, 0 ⁇ r ⁇ 1.
  • the determining of the said The intermediate frame includes: determining the first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image; determining the first forward mapping result according to the third optical flow and the third image feature the second forward mapping result corresponding to the image feature of the intermediate frame; the third forward mapping result corresponding to the intermediate frame is determined according to the fourth optical flow and the second image; according to the fourth optical flow and the fourth image feature, determine the fourth forward mapping result corresponding to the image feature of the intermediate frame; according to the first forward mapping result, the second forward mapping result, the third forward mapping result
  • the intermediate frame is determined from the mapping result and the fourth forward mapping result. According to this example, the intermediate frame can be accurately determined by using the forward warp result of the image of the intermediate frame and the forward mapping result of the image feature.
  • Equation 13 the following (Equation 13) can be used to obtain the first forward mapping result Second forward mapping result Third forward mapping result and the fourth forward mapping result
  • F 0 ′ represents the third image feature
  • F 1 ′ represents the fourth image feature
  • the first forward mapping result, the second forward mapping result, the third forward mapping result, and the fourth forward mapping result may be input into a pre-trained fusion network, via The fusion network outputs the intermediate frame.
  • the first image feature and the second image feature are image features extracted by a first feature extraction network
  • the third image feature and the fourth image feature are second features
  • the image features extracted by the network are extracted
  • the fifth image feature and the sixth image feature are image features extracted by the third feature extraction network.
  • the first feature extraction network, the second feature extraction network and the third feature extraction network may be different feature extraction networks, or may be the same feature extraction network.
  • 2D (2 Dimensions, two-dimensional) animation production companies In order to reduce the cost of manual drawing, 2D (2 Dimensions, two-dimensional) animation production companies often repeat the same frame several times in the animation to achieve the frame rate required for film and television works. This results in a lower actual frame rate of the animation, which affects the user's viewing experience. If we can use video frame interpolation technology to generate the middle frame between every two frames in the animation video, we can save production cost, improve frame rate and user viewing experience. In the related art, most video frame interpolation technologies are implemented based on "motion estimation-motion compensation", namely optical flow, and good results have been achieved in the task of frame interpolation of live video.
  • animation video frame interpolation has the following two difficulties: First, the objects in animation video (such as characters, objects) lack texture, which makes it difficult to perform motion estimation methods that video frame interpolation technology in related technologies relies on. Texture matching, so it is difficult to estimate accurate optical flow. Second, animated videos often use some exaggerated motions to achieve certain artistic effects. These motions are usually nonlinear and have large motion amplitudes, which makes it difficult for general optical flow estimation algorithms to deal with these exaggerated motions. The video frame insertion method in the related art does not specifically deal with the difficulty of animation video frame insertion, so it is difficult to generate an animation video with high quality and a frame rate that meets the requirements.
  • FIG. 2 shows a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
  • the color patch matching module 21, the optical flow optimization module 22 and the image synthesis module 23 can be used to complete the frame insertion of the animation video, that is, to determine the intermediate frame between the first image I 0 and the second image I 1
  • the input of the color patch matching module includes a first image I 0 and a second image I 1
  • the output includes a first optical flow f 0 ⁇ 1 from the first image I 0 to the second image I 1 and from The first optical flows f 1 ⁇ 0 of the second image I 1 to the first image I 0 .
  • FIG. 3 shows a schematic diagram of a color patch matching module provided by an embodiment of the present disclosure.
  • the color patch matching module can use the 5 ⁇ 5 Laplacian Gaussian operator to perform edge extraction on the first image I 0 to obtain the first edge extraction result corresponding to the first image I 0 ;
  • the Laplacian Gaussian operator performs edge extraction on the second image I 1 to obtain a second edge extraction result corresponding to the second image I 1 .
  • the color block matching module can use the Trapped-ball algorithm to perform color block segmentation on the first image I 0 according to the first edge extraction result to obtain the first color block segmentation result S 0 corresponding to the first image I 0 ; As a result, the Trapped-ball algorithm is used to perform color block segmentation on the second image I 1 to obtain a second color block segmentation result S 1 corresponding to the second image I 1 .
  • the color patch matching module can perform feature extraction on the first image I 0 through the pre-trained VGGNet to obtain the fifth image feature corresponding to the first image I 0 ; perform feature extraction on the second image I 1 through the VGGNet to obtain the second image.
  • the sixth image feature corresponding to I 1 can be performed.
  • the color patch matching module can obtain the first color patch feature matrix F 0 corresponding to the first image according to the first color patch segmentation result S 0 and the fifth image feature; according to the second color patch segmentation result S 1 and the sixth image feature, A second color patch feature matrix F 1 corresponding to the second image is obtained.
  • the first color block feature matrix F 0 may be a K 0 ⁇ N matrix
  • the second color block feature matrix F 1 may be a K 1 ⁇ N matrix.
  • the color patch matching module can use the above (Equation 4), according to the similarity A(i, j) between the feature of the color patch i in the first image I 0 and the feature of the color patch j in the second image I 1 ), and the distance penalty term L dist (i,j) and the size penalty term L size (i,j) between the color patch i of the first image I 0 and the color patch j of the second image I 1 , determine the first The matching degree C(i,j) between the color patch i of an image I 0 and the color patch j of the second image I 1 .
  • a matching degree matrix between the first image I 0 and the second image I 1 can be formed.
  • the matching degree matrix using the above (Equation 5), the color patch matching result between the first image I 0 and the second image I 1 can be determined.
  • the optical flow between the first image I 0 and the second image I 1 and between matched color patches can be determined.
  • Equation 7 by splicing the optical flows between the matched color blocks together, the first optical flow f 0 ⁇ 1 from the first image I 0 to the second image I 1 and the The first optical flow f 1 ⁇ 0 of the image I 1 to the first image I 0 .
  • the input of the optical flow optimization module includes a first optical flow f 0 ⁇ 1 from the first image I 0 to the second image I 1 , and a first optical flow from the second image I 1 to the first image I 0 .
  • Optical flow f 1 ⁇ 0 , the first image I 0 and the second image I 1 the output includes the second optical flow f′ 0 ⁇ 1 from the first image I 0 to the second image I 1 and from the second image I 1
  • the optical flow optimization module can use Transformer neural network to iteratively optimize the optical flow.
  • FIG. 4 shows a schematic diagram of an optical flow optimization module provided by an embodiment of the present disclosure.
  • the optical flow optimization module can perform feature extraction on the first image I 0 and the second image I 1 respectively through a feature network (such as a residual network) to obtain the first image features and the second image feature
  • the optical flow optimization module can determine the first image feature according to (Equation 8) above with the second image feature correlation product between
  • the optical flow optimization module can convert
  • the error degree g(x) corresponding to f 0 ⁇ 1 is output through the convolutional neural network.
  • the confidence map corresponding to f 0 ⁇ 1 can be obtained Using (Equation 9) above, it can be based on the confidence map and f 0 ⁇ 1 , the optical flow to be optimized for the first optimization is obtained
  • the optical flow optimization module can and Enter ConvGRU to get the optical flow increment of the t-th optimization After T times of optimization, the second optical flow f′ 0 ⁇ 1 from the first image I 0 to the second image I 1 can be obtained.
  • the input of the image synthesis module includes the second optical flow f′ 0 ⁇ 1 from the first image I 0 to the second image I 1 , and the second optical flow f′ 0 ⁇ 1 from the second image I 1 to the first image I 0 Optical flow f′ 1 ⁇ 0 , the first image I 0 and the second image I 1 , the output is an intermediate frame between the first image I 0 and the second image I 1
  • the image synthesis module can perform feature extraction on the first image I 0 and the second image I 1 through CNN, respectively, to obtain the third image feature F 0 ′ corresponding to the first image I 0 and the fourth image feature corresponding to the second image I 1 . F1 ' .
  • the image synthesis module can determine from the first image I 0 to the intermediate frame The third optical flow f 0 ⁇ r and from the second image I 1 to the intermediate frame The fourth optical flow f 1 ⁇ r of .
  • the image synthesis module can determine the first forward mapping result according to the first image I 0 , the second image I 1 , the third image feature F 0 ′ and the fourth image feature F 1 ′ Second forward mapping result Third forward mapping result and the fourth forward mapping result Convert the first forward mapping result Second forward mapping result Third forward mapping result and the fourth forward mapping result Input the pre-trained fusion network, you can get the intermediate frame between the first image I 0 and the second image I 1
  • This application scenario can accurately estimate the optical flow of uniform color patches, and can accurately describe exaggerated motion, so that reasonable and natural animation videos with high frame rate can be generated.
  • embodiments of the present disclosure also provide image processing apparatuses, devices, computer-readable storage media, computer programs, and computer program products, all of which can be used to implement any image processing method provided by the embodiments of the present disclosure, and the corresponding technical solutions and The technical effects can be found in the corresponding records in the Methods section.
  • FIG. 5 shows a block diagram of an image processing apparatus provided by an embodiment of the present disclosure. As shown in Figure 5, the image processing device includes:
  • the color block segmentation part 51 is configured to perform color block segmentation on the first image and the second image respectively, and obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image. , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to a first preset threshold;
  • the matching part 52 is configured to match the color patches in the first color patch segmentation result with the color patches in the second color patch segmentation result to obtain the first color patch segmentation result and the second color patch Color patch matching results between block segmentation results;
  • the first determining part 53 is configured to determine the first optical flow between the first image and the second image according to the color patch matching result.
  • the apparatus further includes:
  • An optimization part configured to perform a first optical flow between the first image and the second image according to the first image feature corresponding to the first image and the second image feature corresponding to the second image optimization to obtain a second optical flow between the first image and the second image.
  • the first image and the second image are adjacent frames in the target video
  • the apparatus further includes: a second determination part configured to determine the first image and the second image according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the first image and the second image A second optical flow between the first image and the second image is determined to be an intermediate frame.
  • the color block dividing part 51 is configured as:
  • color block segmentation is performed on the second image to obtain a second color block segmentation result corresponding to the second image.
  • the matching part 52 is configured as:
  • the color blocks in the first color block segmentation result are matched with the color blocks in the second color block segmentation result, and the obtained color block is obtained.
  • a color patch matching result between the first color patch segmentation result and the second color patch segmentation result is obtained.
  • the matching part 52 is configured as:
  • superpixel pooling is performed on the sixth image feature to obtain a second color block feature matrix corresponding to the second image.
  • the matching part 52 is configured as:
  • the feature of the first color block in the first color block segmentation result and the second color block in the second color block segmentation result are determined The similarity between the features of the blocks, wherein the first color block is any color block in the first color block segmentation result, and the second color block is the second color block in the second color block segmentation result. any color block;
  • the first color block segmentation result and the second color block segmentation result are obtained between the color patch matching results.
  • the matching part 52 is configured as:
  • the similarity is determined to determine the matching degree between the first color block and the second color block.
  • the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
  • the optimization part is configured as:
  • a first optical flow between the first image and the second image is optimized to obtain a second optical flow between the first image and the second image.
  • the optimization part is configured as:
  • multiple iterations are performed on the first optical flow between the first image and the second image to obtain a second optical flow between the first image and the second image .
  • the optimization part is configured as:
  • the confidence level corresponding to the first optical flow is obtained picture
  • the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1 ⁇ t ⁇ T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2;
  • the optimized optical flow of the T-th optimization is determined as the second optical flow between the first image and the second image.
  • the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image. a second optical flow from two images to the first image;
  • the second determination part is configured as:
  • the intermediate frame is determined according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image.
  • the second determining part is configured as:
  • a third optical flow from the first image to the intermediate frame is determined according to the second optical flow from the first image to the second image and a first parameter, wherein the first parameter is A ratio of a first time interval to a second time interval, where the first time interval is the time interval between the first image and the intermediate frame, and the second time interval is the first image and the the time interval between the second images;
  • a fourth optical flow from the second image to the intermediate frame is determined based on the second optical flow from the second image to the first image, and the first parameter.
  • the second determining part is configured as:
  • the intermediate frame is determined according to the first forward mapping result, the second forward mapping result, the third forward mapping result and the fourth forward mapping result.
  • the first image and the second image are video frames of an animation video.
  • a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to
  • the first preset threshold is to match the color blocks in the first color block segmentation result with the color blocks in the second color block segmentation result, and obtain the first color block segmentation result and the second color block.
  • the color patch matching result between the block segmentation results, and the first optical flow between the first image and the second image is determined according to the color patch matching result, so that the first optical flow can be accurately determined optical flow between the image and the second image. Since the image processing apparatus provided by the embodiment of the present disclosure has a low dependence on texture matching between pixels, the image processing apparatus provided by the embodiment of the present disclosure can also accurately determine the optical flow between images lacking texture.
  • the functions or modules included in the apparatus provided by the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments, and the specific implementation and technical effects thereof may refer to the descriptions of the above method embodiments.
  • Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
  • the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
  • Embodiments of the present disclosure further provide a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, the processor in the electronic device executes the above method.
  • Embodiments of the present disclosure also provide a computer program product for storing computer-readable instructions, which, when executed, cause the computer to perform the operations of the image processing method provided by any of the foregoing embodiments.
  • Embodiments of the present disclosure further provide an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke executable instructions stored in the memory instruction to execute the above method.
  • the electronic device may be provided as a terminal, server or other form of device.
  • FIG. 6 shows a block diagram of an electronic device provided by an embodiment of the present disclosure.
  • electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
  • electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816 .
  • the processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations.
  • the processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above.
  • processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components.
  • processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
  • Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
  • SRAM static random access memory
  • EEPROM electrically erasable programmable read only memory
  • EPROM erasable Programmable Read Only Memory
  • PROM Programmable Read Only Memory
  • ROM Read Only Memory
  • Magnetic Memory Flash Memory
  • Magnetic or Optical Disk Magnetic Disk
  • Power supply assembly 806 provides power to various components of electronic device 800 .
  • Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
  • Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user.
  • the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user.
  • the touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action.
  • the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
  • Audio component 810 is configured to output and/or input audio signals.
  • audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode.
  • the received audio signal may be further stored in memory 804 or transmitted via communication component 816 .
  • audio component 810 also includes a speaker for outputting audio signals.
  • the I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
  • Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 .
  • the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 .
  • Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact.
  • Sensor assembly 814 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, for use in imaging applications.
  • CMOS complementary metal oxide semiconductor
  • CCD charge coupled device
  • the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
  • Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices.
  • the electronic device 800 can access a wireless network based on communication standards, such as wireless network (Wi-Fi), second generation mobile communication technology (2G), third generation mobile communication technology (3G), fourth generation mobile communication technology (4G) )/Long Term Evolution (LTE) of Universal Mobile Communications Technology, Fifth Generation Mobile Communications Technology (5G), or a combination thereof.
  • the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel.
  • the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication.
  • the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
  • RFID radio frequency identification
  • IrDA infrared data association
  • UWB ultra-wideband
  • Bluetooth Bluetooth
  • electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • ASICs application specific integrated circuits
  • DSPs digital signal processors
  • DSPDs digital signal processing devices
  • PLDs programmable logic devices
  • FPGA field programmable A programmed gate array
  • controller microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
  • a non-volatile computer-readable storage medium such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
  • FIG. 7 shows a block diagram of another electronic device provided by an embodiment of the present disclosure.
  • the electronic device 1900 may be provided as a server.
  • electronic device 1900 includes processing component 1922, which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922, such as applications.
  • An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions.
  • the processing component 1922 is configured to execute instructions to perform the above-described methods.
  • the electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 .
  • the electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft server operating system (Windows Server TM ), a graphical user interface based operating system (Mac OS X TM ) introduced by Apple, a multi-user multi-process computer operating system (Unix TM ), Free and Open Source Unix-like Operating System (Linux TM ), Open Source Unix-like Operating System (FreeBSD TM ) or the like.
  • Microsoft server operating system Windows Server TM
  • Mac OS X TM graphical user interface based operating system
  • Uniix TM multi-user multi-process computer operating system
  • Free and Open Source Unix-like Operating System Linux TM
  • FreeBSD TM Open Source Unix-like Operating System
  • a non-volatile computer-readable storage medium such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
  • the present disclosure may be a system, method and/or computer program product.
  • the computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present disclosure.
  • a computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • Non-exhaustive list of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above.
  • RAM random access memory
  • ROM read only memory
  • EPROM erasable programmable read only memory
  • flash memory static random access memory
  • SRAM static random access memory
  • CD-ROM compact disk read only memory
  • DVD digital versatile disk
  • memory sticks floppy disks
  • mechanically coded devices such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above.
  • Computer-readable storage media are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
  • the computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network.
  • the network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
  • Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages.
  • Source or object code written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages.
  • the computer readable program instructions 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 implement.
  • the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect).
  • LAN local area network
  • WAN wide area network
  • custom electronic circuits such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs) can be personalized by utilizing state information of computer readable program instructions.
  • Computer readable program instructions are executed to implement various aspects of the present disclosure.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
  • Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions.
  • the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • 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 in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
  • the computer program product can be specifically implemented by hardware, software or a combination thereof.
  • the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
  • a software development kit Software Development Kit, SDK
  • Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product.
  • the method includes: performing color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, For any one color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset value.
  • the image processing method provided according to the embodiment of the present disclosure can accurately determine the optical flow between the first image and the second image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Image Analysis (AREA)

Abstract

An image processing method and apparatus, a device, a storage medium, a program, and a program product. The method comprises: respectively performing color block segmentation on a first image and a second image to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to a first preset threshold value (S11); matching color blocks in the first color block segmentation result with color blocks in the second color block segmentation result to obtain a color block matching result between the first color block segmentation result and the second color block segmentation result (S12); and determining a first optical flow between the first image and the second image according to the color block matching result (S13).

Description

图像处理方法及装置、设备、存储介质、程序和程序产品Image processing method and apparatus, device, storage medium, program and program product
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202110276844.9、申请日为2021年03月15日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以全文引用的方式引入本公开。The present disclosure is based on the Chinese patent application with the application number of 202110276844.9 and the filing date of March 15, 2021, and claims the priority of the Chinese patent application. The entire contents of the Chinese patent application are hereby incorporated by reference into the present disclosure in their entirety. .
技术领域technical field
本公开涉及计算机视觉技术领域,尤其涉及一种图像处理方法及装置、设备、存储介质、程序和程序产品。The present disclosure relates to the technical field of computer vision, and in particular, to an image processing method and apparatus, device, storage medium, program and program product.
背景技术Background technique
光流(optical flow)法是图像分析的重要方法,是利用图像序列中相邻帧之间的相关性来找到上一帧与当前帧之间存在的对应关系,从而计算出相邻帧之间目标对象的运动信息的一种方法。光流表达了图像在时域上的变化。由于光流包含了图像中的目标对象的运动信息,因此可以被观察者用来确定目标对象的运动情况。对光流的研究成为计算机视觉及有关研究领域中的一个重要部分。准确地确定图像序列中相邻帧之间的光流,在视频插帧、视频压缩等方面具有重要意义。The optical flow method is an important method of image analysis. It uses the correlation between adjacent frames in the image sequence to find the corresponding relationship between the previous frame and the current frame, so as to calculate the relationship between adjacent frames. A method for the motion information of the target object. Optical flow expresses the change of the image in the temporal domain. Since the optical flow contains the motion information of the target object in the image, it can be used by the observer to determine the motion of the target object. The study of optical flow has become an important part of computer vision and related research fields. Accurately determining the optical flow between adjacent frames in an image sequence is of great significance in video frame interpolation and video compression.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供了一种图像处理方法及装置、设备、存储介质、程序和程序产品。Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product.
本公开实施例的一方面,提供了一种图像处理方法,包括:An aspect of the embodiments of the present disclosure provides an image processing method, including:
对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。Perform color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, for the first color block segmentation result For any color block in the color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset threshold; The color blocks in the first color block segmentation result are matched with the color blocks in the second color block segmentation result, and the color blocks between the first color block segmentation result and the second color block segmentation result are obtained. Matching result; determining the first optical flow between the first image and the second image according to the color patch matching result.
通过对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,并根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流,由此能够准确地确定所述第一图像与所述第二图像之间的光流。By performing color block segmentation on the first image and the second image respectively, a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained. For any one color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset threshold value, for The color patches in the first color patch segmentation result and the color patches in the second color patch segmentation result are matched to obtain the color between the first color patch segmentation result and the second color patch segmentation result. block matching result, and determine the first optical flow between the first image and the second image according to the color patch matching result, so that the first image and the second image can be accurately determined optical flow between.
在一种可能的实现方式中,在所述确定所述第一图像与所述第二图像之间的第一光流之后,所述方法还包括:根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, after the determining the first optical flow between the first image and the second image, the method further includes: according to the first image corresponding to the first image feature and the second image feature corresponding to the second image, optimize the first optical flow between the first image and the second image, and obtain a relationship between the first image and the second image the second optical flow.
在该实现方式中,通过在所述确定所述第一图像与所述第二图像之间的第一光流之后,根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,由此提高所确定的光流的准确性。对于非线性、运动幅度较大的应用场景,通过采用该实现方式,能够较大幅度地提高所确定的光流的准确性。In this implementation manner, after the first optical flow between the first image and the second image is determined, according to the first image feature corresponding to the first image and the second image corresponding The second image feature of , optimizes the first optical flow between the first image and the second image to obtain the second optical flow between the first image and the second image, thus Improve the accuracy of the determined optical flow. For an application scenario with nonlinearity and a large motion range, by adopting this implementation manner, the accuracy of the determined optical flow can be greatly improved.
在一种可能的实现方式中,所述第一图像和所述第二图像是目标视频中的相邻帧;在所述得到所述第一图像与所述第二图像之间的第二光流之后,所述方法还包括:根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧。In a possible implementation manner, the first image and the second image are adjacent frames in the target video; the second light between the obtained first image and the second image After streaming, the method further includes: according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the third image feature between the first image and the second image Two optical flows, determining the intermediate frame of the first image and the second image.
在该实现方式中,通过在所述得到所述第一图像与所述第二图像之间的第二光流之后,根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧,由此基于较准确的第二光流,能够得到较 高质量的中间帧,能够获得较平滑流畅的插帧效果。In this implementation manner, after obtaining the second optical flow between the first image and the second image, according to the third image feature corresponding to the first image and the second image corresponding The fourth image feature of , and the second optical flow between the first image and the second image, determine the intermediate frame of the first image and the second image, thus based on the more accurate second image Optical flow can obtain higher-quality intermediate frames, and can obtain smoother and smoother frame insertion effects.
在一种可能的实现方式中,所述对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,包括:对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果;根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。In a possible implementation manner, performing color block segmentation on the first image and the second image, respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block corresponding to the second image. The block segmentation result includes: performing edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image; an edge extraction result, performing color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; and performing color block segmentation on the second image according to the second edge extraction result , to obtain the second color block segmentation result corresponding to the second image.
在该实现方式中,通过对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果,根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果,并根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果,由此能够利用所述第一图像中的边缘信息,较准确地确定所述第一图像的色块分割结果,能够利用所述第二图像中的边缘信息,较准确地确定所述第二图像的色块分割结果。In this implementation manner, by performing edge extraction on the first image and the second image respectively, a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image are obtained. With the first edge extraction result, color block segmentation is performed on the first image to obtain a first color block segmentation result corresponding to the first image, and according to the second edge extraction result, color block segmentation is performed on the second image. block segmentation to obtain the second color block segmentation result corresponding to the second image, so that the edge information in the first image can be used to more accurately determine the color block segmentation result of the first image. The edge information in the second image is used to more accurately determine the color block segmentation result of the second image.
在一种可能的实现方式中,所述对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征;根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵;根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵;根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In a possible implementation manner, the matching of the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result is performed to obtain the first color block segmentation result and The color patch matching result between the second color patch segmentation results includes: performing feature extraction on the first image and the second image respectively to obtain the fifth image feature corresponding to the first image and the The sixth image feature corresponding to the second image; according to the first color block segmentation result and the fifth image feature, the first color block feature matrix corresponding to the first image is obtained; according to the second color block segmentation The result and the sixth image feature to obtain a second color block feature matrix corresponding to the second image; according to the first color block feature matrix and the second color block feature matrix, the first color block feature matrix The color patch in the segmentation result is matched with the color patch in the second color patch segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
根据该实现方式,能够基于所述第一图像和所述第二图像中的色块的视觉特征进行色块匹配,能够得到准确的色块匹配结果。According to this implementation, color patch matching can be performed based on the visual features of the color patches in the first image and the second image, and an accurate color patch matching result can be obtained.
在一种可能的实现方式中,所述根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵,包括:根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵;所述根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵,包括:根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵。In a possible implementation manner, the obtaining a first color block feature matrix corresponding to the first image according to the first color block segmentation result and the fifth image feature includes: according to the first color block feature matrix color block segmentation result, perform superpixel pooling on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and the sixth image to obtain the second color block feature matrix corresponding to the second image, including: performing superpixel pooling on the sixth image feature according to the second color block segmentation result, to obtain the second color block corresponding to the second image. The second color patch feature matrix.
通过根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵,并根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵,由此能够得到较高精度的色块特征矩阵。By performing superpixel pooling on the fifth image feature according to the first color block segmentation result, a first color block feature matrix corresponding to the first image is obtained, and according to the second color block segmentation result, Perform superpixel pooling on the sixth image feature to obtain a second color block feature matrix corresponding to the second image, thereby obtaining a color block feature matrix with higher precision.
在一种可能的实现方式中,所述根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:根据所述第一色块特征矩阵和所述第二色块特征矩阵,确定所述第一色块分割结果中的第一色块的特征与所述第二色块分割结果中的第二色块的特征之间的相似度,其中,所述第一色块为所述第一色块分割结果中的任意一个色块,所述第二色块为所述第二色块分割结果中的任意一个色块;根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度;根据所述第一色块分割结果中的色块与所述第二色块分割结果中的色块之间的匹配度,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In a possible implementation manner, according to the first color block feature matrix and the second color block feature matrix, the color block and the second color block in the first color block segmentation result are divided Matching the color blocks in the segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result, including: according to the first color patch feature matrix and the first color patch feature matrix A two-color block feature matrix to determine the similarity between the feature of the first color block in the first color block segmentation result and the feature of the second color block in the second color block segmentation result, wherein the The first color block is any color block in the first color block segmentation result, and the second color block is any color block in the second color block segmentation result; according to the first color block The similarity between the feature and the feature of the second color block determines the matching degree between the first color block and the second color block; according to the color block in the first color block segmentation result and The matching degree between the color patches in the second color patch segmentation result is obtained as a color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
根据该实现方式,能够利用所述第一图像的色块与所述第二图像的色块在视觉特征上的相似度准确地确定所述第一图像与所述第二图像之间的色块匹配结果。According to this implementation, the color patch between the first image and the second image can be accurately determined by using the similarity in visual features between the color patch of the first image and the color patch of the second image match results.
在一种可能的实现方式中,所述根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度,包括:根据所述第一色块与所述第二色块之间的尺寸差异和位置差异中的一项或两项,以及所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度。In a possible implementation manner, determining the difference between the first color block and the second color block according to the similarity between the feature of the first color block and the feature of the second color block The matching degree between the color blocks includes: according to one or both of the size difference and the position difference between the first color block and the second color block, and the characteristics of the first color block and the first color block. The similarity between the features of the two color blocks determines the matching degree between the first color block and the second color block.
在该实现方式中,通过利用尺寸差异和位置差异中的一项或两项,能够在视觉特征的基础上,调整所述第一图像的色块与所述第二图像的色块之间的匹配度,从而能够进一步提高所确定的色块匹配结果的准确性。In this implementation, by using one or both of the size difference and the position difference, the difference between the color blocks of the first image and the color blocks of the second image can be adjusted on the basis of visual features. The matching degree can be further improved, so that the accuracy of the determined color patch matching result can be further improved.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第一光流包括从所述第一图像至所述第二图像的第一光流和/或从所述第二图像至所述第一图像的第一光流。In a possible implementation manner, the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
在该实现方式中,通过确定双向的光流,能够提供更丰富的运动信息。In this implementation, by determining the bidirectional optical flow, more abundant motion information can be provided.
在一种可能的实现方式中,所述根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图 像之间的第二光流,包括:根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性;根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, according to the first image feature corresponding to the first image and the second image feature corresponding to the second image, the comparison between the first image and the second image is performed. The first optical flow is optimized to obtain the second optical flow between the first image and the second image, including: according to the first optical flow between the first image and the second image, determining the correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image; The first optical flow is optimized to obtain a second optical flow between the first image and the second image.
在该实现方式中,通过根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性,并根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,由此利用根据第一光流确定的第一图像特征与第二图像特征之间的相关性,来优化所述第一光流,从而能够提高优化得到的第二光流的准确性。In this implementation manner, the first image feature corresponding to the first image and the second image corresponding to the second image are determined according to the first optical flow between the first image and the second image The correlation between the features, and according to the correlation, the first optical flow between the first image and the second image is optimized to obtain the relationship between the first image and the second image The second optical flow of , so that the correlation between the first image feature and the second image feature determined according to the first optical flow is used to optimize the first optical flow, so that the optimized second optical flow can be improved. accuracy.
在一种可能的实现方式中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,包括:根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the first optical flow between the first image and the second image is optimized according to the correlation to obtain the first image and the second image The second optical flow between the images includes: performing multiple iterative optimizations on the first optical flow between the first image and the second image according to the correlation to obtain the first image and the second optical flow. the second optical flow between the second images.
在该实现方式中,通过对第一图像与第二图像之间的光流进行多次迭代优化,能够进一步提高优化得到的光流的准确性,能够更准确地确定非线性、运动幅度较大的图像之间的光流。In this implementation, by performing multiple iterative optimizations on the optical flow between the first image and the second image, the accuracy of the optical flow obtained by optimization can be further improved, and the nonlinearity and large motion range can be determined more accurately. optical flow between images.
在一种可能的实现方式中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流,包括:根据所述第一图像与所述第二图像之间的第一光流,以及所述第一图像的像素值和所述第二图像的像素值,得到所述第一光流对应的置信度图;根据所述置信度图对所述第一光流进行加权,得到所述第一光流对应的第1次优化的待优化光流;在第t次优化中,根据所述第t次优化的待优化光流、所述相关性以及所述第一图像特征,确定第t次优化的优化光流,并在t小于T的情况下,将第t次优化的优化光流作为第t+1次优化的待优化光流,其中,1≤t≤T,T表示预设的迭代优化次数,T大于或等于2;将第T次优化的优化光流确定为所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the first optical flow between the first image and the second image is iteratively optimized for multiple times according to the correlation, so as to obtain the relationship between the first image and the second image. The second optical flow between the second images includes: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image pixel value to obtain the confidence map corresponding to the first optical flow; weight the first optical flow according to the confidence map to obtain the optical flow to be optimized for the first optimization corresponding to the first optical flow ; In the t-th optimization, the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1≤t≤T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2; The sub-optimized optimized optical flow is determined as the second optical flow between the first image and the second image.
在该实现方式中,基于根据第一光流、第一图像的像素值和第二图像的像素值确定的置信度图,对第一光流进行多次迭代优化,从而能够使迭代优化得到的第二光流更能够准确地反映第一图像与第二图像之间的运动信息。In this implementation manner, based on the confidence map determined according to the first optical flow, the pixel value of the first image, and the pixel value of the second image, the first optical flow is iteratively optimized for multiple times, so that the iterative optimization can be obtained. The second optical flow can more accurately reflect the motion information between the first image and the second image.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第二光流包括从所述第一图像至所述第二图像的第二光流和从所述第二图像至所述第一图像的第二光流;所述根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧,包括:根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流;根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流;根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧。In a possible implementation manner, the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image. The second optical flow from the second image to the first image; the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the first image and the For the second optical flow between the second images, determining the intermediate frame between the first image and the second image includes: determining, according to the second optical flow from the first image to the second image, from the first image to the second image. a third optical flow from the first image to the intermediate frame; determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image Optical flow; determining the intermediate frame according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image.
在该实现方式中,利用第一图像与第二图像之间的双向的第二光流,能够准确地确定从所述第一图像至所述中间帧的第三光流和从所述第二图像至所述中间帧的第四光流,基于由此确定的第三光流和第四光流,以及第三图像特征和第四图像特征,能够准确地确定第一图像和第二图像的中间帧。In this implementation, using the bidirectional second optical flow between the first image and the second image, the third optical flow from the first image to the intermediate frame and the second optical flow from the first image to the intermediate frame can be accurately determined. The fourth optical flow from the image to the intermediate frame, based on the third optical flow and the fourth optical flow determined thereby, and the third image feature and the fourth image feature, can accurately determine the first image and the second image. intermediate frame.
在一种可能的实现方式中,所述根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流,包括:根据从所述第一图像至所述第二图像的第二光流,以及第一参数,确定从所述第一图像至所述中间帧的第三光流,其中,所述第一参数为第一时间间隔与第二时间间隔的比值,所述第一时间间隔为所述第一图像与所述中间帧之间的时间间隔,所述第二时间间隔为所述第一图像与所述第二图像之间的时间间隔;所述根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流,包括:根据从所述第二图像至所述第一图像的第二光流,以及所述第一参数,确定从所述第二图像至所述中间帧的第四光流。In a possible implementation manner, the determining, according to the second optical flow from the first image to the second image, the third optical flow from the first image to the intermediate frame includes: A third optical flow from the first image to the intermediate frame is determined according to the second optical flow from the first image to the second image and a first parameter, wherein the first parameter is A ratio of a first time interval to a second time interval, where the first time interval is the time interval between the first image and the intermediate frame, and the second time interval is the first image and the the time interval between the second images; the determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image, comprising: A fourth optical flow from the second image to the intermediate frame is determined based on the second optical flow from the second image to the first image, and the first parameter.
根据该实现方式,能够准确地确定所要求的时刻对应的中间帧。根据这个例子,还能够确定第一图像与第二图像之间的多个时刻的中间帧,从而能够在第一图像与第二图像之间插多个帧,得到更平滑流畅的视频。According to this implementation manner, the intermediate frame corresponding to the required moment can be accurately determined. According to this example, intermediate frames at multiple moments between the first image and the second image can also be determined, so that multiple frames can be inserted between the first image and the second image to obtain a smoother and smoother video.
在一种可能的实现方式中,所述根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧,包括:根据所述第三光流和所述第一图像,确定所述中间帧对应的第一前向映射结果;根据所述第三光流和所述第三图像特征,确定所述中间帧的图像特征对应的第二前向映射结果;根据所述第四光流和所述第二图像,确定所述中间帧对应的第三前向映射结果;根据所述第四光流和所述第四图像特征,确定所述中间帧的图像特征对应的第四前向映射结果;根据所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果,确定所述中间帧。In a possible implementation manner, according to the third optical flow and the fourth optical flow, and the third image feature corresponding to the first image and the fourth image feature corresponding to the second image , determining the intermediate frame, comprising: determining a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image; according to the third optical flow and the third image feature, determine the second forward mapping result corresponding to the image feature of the intermediate frame; determine the third forward mapping result corresponding to the intermediate frame according to the fourth optical flow and the second image; according to the The fourth optical flow and the fourth image feature determine a fourth forward mapping result corresponding to the image feature of the intermediate frame; according to the first forward mapping result, the second forward mapping result, the The third forward mapping result and the fourth forward mapping result determine the intermediate frame.
根据该实现方式,能够利用中间帧的图像的前向映射结果和图像特征的前向映射结果,准确地确定 中间帧。According to this implementation, the intermediate frame can be accurately determined by using the forward mapping result of the image of the intermediate frame and the forward mapping result of the image feature.
在一种可能的实现方式中,所述第一图像和所述第二图像为动画视频的视频帧。In a possible implementation manner, the first image and the second image are video frames of an animation video.
由于所述图像处理方法在确定图像之间的光流的过程中对像素之间的纹理匹配的依赖度较低,因此对于缺乏纹理的动画视频中的第一图像和第二图像进行处理,能够准确地确定第一图像与第二图像之间的光流。Since the image processing method has a low dependence on texture matching between pixels in the process of determining the optical flow between images, the processing of the first image and the second image in the animation video lacking texture can The optical flow between the first image and the second image is accurately determined.
本公开实施例的一方面,提供了一种图像处理装置,包括:An aspect of the embodiments of the present disclosure provides an image processing apparatus, including:
色块分割部分,配置为对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;匹配部分,配置为对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;第一确定部分,配置为根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。a color block segmentation part, configured to perform color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, Wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first color block. a preset threshold; the matching part is configured to match the color patches in the first color patch segmentation result with the color patches in the second color patch segmentation result, and obtain the first color patch segmentation result and the color patch in the second color patch segmentation result. a color patch matching result between the second color patch segmentation results; a first determining part is configured to determine a first optical flow between the first image and the second image according to the color patch matching result.
在一种可能的实现方式中,所述装置还包括:优化部分,配置为根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the apparatus further includes: an optimization part configured to perform an optimization on the first image according to the first image feature corresponding to the first image and the second image feature corresponding to the second image The first optical flow between the image and the second image is optimized to obtain a second optical flow between the first image and the second image.
在一种可能的实现方式中,所述第一图像和所述第二图像是目标视频中的相邻帧;所述装置还包括:第二确定部分,配置为根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧。In a possible implementation manner, the first image and the second image are adjacent frames in the target video; the apparatus further includes: a second determining part configured to The third image feature and the fourth image feature corresponding to the second image, and the second optical flow between the first image and the second image, determine the difference between the first image and the second image intermediate frame.
在一种可能的实现方式中,所述色块分割部分配置为:对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果;根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。In a possible implementation manner, the color block segmentation part is configured to: perform edge extraction on the first image and the second image respectively, to obtain a first edge extraction result corresponding to the first image and the second image The corresponding second edge extraction result; according to the first edge extraction result, color block segmentation is performed on the first image to obtain the first color block segmentation result corresponding to the first image; according to the second edge extraction As a result, color block segmentation is performed on the second image to obtain a second color block segmentation result corresponding to the second image.
在一种可能的实现方式中,所述匹配部分配置为:对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征;根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵;根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵;根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In a possible implementation manner, the matching part is configured to: perform feature extraction on the first image and the second image respectively, so as to obtain the fifth image feature corresponding to the first image and the second image feature. The sixth image feature corresponding to the image; according to the first color block segmentation result and the fifth image feature, the first color block feature matrix corresponding to the first image is obtained; according to the second color block segmentation result and obtaining the second color block feature matrix corresponding to the second image from the sixth image feature; and obtaining the first color block segmentation result according to the first color block feature matrix and the second color block feature matrix The color blocks in the color block are matched with the color blocks in the second color block segmentation result, and the color block matching result between the first color block segmentation result and the second color block segmentation result is obtained.
在一种可能的实现方式中,所述匹配部分配置为:根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵;根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵。In a possible implementation manner, the matching part is configured to: perform superpixel pooling on the fifth image feature according to the first color block segmentation result to obtain the first color corresponding to the first image block feature matrix; according to the second color block segmentation result, perform superpixel pooling on the sixth image feature to obtain a second color block feature matrix corresponding to the second image.
在一种可能的实现方式中,所述匹配部分配置为:根据所述第一色块特征矩阵和所述第二色块特征矩阵,确定所述第一色块分割结果中的第一色块的特征与所述第二色块分割结果中的第二色块的特征之间的相似度,其中,所述第一色块为所述第一色块分割结果中的任意一个色块,所述第二色块为所述第二色块分割结果中的任意一个色块;根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度;根据所述第一色块分割结果中的色块与所述第二色块分割结果中的色块之间的匹配度,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In a possible implementation manner, the matching part is configured to: determine the first color block in the first color block segmentation result according to the first color block feature matrix and the second color block feature matrix The similarity between the feature of the second color block and the feature of the second color block in the second color block segmentation result, wherein, the first color block is any color block in the first color block segmentation result, so The second color block is any color block in the second color block segmentation result; according to the similarity between the characteristics of the first color block and the characteristics of the second color block, the first color block is determined. The matching degree between the color block and the second color block; according to the matching degree between the color block in the first color block segmentation result and the color block in the second color block segmentation result, the obtained The color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
在一种可能的实现方式中,所述匹配部分配置为:根据所述第一色块与所述第二色块之间的尺寸差异和位置差异中的一项或两项,以及所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度。In a possible implementation manner, the matching part is configured to: according to one or both of a size difference and a position difference between the first color block and the second color block, and the first color block The similarity between the feature of a color block and the feature of the second color block determines the matching degree between the first color block and the second color block.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第一光流包括从所述第一图像至所述第二图像的第一光流和/或从所述第二图像至所述第一图像的第一光流。In a possible implementation manner, the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
在一种可能的实现方式中,所述优化部分配置为:根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性;根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the optimization part is configured to: determine, according to the first optical flow between the first image and the second image, the first image feature corresponding to the first image and the the correlation between the second image features corresponding to the second image; according to the correlation, optimize the first optical flow between the first image and the second image to obtain the first image and a second optical flow between the second image.
在一种可能的实现方式中,所述优化部分配置为:根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the optimization part is configured to: according to the correlation, perform multiple iterative optimizations on the first optical flow between the first image and the second image to obtain the a second optical flow between the first image and the second image.
在一种可能的实现方式中,所述优化部分配置为:根据所述第一图像与所述第二图像之间的第一光流,以及所述第一图像的像素值和所述第二图像的像素值,得到所述第一光流对应的置信度图;根据所述置信度图对所述第一光流进行加权,得到所述第一光流对应的第1次优化的待优化光流;在第t次优化中,根据所述第t次优化的待优化光流、所述相关性以及所述第一图像特征,确定第t次优化的优化光流,并在 t小于T的情况下,将第t次优化的优化光流作为第t+1次优化的待优化光流,其中,1≤t≤T,T表示预设的迭代优化次数,T大于或等于2;将第T次优化的优化光流确定为所述第一图像与所述第二图像之间的第二光流。In a possible implementation manner, the optimization part is configured to: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the second image The pixel value of the image is obtained, and the confidence map corresponding to the first optical flow is obtained; the first optical flow is weighted according to the confidence map to obtain the first optimization corresponding to the first optical flow to be optimized. Optical flow; in the t-th optimization, the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T In the case of , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1≤t≤T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2; The optimized optical flow of the T-th optimization is determined as the second optical flow between the first image and the second image.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第二光流包括从所述第一图像至所述第二图像的第二光流和从所述第二图像至所述第一图像的第二光流;所述第二确定部分配置为:根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流;根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流;根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧。In a possible implementation manner, the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image. The second optical flow from the two images to the first image; the second determining part is configured to: determine the second optical flow from the first image to the second image according to the second optical flow from the first image to the second image a third optical flow of the intermediate frame; determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image; according to the The third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, determine the intermediate frame.
在一种可能的实现方式中,所述第二确定部分配置为:根据从所述第一图像至所述第二图像的第二光流,以及第一参数,确定从所述第一图像至所述中间帧的第三光流,其中,所述第一参数为第一时间间隔与第二时间间隔的比值,所述第一时间间隔为所述第一图像与所述中间帧之间的时间间隔,所述第二时间间隔为所述第一图像与所述第二图像之间的时间间隔;根据从所述第二图像至所述第一图像的第二光流,以及所述第一参数,确定从所述第二图像至所述中间帧的第四光流。In a possible implementation manner, the second determining part is configured to: determine the distance from the first image to the second image according to the second optical flow from the first image to the second image and the first parameter The third optical flow of the intermediate frame, wherein the first parameter is the ratio of the first time interval to the second time interval, and the first time interval is the difference between the first image and the intermediate frame. time interval, the second time interval is the time interval between the first image and the second image; according to the second optical flow from the second image to the first image, and the first A parameter that determines a fourth optical flow from the second image to the intermediate frame.
在一种可能的实现方式中,所述第二确定部分配置为:根据所述第三光流和所述第一图像,确定所述中间帧对应的第一前向映射结果;根据所述第三光流和所述第三图像特征,确定所述中间帧的图像特征对应的第二前向映射结果;根据所述第四光流和所述第二图像,确定所述中间帧对应的第三前向映射结果;根据所述第四光流和所述第四图像特征,确定所述中间帧的图像特征对应的第四前向映射结果;根据所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果,确定所述中间帧。In a possible implementation manner, the second determining part is configured to: determine a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image; The third optical flow and the third image feature are used to determine the second forward mapping result corresponding to the image feature of the intermediate frame; according to the fourth optical flow and the second image, the first forward mapping result corresponding to the intermediate frame is determined. Three forward mapping results; according to the fourth optical flow and the fourth image feature, determine the fourth forward mapping result corresponding to the image feature of the intermediate frame; according to the first forward mapping result, the The second forward mapping result, the third forward mapping result and the fourth forward mapping result determine the intermediate frame.
在一种可能的实现方式中,所述第一图像和所述第二图像为动画视频的视频帧。In a possible implementation manner, the first image and the second image are video frames of an animation video.
本公开实施例的一方面,提供了一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。An aspect of an embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to call the memory Stored executable instructions to perform the above method.
本公开实施例的一方面,提供了一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。An aspect of the embodiments of the present disclosure provides a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented.
本公开实施例的一方面,提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现上述方法。An aspect of the embodiments of the present disclosure provides a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, the processor in the electronic device executes to implement the above method.
本公开实施例的一方面,提供了一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序产品陪计算机读取并执行时实现上述方法。In one aspect of the embodiments of the present disclosure, a computer program product is provided, the computer program product includes a non-transitory computer-readable storage medium storing a computer program, and the computer program product realizes the above when read and executed by a computer. method.
在本公开实施例中,通过对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,并根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流,由此能够准确地确定所述第一图像与所述第二图像之间的光流。由于本公开实施例提供的图像处理方法在确定图像之间的光流的过程中对像素之间的纹理匹配的依赖度较低,因此本公开实施例提供的图像处理方法也能够准确地确定缺少纹理的图像之间的光流。In the embodiment of the present disclosure, by performing color block segmentation on the first image and the second image respectively, a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to The first preset threshold is to match the color blocks in the first color block segmentation result with the color blocks in the second color block segmentation result, and obtain the first color block segmentation result and the second color block. The color patch matching result between the block segmentation results, and the first optical flow between the first image and the second image is determined according to the color patch matching result, so that the first optical flow can be accurately determined optical flow between the image and the second image. Since the image processing method provided by the embodiment of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between the images, the image processing method provided by the embodiment of the present disclosure can also accurately determine the lack of Optical flow between textured images.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本公开。It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
根据下面参考附图对示例性实施例的详细说明,本公开的其它特征及方面将变得清楚。Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the accompanying drawings.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开的技术方案。The accompanying drawings, which are incorporated into and constitute a part of this specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the present disclosure.
图1示出本公开实施例提供的图像处理方法的流程图。FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure.
图2示出本公开实施例提供的一种应用场景的示意图。FIG. 2 shows a schematic diagram of an application scenario provided by an embodiment of the present disclosure.
图3示出本公开实施例提供的色块匹配模块的示意图。FIG. 3 shows a schematic diagram of a color patch matching module provided by an embodiment of the present disclosure.
图4示出本公开实施例提供的光流优化模块的示意图。FIG. 4 shows a schematic diagram of an optical flow optimization module provided by an embodiment of the present disclosure.
图5示出本公开实施例提供的图像处理装置的框图。FIG. 5 shows a block diagram of an image processing apparatus provided by an embodiment of the present disclosure.
图6示出本公开实施例提供的一种电子设备的框图。FIG. 6 shows a block diagram of an electronic device provided by an embodiment of the present disclosure.
图7示出本公开实施例提供的另一种电子设备的框图。FIG. 7 shows a block diagram of another electronic device provided by an embodiment of the present disclosure.
具体实施方式Detailed ways
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。附图中相同的附图标记表示功能相同或相似的元件。尽管在附图中示出了实施例的各种方面,但是除非特别指出,不必按比例绘制附图。Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numbers in the figures denote elements that have the same or similar functions. While various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated.
在这里专用的词“示例性”意为“用作例子、实施例或说明性”。这里作为“示例性”所说明的任何实施例不必解释为优于或好于其它实施例。The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration." Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
另外,为了更好地说明本公开,在下文的具体实施方式中给出了众多的具体细节。本领域技术人员应当理解,没有某些具体细节,本公开同样可以实施。在一些实例中,对于本领域技术人员熟知的方法、手段、元件和电路未作详细描述,以便于凸显本公开的主旨。In addition, in order to better illustrate the present disclosure, numerous specific details are set forth in the following detailed description. It will be understood by those skilled in the art that the present disclosure may be practiced without certain specific details. In some instances, methods, means, components and circuits well known to those skilled in the art have not been described in detail so as not to obscure the subject matter of the present disclosure.
本公开实施例提供了一种图像处理方法及装置、设备、存储介质、程序和程序产品,通过对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,并根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流,由此能够准确地确定所述第一图像与所述第二图像之间的光流。由于本公开实施例提供的图像处理方法在确定图像之间的光流的过程中对像素之间的纹理匹配的依赖度较低,因此本公开实施例提供的图像处理方法也能够准确地确定缺少纹理的图像之间的光流。Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product. By performing color block segmentation on a first image and a second image, respectively, a first color corresponding to the first image is obtained. The block segmentation result and the second color block segmentation result corresponding to the second image, wherein, for any color block in the first color block segmentation result and the second color block segmentation result, in the color block The absolute value of the difference between the pixel values of any two pixels is less than or equal to the first preset threshold, and the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result are analyzed. matching, obtain the color patch matching result between the first color patch segmentation result and the second color patch segmentation result, and determine the difference between the first image and the second image according to the color patch matching result. Therefore, the optical flow between the first image and the second image can be accurately determined. Since the image processing method provided by the embodiment of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between the images, the image processing method provided by the embodiment of the present disclosure can also accurately determine the lack of Optical flow between textured images.
下面结合附图对本公开实施例提供的图像处理方法进行详细的说明。The image processing method provided by the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
图1示出本公开实施例提供的图像处理方法的流程图。在一种可能的实现方式中,所述图像处理方法可以由终端设备或服务器或其它处理设备执行。其中,终端设备可以是用户设备(User Equipment,UE)、移动设备、用户终端、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备或者可穿戴设备等。在一些可能的实现方式中,所述图像处理方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。如图1所示,所述图像处理方法包括步骤S11至步骤S13。FIG. 1 shows a flowchart of an image processing method provided by an embodiment of the present disclosure. In a possible implementation manner, the image processing method may be executed by a terminal device or a server or other processing device. The terminal device may be a user equipment (User Equipment, UE), a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant (Personal Digital Assistant, PDA), a handheld device, a computing device, a vehicle-mounted device, or a wearable devices, etc. In some possible implementations, the image processing method may be implemented by a processor invoking computer-readable instructions stored in a memory. As shown in FIG. 1 , the image processing method includes steps S11 to S13.
在步骤S11中,对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值。In step S11, color block segmentation is performed on the first image and the second image respectively to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, For any one color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset value. Set the threshold.
在步骤S12中,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In step S12, the color patches in the first color patch segmentation result and the color patches in the second color patch segmentation result are matched to obtain the first color patch segmentation result and the second color patch Patch matching results between segmentation results.
在步骤S13中,根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。In step S13, a first optical flow between the first image and the second image is determined according to the color patch matching result.
在本公开实施例中,所述第一图像和所述第二图像可以是两个相关的图像。例如,所述第一图像和所述第二图像可以是属于同一个图像序列的两个图像,又如,所述第一图像和所述第二图像可以是在邻近的时间对相同的地点或者相同的对象采集得到的两个图像。例如,所述第一图像和所述第二图像可以是目标视频中的两个视频帧。其中,所述目标视频可以是动画视频或者游戏视频,还可以是缺乏纹理的实景视频,也可以是其他任意类型的视频,在此不作限定。其中,实景视频指的是对真实世界进行视频采集得到的视频。In an embodiment of the present disclosure, the first image and the second image may be two related images. For example, the first image and the second image may be two images belonging to the same sequence of images, in another example, the first image and the second image may be of the same location at adjacent times or Two images acquired from the same subject. For example, the first image and the second image may be two video frames in the target video. Wherein, the target video may be an animation video or a game video, or may be a real-life video lacking texture, or may be any other type of video, which is not limited herein. The live video refers to a video obtained by video collection of the real world.
在一种可能的实现方式中,所述第一图像和所述第二图像为动画视频的视频帧。由于本公开实施例提供的图像处理方法在确定图像之间的光流的过程中对像素之间的纹理匹配的依赖度较低,因此对于缺乏纹理的动画视频中的第一图像和第二图像进行光流估计,能够准确地确定第一图像与第二图像之间的光流。In a possible implementation manner, the first image and the second image are video frames of an animation video. Since the image processing method provided by the embodiments of the present disclosure has a low dependence on the texture matching between pixels in the process of determining the optical flow between images, the first image and the second image in the animation video lacking texture are less dependent on the texture matching between the pixels. By performing optical flow estimation, the optical flow between the first image and the second image can be accurately determined.
在本公开实施例中,第一色块分割结果可以表示第一图像的色块分割结果,第二色块分割结果可以表示第二图像的色块分割结果。例如,第一图像可以记为I 0,第二图像可以记为I 1,第一图像I 0中像素x的像素值可以用I 0(x)来表示,第二图像I 1中像素x的像素值可以用I 1(x)来表示。第一色块分割结果和第二色块分割结果可以采用图、矩阵、数组等数据形式来表示,在此不作限定。例如,第一色块分割结果可以是与第一图像尺寸相同的图。在第一色块分割结果中,属于不同色块的像素的标签值可以不同,属于同一色块的像素的标签值可以相同。例如,第一色块分割结果包括K 0个色块,即,第一图像包括K 0 个色块,其中,K 0≥2。在第一色块分割结果中,属于第1个色块的各个像素的标签值均为1,属于第2个色块的各个像素的标签值均为2,……,属于第K 0个色块的各个像素的标签值均为K 0。第二色块分割结果与第一色块分割结果类似。在一个例子中,S 0(i)可以表示第一图像中的第i个色块,S 1(j)可以表示第二图像中的第j个色块。 In the embodiment of the present disclosure, the first color block segmentation result may represent the color block segmentation result of the first image, and the second color block segmentation result may represent the color block segmentation result of the second image. For example, the first image may be denoted as I 0 , the second image may be denoted as I 1 , the pixel value of the pixel x in the first image I 0 may be denoted by I 0 (x), and the value of the pixel x in the second image I 1 may be denoted by I 0 (x). The pixel value can be represented by I 1 (x). The first color block segmentation result and the second color block segmentation result may be represented by data forms such as graphs, matrices, and arrays, which are not limited herein. For example, the first color block segmentation result may be a map of the same size as the first image. In the first color block segmentation result, the label values of pixels belonging to different color blocks may be different, and the label values of pixels belonging to the same color block may be the same. For example, the first color block segmentation result includes K 0 color blocks, that is, the first image includes K 0 color blocks, where K 0 ≥2. In the first color block segmentation result, the label value of each pixel belonging to the first color block is 1, and the label value of each pixel belonging to the second color block is 2, ..., belonging to the K 0th color The label value of each pixel of the block is K 0 . The second color patch segmentation result is similar to the first color patch segmentation result. In one example, S 0 (i) may represent the i-th color patch in the first image, and S 1 (j) may represent the j-th color patch in the second image.
在本公开实施例中,经过色块分割得到的任意一个色块中,任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值,即,同一色块中的不同像素的像素值较接近。在一种可能的实现方式中,任一色块中的不同像素具有相同的语义信息,即,同一色块中的各个像素均具有相同的语义信息。例如,色块1中的各像素的语义信息均为手臂,色块2中的各像素的语义信息均为头部,色块3中的各像素的语义信息均为帽子,色块4中的各像素的语义信息均为雨伞,等等。在另一种可能的实现方式中,同一色块中的不同像素也可以具有不同的语义信息,只要同一色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值即可。在一种可能的实现方式中,所述第一色块分割结果和所述第二色块分割结果中的任意一个色块的尺寸大于或等于第二预设阈值。例如,第二预设阈值可以为50像素。在该实现方式中,可以忽略尺寸小于第二预设阈值的色块,即,第一色块分割结果和第二色块分割结果中可以不包括尺寸小于第二预设阈值的色块。在另一种可能的实现方式中,可以不对色块的尺寸进行限定。在一种可能的实现方式中,任意一个色块中的各个像素属于同一个连通域。在另一种可能的实现方式中,任意一个色块可以包括一个或多个连通域。In the embodiment of the present disclosure, in any color block obtained by color block segmentation, the absolute value of the difference between the pixel values of any two pixels is less than or equal to the first preset threshold, that is, different pixels in the same color block pixel values are closer. In a possible implementation manner, different pixels in any color block have the same semantic information, that is, each pixel in the same color block has the same semantic information. For example, the semantic information of each pixel in color block 1 is arm, the semantic information of each pixel in color block 2 is head, the semantic information of each pixel in color block 3 is hat, and the semantic information of each pixel in color block 4 is hat, The semantic information of each pixel is an umbrella, and so on. In another possible implementation manner, different pixels in the same color block may also have different semantic information, as long as the absolute value of the difference between the pixel values of any two pixels in the same color block is less than or equal to the first preset value You can set a threshold. In a possible implementation manner, the size of any one color block in the first color block segmentation result and the second color block segmentation result is greater than or equal to a second preset threshold. For example, the second preset threshold may be 50 pixels. In this implementation, color blocks whose size is smaller than the second preset threshold may be ignored, that is, the first color block segmentation result and the second color block segmentation result may not include color blocks whose size is smaller than the second preset threshold. In another possible implementation manner, the size of the color block may not be limited. In a possible implementation manner, each pixel in any color block belongs to the same connected domain. In another possible implementation, any color block may include one or more connected domains.
在一种可能的实现方式中,所述对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,包括:对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果;根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。在该实现方式中,第一边缘提取结果表示第一图像的边缘提取结果,第二边缘提取结果表示第二图像的边缘提取结果。第一边缘提取结果可以包括第一图像中的边缘所在的像素的位置信息,第二边缘提取结果可以包括第二图像中的边缘所在的像素的位置信息。In a possible implementation manner, performing color block segmentation on the first image and the second image, respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block corresponding to the second image. The block segmentation result includes: performing edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image; an edge extraction result, performing color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; and performing color block segmentation on the second image according to the second edge extraction result , to obtain the second color block segmentation result corresponding to the second image. In this implementation manner, the first edge extraction result represents the edge extraction result of the first image, and the second edge extraction result represents the edge extraction result of the second image. The first edge extraction result may include location information of the pixel where the edge is located in the first image, and the second edge extraction result may include location information of the pixel where the edge is located in the second image.
作为该实现方式的一个示例,可以使用5×5的拉普拉斯高斯算子(Laplacian of Gaussian,LoG)分别对第一图像和第二图像进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果。在其他示例中,也可以采用Sobel算子、Roberts算子等对第一图像和第二图像进行边缘提取,在此不作限定。As an example of this implementation, a 5×5 Laplacian of Gaussian (LoG) can be used to perform edge extraction on the first image and the second image, respectively, to obtain the first image corresponding to the first image. An edge extraction result and a second edge extraction result corresponding to the second image. In other examples, the Sobel operator, the Roberts operator, etc. may also be used to perform edge extraction on the first image and the second image, which is not limited herein.
作为该实现方式的一个示例,根据所述第一边缘提取结果,可以采用Trapped-ball算法对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;根据所述第二边缘提取结果,可以采用Trapped-ball算法对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。在其他示例中,还可以超像素分割的方法等方法对第一图像和第二图像进行色块分割,在此不作限定。As an example of this implementation, according to the first edge extraction result, the Trapped-ball algorithm may be used to perform color block segmentation on the first image to obtain a first color block segmentation result corresponding to the first image; according to For the second edge extraction result, a Trapped-ball algorithm may be used to perform color block segmentation on the second image, to obtain a second color block segmentation result corresponding to the second image. In other examples, color block segmentation may also be performed on the first image and the second image by methods such as superpixel segmentation, which is not limited herein.
在该实现方式中,通过对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果,根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果,并根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果,由此能够利用所述第一图像中的边缘信息,较准确地确定所述第一图像的色块分割结果,能够利用所述第二图像中的边缘信息,较准确地确定所述第二图像的色块分割结果。In this implementation manner, by performing edge extraction on the first image and the second image respectively, a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image are obtained. With the first edge extraction result, color block segmentation is performed on the first image to obtain a first color block segmentation result corresponding to the first image, and according to the second edge extraction result, color block segmentation is performed on the second image. block segmentation to obtain the second color block segmentation result corresponding to the second image, so that the edge information in the first image can be used to more accurately determine the color block segmentation result of the first image. The edge information in the second image is used to more accurately determine the color block segmentation result of the second image.
在其他可能的实现方式中,还可以不利用边缘信息,而基于像素的像素值以及像素之间的位置关系进行色块分割。In other possible implementation manners, instead of using edge information, color block segmentation may be performed based on pixel values of pixels and the positional relationship between pixels.
在本公开实施例中,所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,可以表示第一图像与第二图像中相匹配的色块的信息。即,根据所述色块匹配结果,可以确定第一图像的某一色块与第二图像的哪个色块相匹配。In the embodiment of the present disclosure, the color patch matching result between the first color patch segmentation result and the second color patch segmentation result may represent information of color patches matched in the first image and the second image. That is, according to the color patch matching result, it can be determined which color patch of the first image matches with which color patch of the second image.
在一种可能的实现方式中,所述对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征;根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵;根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵;根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。In a possible implementation manner, the matching of the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result is performed to obtain the first color block segmentation result and The color patch matching result between the second color patch segmentation results includes: performing feature extraction on the first image and the second image respectively to obtain the fifth image feature corresponding to the first image and the The sixth image feature corresponding to the second image; according to the first color block segmentation result and the fifth image feature, the first color block feature matrix corresponding to the first image is obtained; according to the second color block segmentation The result and the sixth image feature to obtain a second color block feature matrix corresponding to the second image; according to the first color block feature matrix and the second color block feature matrix, the first color block feature matrix The color patch in the segmentation result is matched with the color patch in the second color patch segmentation result to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
在该实现方式中,可以采用预先训练的VGGNet对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征。其中,所述第五图像特征 和所述第六图像特征可以分别包括N级,其中,N大于或等于1。例如,所述预先训练的VGGNet可以包括19层,即,所述预先训练的VGGNet可以可以是VGG-19;将第一图像输入所述预先训练的VGGNet后,可以将relu1_2、relu2_2、relu3_4和relu4_4这四层的输出分别作为所述第一图像对应的第五图像特征,即,第五图像特征可以包括4级图像特征;将第二图像输入所述预先训练的VGGNet后,可以将relu1_2、relu2_2、relu3_4和relu4_4这四层的输出分别作为所述第二图像对应的第六图像特征,即,第六图像特征可以包括4级图像特征。其中,relu1_2输出的图像特征可以包括64个通道,relu2_2输出的图像特征可以包括128个通道,relu3_4输出的图像特征可以包括256个通道,relu4_4输出的图像特征可以包括512个通道。In this implementation manner, a pre-trained VGGNet may be used to perform feature extraction on the first image and the second image, respectively, to obtain the fifth image feature corresponding to the first image and the first image feature corresponding to the second image. Six image features. Wherein, the fifth image feature and the sixth image feature may respectively include N levels, where N is greater than or equal to 1. For example, the pre-trained VGGNet may include 19 layers, that is, the pre-trained VGGNet may be VGG-19; after the first image is input into the pre-trained VGGNet, relu1_2, relu2_2, relu3_4 and relu4_4 The outputs of these four layers are respectively used as the fifth image feature corresponding to the first image, that is, the fifth image feature may include 4-level image features; after the second image is input into the pre-trained VGGNet, relu1_2, relu2_2 The outputs of the four layers of , relu3_4 and relu4_4 are respectively used as the sixth image feature corresponding to the second image, that is, the sixth image feature may include 4-level image features. The image features output by relu1_2 may include 64 channels, the image features output by relu2_2 may include 128 channels, the image features output by relu3_4 may include 256 channels, and the image features output by relu4_4 may include 512 channels.
例如,若第一图像I 0对应的第五图像特征包括N级图像特征,第一色块分割结果S 0包括K 0个色块,那么,第一色块特征矩阵F 0可以是K 0×N的矩阵,其中,第一色块特征矩阵F 0的第i行对应第一色块分割结果S 0中的第i个色块的特征,即,第一图像I 0中的每个色块可以包括N维特征。相应地,若第二图像I 1对应的第六图像特征包括N级图像特征,第二色块分割结果S 1包括K 1个色块,那么,第二色块特征矩阵F 1可以是K 1×N的矩阵,其中,第二色块特征矩阵F 1的第j行对应第二色块分割结果S 1中的第j个色块的特征,即,第二图像I 1中的每个色块可以包括N维特征。 For example, if the fifth image feature corresponding to the first image I 0 includes N-level image features, and the first color block segmentation result S 0 includes K 0 color blocks, then the first color block feature matrix F 0 may be K 0 × A matrix of N, where the ith row of the first color patch feature matrix F 0 corresponds to the feature of the ith color patch in the first color patch segmentation result S 0 , that is, each color patch in the first image I 0 N-dimensional features can be included. Correspondingly, if the sixth image feature corresponding to the second image I 1 includes N-level image features, and the second color block segmentation result S 1 includes K 1 color blocks, then the second color block feature matrix F 1 may be K 1 ×N matrix, where the jth row of the second color patch feature matrix F1 corresponds to the feature of the jth color patch in the second color patch segmentation result S1, that is, each color patch in the second image I1 A block may include N-dimensional features.
在该实现方式中,通过对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征,根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵,根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵,根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,由此能够基于所述第一图像和所述第二图像中的色块的视觉特征进行色块匹配,从而能够得到准确的色块匹配结果。In this implementation manner, by performing feature extraction on the first image and the second image respectively, the fifth image feature corresponding to the first image and the sixth image feature corresponding to the second image are obtained. From the first color block segmentation result and the fifth image feature, a first color block feature matrix corresponding to the first image is obtained, and according to the second color block segmentation result and the sixth image feature, the obtained color block is obtained. the second color block feature matrix corresponding to the second image, according to the first color block feature matrix and the second color block feature matrix, the color blocks in the first color block segmentation result and the second color block feature matrix The color patches in the color patch segmentation result are matched to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result, so that it can be based on the first image and the first color patch. The visual features of the color patches in the two images are color patch matched, so that an accurate color patch matching result can be obtained.
作为该实现方式的一个示例,所述根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵,包括:根据所述第一色块分割结果,对所述第五图像特征进行超像素池化(Super-pixel pooling),得到所述第一图像对应的第一色块特征矩阵;所述根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵,包括:根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵。在该示例中,通过根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵,并根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵,由此能够得到较高精度的色块特征矩阵。As an example of this implementation, the obtaining a first color block feature matrix corresponding to the first image according to the first color block segmentation result and the fifth image feature includes: according to the first color block The block segmentation result is to perform super-pixel pooling (Super-pixel pooling) on the fifth image feature to obtain a first color block feature matrix corresponding to the first image; the second color block segmentation result and For the sixth image feature, obtaining a second color block feature matrix corresponding to the second image includes: performing superpixel pooling on the sixth image feature according to the second color block segmentation result to obtain the second color block feature matrix. The second color block feature matrix corresponding to the second image. In this example, by performing superpixel pooling on the fifth image feature according to the first color block segmentation result, a first color block feature matrix corresponding to the first image is obtained, and according to the second color block feature matrix As a result of the color block segmentation, superpixel pooling is performed on the sixth image feature to obtain a second color block feature matrix corresponding to the second image, so that a higher-precision color block feature matrix can be obtained.
在其他示例中,还可以采用平均池化、全连接等方式得到第一色块特征矩阵和第二色块特征矩阵,在此不作限定。In other examples, the first color block feature matrix and the second color block feature matrix may also be obtained by means of average pooling, full connection, etc., which are not limited herein.
作为该实现方式的一个示例,所述根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:根据所述第一色块特征矩阵和所述第二色块特征矩阵,确定所述第一色块分割结果中的第一色块的特征与所述第二色块分割结果中的第二色块的特征之间的相似度,其中,所述第一色块为所述第一色块分割结果中的任意一个色块,所述第二色块为所述第二色块分割结果中的任意一个色块;根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度;根据所述第一色块分割结果中的色块与所述第二色块分割结果中的色块之间的匹配度,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。根据该示例,能够利用所述第一图像的色块与所述第二图像的色块在视觉特征上的相似度准确地确定所述第一图像与所述第二图像之间的色块匹配结果。As an example of this implementation, the color block and the second color block in the first color block segmentation result are divided according to the first color block feature matrix and the second color block feature matrix. Matching the color blocks in the result to obtain a color block matching result between the first color block segmentation result and the second color block segmentation result, including: according to the first color block feature matrix and the second color block feature matrix A color patch feature matrix, determining the similarity between the feature of the first color patch in the first color patch segmentation result and the feature of the second color patch in the second color patch segmentation result, wherein the first color patch A color block is any color block in the first color block segmentation result, and the second color block is any color block in the second color block segmentation result; according to the characteristics of the first color block The similarity between the features of the second color block and the second color block is used to determine the matching degree between the first color block and the second color block; according to the color block in the first color block segmentation result and all The matching degree between the color patches in the second color patch segmentation result is obtained, and the color patch matching result between the first color patch segmentation result and the second color patch segmentation result is obtained. According to this example, the color patch matching between the first image and the second image can be accurately determined by using the similarity in visual features of the color patches of the first image and the color patches of the second image result.
例如,第一色块分割结果S 0中的第i个色块的第n个特征的正则化结果
Figure PCTCN2021106895-appb-000001
第二色块分割结果S 1的第j个色块的第n个特征的正则化结果
Figure PCTCN2021106895-appb-000002
则色块i与色块j的特征之间的相似度A(i,j)可以采用如下(式1)确定:
For example, the regularization result of the n-th feature of the i-th color patch in the first color patch segmentation result S 0
Figure PCTCN2021106895-appb-000001
Regularization result of the n-th feature of the j- th color patch of the second color patch segmentation result S1
Figure PCTCN2021106895-appb-000002
Then the similarity A(i,j) between the features of color block i and color block j can be determined by the following (Equation 1):
Figure PCTCN2021106895-appb-000003
Figure PCTCN2021106895-appb-000003
在一个例子中,可以采用
Figure PCTCN2021106895-appb-000004
记录与第一图像中的各个色块匹配的第二图像中的色块的信息,例如,
Figure PCTCN2021106895-appb-000005
可以表示与第一图像中的色块i匹配的第二图像的色块。可以采用
Figure PCTCN2021106895-appb-000006
记录与第二图像中的各个色块匹配的第一图像中的色块的信息,例如,
Figure PCTCN2021106895-appb-000007
可以表示与第二图像中的色块j匹配的第一图像 的色块。
In one example, one can use
Figure PCTCN2021106895-appb-000004
Record information about the color patches in the second image that match the respective color patches in the first image, for example,
Figure PCTCN2021106895-appb-000005
A patch of the second image that matches patch i in the first image may be represented. can be used
Figure PCTCN2021106895-appb-000006
Record information about the color patches in the first image that match the respective color patches in the second image, for example,
Figure PCTCN2021106895-appb-000007
A patch of the first image that matches patch j in the second image may be represented.
在一个例子中,所述根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度,包括:根据所述第一色块与所述第二色块之间的尺寸差异和位置差异中的一项或两项,以及所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度。在这个例子中,通过利用尺寸差异和位置差异中的一项或两项,能够在视觉特征的基础上,调整所述第一图像的色块与所述第二图像的色块之间的匹配度,从而能够进一步提高所确定的色块匹配结果的准确性。在这个例子中,所述尺寸差异表示第一色块与第二色块之间的尺寸的差异。例如,所述尺寸差异可以为第一色块与第二色块之间的像素数的差值的绝对值。又如,所述尺寸差异可以为第一色块与第二色块之间的面积的差值的绝对值。所述位置差异表示第一色块与第二色块之间的位置的差异。所述位置差异可以是第一色块与第二色块之间相应的像素的坐标的差值的绝对值。例如,所述位置差异可以是第一色块与第二色块的矩形包围盒的重心的坐标的差值的绝对值。又如,所述位置差异可以是第一色块与第二色块的几何中心的坐标的差值的绝对值。在这个例子中,所述匹配度与所述尺寸差异负相关。即,所述尺寸差异越大,则所述匹配度越小;所述尺寸差异越小,则所述匹配度越大。所述匹配度与所述位置差异负相关。即,所述位置差异越大,则所述匹配度越小;所述位置差异越小,则所述匹配度越大。In one example, the matching degree between the first color block and the second color block is determined according to the similarity between the feature of the first color block and the feature of the second color block , including: according to one or both of the size difference and the position difference between the first color block and the second color block, and the characteristics of the first color block and the second color block The similarity between the features determines the matching degree between the first color block and the second color block. In this example, the matching between the color patches of the first image and the color patches of the second image can be adjusted on the basis of visual features by utilizing one or both of the size difference and the position difference Therefore, the accuracy of the determined color patch matching result can be further improved. In this example, the size difference represents the difference in size between the first color patch and the second color patch. For example, the size difference may be the absolute value of the difference in the number of pixels between the first color block and the second color block. For another example, the size difference may be the absolute value of the difference in area between the first color patch and the second color patch. The positional difference represents a positional difference between the first color patch and the second color patch. The positional difference may be an absolute value of a difference in coordinates of corresponding pixels between the first color patch and the second color patch. For example, the position difference may be the absolute value of the difference between the coordinates of the barycenters of the rectangular bounding boxes of the first color patch and the second color patch. For another example, the position difference may be the absolute value of the difference between the coordinates of the geometric centers of the first color patch and the second color patch. In this example, the fit is inversely related to the size difference. That is, the larger the size difference is, the smaller the matching degree is; the smaller the size difference is, the larger the matching degree is. The matching degree is negatively correlated with the position difference. That is, the larger the position difference is, the smaller the matching degree is; the smaller the position difference is, the larger the matching degree is.
在一个例子中,可以根据第一色块与第二色块之间的尺寸差异,构建第一色块与第二色块之间的尺寸惩罚项;根据第一色块与第二色块之间的位置差异,构建第一色块与第二色块之间的距离惩罚项。通过引入尺寸惩罚项和距离惩罚项,能够较准确地调整色块之间的匹配度。In one example, a size penalty term between the first color block and the second color block may be constructed according to the size difference between the first color block and the second color block; according to the difference between the first color block and the second color block The position difference between the first color block and the second color block is constructed, and the distance penalty term is constructed. By introducing size penalty and distance penalty, the matching degree between color blocks can be adjusted more accurately.
例如,可以采用如下(式2)确定色块i与色块j之间的距离惩罚项L dist(i,j): For example, the following (Equation 2) can be used to determine the distance penalty term L dist (i,j) between color patch i and color patch j:
Figure PCTCN2021106895-appb-000008
Figure PCTCN2021106895-appb-000008
其中,P 0(i)表示色块i的矩形包围盒的重心的坐标,P 1(j)表示色块j的矩形包围盒的重心的坐标;H表示第一图像的高度,第一图像的高度等于第二图像的高度;W表示第一图像的宽度,第一图像的宽度等于第二图像的宽度。 Among them, P 0 (i) represents the coordinates of the barycenter of the rectangular bounding box of color patch i, P 1 (j) represents the coordinates of the barycenter of the rectangular bounding box of color patch j; H represents the height of the first image, and the The height is equal to the height of the second image; W represents the width of the first image, and the width of the first image is equal to the width of the second image.
例如,可以采用如下(式3)确定色块i与色块j之间的尺寸惩罚项L size(i,j): For example, the following (equation 3) can be used to determine the size penalty term L size (i, j) between color patch i and color patch j:
Figure PCTCN2021106895-appb-000009
Figure PCTCN2021106895-appb-000009
其中,|S 0(i)|表示第一图像的色块i中的像素数,|S 1(j)|表示第二图像的色块j中的像素数。 Wherein, |S 0 (i)| represents the number of pixels in the color block i of the first image, and |S 1 (j)| represents the number of pixels in the color block j of the second image.
在一个例子中,可以采用如下(式4)确定色块i与色块j之间的匹配度C(i,j):In an example, the following (equation 4) can be used to determine the matching degree C(i,j) between color patch i and color patch j:
C(i,j)=A(i,j)-λ distL dist(i,j)-λ sizeL size(i,j)        (式4); C(i,j)=A(i,j)-λ dist L dist (i,j)-λ size L size (i,j) (Equation 4);
其中,λ dist表示距离惩罚项对应的系数,λ size表示尺寸惩罚项对应的系数。例如,λ dist=0.2,λ size=0.5。当然,本领域技术人员可以根据实际应用场景需求和/或经验灵活设置λ dist和λ size,在此不作限定。 Among them, λ dist represents the coefficient corresponding to the distance penalty term, and λ size represents the coefficient corresponding to the size penalty term. For example, λ dist =0.2, λ size =0.5. Of course, those skilled in the art can flexibly set λ dist and λ size according to actual application scenario requirements and/or experience, which are not limited herein.
在一个例子中,可以仅在第一图像与第二图像之间的位移大于预设长度的情况下,采用所述距离惩罚项,其中,所述预设长度等于第一图像的对角线长度与预设系数的乘积。例如,预设系数可以是0.15。在其他例子中,也可以不考虑第一图像与第二图像之间的位移是否大于预设长度。In one example, the distance penalty term may be used only when the displacement between the first image and the second image is greater than a preset length, where the preset length is equal to the diagonal length of the first image Product with preset coefficients. For example, the preset coefficient may be 0.15. In other examples, it may not be considered whether the displacement between the first image and the second image is greater than a preset length.
在一个例子中,可以根据如下(式5)确定与第一图像中的色块i匹配的第二图像中的色块
Figure PCTCN2021106895-appb-000010
以及与第二图像中的色块j匹配的第一图像中的色块
Figure PCTCN2021106895-appb-000011
In one example, the color patch in the second image that matches the color patch i in the first image can be determined according to the following (Equation 5)
Figure PCTCN2021106895-appb-000010
and a patch in the first image that matches patch j in the second image
Figure PCTCN2021106895-appb-000011
Figure PCTCN2021106895-appb-000012
Figure PCTCN2021106895-appb-000012
即,
Figure PCTCN2021106895-appb-000013
表示第二图像中与色块i匹配度最高的色块,
Figure PCTCN2021106895-appb-000014
表示第一图像中与色块j匹配度最高的色块。
which is,
Figure PCTCN2021106895-appb-000013
Indicates the color block with the highest matching degree with color block i in the second image,
Figure PCTCN2021106895-appb-000014
Indicates the color block with the highest matching degree with color block j in the first image.
在本公开实施例中,根据所述色块匹配结果,可以确定第一图像和第二图像中相互匹配的色块对。例如,匹配的色块对可以记为(i,j),其中,
Figure PCTCN2021106895-appb-000015
对于每一个匹配的色块对(i,j),可以计算块间光流。首先,可以确定色块j的矩形包围盒的重心相对于色块i的矩形包围盒的重心的位移
Figure PCTCN2021106895-appb-000016
接着,可以计算在像素x处的光流
Figure PCTCN2021106895-appb-000017
其中,x∈S 0(i),u() 表示在x轴方向上的位移量,v()表示在y轴方向上的位移量。然后,可以采用变分精化(Variational refinement)的方法求出
Figure PCTCN2021106895-appb-000018
其能量函数采用如下(式6)表示:
In an embodiment of the present disclosure, according to the color patch matching result, a pair of color patches that match each other in the first image and the second image can be determined. For example, a matching color patch pair can be denoted as (i,j), where,
Figure PCTCN2021106895-appb-000015
For each matching patch pair (i,j), the inter-block optical flow can be computed. First, the displacement of the center of gravity of the rectangular bounding box of color patch j relative to the center of gravity of the rectangular bounding box of color patch i can be determined
Figure PCTCN2021106895-appb-000016
Next, the optical flow at pixel x can be calculated
Figure PCTCN2021106895-appb-000017
Among them, x∈S 0 (i), u() represents the displacement amount in the x-axis direction, and v() represents the displacement amount in the y-axis direction. Then, the method of variational refinement can be used to find
Figure PCTCN2021106895-appb-000018
Its energy function is expressed as follows (Equation 6):
Figure PCTCN2021106895-appb-000019
Figure PCTCN2021106895-appb-000019
其中,当
Figure PCTCN2021106895-appb-000020
时,
Figure PCTCN2021106895-appb-000021
对于非相互匹配的两个色块,可以将这两个色块之间的光流确定为0。
Among them, when
Figure PCTCN2021106895-appb-000020
hour,
Figure PCTCN2021106895-appb-000021
For two color blocks that do not match each other, the optical flow between the two color blocks can be determined as 0.
其中,
Figure PCTCN2021106895-appb-000022
即,
Figure PCTCN2021106895-appb-000023
在一个例子中,可以采用如下(式7)确定从第一图像至第二图像的第一光流:
in,
Figure PCTCN2021106895-appb-000022
which is,
Figure PCTCN2021106895-appb-000023
In one example, the following (equation 7) can be used to determine the first optical flow from the first image to the second image:
Figure PCTCN2021106895-appb-000024
Figure PCTCN2021106895-appb-000024
在本公开实施例中,基于所述色块匹配结果,可以确定第一图像与第二图像之间、匹配的色块之间的光流。将匹配的色块之间的光流拼接在一起,可以得到所述第一光流。In the embodiment of the present disclosure, based on the color patch matching result, the optical flow between the first image and the second image and between matched color patches may be determined. The first optical flow can be obtained by splicing together the optical flows between the matched color blocks.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第一光流包括从所述第一图像至所述第二图像的第一光流和/或从所述第二图像至所述第一图像的第一光流。在该实现方式中,通过确定双向的光流,能够提供更丰富的运动信息。In a possible implementation manner, the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image. In this implementation, by determining the bidirectional optical flow, more abundant motion information can be provided.
在一种可能的实现方式中,在所述确定所述第一图像与所述第二图像之间的第一光流之后,所述方法还包括:根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。在该实现方式中,可以采用深度学习等方法,对所述第一图像与所述第二图像之间的第一光流进行优化。例如,可以采用Transformer式的神经网络迭代优化所述第一图像与所述第二图像之间的光流,得到所述第二光流。作为该实现方式的一个示例,所述第一图像特征可以是残差网络(ResNet)对第一图像提取的图像特征,所述第二图像特征可以是残差网络对第二图像提取的图像特征。当然,在其他示例中,也可以通过其他特征提取网络提取第一图像对应的第一图像特征和第二图像对应的第二图像特征,在此不作限定。在该实现方式中,通过在所述确定所述第一图像与所述第二图像之间的第一光流之后,根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,由此提高所确定的光流的准确性。对于非线性、运动幅度较大的应用场景,通过采用该实现方式,能够较大幅度地提高所确定的光流的准确性。In a possible implementation manner, after the determining the first optical flow between the first image and the second image, the method further includes: according to the first image corresponding to the first image feature and the second image feature corresponding to the second image, optimize the first optical flow between the first image and the second image, and obtain a relationship between the first image and the second image the second optical flow. In this implementation manner, a method such as deep learning may be used to optimize the first optical flow between the first image and the second image. For example, a Transformer-type neural network may be used to iteratively optimize the optical flow between the first image and the second image to obtain the second optical flow. As an example of this implementation, the first image feature may be an image feature extracted from the first image by a residual network (ResNet), and the second image feature may be an image feature extracted from the second image by a residual network . Of course, in other examples, the first image feature corresponding to the first image and the second image feature corresponding to the second image may also be extracted through other feature extraction networks, which is not limited herein. In this implementation manner, after the first optical flow between the first image and the second image is determined, according to the first image feature corresponding to the first image and the second image corresponding The second image feature of , optimizes the first optical flow between the first image and the second image to obtain the second optical flow between the first image and the second image, thus Improve the accuracy of the determined optical flow. For an application scenario with nonlinearity and a large motion range, by adopting this implementation manner, the accuracy of the determined optical flow can be greatly improved.
作为该实现方式的一个示例,所述根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,包括:根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性;根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。As an example of this implementation manner, according to the first image feature corresponding to the first image and the second image feature corresponding to the second image, the difference between the first image and the second image is Optimizing the first optical flow to obtain a second optical flow between the first image and the second image, comprising: determining according to the first optical flow between the first image and the second image The correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image; according to the correlation, the correlation between the first image and the second image is The first optical flow is optimized to obtain a second optical flow between the first image and the second image.
例如,第一图像特征可以记为
Figure PCTCN2021106895-appb-000025
第二图像特征可以记为
Figure PCTCN2021106895-appb-000026
可以采用如下(式8)确定第一图像特征
Figure PCTCN2021106895-appb-000027
与第二图像特征
Figure PCTCN2021106895-appb-000028
之间的相关性
Figure PCTCN2021106895-appb-000029
For example, the first image feature can be written as
Figure PCTCN2021106895-appb-000025
The second image feature can be denoted as
Figure PCTCN2021106895-appb-000026
The first image feature can be determined by the following (Equation 8)
Figure PCTCN2021106895-appb-000027
with the second image feature
Figure PCTCN2021106895-appb-000028
correlation between
Figure PCTCN2021106895-appb-000029
Figure PCTCN2021106895-appb-000030
Figure PCTCN2021106895-appb-000030
其中,Ω(x)表示以像素x为几何中心的方形区域,p表示属于Ω(x)的像素,
Figure PCTCN2021106895-appb-000031
表示第一图像特征
Figure PCTCN2021106895-appb-000032
中像素p处的特征,
Figure PCTCN2021106895-appb-000033
表示第二图像特征
Figure PCTCN2021106895-appb-000034
中在像素
Figure PCTCN2021106895-appb-000035
处的特征。例如,Ω(x)的尺寸可以为3×3或者5×5等。
Among them, Ω(x) represents the square area with pixel x as the geometric center, p represents the pixel belonging to Ω(x),
Figure PCTCN2021106895-appb-000031
represents the first image feature
Figure PCTCN2021106895-appb-000032
features at pixel p in ,
Figure PCTCN2021106895-appb-000033
represents the second image feature
Figure PCTCN2021106895-appb-000034
middle pixel
Figure PCTCN2021106895-appb-000035
features at. For example, the size of Ω(x) can be 3×3 or 5×5, etc.
在该示例中,通过根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性,并根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,由此利用根据第一光流确定的第一图像特征与第二图像特征之间的相关性,来优化所述第一光流,从而能够提高优化得到的第二光流的准确性。In this example, the first image feature corresponding to the first image and the second image feature corresponding to the second image are determined according to the first optical flow between the first image and the second image and the first optical flow between the first image and the second image is optimized according to the correlation to obtain the correlation between the first image and the second image. The second optical flow, whereby the correlation between the first image feature and the second image feature determined according to the first optical flow is used to optimize the first optical flow, so that the second optical flow obtained by optimization can be improved. accuracy.
在一个示例中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,包括:根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流。在该示例中,通过对第一图像与第二图像之间的光流进行多次迭代优化,能够进一步提高优化得到的光流的准确性,能够更准确地确定非线性、运动幅度较大的图像之间的光流。In an example, according to the correlation, the first optical flow between the first image and the second image is optimized to obtain an optical flow between the first image and the second image. The second optical flow includes: performing multiple iterative optimization on the first optical flow between the first image and the second image according to the correlation to obtain the first image and the second image the second optical flow in between. In this example, by performing multiple iterative optimizations on the optical flow between the first image and the second image, the accuracy of the optimized optical flow can be further improved, and the nonlinear and large motion amplitude can be more accurately determined. Optical flow between images.
例如,从第一图像至第二图像的第一光流可以记为f 0→1,从第二图像至第一图像的第一光流可以记为f 1→0,从第一图像至第二图像的第二光流可以记为f 0→1,从第二图像至第一图像的第二光流可以记为f 1→0For example, the first optical flow from the first image to the second image can be denoted as f 0→1 , the first optical flow from the second image to the first image can be denoted as f 1→0 , from the first image to the first image The second optical flow of the two images may be denoted as f 0→1 , and the second optical flow from the second image to the first image may be denoted as f 1→0 .
在一个例子中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流,包括:根据所述第一图像与所述第二图像之间的第一光流,以及所述第一图像的像素值和所述第二图像的像素值,得到所述第一光流对应的置信度图;根据所述置信度图对所述第一光流进行加权,得到所述第一光流对应的第1次优化的待优化光流;在第t次优化中,根据所述第t次优化的待优化光流、所述相关性以及所述第一图像特征,确定第t次优化的优化光流,并在t小于T的情况下,将第t次优化的优化光流作为第t+1次优化的待优化光流,其中,1≤t≤T,T表示预设的迭代优化次数,T大于或等于2;将第T次优化的优化光流确定为所述第一图像与所述第二图像之间的第二光流。在这个例子中,基于根据第一光流、第一图像的像素值和第二图像的像素值确定的置信度图,对第一光流进行多次迭代优化,从而能够使迭代优化得到的第二光流更能够准确地反映第一图像与第二图像之间的运动信息。In one example, according to the correlation, the first optical flow between the first image and the second image is optimized for multiple iterations to obtain the first image and the second image The second optical flow between the two includes: according to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image, obtaining the confidence map corresponding to the first optical flow; weight the first optical flow according to the confidence map to obtain the optical flow to be optimized corresponding to the first optical flow; In the sub-optimization, the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T, the t-th optimization is determined. The optimized optical flow of the t-time optimization is taken as the optical flow to be optimized for the t+1th optimization, where 1≤t≤T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2; Optical flow is determined as a second optical flow between the first image and the second image. In this example, based on the confidence map determined according to the first optical flow, the pixel values of the first image, and the pixel values of the second image, the first optical flow is iteratively optimized for multiple times, so that the first optical flow obtained by the iterative optimization can be optimized. The two optical flow can more accurately reflect the motion information between the first image and the second image.
以从第一图像至第二图像的光流为例,例如,第1次优化的待优化光流可以记为
Figure PCTCN2021106895-appb-000036
第1次优化的优化光流(即经过第1次优化得到的光流)可以记为
Figure PCTCN2021106895-appb-000037
第t次优化的待优化光流可以记为
Figure PCTCN2021106895-appb-000038
第t次优化的优化光流可以记为
Figure PCTCN2021106895-appb-000039
第T次优化的优化光流(即第二光流)可以记为
Figure PCTCN2021106895-appb-000040
Figure PCTCN2021106895-appb-000041
Taking the optical flow from the first image to the second image as an example, for example, the optical flow to be optimized for the first optimization can be recorded as
Figure PCTCN2021106895-appb-000036
The optimized optical flow of the first optimization (that is, the optical flow obtained after the first optimization) can be recorded as
Figure PCTCN2021106895-appb-000037
The optical flow to be optimized for the t-th optimization can be recorded as
Figure PCTCN2021106895-appb-000038
The optimized optical flow of the t-th optimization can be written as
Figure PCTCN2021106895-appb-000039
The optimized optical flow of the T-th optimization (ie, the second optical flow) can be recorded as
Figure PCTCN2021106895-appb-000040
which is
Figure PCTCN2021106895-appb-000041
例如,可以将|I 1(x+f 0→1(x))–I 0(x)|、I 0和f 0→1合并(concatenate)后输入至一个预先训练的3层的卷积神经网络(Convolutional neural network,CNN),经由该卷积神经网络输出第一光流对应的错误度g(x),其中,g(x)的尺度可以与f 0→1相同。根据第一光流对应的错误度g(x),可以得到第一光流对应的置信度图,例如,第一光流对应的置信度图可以为
Figure PCTCN2021106895-appb-000042
其中,第一光流对应的置信度图
Figure PCTCN2021106895-appb-000043
包括第一光流在各个像素的置信度。第一光流对应的置信度图
Figure PCTCN2021106895-appb-000044
可以将权重归一化至[0,1]。在一个例子中,第一光流对应的第1次优化的待优化光流
Figure PCTCN2021106895-appb-000045
可以为可以采用如下(式9)确定:
For example, |I 1 (x+f 0→1 (x))–I 0 (x)|, I 0 and f 0→1 can be concatenated and fed into a pre-trained 3-layer convolutional neural network network (Convolutional neural network, CNN), through the convolutional neural network to output the error degree g(x) corresponding to the first optical flow, wherein the scale of g(x) can be the same as f 0→1 . According to the error g(x) corresponding to the first optical flow, the confidence map corresponding to the first optical flow can be obtained. For example, the confidence map corresponding to the first optical flow can be
Figure PCTCN2021106895-appb-000042
Among them, the confidence map corresponding to the first optical flow
Figure PCTCN2021106895-appb-000043
Including the confidence of the first optical flow at each pixel. The confidence map corresponding to the first optical flow
Figure PCTCN2021106895-appb-000044
The weights can be normalized to [0,1]. In an example, the optical flow to be optimized for the first optimization corresponding to the first optical flow
Figure PCTCN2021106895-appb-000045
It can be determined by using the following (equation 9):
Figure PCTCN2021106895-appb-000046
Figure PCTCN2021106895-appb-000046
例如,
Figure PCTCN2021106895-appb-000047
表示第t(t>0)次优化的待优化光流,即第t-1次优化的优化光流,
Figure PCTCN2021106895-appb-000048
表示第一图像特征,
Figure PCTCN2021106895-appb-000049
表示第一图像特征
Figure PCTCN2021106895-appb-000050
与第二图像特征
Figure PCTCN2021106895-appb-000051
之间的相关性,那么,可以将
Figure PCTCN2021106895-appb-000052
Figure PCTCN2021106895-appb-000053
输入ConvGRU,得到第t次优化的光流增量
Figure PCTCN2021106895-appb-000054
E.g,
Figure PCTCN2021106895-appb-000047
Represents the optical flow to be optimized for the t(t>0) optimization, that is, the optimized optical flow for the t-1 optimization,
Figure PCTCN2021106895-appb-000048
represents the first image feature,
Figure PCTCN2021106895-appb-000049
represents the first image feature
Figure PCTCN2021106895-appb-000050
with the second image feature
Figure PCTCN2021106895-appb-000051
correlation between, then, it can be
Figure PCTCN2021106895-appb-000052
and
Figure PCTCN2021106895-appb-000053
Enter ConvGRU to get the optical flow increment of the t-th optimization
Figure PCTCN2021106895-appb-000054
例如,可以采用如下(式10)得到第t次优化的光流增量
Figure PCTCN2021106895-appb-000055
For example, the following (Equation 10) can be used to obtain the optical flow increment of the t-th optimization
Figure PCTCN2021106895-appb-000055
Figure PCTCN2021106895-appb-000056
Figure PCTCN2021106895-appb-000056
经过T次优化得到的第二光流可以采用如下(式11)来确定:The second optical flow obtained after T times of optimization can be determined by the following (Equation 11):
Figure PCTCN2021106895-appb-000057
Figure PCTCN2021106895-appb-000057
本公开实施例得到的第二光流或者第一光流可以用于视频插帧、视频压缩、视频编码、目标检测、目标跟踪或者对象分割等,在此不作限定。The second optical flow or the first optical flow obtained in the embodiment of the present disclosure may be used for video frame insertion, video compression, video coding, target detection, target tracking, or object segmentation, etc., which is not limited herein.
在一种可能的实现方式中,所述第一图像和所述第二图像是目标视频中的相邻帧;在所述得到所述第一图像与所述第二图像之间的第二光流之后,所述方法还包括:根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧。作为该实现方式的一个示例,可以采用卷积神经网络对第一图像和第二图像分别进行特征提取,得到所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征。在该实现方式中,通过在所述得到所述第一图像与所述第二图像之间的第二光流之后,根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧,由此基于较准确的第二光流,能够得到较高质量的中间帧,能够获得较平滑流畅的插帧效果。In a possible implementation manner, the first image and the second image are adjacent frames in the target video; the second light between the obtained first image and the second image After streaming, the method further includes: according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the third image feature between the first image and the second image Two optical flows, determining the intermediate frame of the first image and the second image. As an example of this implementation, a convolutional neural network can be used to perform feature extraction on the first image and the second image respectively, to obtain the third image feature corresponding to the first image and the fourth image corresponding to the second image feature. In this implementation manner, after obtaining the second optical flow between the first image and the second image, according to the third image feature corresponding to the first image and the second image corresponding The fourth image feature of , and the second optical flow between the first image and the second image, determine the intermediate frame of the first image and the second image, thus based on the more accurate second image Optical flow can obtain higher-quality intermediate frames, and can obtain smoother and smoother frame insertion effects.
作为该实现方式的一个示例,所述第一图像与所述第二图像之间的第二光流包括从所述第一图像至所述第二图像的第二光流和从所述第二图像至所述第一图像的第二光流;所述根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧,包括:根据从所述第一图像至所述第二图像的第二光流, 确定从所述第一图像至所述中间帧的第三光流;根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流;根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧。在这个示例中,利用第一图像与第二图像之间的双向的第二光流,能够准确地确定从所述第一图像至所述中间帧的第三光流和从所述第二图像至所述中间帧的第四光流,基于由此确定的第三光流和第四光流,以及第三图像特征和第四图像特征,能够准确地确定第一图像和第二图像的中间帧。As an example of this implementation, the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the second image the second optical flow from the image to the first image; the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the first image and the first image For the second optical flow between the two images, determining the intermediate frame between the first image and the second image includes: determining, according to the second optical flow from the first image to the second image, the frame from the first image to the second image. a third optical flow from the first image to the intermediate frame; and determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image flow; determining the intermediate frame according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image. In this example, using the bidirectional second optical flow between the first image and the second image, the third optical flow from the first image to the intermediate frame and from the second image can be accurately determined The fourth optical flow to the intermediate frame, based on the third optical flow and the fourth optical flow determined thereby, and the third image feature and the fourth image feature, can accurately determine the middle of the first image and the second image frame.
在一个例子中,所述根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流,包括:根据从所述第一图像至所述第二图像的第二光流,以及第一参数,确定从所述第一图像至所述中间帧的第三光流,其中,所述第一参数为第一时间间隔与第二时间间隔的比值,所述第一时间间隔为所述第一图像与所述中间帧之间的时间间隔,所述第二时间间隔为所述第一图像与所述第二图像之间的时间间隔;所述根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流,包括:根据从所述第二图像至所述第一图像的第二光流,以及所述第一参数,确定从所述第二图像至所述中间帧的第四光流。根据这个例子,能够准确地确定所要求的时刻对应的中间帧。根据这个例子,还能够确定第一图像与第二图像之间的多个时刻的中间帧,从而能够在第一图像与第二图像之间插多个帧,得到更平滑流畅的视频。In one example, the determining the third optical flow from the first image to the intermediate frame according to the second optical flow from the first image to the second image includes: according to the second optical flow from the first image to the second image a second optical flow from the first image to the second image, and a first parameter to determine a third optical flow from the first image to the intermediate frame, wherein the first parameter is a first time interval The ratio of the first time interval to the second time interval, the first time interval being the time interval between the first image and the intermediate frame, and the second time interval being the difference between the first image and the second image the time interval between; the determining, according to the second optical flow from the second image to the first image, the fourth optical flow from the second image to the intermediate frame, comprising: according to the optical flow from the second image to the intermediate frame A second optical flow from the second image to the first image, and the first parameter, determines a fourth optical flow from the second image to the intermediate frame. According to this example, the intermediate frame corresponding to the required time can be accurately determined. According to this example, intermediate frames at multiple moments between the first image and the second image can also be determined, so that multiple frames can be inserted between the first image and the second image to obtain a smoother and smoother video.
例如,可以采用如下(式12)确定从所述第一图像至所述中间帧的第三光流f 0→r和从所述第二图像至所述中间帧的第四光流f 1→rFor example, the following (Equation 12) can be used to determine the third optical flow f 0→r from the first image to the intermediate frame and the fourth optical flow f 1→ from the second image to the intermediate frame r :
Figure PCTCN2021106895-appb-000058
Figure PCTCN2021106895-appb-000058
其中,r表示第一参数,0<r<1。Among them, r represents the first parameter, 0<r<1.
在一个例子中,所述根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧,包括:根据所述第三光流和所述第一图像,确定所述中间帧对应的第一前向映射结果;根据所述第三光流和所述第三图像特征,确定所述中间帧的图像特征对应的第二前向映射结果;根据所述第四光流和所述第二图像,确定所述中间帧对应的第三前向映射结果;根据所述第四光流和所述第四图像特征,确定所述中间帧的图像特征对应的第四前向映射结果;根据所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果,确定所述中间帧。根据这个例子,能够利用中间帧的图像的前向映射(Forward warp)结果和图像特征的前向映射结果,准确地确定中间帧。In one example, the determining of the said The intermediate frame includes: determining the first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image; determining the first forward mapping result according to the third optical flow and the third image feature the second forward mapping result corresponding to the image feature of the intermediate frame; the third forward mapping result corresponding to the intermediate frame is determined according to the fourth optical flow and the second image; according to the fourth optical flow and the fourth image feature, determine the fourth forward mapping result corresponding to the image feature of the intermediate frame; according to the first forward mapping result, the second forward mapping result, the third forward mapping result The intermediate frame is determined from the mapping result and the fourth forward mapping result. According to this example, the intermediate frame can be accurately determined by using the forward warp result of the image of the intermediate frame and the forward mapping result of the image feature.
例如,可以采用如下(式13),得到第一前向映射结果
Figure PCTCN2021106895-appb-000059
第二前向映射结果
Figure PCTCN2021106895-appb-000060
第三前向映射结果
Figure PCTCN2021106895-appb-000061
和第四前向映射结果
Figure PCTCN2021106895-appb-000062
For example, the following (Equation 13) can be used to obtain the first forward mapping result
Figure PCTCN2021106895-appb-000059
Second forward mapping result
Figure PCTCN2021106895-appb-000060
Third forward mapping result
Figure PCTCN2021106895-appb-000061
and the fourth forward mapping result
Figure PCTCN2021106895-appb-000062
Figure PCTCN2021106895-appb-000063
Figure PCTCN2021106895-appb-000063
其中,F 0′表示第三图像特征,F 1′表示第四图像特征。 Wherein, F 0 ′ represents the third image feature, and F 1 ′ represents the fourth image feature.
在一个例子中,可以将所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果输入预先训练的融合网络,经由所述融合网络输出所述中间帧。In one example, the first forward mapping result, the second forward mapping result, the third forward mapping result, and the fourth forward mapping result may be input into a pre-trained fusion network, via The fusion network outputs the intermediate frame.
在一种可能的实现方式中,所述第一图像特征与所述第二图像特征是第一特征提取网络提取的图像特征,所述第三图像特征与所述第四图像特征是第二特征提取网络提取的图像特征,所述第五图像特征与所述第六图像特征是第三特征提取网络提取的图像特征。所述第一特征提取网络、所述第二特征提取网络和所述第三特征提取网络可以是不同的特征提取网络,也可以是相同的特征提取网络。In a possible implementation manner, the first image feature and the second image feature are image features extracted by a first feature extraction network, and the third image feature and the fourth image feature are second features The image features extracted by the network are extracted, and the fifth image feature and the sixth image feature are image features extracted by the third feature extraction network. The first feature extraction network, the second feature extraction network and the third feature extraction network may be different feature extraction networks, or may be the same feature extraction network.
下面通过一个应用场景说明本公开实施例提供的图像处理方法。The image processing method provided by the embodiment of the present disclosure is described below through an application scenario.
为了降低手工绘制成本,2D(2 Dimensions,二维)动画制作公司经常在动画中重复同一帧若干次来达到影视作品需要的帧率。这导致了动画的实际帧率较低,从而影响了用户的观看体检。如果我们能使用视频插帧技术生成动画视频中每两帧间的中间帧,我们便可以节省制作成本、提高帧率和用户观看体验。相关技术中,大多数的视频插帧技术是基于“运动估计-运动补偿”,即光流来实现,在实景视频的插帧任务上已经取得了不错的成果。但不同于实景视频,动画视频插帧有以下两个难点:第一,动画视频中的对象(例如人物、物体)缺乏纹理,导致相关技术中的视频插帧技术所依赖的运动估计方法难以进行纹理匹配,因此难以估计出准确的光流。第二,动画视频经常使用一些夸张的运动来实现一定的艺术 效果,这些运动通常是非线性的,并且运动幅度很大,这导致一般的光流估计算法难以处理这些夸张的运动。相关技术中的视频插帧方法没有专门处理动画视频插帧的难点,因此难以生成高质量、帧率满足要求的动画视频。In order to reduce the cost of manual drawing, 2D (2 Dimensions, two-dimensional) animation production companies often repeat the same frame several times in the animation to achieve the frame rate required for film and television works. This results in a lower actual frame rate of the animation, which affects the user's viewing experience. If we can use video frame interpolation technology to generate the middle frame between every two frames in the animation video, we can save production cost, improve frame rate and user viewing experience. In the related art, most video frame interpolation technologies are implemented based on "motion estimation-motion compensation", namely optical flow, and good results have been achieved in the task of frame interpolation of live video. However, unlike live video, animation video frame interpolation has the following two difficulties: First, the objects in animation video (such as characters, objects) lack texture, which makes it difficult to perform motion estimation methods that video frame interpolation technology in related technologies relies on. Texture matching, so it is difficult to estimate accurate optical flow. Second, animated videos often use some exaggerated motions to achieve certain artistic effects. These motions are usually nonlinear and have large motion amplitudes, which makes it difficult for general optical flow estimation algorithms to deal with these exaggerated motions. The video frame insertion method in the related art does not specifically deal with the difficulty of animation video frame insertion, so it is difficult to generate an animation video with high quality and a frame rate that meets the requirements.
为了解决类似上文所述的技术问题,在该应用场景中,我们将动画视频中的相邻的两帧分别作为第一图像I 0和第二图像I 1,其中,第一图像I 0为第二图像I 1的上一帧。 In order to solve the technical problem similar to the above, in this application scenario, we take two adjacent frames in the animation video as the first image I 0 and the second image I 1 respectively, where the first image I 0 is The previous frame of the second image I1 .
图2示出本公开实施例提供的一种应用场景的示意图。如图2所示,可以采用色块匹配模块21、光流优化模块22和图像合成模块23,完成动画视频的插帧,即,确定第一图像I 0与第二图像I 1的中间帧
Figure PCTCN2021106895-appb-000064
下面分别对色块匹配模块、光流优化模块和图像合成模块进行介绍。
FIG. 2 shows a schematic diagram of an application scenario provided by an embodiment of the present disclosure. As shown in FIG. 2, the color patch matching module 21, the optical flow optimization module 22 and the image synthesis module 23 can be used to complete the frame insertion of the animation video, that is, to determine the intermediate frame between the first image I 0 and the second image I 1
Figure PCTCN2021106895-appb-000064
The following describes the color patch matching module, optical flow optimization module and image synthesis module respectively.
一、色块匹配模块1. Color block matching module
如图2所示,色块匹配模块的输入包括第一图像I 0和第二图像I 1,输出包括从第一图像I 0至第二图像I 1的第一光流f 0→1以及从第二图像I 1至第一图像I 0的第一光流f 1→0As shown in FIG. 2 , the input of the color patch matching module includes a first image I 0 and a second image I 1 , and the output includes a first optical flow f 0→1 from the first image I 0 to the second image I 1 and from The first optical flows f 1→0 of the second image I 1 to the first image I 0 .
图3示出本公开实施例提供的色块匹配模块的示意图。FIG. 3 shows a schematic diagram of a color patch matching module provided by an embodiment of the present disclosure.
参考图3,色块匹配模块可以使用5×5的拉普拉斯高斯算子对第一图像I 0进行边缘提取,得到第一图像I 0对应的第一边缘提取结果;使用5×5的拉普拉斯高斯算子对第二图像I 1进行边缘提取,得到第二图像I 1对应的第二边缘提取结果。色块匹配模块可以根据第一边缘提取结果,采用Trapped-ball算法对第一图像I 0进行色块分割,得到第一图像I 0对应的第一色块分割结果S 0;根据第二边缘提取结果,采用Trapped-ball算法对第二图像I 1进行色块分割,得到第二图像I 1对应的第二色块分割结果S 1Referring to FIG. 3 , the color patch matching module can use the 5×5 Laplacian Gaussian operator to perform edge extraction on the first image I 0 to obtain the first edge extraction result corresponding to the first image I 0 ; The Laplacian Gaussian operator performs edge extraction on the second image I 1 to obtain a second edge extraction result corresponding to the second image I 1 . The color block matching module can use the Trapped-ball algorithm to perform color block segmentation on the first image I 0 according to the first edge extraction result to obtain the first color block segmentation result S 0 corresponding to the first image I 0 ; As a result, the Trapped-ball algorithm is used to perform color block segmentation on the second image I 1 to obtain a second color block segmentation result S 1 corresponding to the second image I 1 .
色块匹配模块可以通过预先训练的VGGNet对第一图像I 0进行特征提取,得到第一图像I 0对应的第五图像特征;通过该VGGNet对第二图像I 1进行特征提取,得到第二图像I 1对应的第六图像特征。 The color patch matching module can perform feature extraction on the first image I 0 through the pre-trained VGGNet to obtain the fifth image feature corresponding to the first image I 0 ; perform feature extraction on the second image I 1 through the VGGNet to obtain the second image. The sixth image feature corresponding to I 1 .
色块匹配模块可以根据第一色块分割结果S 0和第五图像特征,得到第一图像对应的第一色块特征矩阵F 0;根据第二色块分割结果S 1和第六图像特征,得到第二图像对应的第二色块特征矩阵F 1。其中,第一色块特征矩阵F 0可以是K 0×N的矩阵,第二色块特征矩阵F 1可以是K 1×N的矩阵。 The color patch matching module can obtain the first color patch feature matrix F 0 corresponding to the first image according to the first color patch segmentation result S 0 and the fifth image feature; according to the second color patch segmentation result S 1 and the sixth image feature, A second color patch feature matrix F 1 corresponding to the second image is obtained. The first color block feature matrix F 0 may be a K 0 ×N matrix, and the second color block feature matrix F 1 may be a K 1 ×N matrix.
色块匹配模块可以采用上文中的(式4),根据第一图像I 0中的色块i的特征与第二图像I 1中的色块j的特征之间的相似度A(i,j),以及第一图像I 0的色块i与第二图像I 1的色块j的之间的距离惩罚项L dist(i,j)和尺寸惩罚项L size(i,j),确定第一图像I 0的色块i与第二图像I 1的色块j之间的匹配度C(i,j)。 The color patch matching module can use the above (Equation 4), according to the similarity A(i, j) between the feature of the color patch i in the first image I 0 and the feature of the color patch j in the second image I 1 ), and the distance penalty term L dist (i,j) and the size penalty term L size (i,j) between the color patch i of the first image I 0 and the color patch j of the second image I 1 , determine the first The matching degree C(i,j) between the color patch i of an image I 0 and the color patch j of the second image I 1 .
根据第一图像I 0与第二图像I 1中的各个色块之间的匹配度,可以形成第一图像I 0与第二图像I 1之间的匹配度矩阵。根据该匹配度矩阵,采用上文中的(式5),可以确定第一图像I 0与第二图像I 1之间的色块匹配结果。 According to the matching degree between each color block in the first image I 0 and the second image I 1 , a matching degree matrix between the first image I 0 and the second image I 1 can be formed. According to the matching degree matrix, using the above (Equation 5), the color patch matching result between the first image I 0 and the second image I 1 can be determined.
基于色块匹配结果,采用上文中的(式6),可以确定第一图像I 0与第二图像I 1之间、匹配的色块之间的光流。采用上文中的(式7),将匹配的色块之间的光流拼接在一起,可以得到从第一图像I 0至第二图像I 1的第一光流f 0→1和从第二图像I 1至第一图像I 0的第一光流f 1→0Based on the color patch matching result, using the above (Equation 6), the optical flow between the first image I 0 and the second image I 1 and between matched color patches can be determined. Using the above (Equation 7), by splicing the optical flows between the matched color blocks together, the first optical flow f 0→1 from the first image I 0 to the second image I 1 and the The first optical flow f 1→0 of the image I 1 to the first image I 0 .
二、光流优化模块2. Optical flow optimization module
如图2所示,光流优化模块的输入包括从第一图像I 0至第二图像I 1的第一光流f 0→1、从第二图像I 1至第一图像I 0的第一光流f 1→0、第一图像I 0和第二图像I 1,输出包括从第一图像I 0至第二图像I 1的第二光流f′ 0→1和从第二图像I 1至第一图像I 0的第二光流f′ 1→0。光流优化模块可以采用Transformer式的神经网络对光流进行迭代优化。 As shown in FIG. 2 , the input of the optical flow optimization module includes a first optical flow f 0→1 from the first image I 0 to the second image I 1 , and a first optical flow from the second image I 1 to the first image I 0 . Optical flow f 1→0 , the first image I 0 and the second image I 1 , the output includes the second optical flow f′ 0→1 from the first image I 0 to the second image I 1 and from the second image I 1 The second optical flow f′ 1→0 to the first image I 0 . The optical flow optimization module can use Transformer neural network to iteratively optimize the optical flow.
图4示出本公开实施例提供的光流优化模块的示意图。FIG. 4 shows a schematic diagram of an optical flow optimization module provided by an embodiment of the present disclosure.
光流优化模块可以通过特征网络(例如残差网络)对第一图像I 0和第二图像I 1分别进行特征提取,得到第一图像特征
Figure PCTCN2021106895-appb-000065
和第二图像特征
Figure PCTCN2021106895-appb-000066
光流优化模块可以根据上文中的(式8),确定第一图像特征
Figure PCTCN2021106895-appb-000067
与第二图像特征
Figure PCTCN2021106895-appb-000068
之间的相关积
Figure PCTCN2021106895-appb-000069
The optical flow optimization module can perform feature extraction on the first image I 0 and the second image I 1 respectively through a feature network (such as a residual network) to obtain the first image features
Figure PCTCN2021106895-appb-000065
and the second image feature
Figure PCTCN2021106895-appb-000066
The optical flow optimization module can determine the first image feature according to (Equation 8) above
Figure PCTCN2021106895-appb-000067
with the second image feature
Figure PCTCN2021106895-appb-000068
correlation product between
Figure PCTCN2021106895-appb-000069
以从第一图像I 0至第二图像I 1的光流优化为例,光流优化模块可以将|I 1(x+f 0→1(x))–I 0(x)|、I 0和f 0→1合并(concatenate)后输入至一个预先训练的3层的CNN,经由该卷积神经网络输出f 0→1对应的错误度g(x)。 根据g(x),可以得到f 0→1对应的置信度图
Figure PCTCN2021106895-appb-000070
采用上文中的(式9),可以基于置信度图
Figure PCTCN2021106895-appb-000071
和f 0→1,得到第1次优化的待优化光流
Figure PCTCN2021106895-appb-000072
Taking the optical flow optimization from the first image I 0 to the second image I 1 as an example, the optical flow optimization module can convert |I 1 (x+f 0→1 (x))–I 0 (x)|, I 0 After concatenating with f 0→1 , it is input to a pre-trained 3-layer CNN, and the error degree g(x) corresponding to f 0→1 is output through the convolutional neural network. According to g(x), the confidence map corresponding to f 0→1 can be obtained
Figure PCTCN2021106895-appb-000070
Using (Equation 9) above, it can be based on the confidence map
Figure PCTCN2021106895-appb-000071
and f 0→1 , the optical flow to be optimized for the first optimization is obtained
Figure PCTCN2021106895-appb-000072
Figure PCTCN2021106895-appb-000073
表示第t(t>0)次优化的待优化光流,即经过第t-1次优化得到的优化光流。光流优化模块可以将
Figure PCTCN2021106895-appb-000074
Figure PCTCN2021106895-appb-000075
输入ConvGRU,得到第t次优化的光流增量
Figure PCTCN2021106895-appb-000076
经过T次优化,可以得到从第一图像I 0至第二图像I 1的第二光流f′ 0→1
Figure PCTCN2021106895-appb-000073
Represents the optical flow to be optimized for the t(t>0)th optimization, that is, the optimized optical flow obtained after the t-1th optimization. The optical flow optimization module can
Figure PCTCN2021106895-appb-000074
and
Figure PCTCN2021106895-appb-000075
Enter ConvGRU to get the optical flow increment of the t-th optimization
Figure PCTCN2021106895-appb-000076
After T times of optimization, the second optical flow f′ 0→1 from the first image I 0 to the second image I 1 can be obtained.
类似地,可以得到从第二图像I 1至第一图像I 0的第二光流f′ 1→0Similarly, a second optical flow f′ 1→0 from the second image I 1 to the first image I 0 can be obtained.
三、图像合成模块3. Image synthesis module
如图2所示,图像合成模块的输入包括从第一图像I 0至第二图像I 1的第二光流f′ 0→1、从第二图像I 1至第一图像I 0的第二光流f′ 1→0、第一图像I 0和第二图像I 1,输出为第一图像I 0与第二图像I 1的中间帧
Figure PCTCN2021106895-appb-000077
As shown in FIG. 2 , the input of the image synthesis module includes the second optical flow f′ 0→1 from the first image I 0 to the second image I 1 , and the second optical flow f′ 0→1 from the second image I 1 to the first image I 0 Optical flow f′ 1→0 , the first image I 0 and the second image I 1 , the output is an intermediate frame between the first image I 0 and the second image I 1
Figure PCTCN2021106895-appb-000077
图像合成模块可以通过CNN分别对第一图像I 0和第二图像I 1进行特征提取,得到第一图像I 0对应的第三图像特征F 0′和第二图像I 1对应的第四图像特征F 1′。采用上文中的(式12),图像合成模块可以确定从第一图像I 0至中间帧
Figure PCTCN2021106895-appb-000078
的第三光流f 0→r和从第二图像I 1至中间帧
Figure PCTCN2021106895-appb-000079
的第四光流f 1→r。采用上文中的(式13),图像合成模块可以根据第一图像I 0、第二图像I 1、第三图像特征F 0′和第四图像特征F 1′,确定第一前向映射结果
Figure PCTCN2021106895-appb-000080
第二前向映射结果
Figure PCTCN2021106895-appb-000081
第三前向映射结果
Figure PCTCN2021106895-appb-000082
和第四前向映射结果
Figure PCTCN2021106895-appb-000083
将第一前向映射结果
Figure PCTCN2021106895-appb-000084
第二前向映射结果
Figure PCTCN2021106895-appb-000085
第三前向映射结果
Figure PCTCN2021106895-appb-000086
和第四前向映射结果
Figure PCTCN2021106895-appb-000087
输入预先训练的融合网络,可以得到第一图像I 0与第二图像I 1的中间帧
Figure PCTCN2021106895-appb-000088
The image synthesis module can perform feature extraction on the first image I 0 and the second image I 1 through CNN, respectively, to obtain the third image feature F 0 ′ corresponding to the first image I 0 and the fourth image feature corresponding to the second image I 1 . F1 ' . Using the above (Equation 12), the image synthesis module can determine from the first image I 0 to the intermediate frame
Figure PCTCN2021106895-appb-000078
The third optical flow f 0 → r and from the second image I 1 to the intermediate frame
Figure PCTCN2021106895-appb-000079
The fourth optical flow f 1→r of . Using the above (Equation 13), the image synthesis module can determine the first forward mapping result according to the first image I 0 , the second image I 1 , the third image feature F 0 ′ and the fourth image feature F 1
Figure PCTCN2021106895-appb-000080
Second forward mapping result
Figure PCTCN2021106895-appb-000081
Third forward mapping result
Figure PCTCN2021106895-appb-000082
and the fourth forward mapping result
Figure PCTCN2021106895-appb-000083
Convert the first forward mapping result
Figure PCTCN2021106895-appb-000084
Second forward mapping result
Figure PCTCN2021106895-appb-000085
Third forward mapping result
Figure PCTCN2021106895-appb-000086
and the fourth forward mapping result
Figure PCTCN2021106895-appb-000087
Input the pre-trained fusion network, you can get the intermediate frame between the first image I 0 and the second image I 1
Figure PCTCN2021106895-appb-000088
该应用场景能够准确地估计出均匀色块的光流,并能够准确地描述夸张的运动,从而能够产生合理自然的、较高帧率的动画视频。This application scenario can accurately estimate the optical flow of uniform color patches, and can accurately describe exaggerated motion, so that reasonable and natural animation videos with high frame rate can be generated.
可以理解,本公开实施例提及的上述各个方法实施例,在不违背原理逻辑的情况下,均可以彼此相互结合形成结合后的实施例。本领域技术人员可以理解,在具体实施方式的上述方法中,各步骤的具体执行顺序应当以其功能和可能的内在逻辑确定。It can be understood that the above method embodiments mentioned in the embodiments of the present disclosure can be combined with each other to form a combined embodiment without violating the principle and logic. Those skilled in the art can understand that, in the above method of the specific embodiment, the specific execution order of each step should be determined by its function and possible internal logic.
此外,本公开实施例还提供了图像处理装置、设备、计算机可读存储介质、计算机程序、计算机程序产品,上述均可用来实现本公开实施例提供的任一种图像处理方法,相应技术方案和技术效果可参见方法部分的相应记载。In addition, the embodiments of the present disclosure also provide image processing apparatuses, devices, computer-readable storage media, computer programs, and computer program products, all of which can be used to implement any image processing method provided by the embodiments of the present disclosure, and the corresponding technical solutions and The technical effects can be found in the corresponding records in the Methods section.
图5示出本公开实施例提供的图像处理装置的框图。如图5所示,所述图像处理装置包括:FIG. 5 shows a block diagram of an image processing apparatus provided by an embodiment of the present disclosure. As shown in Figure 5, the image processing device includes:
色块分割部分51,配置为对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;The color block segmentation part 51 is configured to perform color block segmentation on the first image and the second image respectively, and obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image. , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to a first preset threshold;
匹配部分52,配置为对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;The matching part 52 is configured to match the color patches in the first color patch segmentation result with the color patches in the second color patch segmentation result to obtain the first color patch segmentation result and the second color patch Color patch matching results between block segmentation results;
第一确定部分53,配置为根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。The first determining part 53 is configured to determine the first optical flow between the first image and the second image according to the color patch matching result.
在一种可能的实现方式中,所述装置还包括:In a possible implementation, the apparatus further includes:
优化部分,配置为根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。An optimization part configured to perform a first optical flow between the first image and the second image according to the first image feature corresponding to the first image and the second image feature corresponding to the second image optimization to obtain a second optical flow between the first image and the second image.
在一种可能的实现方式中,In one possible implementation,
所述第一图像和所述第二图像是目标视频中的相邻帧;the first image and the second image are adjacent frames in the target video;
所述装置还包括:第二确定部分,配置为根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧。The apparatus further includes: a second determination part configured to determine the first image and the second image according to the third image feature corresponding to the first image and the fourth image feature corresponding to the second image, and the first image and the second image A second optical flow between the first image and the second image is determined to be an intermediate frame.
在一种可能的实现方式中,所述色块分割部分51配置为:In a possible implementation manner, the color block dividing part 51 is configured as:
对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果;Perform edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image;
根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;performing color block segmentation on the first image according to the first edge extraction result to obtain a first color block segmentation result corresponding to the first image;
根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。According to the second edge extraction result, color block segmentation is performed on the second image to obtain a second color block segmentation result corresponding to the second image.
在一种可能的实现方式中,所述匹配部分52配置为:In a possible implementation manner, the matching part 52 is configured as:
对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征;Perform feature extraction on the first image and the second image respectively to obtain a fifth image feature corresponding to the first image and a sixth image feature corresponding to the second image;
根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵;According to the first color block segmentation result and the fifth image feature, obtain a first color block feature matrix corresponding to the first image;
根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵;According to the second color block segmentation result and the sixth image feature, obtain a second color block feature matrix corresponding to the second image;
根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。According to the first color block feature matrix and the second color block feature matrix, the color blocks in the first color block segmentation result are matched with the color blocks in the second color block segmentation result, and the obtained color block is obtained. A color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
在一种可能的实现方式中,所述匹配部分52配置为:In a possible implementation manner, the matching part 52 is configured as:
根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵;According to the first color block segmentation result, superpixel pooling is performed on the fifth image feature to obtain a first color block feature matrix corresponding to the first image;
根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵。According to the second color block segmentation result, superpixel pooling is performed on the sixth image feature to obtain a second color block feature matrix corresponding to the second image.
在一种可能的实现方式中,所述匹配部分52配置为:In a possible implementation manner, the matching part 52 is configured as:
根据所述第一色块特征矩阵和所述第二色块特征矩阵,确定所述第一色块分割结果中的第一色块的特征与所述第二色块分割结果中的第二色块的特征之间的相似度,其中,所述第一色块为所述第一色块分割结果中的任意一个色块,所述第二色块为所述第二色块分割结果中的任意一个色块;According to the first color block feature matrix and the second color block feature matrix, the feature of the first color block in the first color block segmentation result and the second color block in the second color block segmentation result are determined The similarity between the features of the blocks, wherein the first color block is any color block in the first color block segmentation result, and the second color block is the second color block in the second color block segmentation result. any color block;
根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度;determining the degree of matching between the first color block and the second color block according to the similarity between the feature of the first color block and the feature of the second color block;
根据所述第一色块分割结果中的色块与所述第二色块分割结果中的色块之间的匹配度,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。According to the matching degree between the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result, the first color block segmentation result and the second color block segmentation result are obtained between the color patch matching results.
在一种可能的实现方式中,所述匹配部分52配置为:In a possible implementation manner, the matching part 52 is configured as:
根据所述第一色块与所述第二色块之间的尺寸差异和位置差异中的一项或两项,以及所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度。According to one or both of the size difference and the position difference between the first color patch and the second color patch, and between the features of the first color patch and the second color patch The similarity is determined to determine the matching degree between the first color block and the second color block.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第一光流包括从所述第一图像至所述第二图像的第一光流和/或从所述第二图像至所述第一图像的第一光流。In a possible implementation manner, the first optical flow between the first image and the second image includes the first optical flow from the first image to the second image and/or the first optical flow from the first image to the second image a first optical flow from the second image to the first image.
在一种可能的实现方式中,所述优化部分配置为:In a possible implementation manner, the optimization part is configured as:
根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性;determining the correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image according to the first optical flow between the first image and the second image;
根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。According to the correlation, a first optical flow between the first image and the second image is optimized to obtain a second optical flow between the first image and the second image.
在一种可能的实现方式中,所述优化部分配置为:In a possible implementation manner, the optimization part is configured as:
根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流。According to the correlation, multiple iterations are performed on the first optical flow between the first image and the second image to obtain a second optical flow between the first image and the second image .
在一种可能的实现方式中,所述优化部分配置为:In a possible implementation manner, the optimization part is configured as:
根据所述第一图像与所述第二图像之间的第一光流,以及所述第一图像的像素值和所述第二图像的像素值,得到所述第一光流对应的置信度图;According to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image, the confidence level corresponding to the first optical flow is obtained picture;
根据所述置信度图对所述第一光流进行加权,得到所述第一光流对应的第1次优化的待优化光流;Weighting the first optical flow according to the confidence map to obtain the optical flow to be optimized for the first optimization corresponding to the first optical flow;
在第t次优化中,根据所述第t次优化的待优化光流、所述相关性以及所述第一图像特征,确定第t次优化的优化光流,并在t小于T的情况下,将第t次优化的优化光流作为第t+1次优化的待优化光流,其中,1≤t≤T,T表示预设的迭代优化次数,T大于或等于2;In the t-th optimization, the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1≤t≤T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2;
将第T次优化的优化光流确定为所述第一图像与所述第二图像之间的第二光流。The optimized optical flow of the T-th optimization is determined as the second optical flow between the first image and the second image.
在一种可能的实现方式中,所述第一图像与所述第二图像之间的第二光流包括从所述第一图像至所述第二图像的第二光流和从所述第二图像至所述第一图像的第二光流;In a possible implementation manner, the second optical flow between the first image and the second image includes a second optical flow from the first image to the second image and a second optical flow from the first image to the second image. a second optical flow from two images to the first image;
所述第二确定部分配置为:The second determination part is configured as:
根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流;determining a third optical flow from the first image to the intermediate frame according to the second optical flow from the first image to the second image;
根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流;determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image;
根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧。The intermediate frame is determined according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image.
在一种可能的实现方式中,所述第二确定部分配置为:In a possible implementation manner, the second determining part is configured as:
根据从所述第一图像至所述第二图像的第二光流,以及第一参数,确定从所述第一图像至所述中间 帧的第三光流,其中,所述第一参数为第一时间间隔与第二时间间隔的比值,所述第一时间间隔为所述第一图像与所述中间帧之间的时间间隔,所述第二时间间隔为所述第一图像与所述第二图像之间的时间间隔;A third optical flow from the first image to the intermediate frame is determined according to the second optical flow from the first image to the second image and a first parameter, wherein the first parameter is A ratio of a first time interval to a second time interval, where the first time interval is the time interval between the first image and the intermediate frame, and the second time interval is the first image and the the time interval between the second images;
根据从所述第二图像至所述第一图像的第二光流,以及所述第一参数,确定从所述第二图像至所述中间帧的第四光流。A fourth optical flow from the second image to the intermediate frame is determined based on the second optical flow from the second image to the first image, and the first parameter.
在一种可能的实现方式中,所述第二确定部分配置为:In a possible implementation manner, the second determining part is configured as:
根据所述第三光流和所述第一图像,确定所述中间帧对应的第一前向映射结果;determining a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image;
根据所述第三光流和所述第三图像特征,确定所述中间帧的图像特征对应的第二前向映射结果;determining a second forward mapping result corresponding to the image feature of the intermediate frame according to the third optical flow and the third image feature;
根据所述第四光流和所述第二图像,确定所述中间帧对应的第三前向映射结果;determining a third forward mapping result corresponding to the intermediate frame according to the fourth optical flow and the second image;
根据所述第四光流和所述第四图像特征,确定所述中间帧的图像特征对应的第四前向映射结果;determining, according to the fourth optical flow and the fourth image feature, a fourth forward mapping result corresponding to the image feature of the intermediate frame;
根据所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果,确定所述中间帧。The intermediate frame is determined according to the first forward mapping result, the second forward mapping result, the third forward mapping result and the fourth forward mapping result.
在一种可能的实现方式中,所述第一图像和所述第二图像为动画视频的视频帧。In a possible implementation manner, the first image and the second image are video frames of an animation video.
在本公开实施例中,通过对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,并根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流,由此能够准确地确定所述第一图像与所述第二图像之间的光流。由于本公开实施例提供的图像处理装置对像素之间的纹理匹配的依赖度较低,因此本公开实施例提供的图像处理装置也能够准确地确定缺少纹理的图像之间的光流。In the embodiment of the present disclosure, by performing color block segmentation on the first image and the second image respectively, a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image are obtained , wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to The first preset threshold is to match the color blocks in the first color block segmentation result with the color blocks in the second color block segmentation result, and obtain the first color block segmentation result and the second color block. The color patch matching result between the block segmentation results, and the first optical flow between the first image and the second image is determined according to the color patch matching result, so that the first optical flow can be accurately determined optical flow between the image and the second image. Since the image processing apparatus provided by the embodiment of the present disclosure has a low dependence on texture matching between pixels, the image processing apparatus provided by the embodiment of the present disclosure can also accurately determine the optical flow between images lacking texture.
在一些实施例中,本公开实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其具体实现和技术效果可以参照上文方法实施例的描述。In some embodiments, the functions or modules included in the apparatus provided by the embodiments of the present disclosure may be used to execute the methods described in the above method embodiments, and the specific implementation and technical effects thereof may refer to the descriptions of the above method embodiments.
本公开实施例还提供一种计算机可读存储介质,其上存储有计算机程序指令,所述计算机程序指令被处理器执行时实现上述方法。其中,所述计算机可读存储介质可以是非易失性计算机可读存储介质,或者可以是易失性计算机可读存储介质。Embodiments of the present disclosure further provide a computer-readable storage medium, on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the foregoing method is implemented. Wherein, the computer-readable storage medium may be a non-volatile computer-readable storage medium, or may be a volatile computer-readable storage medium.
本公开实施例还提出一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现上述方法。Embodiments of the present disclosure further provide a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, the processor in the electronic device executes the above method.
本公开实施例还提供了一种计算机程序产品,用于存储计算机可读指令,指令被执行时使得计算机执行上述任一实施例提供的图像处理方法的操作。Embodiments of the present disclosure also provide a computer program product for storing computer-readable instructions, which, when executed, cause the computer to perform the operations of the image processing method provided by any of the foregoing embodiments.
本公开实施例还提供一种电子设备,包括:一个或多个处理器;用于存储可执行指令的存储器;其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行上述方法。Embodiments of the present disclosure further provide an electronic device, including: one or more processors; a memory for storing executable instructions; wherein the one or more processors are configured to invoke executable instructions stored in the memory instruction to execute the above method.
电子设备可以被提供为终端、服务器或其它形态的设备。The electronic device may be provided as a terminal, server or other form of device.
图6示出本公开实施例提供的一种电子设备的框图。例如,电子设备800可以是移动电话,计算机,数字广播终端,消息收发设备,游戏控制台,平板设备,医疗设备,健身设备,个人数字助理等终端。FIG. 6 shows a block diagram of an electronic device provided by an embodiment of the present disclosure. For example, electronic device 800 may be a mobile phone, computer, digital broadcast terminal, messaging device, game console, tablet device, medical device, fitness device, personal digital assistant, etc. terminal.
参照图6,电子设备800可以包括以下一个或多个组件:处理组件802,存储器804,电源组件806,多媒体组件808,音频组件810,输入/输出(I/O)的接口812,传感器组件814,以及通信组件816。6, electronic device 800 may include one or more of the following components: processing component 802, memory 804, power supply component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814 , and the communication component 816 .
处理组件802通常控制电子设备800的整体操作,诸如与显示,电话呼叫,数据通信,相机操作和记录操作相关联的操作。处理组件802可以包括一个或多个处理器820来执行指令,以完成上述的方法的全部或部分步骤。此外,处理组件802可以包括一个或多个模块,便于处理组件802和其他组件之间的交互。例如,处理组件802可以包括多媒体模块,以方便多媒体组件808和处理组件802之间的交互。The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 can include one or more processors 820 to execute instructions to perform all or some of the steps of the methods described above. Additionally, processing component 802 may include one or more modules that facilitate interaction between processing component 802 and other components. For example, processing component 802 may include a multimedia module to facilitate interaction between multimedia component 808 and processing component 802.
存储器804被配置为存储各种类型的数据以支持在电子设备800的操作。这些数据的示例包括用于在电子设备800上操作的任何应用程序或方法的指令,联系人数据,电话簿数据,消息,图片,视频等。存储器804可以由任何类型的易失性或非易失性存储设备或者它们的组合实现,如静态随机存取存储器(SRAM),电可擦除可编程只读存储器(EEPROM),可擦除可编程只读存储器(EPROM),可编程只读存储器(PROM),只读存储器(ROM),磁存储器,快闪存储器,磁盘或光盘。 Memory 804 is configured to store various types of data to support operation at electronic device 800 . Examples of such data include instructions for any application or method operating on electronic device 800, contact data, phonebook data, messages, pictures, videos, and the like. Memory 804 may be implemented by any type of volatile or nonvolatile storage device or combination thereof, such as static random access memory (SRAM), electrically erasable programmable read only memory (EEPROM), erasable Programmable Read Only Memory (EPROM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Magnetic Memory, Flash Memory, Magnetic or Optical Disk.
电源组件806为电子设备800的各种组件提供电力。电源组件806可以包括电源管理系统,一个或多个电源,及其他与为电子设备800生成、管理和分配电力相关联的组件。 Power supply assembly 806 provides power to various components of electronic device 800 . Power supply components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 800 .
多媒体组件808包括在所述电子设备800和用户之间的提供一个输出接口的屏幕。在一些实施例中,屏幕可以包括液晶显示器(LCD)和触摸面板(TP)。如果屏幕包括触摸面板,屏幕可以被实现为触摸屏,以接收来自用户的输入信号。触摸面板包括一个或多个触摸传感器以感测触摸、滑动和触摸面板上的手势。所述触摸传感器可以不仅感测触摸或滑动动作的边界,而且还检测与所述触摸或滑动操作相关的持续时间和压力。在一些实施例中,多媒体组件808包括一个前置摄像头和/或后置摄像头。当电子设备800 处于操作模式,如拍摄模式或视频模式时,前置摄像头和/或后置摄像头可以接收外部的多媒体数据。每个前置摄像头和后置摄像头可以是一个固定的光学透镜系统或具有焦距和光学变焦能力。 Multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touch, swipe, and gestures on the touch panel. The touch sensor may not only sense the boundaries of a touch or swipe action, but also detect the duration and pressure associated with the touch or swipe action. In some embodiments, the multimedia component 808 includes a front-facing camera and/or a rear-facing camera. When the electronic device 800 is in an operation mode, such as a shooting mode or a video mode, the front camera and/or the rear camera may receive external multimedia data. Each of the front and rear cameras can be a fixed optical lens system or have focal length and optical zoom capability.
音频组件810被配置为输出和/或输入音频信号。例如,音频组件810包括一个麦克风(MIC),当电子设备800处于操作模式,如呼叫模式、记录模式和语音识别模式时,麦克风被配置为接收外部音频信号。所接收的音频信号可以被进一步存储在存储器804或经由通信组件816发送。在一些实施例中,音频组件810还包括一个扬声器,用于输出音频信号。 Audio component 810 is configured to output and/or input audio signals. For example, audio component 810 includes a microphone (MIC) that is configured to receive external audio signals when electronic device 800 is in operating modes, such as calling mode, recording mode, and voice recognition mode. The received audio signal may be further stored in memory 804 or transmitted via communication component 816 . In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
I/O接口812为处理组件802和外围接口模块之间提供接口,上述外围接口模块可以是键盘,点击轮,按钮等。这些按钮可包括但不限于:主页按钮、音量按钮、启动按钮和锁定按钮。The I/O interface 812 provides an interface between the processing component 802 and a peripheral interface module, which may be a keyboard, a click wheel, a button, or the like. These buttons may include, but are not limited to: home button, volume buttons, start button, and lock button.
传感器组件814包括一个或多个传感器,用于为电子设备800提供各个方面的状态评估。例如,传感器组件814可以检测到电子设备800的打开/关闭状态,组件的相对定位,例如所述组件为电子设备800的显示器和小键盘,传感器组件814还可以检测电子设备800或电子设备800一个组件的位置改变,用户与电子设备800接触的存在或不存在,电子设备800方位或加速/减速和电子设备800的温度变化。传感器组件814可以包括接近传感器,被配置用来在没有任何的物理接触时检测附近物体的存在。传感器组件814还可以包括光传感器,如互补金属氧化物半导体(CMOS)或电荷耦合装置(CCD)图像传感器,用于在成像应用中使用。在一些实施例中,该传感器组件814还可以包括加速度传感器,陀螺仪传感器,磁传感器,压力传感器或温度传感器。 Sensor assembly 814 includes one or more sensors for providing status assessment of various aspects of electronic device 800 . For example, the sensor assembly 814 can detect the on/off state of the electronic device 800, the relative positioning of the components, such as the display and the keypad of the electronic device 800, the sensor assembly 814 can also detect the electronic device 800 or one of the electronic device 800 Changes in the position of components, presence or absence of user contact with the electronic device 800 , orientation or acceleration/deceleration of the electronic device 800 and changes in the temperature of the electronic device 800 . Sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Sensor assembly 814 may also include a light sensor, such as a complementary metal oxide semiconductor (CMOS) or charge coupled device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
通信组件816被配置为便于电子设备800和其他设备之间有线或无线方式的通信。电子设备800可以接入基于通信标准的无线网络,如无线网络(Wi-Fi)、第二代移动通信技术(2G)、第三代移动通信技术(3G)、第四代移动通信技术(4G)/通用移动通信技术的长期演进(LTE)、第五代移动通信技术(5G)或它们的组合。在一个示例性实施例中,通信组件816经由广播信道接收来自外部广播管理系统的广播信号或广播相关信息。在一个示例性实施例中,所述通信组件816还包括近场通信(NFC)模块,以促进短程通信。例如,在NFC模块可基于射频识别(RFID)技术,红外数据协会(IrDA)技术,超宽带(UWB)技术,蓝牙(BT)技术和其他技术来实现。 Communication component 816 is configured to facilitate wired or wireless communication between electronic device 800 and other devices. The electronic device 800 can access a wireless network based on communication standards, such as wireless network (Wi-Fi), second generation mobile communication technology (2G), third generation mobile communication technology (3G), fourth generation mobile communication technology (4G) )/Long Term Evolution (LTE) of Universal Mobile Communications Technology, Fifth Generation Mobile Communications Technology (5G), or a combination thereof. In one exemplary embodiment, the communication component 816 receives broadcast signals or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
在示例性实施例中,电子设备800可以被一个或多个应用专用集成电路(ASIC)、数字信号处理器(DSP)、数字信号处理设备(DSPD)、可编程逻辑器件(PLD)、现场可编程门阵列(FPGA)、控制器、微控制器、微处理器或其他电子元件实现,用于执行上述方法。In an exemplary embodiment, electronic device 800 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable A programmed gate array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation is used to perform the above method.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器804,上述计算机程序指令可由电子设备800的处理器820执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium, such as a memory 804 comprising computer program instructions executable by the processor 820 of the electronic device 800 to perform the above method is also provided.
图7示出本公开实施例提供的另一种电子设备的框图。例如,电子设备1900可以被提供为一服务器。参照图7,电子设备1900包括处理组件1922,其进一步包括一个或多个处理器,以及由存储器1932所代表的存储器资源,用于存储可由处理组件1922的执行的指令,例如应用程序。存储器1932中存储的应用程序可以包括一个或一个以上的每一个对应于一组指令的模块。此外,处理组件1922被配置为执行指令,以执行上述方法。FIG. 7 shows a block diagram of another electronic device provided by an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server. 7, electronic device 1900 includes processing component 1922, which further includes one or more processors, and a memory resource represented by memory 1932 for storing instructions executable by processing component 1922, such as applications. An application program stored in memory 1932 may include one or more modules, each corresponding to a set of instructions. Additionally, the processing component 1922 is configured to execute instructions to perform the above-described methods.
电子设备1900还可以包括一个电源组件1926被配置为执行电子设备1900的电源管理,一个有线或无线网络接口1950被配置为将电子设备1900连接到网络,和一个输入输出(I/O)接口1958。电子设备1900可以操作基于存储在存储器1932的操作系统,例如微软服务器操作系统(Windows Server TM),苹果公司推出的基于图形用户界面操作系统(Mac OS X TM),多用户多进程的计算机操作系统(Unix TM),自由和开放原代码的类Unix操作系统(Linux TM),开放原代码的类Unix操作系统(FreeBSD TM)或类似。 The electronic device 1900 may also include a power supply assembly 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input output (I/O) interface 1958 . The electronic device 1900 can operate based on an operating system stored in the memory 1932, such as a Microsoft server operating system (Windows Server ), a graphical user interface based operating system (Mac OS X ) introduced by Apple, a multi-user multi-process computer operating system (Unix ), Free and Open Source Unix-like Operating System (Linux ), Open Source Unix-like Operating System (FreeBSD ) or the like.
在示例性实施例中,还提供了一种非易失性计算机可读存储介质,例如包括计算机程序指令的存储器1932,上述计算机程序指令可由电子设备1900的处理组件1922执行以完成上述方法。In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as memory 1932 comprising computer program instructions executable by processing component 1922 of electronic device 1900 to perform the above-described method.
本公开可以是系统、方法和/或计算机程序产品。计算机程序产品可以包括计算机可读存储介质,其上载有用于使处理器实现本公开的各个方面的计算机可读程序指令。The present disclosure may be a system, method and/or computer program product. The computer program product may include a computer-readable storage medium having computer-readable program instructions loaded thereon for causing a processor to implement various aspects of the present disclosure.
计算机可读存储介质可以是可以保持和存储由指令执行设备使用的指令的有形设备。计算机可读存储介质例如可以是――但不限于――电存储设备、磁存储设备、光存储设备、电磁存储设备、半导体存储设备或者上述的任意合适的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、静态随机存取存储器(SRAM)、便携式压缩盘只读存储器(CD-ROM)、数字多功能盘(DVD)、记忆棒、软盘、机械编码设备、例如其上存储有指令的打孔卡或凹槽内凸起结构、以及上述的任意合适的组合。这里所使用的计算机可读存储介质不被解释为瞬时信号本身,诸如无线电波或者其他自由传播的电磁波、通过波导或其他传输媒介传播的电磁波(例如,通过光纤电缆的光脉冲)、或者通过电线传输的电信号。A computer-readable storage medium may be a tangible device that can hold and store instructions for use by the instruction execution device. The computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. More specific examples (non-exhaustive list) of computer readable storage media include: portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable programmable read only memory (EPROM) or flash memory), static random access memory (SRAM), portable compact disk read only memory (CD-ROM), digital versatile disk (DVD), memory sticks, floppy disks, mechanically coded devices, such as printers with instructions stored thereon Hole cards or raised structures in grooves, and any suitable combination of the above. Computer-readable storage media, as used herein, are not to be construed as transient signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through waveguides or other transmission media (eg, light pulses through fiber optic cables), or through electrical wires transmitted electrical signals.
这里所描述的计算机可读程序指令可以从计算机可读存储介质下载到各个计算/处理设备,或者通过网络、例如因特网、局域网、广域网和/或无线网下载到外部计算机或外部存储设备。网络可以包括铜传 输电缆、光纤传输、无线传输、路由器、防火墙、交换机、网关计算机和/或边缘服务器。每个计算/处理设备中的网络适配卡或者网络接口从网络接收计算机可读程序指令,并转发该计算机可读程序指令,以供存储在各个计算/处理设备中的计算机可读存储介质中。The computer readable program instructions described herein may be downloaded to various computing/processing devices from a computer readable storage medium, or to an external computer or external storage device over a network such as the Internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer-readable program instructions from a network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in each computing/processing device .
用于执行本公开操作的计算机程序指令可以是汇编指令、指令集架构(ISA)指令、机器指令、机器相关指令、微代码、固件指令、状态设置数据、或者以一种或多种编程语言的任意组合编写的源代码或目标代码,所述编程语言包括面向对象的编程语言—诸如Smalltalk、C++等,以及常规的过程式编程语言—诸如“C”语言或类似的编程语言。计算机可读程序指令可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络—包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。在一些实施例中,通过利用计算机可读程序指令的状态信息来个性化定制电子电路,例如可编程逻辑电路、现场可编程门阵列(FPGA)或可编程逻辑阵列(PLA),该电子电路可以执行计算机可读程序指令,从而实现本公开的各个方面。Computer program instructions for carrying out operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or instructions in one or more programming languages. Source or object code, written in any combination, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as the "C" language or similar programming languages. The computer readable program instructions 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 implement. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through the Internet connect). In some embodiments, custom electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can be personalized by utilizing state information of computer readable program instructions. Computer readable program instructions are executed to implement various aspects of the present disclosure.
这里参照根据本公开实施例的方法、装置(系统)和计算机程序产品的流程图和/或框图描述了本公开的各个方面。应当理解,流程图和/或框图的每个方框以及流程图和/或框图中各方框的组合,都可以由计算机可读程序指令实现。Aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
这些计算机可读程序指令可以提供给通用计算机、专用计算机或其它可编程数据处理装置的处理器,从而生产出一种机器,使得这些指令在通过计算机或其它可编程数据处理装置的处理器执行时,产生了实现流程图和/或框图中的一个或多个方框中规定的功能/动作的装置。也可以把这些计算机可读程序指令存储在计算机可读存储介质中,这些指令使得计算机、可编程数据处理装置和/或其他设备以特定方式工作,从而,存储有指令的计算机可读介质则包括一个制造品,其包括实现流程图和/或框图中的一个或多个方框中规定的功能/动作的各个方面的指令。These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer or other programmable data processing apparatus to produce a machine that causes the instructions when executed by the processor of the computer or other programmable data processing apparatus , resulting in means for implementing the functions/acts specified in one or more blocks of the flowchart and/or block diagrams. These computer readable program instructions can also be stored in a computer readable storage medium, these instructions cause a computer, programmable data processing apparatus and/or other equipment to operate in a specific manner, so that the computer readable medium on which the instructions are stored includes An article of manufacture comprising instructions for implementing various aspects of the functions/acts specified in one or more blocks of the flowchart and/or block diagrams.
也可以把计算机可读程序指令加载到计算机、其它可编程数据处理装置、或其它设备上,使得在计算机、其它可编程数据处理装置或其它设备上执行一系列操作步骤,以产生计算机实现的过程,从而使得在计算机、其它可编程数据处理装置、或其它设备上执行的指令实现流程图和/或框图中的一个或多个方框中规定的功能/动作。Computer readable program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other equipment to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other equipment to produce a computer-implemented process , thereby causing instructions executing on a computer, other programmable data processing apparatus, or other device to implement the functions/acts specified in one or more blocks of the flowcharts and/or block diagrams.
附图中的流程图和框图显示了根据本公开的多个实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或指令的一部分,所述模块、程序段或指令的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。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 the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more functions for implementing the specified logical function(s) executable instructions. In some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also 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 in dedicated hardware-based systems that perform the specified functions or actions , or can be implemented in a combination of dedicated hardware and computer instructions.
该计算机程序产品可以具体通过硬件、软件或其结合的方式实现。在一个可选实施例中,所述计算机程序产品具体体现为计算机存储介质,在另一个可选实施例中,计算机程序产品具体体现为软件产品,例如软件开发包(Software Development Kit,SDK)等等。The computer program product can be specifically implemented by hardware, software or a combination thereof. In an optional embodiment, the computer program product is embodied as a computer storage medium, and in another optional embodiment, the computer program product is embodied as a software product, such as a software development kit (Software Development Kit, SDK), etc. Wait.
以上已经描述了本公开的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术的改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。Various embodiments of the present disclosure have been described above, and the foregoing descriptions are exemplary, not exhaustive, and not limiting of the disclosed embodiments. Numerous modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein was chosen to best explain the principles of the various embodiments, the practical application or improvement over the technology in the marketplace, or to enable others of ordinary skill in the art to understand the various embodiments disclosed herein.
工业实用性Industrial Applicability
本公开实施例提供了一种图像处理方法及装置、设备、存储介质、程序和程序产品。所述方法包括:对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。根据本公开实施例提供的图像处理方法能够准确地确定所述第一图像与所述第二图像之间的光流。Embodiments of the present disclosure provide an image processing method and apparatus, device, storage medium, program, and program product. The method includes: performing color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, For any one color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset value. Set a threshold; match the color blocks in the first color block segmentation result with the color blocks in the second color block segmentation result to obtain the first color block segmentation result and the second color block segmentation result The color patch matching result between them; and determining the first optical flow between the first image and the second image according to the color patch matching result. The image processing method provided according to the embodiment of the present disclosure can accurately determine the optical flow between the first image and the second image.

Claims (21)

  1. 一种图像处理方法,其中,所述方法包括:An image processing method, wherein the method comprises:
    对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;Perform color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, wherein, for the first color block segmentation result Any one color block in the color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first preset threshold;
    对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;Matching the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result to obtain the difference between the first color block segmentation result and the second color block segmentation result. Color block matching result;
    根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。According to the color patch matching result, a first optical flow between the first image and the second image is determined.
  2. 根据权利要求1所述的方法,其中,在所述确定所述第一图像与所述第二图像之间的第一光流之后,所述方法还包括:The method of claim 1, wherein after the determining the first optical flow between the first image and the second image, the method further comprises:
    根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。According to the first image feature corresponding to the first image and the second image feature corresponding to the second image, the first optical flow between the first image and the second image is optimized to obtain the a second optical flow between the first image and the second image.
  3. 根据权利要求2所述的方法,其中,The method of claim 2, wherein,
    所述第一图像和所述第二图像是目标视频中的相邻帧;the first image and the second image are adjacent frames in the target video;
    在所述得到所述第一图像与所述第二图像之间的第二光流之后,所述方法还包括:根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧。After the obtaining of the second optical flow between the first image and the second image, the method further includes: according to the third image feature corresponding to the first image and the third image feature corresponding to the second image A fourth image feature, and a second optical flow between the first image and the second image, determine an intermediate frame between the first image and the second image.
  4. 根据权利要求1至3中任意一项所述的方法,其中,所述对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,包括:The method according to any one of claims 1 to 3, wherein the color block segmentation is performed on the first image and the second image respectively to obtain a first color block segmentation result corresponding to the first image and the The second color block segmentation result corresponding to the second image, including:
    对第一图像和第二图像分别进行边缘提取,得到所述第一图像对应的第一边缘提取结果和所述第二图像对应的第二边缘提取结果;Perform edge extraction on the first image and the second image respectively to obtain a first edge extraction result corresponding to the first image and a second edge extraction result corresponding to the second image;
    根据所述第一边缘提取结果,对所述第一图像进行色块分割,得到所述第一图像对应的第一色块分割结果;performing color block segmentation on the first image according to the first edge extraction result to obtain a first color block segmentation result corresponding to the first image;
    根据所述第二边缘提取结果,对所述第二图像进行色块分割,得到所述第二图像对应的第二色块分割结果。According to the second edge extraction result, color block segmentation is performed on the second image to obtain a second color block segmentation result corresponding to the second image.
  5. 根据权利要求1至4中任意一项所述的方法,其中,所述对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:The method according to any one of claims 1 to 4, wherein the matching of the color patches in the first color patch segmentation result and the color patches in the second color patch segmentation result is performed to obtain the The color patch matching result between the first color patch segmentation result and the second color patch segmentation result, including:
    对所述第一图像和所述第二图像分别进行特征提取,得到所述第一图像对应的第五图像特征和所述第二图像对应的第六图像特征;Perform feature extraction on the first image and the second image respectively to obtain a fifth image feature corresponding to the first image and a sixth image feature corresponding to the second image;
    根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵;According to the first color block segmentation result and the fifth image feature, obtain a first color block feature matrix corresponding to the first image;
    根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵;According to the second color block segmentation result and the sixth image feature, obtain a second color block feature matrix corresponding to the second image;
    根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。According to the first color block feature matrix and the second color block feature matrix, the color blocks in the first color block segmentation result are matched with the color blocks in the second color block segmentation result, and the obtained color block is obtained. The color patch matching result between the first color patch segmentation result and the second color patch segmentation result.
  6. 根据权利要求5所述的方法,其中,The method of claim 5, wherein,
    所述根据所述第一色块分割结果和所述第五图像特征,得到所述第一图像对应的第一色块特征矩阵,包括:根据所述第一色块分割结果,对所述第五图像特征进行超像素池化,得到所述第一图像对应的第一色块特征矩阵;The obtaining a first color block feature matrix corresponding to the first image according to the first color block segmentation result and the fifth image feature includes: according to the first color block segmentation result, for the first color block segmentation result. Five image features are subjected to superpixel pooling to obtain a first color block feature matrix corresponding to the first image;
    所述根据所述第二色块分割结果和所述第六图像特征,得到所述第二图像对应的第二色块特征矩阵,包括:根据所述第二色块分割结果,对所述第六图像特征进行超像素池化,得到所述第二图像对应的第二色块特征矩阵。The obtaining a second color block feature matrix corresponding to the second image according to the second color block segmentation result and the sixth image feature includes: according to the second color block segmentation result, performing a The six image features are subjected to superpixel pooling to obtain a second color block feature matrix corresponding to the second image.
  7. 根据权利要求5或6所述的方法,其中,所述根据所述第一色块特征矩阵和所述第二色块特征矩阵,对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果,包括:The method according to claim 5 or 6, wherein, according to the first color block feature matrix and the second color block feature matrix, the color blocks in the first color block segmentation result are compared with the color blocks in the first color block segmentation result. The color patches in the second color patch segmentation result are matched to obtain a color patch matching result between the first color patch segmentation result and the second color patch segmentation result, including:
    根据所述第一色块特征矩阵和所述第二色块特征矩阵,确定所述第一色块分割结果中的第一色块的特征与所述第二色块分割结果中的第二色块的特征之间的相似度,其中,所述第一色块为所述第一色块分割结果中的任意一个色块,所述第二色块为所述第二色块分割结果中的任意一个色块;According to the first color block feature matrix and the second color block feature matrix, the feature of the first color block in the first color block segmentation result and the second color block in the second color block segmentation result are determined The similarity between the features of the blocks, wherein the first color block is any color block in the first color block segmentation result, and the second color block is the second color block in the second color block segmentation result. any color block;
    根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度;determining the degree of matching between the first color block and the second color block according to the similarity between the feature of the first color block and the feature of the second color block;
    根据所述第一色块分割结果中的色块与所述第二色块分割结果中的色块之间的匹配度,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果。According to the matching degree between the color blocks in the first color block segmentation result and the color blocks in the second color block segmentation result, the first color block segmentation result and the second color block segmentation result are obtained between the color patch matching results.
  8. 根据权利要求7所述的方法,其中,所述根据所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度,包括:The method according to claim 7, wherein determining the first color block and the second color block according to the similarity between the characteristics of the first color block and the characteristics of the second color block Match between blocks, including:
    根据所述第一色块与所述第二色块之间的尺寸差异和位置差异中的一项或两项,以及所述第一色块的特征与所述第二色块的特征之间的相似度,确定所述第一色块与所述第二色块之间的匹配度。According to one or both of the size difference and the position difference between the first color patch and the second color patch, and between the features of the first color patch and the second color patch The similarity is determined to determine the matching degree between the first color block and the second color block.
  9. 根据权利要求1至8中任意一项所述的方法,其中,所述第一图像与所述第二图像之间的第一光流包括从所述第一图像至所述第二图像的第一光流和/或从所述第二图像至所述第一图像的第一光流。8. The method of any one of claims 1 to 8, wherein the first optical flow between the first image and the second image comprises a first optical flow from the first image to the second image An optical flow and/or a first optical flow from the second image to the first image.
  10. 根据权利要求2所述的方法,其中,所述根据所述第一图像对应的第一图像特征和所述第二图像对应的第二图像特征,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,包括:The method according to claim 2, wherein the first image and the second image are analyzed according to the first image feature corresponding to the first image and the second image feature corresponding to the second image. optimizing the first optical flow between the first image and the second image to obtain the second optical flow between the first image and the second image, including:
    根据所述第一图像与所述第二图像之间的第一光流,确定所述第一图像对应的第一图像特征与所述第二图像对应的第二图像特征之间的相关性;determining the correlation between the first image feature corresponding to the first image and the second image feature corresponding to the second image according to the first optical flow between the first image and the second image;
    根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流。According to the correlation, a first optical flow between the first image and the second image is optimized to obtain a second optical flow between the first image and the second image.
  11. 根据权利要求10所述的方法,其中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行优化,得到所述第一图像与所述第二图像之间的第二光流,包括:The method according to claim 10, wherein, according to the correlation, the first optical flow between the first image and the second image is optimized to obtain the first image and the second image. A second optical flow between the second images, including:
    根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流。According to the correlation, multiple iterations are performed on the first optical flow between the first image and the second image to obtain a second optical flow between the first image and the second image .
  12. 根据权利要求11所述的方法,其中,所述根据所述相关性,对所述第一图像与所述第二图像之间的第一光流进行多次迭代优化,得到所述第一图像与所述第二图像之间的第二光流,包括:The method according to claim 11, wherein, according to the correlation, the first optical flow between the first image and the second image is optimized for multiple iterations to obtain the first image and the second optical flow between the second image, including:
    根据所述第一图像与所述第二图像之间的第一光流,以及所述第一图像的像素值和所述第二图像的像素值,得到所述第一光流对应的置信度图;According to the first optical flow between the first image and the second image, and the pixel value of the first image and the pixel value of the second image, the confidence level corresponding to the first optical flow is obtained picture;
    根据所述置信度图对所述第一光流进行加权,得到所述第一光流对应的第1次优化的待优化光流;Weighting the first optical flow according to the confidence map to obtain the optical flow to be optimized for the first optimization corresponding to the first optical flow;
    在第t次优化中,根据所述第t次优化的待优化光流、所述相关性以及所述第一图像特征,确定第t次优化的优化光流,并在t小于T的情况下,将第t次优化的优化光流作为第t+1次优化的待优化光流,其中,1≤t≤T,T表示预设的迭代优化次数,T大于或等于2;In the t-th optimization, the optimized optical flow of the t-th optimization is determined according to the to-be-optimized optical flow, the correlation and the first image feature of the t-th optimization, and when t is less than T , take the optimized optical flow of the t-th optimization as the optical flow to be optimized for the t+1-th optimization, where 1≤t≤T, T represents the preset number of iterative optimizations, and T is greater than or equal to 2;
    将第T次优化的优化光流确定为所述第一图像与所述第二图像之间的第二光流。The optimized optical flow of the T-th optimization is determined as the second optical flow between the first image and the second image.
  13. 根据权利要求3所述的方法,其中,所述第一图像与所述第二图像之间的第二光流包括从所述第一图像至所述第二图像的第二光流和从所述第二图像至所述第一图像的第二光流;3. The method of claim 3, wherein the second optical flow between the first image and the second image comprises a second optical flow from the first image to the second image and a second optical flow from the first image to the second image a second optical flow from the second image to the first image;
    所述根据所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,以及所述第一图像与所述第二图像之间的第二光流,确定所述第一图像和所述第二图像的中间帧,包括:determining the said An intermediate frame between the first image and the second image, including:
    根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流;determining a third optical flow from the first image to the intermediate frame according to the second optical flow from the first image to the second image;
    根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流;determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image;
    根据所述第三光流和所述第四光流,以及所述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧。The intermediate frame is determined according to the third optical flow and the fourth optical flow, as well as the third image feature corresponding to the first image and the fourth image feature corresponding to the second image.
  14. 根据权利要求13所述的方法,其中,The method of claim 13, wherein,
    所述根据从所述第一图像至所述第二图像的第二光流,确定从所述第一图像至所述中间帧的第三光流,包括:根据从所述第一图像至所述第二图像的第二光流,以及第一参数,确定从所述第一图像至所述中间帧的第三光流,其中,所述第一参数为第一时间间隔与第二时间间隔的比值,所述第一时间间隔为所述第一图像与所述中间帧之间的时间间隔,所述第二时间间隔为所述第一图像与所述第二图像之间的时间间隔;The determining the third optical flow from the first image to the intermediate frame according to the second optical flow from the first image to the second image includes: according to the second optical flow from the first image to the intermediate frame The second optical flow of the second image and the first parameter determine the third optical flow from the first image to the intermediate frame, wherein the first parameter is a first time interval and a second time interval The ratio of , the first time interval is the time interval between the first image and the intermediate frame, and the second time interval is the time interval between the first image and the second image;
    所述根据从所述第二图像至所述第一图像的第二光流,确定从所述第二图像至所述中间帧的第四光流,包括:根据从所述第二图像至所述第一图像的第二光流,以及所述第一参数,确定从所述第二图像至所述中间帧的第四光流。The determining a fourth optical flow from the second image to the intermediate frame according to the second optical flow from the second image to the first image includes: according to the second optical flow from the second image to the intermediate frame The second optical flow of the first image, and the first parameter, determine a fourth optical flow from the second image to the intermediate frame.
  15. 根据权利要求13或14所述的方法,其中,所述根据所述第三光流和所述第四光流,以及所 述第一图像对应的第三图像特征和所述第二图像对应的第四图像特征,确定所述中间帧,包括:The method according to claim 13 or 14, wherein, according to the third optical flow and the fourth optical flow, and the third image feature corresponding to the first image and the second image corresponding The fourth image feature, determining the intermediate frame, includes:
    根据所述第三光流和所述第一图像,确定所述中间帧对应的第一前向映射结果;determining a first forward mapping result corresponding to the intermediate frame according to the third optical flow and the first image;
    根据所述第三光流和所述第三图像特征,确定所述中间帧的图像特征对应的第二前向映射结果;determining a second forward mapping result corresponding to the image feature of the intermediate frame according to the third optical flow and the third image feature;
    根据所述第四光流和所述第二图像,确定所述中间帧对应的第三前向映射结果;determining a third forward mapping result corresponding to the intermediate frame according to the fourth optical flow and the second image;
    根据所述第四光流和所述第四图像特征,确定所述中间帧的图像特征对应的第四前向映射结果;determining, according to the fourth optical flow and the fourth image feature, a fourth forward mapping result corresponding to the image feature of the intermediate frame;
    根据所述第一前向映射结果、所述第二前向映射结果、所述第三前向映射结果和所述第四前向映射结果,确定所述中间帧。The intermediate frame is determined according to the first forward mapping result, the second forward mapping result, the third forward mapping result and the fourth forward mapping result.
  16. 根据权利要求1至15中任意一项所述的方法,其中,所述第一图像和所述第二图像为动画视频的视频帧。The method of any one of claims 1 to 15, wherein the first image and the second image are video frames of an animated video.
  17. 一种图像处理装置,其中,包括:An image processing device, comprising:
    色块分割部分,配置为对第一图像和第二图像分别进行色块分割,得到所述第一图像对应的第一色块分割结果和所述第二图像对应的第二色块分割结果,其中,对于所述第一色块分割结果和所述第二色块分割结果中的任意一个色块,所述色块中的任意两个像素的像素值的差值的绝对值小于或等于第一预设阈值;a color block segmentation part, configured to perform color block segmentation on the first image and the second image respectively, to obtain a first color block segmentation result corresponding to the first image and a second color block segmentation result corresponding to the second image, Wherein, for any color block in the first color block segmentation result and the second color block segmentation result, the absolute value of the difference between the pixel values of any two pixels in the color block is less than or equal to the first color block. a preset threshold;
    匹配部分,配置为对所述第一色块分割结果中的色块与所述第二色块分割结果中的色块进行匹配,得到所述第一色块分割结果与所述第二色块分割结果之间的色块匹配结果;A matching part configured to match the color patches in the first color patch segmentation result with the color patches in the second color patch segmentation result to obtain the first color patch segmentation result and the second color patch Color patch matching results between segmentation results;
    第一确定部分,配置为根据所述色块匹配结果,确定所述第一图像与所述第二图像之间的第一光流。The first determination part is configured to determine the first optical flow between the first image and the second image according to the color patch matching result.
  18. 一种电子设备,其中,包括:An electronic device comprising:
    一个或多个处理器;one or more processors;
    用于存储可执行指令的存储器;memory for storing executable instructions;
    其中,所述一个或多个处理器被配置为调用所述存储器存储的可执行指令,以执行权利要求1至16中任意一项所述的方法。wherein the one or more processors are configured to invoke executable instructions stored in the memory to perform the method of any one of claims 1-16.
  19. 一种计算机可读存储介质,其上存储有计算机程序指令,其中,所述计算机程序指令被处理器执行时实现权利要求1至16中任意一项所述的方法。A computer-readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any one of claims 1 to 16.
  20. 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至16中任意一项所述的方法。A computer program comprising computer readable code, when the computer readable code is run in an electronic device, a processor in the electronic device executes the method for implementing any one of claims 1 to 16 .
  21. 一种计算机程序产品,所述计算机程序产品包括存储了计算机程序的非瞬时性计算机可读存储介质,所述计算机程序被计算机读取并执行时,实现权利要求1至16中任意一项所述的方法。A computer program product, the computer program product comprising a non-transitory computer-readable storage medium storing a computer program, when the computer program is read and executed by a computer, the computer program realizes any one of claims 1 to 16. Methods.
PCT/CN2021/106895 2021-03-15 2021-07-16 Image processing method and apparatus, device, storage medium, program, and program product WO2022193507A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110276844.9 2021-03-15
CN202110276844.9A CN112991381B (en) 2021-03-15 2021-03-15 Image processing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022193507A1 true WO2022193507A1 (en) 2022-09-22

Family

ID=76336476

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/106895 WO2022193507A1 (en) 2021-03-15 2021-07-16 Image processing method and apparatus, device, storage medium, program, and program product

Country Status (2)

Country Link
CN (1) CN112991381B (en)
WO (1) WO2022193507A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112991381B (en) * 2021-03-15 2022-08-02 深圳市慧鲤科技有限公司 Image processing method and device, electronic equipment and storage medium
CN114943736B (en) * 2022-07-21 2022-10-25 山东嘉翔汽车散热器有限公司 Production quality detection method and system for automobile radiating fins
CN116758045B (en) * 2023-07-05 2024-01-23 日照鲁光电子科技有限公司 Surface defect detection method and system for semiconductor light-emitting diode

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101048799A (en) * 2004-10-25 2007-10-03 惠普开发有限公司 Video content understanding through real time video motion analysis
CN101765022A (en) * 2010-01-22 2010-06-30 浙江大学 Depth representing method based on light stream and image segmentation
US20180144477A1 (en) * 2016-06-15 2018-05-24 Beijing Sensetime Technology Development Co.,Ltd Methods and apparatuses, and computing devices for segmenting object
CN108509834A (en) * 2018-01-18 2018-09-07 杭州电子科技大学 Graph structure stipulations method based on video features under polynary logarithm Gaussian Profile
CN112991381A (en) * 2021-03-15 2021-06-18 深圳市慧鲤科技有限公司 Image processing method and device, electronic equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102509071B (en) * 2011-10-14 2016-04-13 江南大学 Optical flow computation system and method
CN109087347B (en) * 2018-08-15 2021-08-17 浙江光珀智能科技有限公司 Image processing method and device
CN109433641B (en) * 2018-09-30 2021-03-16 南通大学 Intelligent detection method for tablet capsule filling omission based on machine vision
CN109584353B (en) * 2018-10-22 2023-04-07 北京航空航天大学 Method for reconstructing three-dimensional facial expression model based on monocular video
CN109741387A (en) * 2018-12-29 2019-05-10 北京旷视科技有限公司 Solid matching method, device, electronic equipment and storage medium
JP6899053B2 (en) * 2019-06-24 2021-07-07 Kddi株式会社 Image decoding device, image decoding method and program
CN110335216B (en) * 2019-07-09 2021-11-30 Oppo广东移动通信有限公司 Image processing method, image processing apparatus, terminal device, and readable storage medium
CN110827323A (en) * 2019-10-31 2020-02-21 博雅工道(北京)机器人科技有限公司 Method and device for hovering underwater device at fixed point
CN111862152B (en) * 2020-06-30 2024-04-05 西安工程大学 Moving target detection method based on inter-frame difference and super-pixel segmentation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101048799A (en) * 2004-10-25 2007-10-03 惠普开发有限公司 Video content understanding through real time video motion analysis
CN101765022A (en) * 2010-01-22 2010-06-30 浙江大学 Depth representing method based on light stream and image segmentation
US20180144477A1 (en) * 2016-06-15 2018-05-24 Beijing Sensetime Technology Development Co.,Ltd Methods and apparatuses, and computing devices for segmenting object
CN108509834A (en) * 2018-01-18 2018-09-07 杭州电子科技大学 Graph structure stipulations method based on video features under polynary logarithm Gaussian Profile
CN112991381A (en) * 2021-03-15 2021-06-18 深圳市慧鲤科技有限公司 Image processing method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112991381A (en) 2021-06-18
CN112991381B (en) 2022-08-02

Similar Documents

Publication Publication Date Title
WO2020224457A1 (en) Image processing method and apparatus, electronic device and storage medium
TWI766286B (en) Image processing method and image processing device, electronic device and computer-readable storage medium
WO2022193507A1 (en) Image processing method and apparatus, device, storage medium, program, and program product
TWI706379B (en) Method, apparatus and electronic device for image processing and storage medium thereof
TWI769635B (en) Network training pedestrian re-identification method and storage medium
WO2021218282A1 (en) Scene depth prediction method and apparatus, camera motion prediction method and apparatus, device, medium, and program
WO2020007241A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
TWI759830B (en) Network training method, image generation method, electronic device and computer-readable storage medium
TW202107339A (en) Pose determination method and apparatus, electronic device, and storage medium
CN109840917B (en) Image processing method and device and network training method and device
CN111401230B (en) Gesture estimation method and device, electronic equipment and storage medium
TWI778313B (en) Method and electronic equipment for image processing and storage medium thereof
CN109325908B (en) Image processing method and device, electronic equipment and storage medium
JP7182020B2 (en) Information processing method, device, electronic device, storage medium and program
KR102367648B1 (en) Method and apparatus for synthesizing omni-directional parallax view, and storage medium
WO2022179013A1 (en) Object positioning method and apparatus, electronic device, storage medium, and program
CN113326768A (en) Training method, image feature extraction method, image recognition method and device
CN111680646B (en) Action detection method and device, electronic equipment and storage medium
CN112184787A (en) Image registration method and device, electronic equipment and storage medium
WO2022193456A1 (en) Target tracking method, apparatus, electronic device, and storage medium
WO2022247091A1 (en) Crowd positioning method and apparatus, electronic device, and storage medium
CN109447258B (en) Neural network model optimization method and device, electronic device and storage medium
WO2022141969A1 (en) Image segmentation method and apparatus, electronic device, storage medium, and program
CN114581525A (en) Attitude determination method and apparatus, electronic device, and storage medium
TWI770531B (en) Face recognition method, electronic device and storage medium thereof

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: 21931085

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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

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