WO2022194079A1 - Sky region segmentation method and apparatus, computer device, and storage medium - Google Patents

Sky region segmentation method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2022194079A1
WO2022194079A1 PCT/CN2022/080598 CN2022080598W WO2022194079A1 WO 2022194079 A1 WO2022194079 A1 WO 2022194079A1 CN 2022080598 W CN2022080598 W CN 2022080598W WO 2022194079 A1 WO2022194079 A1 WO 2022194079A1
Authority
WO
WIPO (PCT)
Prior art keywords
sky
panoramic
images
frames
image
Prior art date
Application number
PCT/CN2022/080598
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 WO2022194079A1 publication Critical patent/WO2022194079A1/en

Links

Classifications

    • 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
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/60Analysis of geometric attributes
    • G06T7/62Analysis of geometric attributes of area, perimeter, diameter or volume
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10016Video; Image sequence
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning

Definitions

  • the present application relates to the technical field of image processing, and in particular, to a sky area segmentation method, apparatus, computer equipment and storage medium.
  • sky segmentation technology which can distinguish sky pixels and non-sky pixels in an image, so as to realize the special effect of sky replacement for the image.
  • the camera or mobile phone when performing sky segmentation to achieve sky replacement, can send the plane image taken to the cloud, and the cloud uses the pre-stored sky segmentation algorithm to perform sky segmentation on the plane image, and returns the segmented result. to the camera or mobile phone; the camera or mobile phone can also perform sky segmentation on the plane image through the locally stored sky segmentation algorithm.
  • the processing speed of the sky segmentation algorithm in the prior art is relatively slow, and the processing accuracy of edge segmentation is low; and the current sky segmentation algorithm processes only plane images, and the sky segmentation processing effect for panoramic images or panoramic videos is relatively low. Difference.
  • a method for segmenting a sky area comprising:
  • the proportion of sky elements in the target panoramic video determine whether to perform sky segmentation processing on the target panoramic video
  • sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
  • judging whether to perform sky segmentation processing on the target panoramic video including:
  • determining whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky pixels in the N mask images includes:
  • judging whether to perform sky segmentation processing on the target panoramic video including:
  • the N frames of panoramic images are identified by the second preset model, and N output results are obtained;
  • the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky;
  • judging whether to perform sky segmentation processing on the target panoramic video including:
  • the proportion of the panoramic image including the sky and the second preset threshold it is determined whether to perform sky segmentation processing on the target panoramic video.
  • the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the panoramic image corresponding to the reference image sky area.
  • the training process of the preset model includes:
  • the panoramic images in the training sample set are input into a neural network model, and the parameters of the neural network model are adjusted according to the output of the neural network model and the loss value of the reference image to obtain the preset model.
  • the training process of the preset model further includes:
  • the neural network model is processed with a model compression algorithm to update the neural network model.
  • a device for segmenting a sky area comprising:
  • the judgment module is used to judge whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video;
  • the acquisition module is used to extract M frames of panoramic images of the target panoramic video when it is judged to perform sky segmentation processing on the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain The mask image of each frame of panoramic image in the M frames of panoramic images; the mask image includes sky area and non-sky area;
  • a segmentation module configured to perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
  • a computer device comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
  • the proportion of sky elements in the target panoramic video determine whether to perform sky segmentation processing on the target panoramic video
  • Extracting M frames of panoramic images of the target panoramic video inputting each frame of panoramic images in the M frames of panoramic images into a preset model, and obtaining a mask image of each frame of panoramic images in the M frames of panoramic images; the mask image including sky areas and non-sky areas;
  • sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the proportion of sky elements in the target panoramic video determine whether to perform sky segmentation processing on the target panoramic video
  • Extracting M frames of panoramic images of the target panoramic video inputting each frame of panoramic images in the M frames of panoramic images into a preset model, and obtaining a mask image of each frame of panoramic images in the M frames of panoramic images; the mask image including sky areas and non-sky areas;
  • sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
  • the computer equipment determines whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; after determining whether to perform sky segmentation processing on the target panoramic video Under the situation, extract the M frames of panoramic images of this target panoramic video, input each frame of panoramic images in this M frames of panoramic images into a preset model, and obtain the mask image of each frame of panoramic images in this M frames of panoramic images; Further, sky segmentation processing may be performed on the panoramic image corresponding to the mask image among the M frames of panoramic images according to the mask image, wherein the mask image includes a sky area and a non-sky area.
  • the target panoramic video before the sky segmentation processing of the target panoramic video is performed, the target panoramic video is first judged to determine whether the target panoramic video is suitable for sky segmentation, and when the target panoramic video is suitable for sky segmentation, the The preset model performs sky segmentation processing on the target panoramic video; this can avoid the problem of poor sky segmentation effect caused by still performing sky segmentation when the panoramic video contains less sky areas in the prior art.
  • the scenes with less sky area that are not suitable for sky segmentation can be effectively filtered, thereby improving the sky segmentation effect; further, each frame of panoramic image can be accurately obtained through the preset model in this embodiment.
  • Respectively corresponding mask images improve the edge processing accuracy of panoramic images, and improve the processing speed of sky segmentation, realize accurate recognition of panoramic images and panoramic videos, and greatly improve the accuracy of panoramic image and panoramic video recognition. Improve the segmentation effect of panoramic images and panoramic videos. Therefore, by using the sky region segmentation method in this embodiment, the sky segmentation effect on panoramic images and panoramic videos can be greatly improved.
  • Fig. 1 is the application environment diagram of the sky area segmentation method in one embodiment
  • FIG. 2 is a schematic flowchart of a method for segmenting a sky region in one embodiment
  • FIG. 3 is a schematic flowchart of a method for segmenting a sky region in another embodiment
  • FIG. 4 is a schematic flowchart of a method for segmenting a sky region in another embodiment
  • FIG. 5 is a structural block diagram of an apparatus for dividing a sky area in one embodiment
  • FIG. 6 is a diagram of the internal structure of a computer device in one embodiment.
  • the sky area segmentation method provided in this application can be applied to the computer equipment as shown in FIG. 1 .
  • the computer equipment can be, but is not limited to, any type of terminal capable of image processing or video processing, such as: ordinary cameras, panoramic cameras , smart phones, personal computers, notebook computers, tablet computers, and VR eyes, etc.; the internal structure of the computer equipment is shown in Figure 1, including a processor, memory, communication interface, display screen and input device connected through the system bus .
  • a method for segmenting a sky area is provided, and the method is applied to the computer device in FIG. 1 as an example for description, including the following steps:
  • Step 201 according to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video.
  • the target panoramic video is a panoramic video to be processed that needs to be divided into the sky.
  • the computer equipment When the computer equipment performs sky segmentation on the target panoramic video, it needs to first determine whether the target panoramic video is suitable for sky segmentation, that is to say, only when the target panoramic video is suitable for sky segmentation, the target panoramic video is processed.
  • Sky segmentation operation optionally, it can be determined whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; wherein, the target panoramic video may include multiple frames of panoramic images, each frame of panoramic video
  • the image can include sky elements and non-sky elements; optionally, the color panoramic image can be converted into a grayscale image through operations such as preprocessing, normalization, subtraction of mean difference, and division of variance, so as to reduce the amount of data processing.
  • image processing technology can be used to mark the sky area and non-sky area of each frame of panoramic image, and then the target panoramic video can be determined.
  • the total area of the sky area that is, the sum of the area of the sky area of each frame of panoramic image
  • the total area of the target panoramic video that is, the sum of the area of each frame of panoramic image; then, according to the sky of the target panoramic video
  • the proportion of sky elements in the target panoramic video can be obtained by dividing the total area of the area by the total area of the target panoramic video.
  • the proportion of sky elements in the target panoramic video and the size of the preset threshold can be used. relationship to determine whether to perform sky segmentation processing on the target panoramic video; when the proportion of sky elements in the target panoramic video is greater than the preset threshold, it can be determined to perform sky segmentation processing on the target panoramic video; in the target panoramic video When the proportion of the sky elements is not greater than the preset threshold, the sky segmentation process is not performed on the target panoramic video; Split processing.
  • Step 202 if yes, then extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the mask of each frame of panoramic images in the M frames of panoramic images image; the mask image includes sky and non-sky areas.
  • the M frames of panoramic images of the target panoramic video are all corresponding panoramic images after converting the target panoramic video into video frame images according to a preset video frame conversion ratio, that is, M is the total number of frames of panoramic images.
  • the preset model includes a panoramic sky segmentation algorithm for accurately identifying panoramic images.
  • the input is a panoramic image
  • the output is a mask image corresponding to the panoramic image.
  • the mask image includes sky areas and non-sky areas. area.
  • the computer device can extract the target panoramic video when it determines that the target panoramic video is subjected to sky segmentation processing, that is, the target panoramic video has a large proportion of sky elements and is suitable for sky segmentation processing of the target panoramic video.
  • M frames of panoramic images of the video and input each frame of the panoramic images of the M frames of panoramic images into the preset model to obtain the mask images corresponding to each frame of the panoramic images in the M frames of panoramic images, that is, Get M mask images.
  • Step 203 Perform sky segmentation processing on the panoramic image corresponding to the mask image among the M frames of panoramic images according to the mask image.
  • the frame of the panoramic image corresponding to the mask image can be subjected to sky segmentation processing according to the mask image, that is, to remove the frame of the panoramic image and the mask image.
  • the non-sky area image obtained by dividing the sky area can be obtained.
  • the computer device determines whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; if it is determined to perform sky segmentation processing on the target panoramic video, extract the target panoramic video M frames of panoramic images, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain a mask image of each frame of panoramic images in the M frames of panoramic images; The panoramic image corresponding to the mask image in the M frames of panoramic images is subjected to sky segmentation processing; wherein, the mask image includes a sky area and a non-sky area.
  • the target panoramic video before the sky segmentation processing of the target panoramic video is performed, the target panoramic video is first judged to determine whether the target panoramic video is suitable for sky segmentation, and when the target panoramic video is suitable for sky segmentation, the The preset model performs sky segmentation processing on the target panoramic video; this can avoid the problem of poor sky segmentation effect caused by still performing sky segmentation when the panoramic video contains less sky areas in the prior art.
  • the scenes with less sky area that are not suitable for sky segmentation can be effectively filtered, thereby improving the sky segmentation effect; further, each frame of panoramic image can be accurately obtained through the preset model in this embodiment.
  • Respectively corresponding mask images improve the edge processing accuracy of panoramic images, and improve the processing speed of sky segmentation, realize accurate recognition of panoramic images and panoramic videos, and greatly improve the accuracy of panoramic image and panoramic video recognition. Improve the segmentation effect of panoramic images and panoramic videos. Therefore, by using the sky region segmentation method in this embodiment, the sky segmentation effect on panoramic images and panoramic videos can be greatly improved.
  • FIG. 3 is a schematic flowchart of a method for segmenting a sky region in another embodiment.
  • This embodiment relates to an optional implementation process of judging whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; on the basis of the above embodiment, as shown in FIG. 3 , the above step 201 includes:
  • Step 301 Determine N frames of panoramic images from the M frames of panoramic images.
  • a partial panoramic image may be selected from all frames of panoramic images corresponding to the target panoramic video, and according to the partial panoramic video
  • the proportion of sky elements in the image is used to determine whether to perform sky segmentation processing on the target panoramic video, so as to reduce the amount of data processing of computer equipment and the amount of calculation of memory. That is, N frames of panoramic images can be determined from the M frames of panoramic images; alternatively, continuous N frames of panoramic images can be randomly selected from the M frames of panoramic images, or different frames of panoramic images can be randomly selected from the M frames of panoramic images. Consecutive N frames of panoramic images. The manner of acquiring N frames of panoramic images is not limited in this embodiment.
  • Step 302 Input the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images.
  • Step 303 according to the proportion of sky pixels in the N mask images, determine whether to perform sky segmentation processing on the target panoramic video.
  • the mask image includes a sky area and a non-sky area, that is, the sky area and the non-sky area Pixels are marked by binary values of 0 and 1, or 0 and 255; further, it can be judged whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky pixels in the N mask images; optional
  • the proportion of the sky pixels can be determined according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images; and according to the proportion of the sky pixels and the first preset The size relationship of the threshold value determines whether to perform sky segmentation processing on the target panoramic video.
  • the number of sky pixels in the N mask images can be expressed as sky_pixels
  • the number of non-sky pixels in the N mask images can be expressed as background_pixels
  • the proportion sky_ratio is greater than the first preset threshold, it can be judged that the target panoramic video is subjected to sky segmentation processing; when the proportion sky_ratio of the sky pixels is not greater than the first preset threshold, it can be judged that the target panoramic video is not to be processed. Perform sky segmentation processing.
  • the computer device determines N frames of panoramic images from the M frames of panoramic images, and inputs the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images; then, according to The proportion of sky pixels in the N mask images determines whether to perform sky segmentation processing on the target panoramic video; that is, in this embodiment, the computer device selects a part of the panoramic image and divides the sky pixels of the part of the panoramic image.
  • the proportion of the target panoramic video is used as the judgment basis for the target panoramic video to determine whether to perform sky segmentation processing on the target panoramic video, which can reduce the data processing volume of the computer equipment; in addition, by inputting the selected N panoramic images into the above-mentioned preset model.
  • the preset model can accurately identify the sky area and non-sky area in the panoramic image, therefore, according to the proportion of sky pixels obtained from the N mask images, and then according to the sky area
  • the proportion of pixels determines whether to perform sky segmentation processing on the target panoramic video, which greatly improves the accuracy of judging the target panoramic video.
  • FIG. 4 is a schematic flowchart of a method for segmenting a sky region in another embodiment.
  • This embodiment relates to another optional implementation process of judging whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; on the basis of the above embodiment, as shown in FIG. 4
  • the above step 201 includes:
  • Step 401 Determine N frames of panoramic images from the M frames of target panoramic images.
  • step 301 details are not repeated here.
  • Step 402 using the second preset model to identify the N frames of panoramic images to obtain N output results.
  • the input of the second preset model is a panoramic image
  • the output is that the panoramic image contains the sky or the panoramic image does not contain the sky.
  • a positive sample image containing a sky area and a negative sample image not containing a sky area can be input into any traditional classification algorithm model, and the sky classification algorithm model can be obtained by training, and the sky classification algorithm model can be used as the second classification algorithm model.
  • any traditional classification algorithm model can be based on a support vector machine (Support Vector Machine) Machine, referred to as SVM), adjacent algorithm (K-NearestNeighbor, referred to as KNN), and deep learning convolutional neural network (Convolutional Neural Networks, CNN for short) and other classification algorithms; among them, deep learning CNN algorithms may include: Residual Neural Networks (Residual Neural Networks) Network, referred to as ResNet), high-resolution network (High-Resoultion Net, referred to as HRNet), and high-efficiency models for mobile and embedded vision applications (referred to as MobileNet), etc.; this embodiment uses which traditional classification algorithm model training The obtained second preset model is not limited.
  • SVM Support Vector Machine
  • KNN K-NearestNeighbor
  • CNN deep learning convolutional neural network
  • ResNet Residual Neural Networks
  • HRNet high-resolution network
  • MobileNet high-efficiency models for mobile and embedded vision applications
  • the N frames of panoramic images may be respectively input into the second preset model, and the N frames of panoramic images may be input by using the second preset model.
  • Each frame of panoramic image is identified separately, and the corresponding output results of each frame of panoramic image are obtained, that is, N output results are obtained; wherein, each output result indicates whether the corresponding frame of panoramic image is a panoramic image containing the sky, or does not contain the sky. panoramic image.
  • Step 403 according to the proportion of panoramic images including the sky in the N output results, determine whether to perform sky segmentation processing on the target panoramic video.
  • N output results after N output results are obtained, it may be determined whether to perform sky segmentation on the target panoramic video according to the proportion of panoramic images containing the sky in the N output results processing; optionally, according to the number of panoramic images that contain the sky in the N output results and the number of panoramic images that do not contain the sky in the N output results, determine the proportion of the panoramic images that contain the sky; and then according to the Whether to perform sky segmentation processing on the target panoramic video is determined according to the relationship between the proportion of panoramic images including the sky and the second preset threshold.
  • the number of panoramic images containing the sky in the N output results can be expressed as sky_nums
  • the number of panoramic images that do not contain the sky in the N output results can be expressed as background_nums
  • the computer device determines N frames of panoramic images from the M frames of target panoramic images, and uses the second preset model to identify the N frames of panoramic images to obtain N output results, and then, according to the N outputs
  • the proportion of the panoramic images containing the sky in the result determines whether to perform sky segmentation processing on the target panoramic video; that is, in this embodiment, the computer equipment selects a part of the panoramic image and divides the panoramic image of the part of the panoramic image including the sky.
  • the proportion of images is used as the basis for judging the target panoramic video to determine whether to perform sky segmentation processing on the target panoramic video, which can reduce the data processing volume of computer equipment; in addition, pre-trained can accurately identify whether the panoramic image contains sky.
  • the second preset model is to identify the part of the panoramic images respectively to obtain the corresponding output results, and then determine the proportion of the panoramic images containing the sky according to the output results and determine whether to perform sky segmentation processing on the target panoramic video, which can improve the The accuracy of the target panoramic video judgment.
  • the training sample set of the preset model may include multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the The sky area of the panoramic image corresponding to the reference image, that is to say, the sky area and the non-sky area in the panoramic image corresponding to the reference image can be distinguished according to the reference image; in this embodiment, the panoramic image can be in any form.
  • the sky area is marked to obtain a reference image that can distinguish the sky area in the panoramic image.
  • the reference image can be a mask image corresponding to each frame of panoramic image, and the mask image can be marked by relevant software, for example: a frame of panoramic image can be marked by PS software to distinguish the sky.
  • the multi-frame panoramic images may include multi-frame panoramic images corresponding to different scenes, may also include panoramic images corresponding to different resolutions, and may also include any panoramic image with distortion or an indistinct boundary between sky and non-sky etc.; this embodiment does not limit it.
  • the training process of the preset model includes: inputting the panoramic images in the training sample set into a neural network model, and adjusting the neural network model according to the output of the neural network model and the loss value of the reference image parameters of the neural network model to obtain the preset model.
  • a partial panoramic image in the training sample set and a reference image corresponding to each panoramic image in the partial panoramic image can be input into a neural network model, and model training can be performed to obtain a panoramic sky segmentation algorithm; Input another part of the panoramic image in the training sample set into the trained neural network model, test the panoramic sky segmentation algorithm, and obtain the output of the neural network model, that is, obtain the mask image corresponding to each panoramic image.
  • the neural network model of the accurate panoramic sky segmentation algorithm is used as the preset model; wherein, the loss value of the reference image is the loss between the output of the neural network model, that is, the mask image, and the reference image, and the loss value is The larger the value is, the larger the error between the mask image and the reference image is; the neural network model is further optimized according to the loss value until the loss value reaches the minimum, that is, the neural network model The output mask image has the smallest error with the corresponding reference image, which makes the output of the neural network model more accurate.
  • the neural network model can use a fully convolutional network (Fully Convolutional Networks (FCN for short), Deep Convolutional Network (Deeplab), Pyramid Scene Parsing Network (PSPNet), High-Resoultion Net (HRNet) and other deep learning-based convolutional neural networks Network model; this is not limited in this embodiment of the present application.
  • FCN Fully Convolutional Networks
  • Deeplab Deep Convolutional Network
  • PSPNet Pyramid Scene Parsing Network
  • HRNet High-Resoultion Net
  • other deep learning-based convolutional neural networks Network model this is not limited in this embodiment of the present application.
  • the performance evaluation of the preset model can be performed, the accuracy of the preset model can be calculated, and the actual measurement of the preset model can be performed.
  • the processing speed on the computer equipment optionally, any number of panoramic images can be input into the preset model, respectively, the mask images corresponding to the multiple panoramic images are output, and the mask images are calculated according to the multiple mask images.
  • the accuracy of the preset model, the accuracy of the preset model may include calculating the average intersection ratio of the preset model (mean Intersection over Union, referred to as mIoU), and calculate the pixel accuracy of the preset model (Accuracy, referred to as acc), etc.; and calculate the average time-consuming of the preset model to process a panoramic image, that is, the processing speed of the model.
  • mIoU mean Intersection over Union
  • acc pixel accuracy of the preset model
  • a model compression algorithm may also be used to process the neural network model to update the neural network model.
  • model compression can be performed on the neural network model through a model compression algorithm to reduce the data processing volume of the model; and then according to the neural network model after model compression.
  • the training of the panoramic sky segmentation algorithm model is carried out to improve the processing speed of the computer equipment to execute the panoramic sky segmentation algorithm and achieve the effect of real-time processing.
  • the model compression algorithm may include model pruning, reducing the number of channels, reducing the number of network layers, reducing the input resolution, knowledge distillation, ablation experiments, and replacing the neural network model with more lightweight feature extraction.
  • the processing speed of the model is improved to meet the requirements of real-time processing.
  • the model compression algorithm is not specifically limited in this embodiment, as long as the processing speed of the neural network model can be improved under the condition that the accuracy of the neural network model is not significantly reduced.
  • steps in the flowcharts of FIGS. 2-4 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 2-4 may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
  • a sky area segmentation device including: a judgment module 501, an acquisition module 502 and a segmentation module 503, wherein:
  • the judgment module 501 is configured to judge whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video.
  • the acquisition module 502 is configured to extract M frames of panoramic images of the target panoramic video when it is judged to perform sky segmentation processing on the target panoramic video, and input each frame of panoramic images in the M frames of panoramic images into a preset model, A mask image of each frame of panoramic images in the M frames of panoramic images is obtained; the mask image includes a sky area and a non-sky area.
  • the segmentation module 503 is configured to perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
  • the above judgment module 501 is specifically configured to determine N frames of panoramic images from the M frames of panoramic images before determining to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video image; input the N frames of panoramic images into the preset model, and obtain N mask images corresponding to the N frames of panoramic images; according to the proportion of sky pixels in the N mask images, determine whether to perform Sky segmentation processing.
  • the above judgment module 501 is specifically configured to determine the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images; The relationship between the proportion of the sky pixels and the first preset threshold determines whether to perform sky segmentation processing on the target panoramic video.
  • the above judgment module 501 is further configured to determine N frames from the M frames of target panoramic images before determining to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video Panoramic image; use the second preset model to identify the N frames of panoramic images, and obtain N output results; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky ; According to the proportion of panoramic images containing the sky in the N output results, determine whether to perform sky segmentation processing on the target panoramic video.
  • the above judgment module 501 is specifically configured to determine the number of panoramic images containing the sky according to the number of panoramic images containing the sky in the N output results and the number of panoramic images that do not contain the sky in the N output results.
  • the proportion of the panoramic image according to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
  • the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the panoramic image corresponding to the reference image sky area.
  • the apparatus further includes: a model training module; the model training module is used for inputting the panoramic images in the training sample set into a neural network model, and according to the output of the neural network model and the loss of the reference image value to adjust the parameters of the neural network model to obtain the preset model.
  • the model training module is further configured to process the neural network model by using a model compression algorithm to update the neural network model.
  • sky area segmentation device For the specific limitation of the sky area segmentation device, reference may be made to the definition of the sky area segmentation method above, which will not be repeated here. All or part of the modules in the above-mentioned sky area segmentation device can be implemented by software, hardware and combinations thereof.
  • the above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
  • a computer device is provided, and the computer device may be the above-mentioned terminal, and its internal structure diagram may be as shown in FIG. 6 .
  • the computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium, an internal memory.
  • the nonvolatile storage medium stores an operating system and a computer program.
  • the internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium.
  • the communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies.
  • the computer program when executed by a processor, implements a sky region segmentation method.
  • the display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
  • FIG. 6 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
  • a computer device including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
  • the proportion of sky elements in the target panoramic video determine whether to perform sky segmentation processing on the target panoramic video
  • sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
  • the processor further implements the following steps when executing the computer program: determining N frames of panoramic images from the M frames of panoramic images; inputting the N frames of panoramic images into the preset model to obtain the corresponding N frames of panoramic images. N mask images; according to the proportion of sky pixels in the N mask images, determine whether to perform sky segmentation processing on the target panoramic video.
  • the processor further implements the following steps when executing the computer program: determining the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images ; According to the relationship between the proportion of the sky pixels and the first preset threshold, it is judged whether to perform sky segmentation processing on the target panoramic video.
  • the processor further implements the following steps when executing the computer program: determining N frames of panoramic images from the M frames of target panoramic images; identifying the N frames of panoramic images by using a second preset model to obtain N outputs Result; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky; according to the proportion of the panoramic images containing the sky in the N output results, it is judged whether the target The panoramic video is processed by sky segmentation.
  • the following steps are further implemented: according to the number of panoramic images including the sky in the N output results and the number of panoramic images that do not include the sky in the N output results, determine the number of the panoramic images including the sky.
  • the proportion of the panoramic image of the sky according to the relationship between the proportion of the panoramic image containing the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
  • the processor further implements the following steps when executing the computer program: the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, the reference image It is used to indicate the sky area of the panoramic image corresponding to the reference image.
  • the processor executes the computer program, the following steps are further implemented: input the panoramic images in the training sample set into a neural network model, and adjust the output of the neural network model according to the output of the neural network model and the loss value of the reference image. parameters to obtain the preset model.
  • the processor further implements the following steps when executing the computer program: processing the neural network model with a model compression algorithm to update the neural network model.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the proportion of sky elements in the target panoramic video determine whether to perform sky segmentation processing on the target panoramic video
  • sky segmentation processing is performed on the panorama image corresponding to the mask image among the M frames of panorama images.
  • the following steps are further implemented: determining N frames of panoramic images from the M frames of panoramic images; inputting the N frames of panoramic images into the preset model to obtain the corresponding N frames of panoramic images. N mask images of ; according to the proportion of sky pixels in the N mask images, it is judged whether to perform sky segmentation processing on the target panoramic video.
  • the following steps are further implemented: determining the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images ratio; according to the relationship between the proportion of the sky pixels and the first preset threshold, it is judged whether to perform sky segmentation processing on the target panoramic video.
  • the following steps are further implemented: determine N frames of panoramic images from the M frames of target panoramic images; identify the N frames of panoramic images by using the second preset model, and obtain N frames of panoramic images.
  • the output result; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky; according to the proportion of the panoramic images containing the sky in the N output results, determine whether to The target panoramic video is subjected to sky segmentation processing.
  • the following steps are further implemented: according to the number of panoramic images including the sky in the N output results and the number of panoramic images not including the sky in the N output results, determine the The proportion of the panoramic image including the sky; according to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
  • the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, the reference The image is used to indicate the sky area of the panoramic image corresponding to the reference image.
  • the computer program further implements the following steps when executed by the processor: inputting the panoramic images in the training sample set into a neural network model, and adjusting the neural network model according to the output of the neural network model and the loss value of the reference image parameters to obtain the preset model.
  • the computer program when executed by the processor, further implements the step of: processing the neural network model with a model compression algorithm to update the neural network model.
  • Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc.
  • Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory.
  • RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (Dynamic Random Access Memory). Access Memory, DRAM), etc.

Abstract

A sky region segmentation method and apparatus, a computer device, and a storage medium. A computer device determines, according to the proportion of sky elements in a target panoramic video, whether to perform sky segmentation on the target panoramic video; if yes, extracts M panoramic image frames of the target panoramic video, and inputs each of the M panoramic image frames into a preset model to obtain a mask image of each of the M panoramic image frames; and performs, according to the mask image, sky segmentation on the panoramic image frame in the M panoramic image frames corresponding to the mask image. Before performing sky segmentation on the target panoramic video, a determination is made on the target panoramic video first, and by considering the sky proportion of the panoramic video, scenarios which have relatively small sky regions and are unsuitable for sky segmentation can be effectively filtered, thereby improving the sky segmentation effect; moreover, the accurate recognition of the panoramic video by the preset model can improve the effect of sky segmentation for the panoramic video.

Description

天空区域分割方法、装置、计算机设备和存储介质Sky area segmentation method, apparatus, computer equipment and storage medium 技术领域technical field
本申请涉及图像处理技术领域,特别是涉及一种天空区域分割方法、装置、计算机设备和存储介质。The present application relates to the technical field of image processing, and in particular, to a sky area segmentation method, apparatus, computer equipment and storage medium.
背景技术Background technique
随着图像处理技术的发展,出现了天空分割技术,该天空分割技术能够将图像中的天空像素和非天空像素进行区分,以实现对图像进行天空替换的特效。With the development of image processing technology, sky segmentation technology has emerged, which can distinguish sky pixels and non-sky pixels in an image, so as to realize the special effect of sky replacement for the image.
传统技术中,在进行天空分割以实现天空替换时,相机或者手机可以将拍摄的平面图像发送至云端,云端通过预存的天空分割算法,对该平面图像进行天空分割,并将分割后的结果返回至相机或者手机;相机或者手机也可以通过本地存储的天空分割算法对该平面图像进行天空分割。In the traditional technology, when performing sky segmentation to achieve sky replacement, the camera or mobile phone can send the plane image taken to the cloud, and the cloud uses the pre-stored sky segmentation algorithm to perform sky segmentation on the plane image, and returns the segmented result. to the camera or mobile phone; the camera or mobile phone can also perform sky segmentation on the plane image through the locally stored sky segmentation algorithm.
技术问题technical problem
然而,现有技术中的天空分割算法的处理速度较慢,对边缘分割的处理精度较低;而目前的天空分割算法处理的均是平面图像,对于全景图像或者全景视频的天空分割处理效果较差。However, the processing speed of the sky segmentation algorithm in the prior art is relatively slow, and the processing accuracy of edge segmentation is low; and the current sky segmentation algorithm processes only plane images, and the sky segmentation processing effect for panoramic images or panoramic videos is relatively low. Difference.
技术解决方案technical solutions
基于此,有必要针对上述技术问题,提供一种能够实现对全景图像和全景视频进行准确天空分割的天空区域分割方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide a sky area segmentation method, device, computer equipment and storage medium that can realize accurate sky segmentation of panoramic images and panoramic videos in view of the above technical problems.
第一方面,提供了一种天空区域分割方法,该方法包括:In a first aspect, a method for segmenting a sky area is provided, the method comprising:
根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
在判断对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;In the case of judging that the target panoramic video is subjected to sky segmentation processing, extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the M frames of panoramic images The mask image of each frame of panoramic image in ; the mask image includes sky area and non-sky area;
根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。According to the mask image, sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
在其中一个实施例中,根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理,包括:In one embodiment, according to the proportion of sky elements in the target panoramic video, judging whether to perform sky segmentation processing on the target panoramic video, including:
从该M帧全景图像中确定N帧全景图像;Determine N frames of panoramic images from the M frames of panoramic images;
将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像;Inputting the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images;
根据该N个掩码图像中天空像素的占比,判断是否对该目标全景视频进行天空分割处理。According to the proportion of sky pixels in the N mask images, it is determined whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,根据该N个掩码图像中天空像素的占比,确定是否对该目标全景视频进行天空分割处理,包括:In one embodiment, determining whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky pixels in the N mask images includes:
根据该N个掩码图像中天空像素的数量和该N个掩码图像中非天空像素的数量,确定该天空像素的占比;Determine the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images;
根据该天空像素的占比和第一预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。According to the relationship between the proportion of the sky pixels and the first preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理,包括:In one embodiment, according to the proportion of sky elements in the target panoramic video, judging whether to perform sky segmentation processing on the target panoramic video, including:
从该M帧目标全景图像中确定N帧全景图像;Determine N frames of panoramic images from the M frames of target panoramic images;
利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果;该第二预设模型的输入为全景图像,输出为该全景图像包含天空或者该全景图像不包含天空;The N frames of panoramic images are identified by the second preset model, and N output results are obtained; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky;
根据该N个输出结果中包含天空的全景图像的占比,判断是否对该目标全景视频进行天空分割处理。According to the proportion of panoramic images containing the sky in the N output results, it is determined whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,根据该N个输出结果中包含天空的全景图像的占比,判断是否对该目标全景视频进行天空分割处理,包括:In one embodiment, according to the proportion of panoramic images containing the sky in the N output results, judging whether to perform sky segmentation processing on the target panoramic video, including:
根据该N个输出结果中包含天空的全景图像的数量和该N个输出结果中不包含天空的全景图像的数量,确定该包含天空的全景图像的占比;According to the number of panoramic images that contain the sky in the N output results and the number of panoramic images that do not contain the sky in the N output results, determine the proportion of the panoramic images that contain the sky;
根据该包含天空的全景图像的占比和第二预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。According to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,该预设模型的训练样本集包括多帧全景图像以及该多帧全景图像中每一帧全景图像对应的参考图像,该参考图像用于指示该参考图像对应的全景图像的天空区域。In one embodiment, the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the panoramic image corresponding to the reference image sky area.
在其中一个实施例中,该预设模型的训练过程包括:In one embodiment, the training process of the preset model includes:
将该训练样本集中的全景图像输入神经网络模型,根据该神经网络模型的输出与该参考图像的损失值调整该神经网络模型的参数,以获得该预设模型。The panoramic images in the training sample set are input into a neural network model, and the parameters of the neural network model are adjusted according to the output of the neural network model and the loss value of the reference image to obtain the preset model.
在其中一个实施例中,该预设模型的训练过程还包括:In one embodiment, the training process of the preset model further includes:
利用模型压缩算法处理该神经网络模型,以更新该神经网络模型。The neural network model is processed with a model compression algorithm to update the neural network model.
第二方面,提供了一种天空区域分割装置,该装置包括:In a second aspect, a device for segmenting a sky area is provided, the device comprising:
判断模块,用于根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;The judgment module is used to judge whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video;
获取模块,用于在判断对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;The acquisition module is used to extract M frames of panoramic images of the target panoramic video when it is judged to perform sky segmentation processing on the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain The mask image of each frame of panoramic image in the M frames of panoramic images; the mask image includes sky area and non-sky area;
分割模块,用于根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。A segmentation module, configured to perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
第三方面,提供了一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:In a third aspect, a computer device is provided, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;Extracting M frames of panoramic images of the target panoramic video, inputting each frame of panoramic images in the M frames of panoramic images into a preset model, and obtaining a mask image of each frame of panoramic images in the M frames of panoramic images; the mask image including sky areas and non-sky areas;
根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。According to the mask image, sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
第四方面,提供了一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;Extracting M frames of panoramic images of the target panoramic video, inputting each frame of panoramic images in the M frames of panoramic images into a preset model, and obtaining a mask image of each frame of panoramic images in the M frames of panoramic images; the mask image including sky areas and non-sky areas;
根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。According to the mask image, sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
技术效果technical effect
上述天空区域分割方法、装置、计算机设备和存储介质,计算机设备根据目标全景视频中天空元素的占比,确定是否对该目标全景视频进行天空分割处理;在确定对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;进而,可以根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理;其中,该掩码图像包括天空区域和非天空区域。可见,本实施例在进行目标全景视频的天空分割处理之前,先对该目标全景视频进行判断,来确定该目标全景视频是否适合进行天空分割,并在该目标全景视频适合进行天空分割时,采用预设的模型对该目标全景视频进行天空分割处理;这样能够避免现有技术中在全景视频包含天空区域较少的情况下仍然进行天空分割,而导致的天空分割效果差的问题,本实施例通过考虑全景视频的天空占比可以有效地过滤天空区域较少不适合进行天空分割的场景,进而提升天空分割效果;进一步地,通过本实施例中的预设模型能够准确得到每一帧全景图像分别对应的掩码图像,提高对全景图像的边缘处理精度,以及提高天空分割的处理速度,实现对全景图像和全景视频的准确识别,大大提高了对全景图像和全景视频识别的准确性,从而提升对全景图像和全景视频的分割效果。因此,采用本实施例中的天空区域分割方法,能够极大地提高对全景图像和全景视频的天空分割效果。The above-mentioned sky area segmentation method, device, computer equipment and storage medium, the computer equipment determines whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; after determining whether to perform sky segmentation processing on the target panoramic video Under the situation, extract the M frames of panoramic images of this target panoramic video, input each frame of panoramic images in this M frames of panoramic images into a preset model, and obtain the mask image of each frame of panoramic images in this M frames of panoramic images; Further, sky segmentation processing may be performed on the panoramic image corresponding to the mask image among the M frames of panoramic images according to the mask image, wherein the mask image includes a sky area and a non-sky area. It can be seen that in this embodiment, before the sky segmentation processing of the target panoramic video is performed, the target panoramic video is first judged to determine whether the target panoramic video is suitable for sky segmentation, and when the target panoramic video is suitable for sky segmentation, the The preset model performs sky segmentation processing on the target panoramic video; this can avoid the problem of poor sky segmentation effect caused by still performing sky segmentation when the panoramic video contains less sky areas in the prior art. By considering the sky proportion of the panoramic video, the scenes with less sky area that are not suitable for sky segmentation can be effectively filtered, thereby improving the sky segmentation effect; further, each frame of panoramic image can be accurately obtained through the preset model in this embodiment. Respectively corresponding mask images, improve the edge processing accuracy of panoramic images, and improve the processing speed of sky segmentation, realize accurate recognition of panoramic images and panoramic videos, and greatly improve the accuracy of panoramic image and panoramic video recognition. Improve the segmentation effect of panoramic images and panoramic videos. Therefore, by using the sky region segmentation method in this embodiment, the sky segmentation effect on panoramic images and panoramic videos can be greatly improved.
附图说明Description of drawings
图1为一个实施例中天空区域分割方法的应用环境图;Fig. 1 is the application environment diagram of the sky area segmentation method in one embodiment;
图2为一个实施例中天空区域分割方法的流程示意图;2 is a schematic flowchart of a method for segmenting a sky region in one embodiment;
图3为另一个实施例中天空区域分割方法的流程示意图;3 is a schematic flowchart of a method for segmenting a sky region in another embodiment;
图4为另一个实施例中天空区域分割方法的流程示意图;4 is a schematic flowchart of a method for segmenting a sky region in another embodiment;
图5为一个实施例中天空区域分割装置的结构框图;5 is a structural block diagram of an apparatus for dividing a sky area in one embodiment;
图6为一个实施例中计算机设备的内部结构图。FIG. 6 is a diagram of the internal structure of a computer device in one embodiment.
本发明的实施方式Embodiments of the present invention
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application will be described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请提供的天空区域分割方法,可以应用于如图1所示的计算机设备中,该计算机设备可以但不限于是任何类型的能够进行图像处理或者视频处理的终端,例如:普通相机、全景相机、智能手机、个人计算机、笔记本电脑、平板电脑、以及VR眼睛等;该计算机设备的内部结构图如图1所示,包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。The sky area segmentation method provided in this application can be applied to the computer equipment as shown in FIG. 1 . The computer equipment can be, but is not limited to, any type of terminal capable of image processing or video processing, such as: ordinary cameras, panoramic cameras , smart phones, personal computers, notebook computers, tablet computers, and VR eyes, etc.; the internal structure of the computer equipment is shown in Figure 1, including a processor, memory, communication interface, display screen and input device connected through the system bus .
在一个实施例中,如图2所示,提供了一种天空区域分割方法,以该方法应用于图1中的计算机设备为例进行说明,包括以下步骤:In one embodiment, as shown in FIG. 2, a method for segmenting a sky area is provided, and the method is applied to the computer device in FIG. 1 as an example for description, including the following steps:
步骤201,根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理。Step 201, according to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video.
其中,该目标全景视频为一段需要进行天空分割的待处理的全景视频。Wherein, the target panoramic video is a panoramic video to be processed that needs to be divided into the sky.
计算机设备在对该目标全景视频进行天空分割时,需要先判断该目标全景视频是否适合进行天空分割,也就是说,在该目标全景视频适合进行天空分割的情况下,才对该目标全景视频进行天空分割操作;可选地,可以根据该目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;其中,该目标全景视频可以包括多帧全景图像,每一帧全景图像中可以包括天空元素和非天空元素;可选地,可以通过预处理、归一化、减均差、除方差等操作,将彩色的全景图像转换为灰度图像,以降低数据处理量。可选地,在确定该目标全景视频中天空元素的占比时,可以采用图像处理技术,分别对每一帧全景图像的天空区域和非天空区域进行标注,进而,可以确定出该目标全景视频的天空区域的总面积,即每一帧全景图像的天空区域的面积之和,以及该目标全景视频的总面积,即每一帧全景图像得面积之和;接着,根据该目标全景视频的天空区域的总面积除以该目标全景视频的总面积,可以得到该目标全景视频中天空元素的占比。进一步地,根据该目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理时,可选地,可以通过该目标全景视频中天空元素的占比与预设阈值的大小关系,来确定是否对该目标全景视频进行天空分割处理;在该目标全景视频中天空元素的占比大于该预设阈值时,可以确定对该目标全景视频进行天空分割处理;在该目标全景视频中天空元素的占比不大于该预设阈值时,则不对该目标全景视频进行天空分割处理;也就是,在该目标全景视频的天空元素较多的情况下,适合对该目标全景视频进行天空分割处理。When the computer equipment performs sky segmentation on the target panoramic video, it needs to first determine whether the target panoramic video is suitable for sky segmentation, that is to say, only when the target panoramic video is suitable for sky segmentation, the target panoramic video is processed. Sky segmentation operation; optionally, it can be determined whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; wherein, the target panoramic video may include multiple frames of panoramic images, each frame of panoramic video The image can include sky elements and non-sky elements; optionally, the color panoramic image can be converted into a grayscale image through operations such as preprocessing, normalization, subtraction of mean difference, and division of variance, so as to reduce the amount of data processing. Optionally, when determining the proportion of sky elements in the target panoramic video, image processing technology can be used to mark the sky area and non-sky area of each frame of panoramic image, and then the target panoramic video can be determined. The total area of the sky area, that is, the sum of the area of the sky area of each frame of panoramic image, and the total area of the target panoramic video, that is, the sum of the area of each frame of panoramic image; then, according to the sky of the target panoramic video The proportion of sky elements in the target panoramic video can be obtained by dividing the total area of the area by the total area of the target panoramic video. Further, when judging whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video, optionally, the proportion of sky elements in the target panoramic video and the size of the preset threshold can be used. relationship to determine whether to perform sky segmentation processing on the target panoramic video; when the proportion of sky elements in the target panoramic video is greater than the preset threshold, it can be determined to perform sky segmentation processing on the target panoramic video; in the target panoramic video When the proportion of the sky elements is not greater than the preset threshold, the sky segmentation process is not performed on the target panoramic video; Split processing.
步骤202,若是,则提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域。Step 202, if yes, then extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the mask of each frame of panoramic images in the M frames of panoramic images image; the mask image includes sky and non-sky areas.
其中,该目标全景视频的M帧全景图像为根据预设的视频帧转换比例,将该目标全景视频转换为视频帧图像后,对应的所有帧全景图像,即M为全景图像的总帧数。另外,该预设模型包括用于对全景图像进行准确识别的全景天空分割算法,其输入为一张全景图像,输出为对应该全景图像的掩码图像,该掩码图像包括天空区域和非天空区域。The M frames of panoramic images of the target panoramic video are all corresponding panoramic images after converting the target panoramic video into video frame images according to a preset video frame conversion ratio, that is, M is the total number of frames of panoramic images. In addition, the preset model includes a panoramic sky segmentation algorithm for accurately identifying panoramic images. The input is a panoramic image, and the output is a mask image corresponding to the panoramic image. The mask image includes sky areas and non-sky areas. area.
在步骤201之后,计算机设备在判断对该目标全景视频进行天空分割处理,即该目标全景视频的天空元素占比较多,适合对该目标全景视频进行天空分割处理的情况下,可以提取该目标全景视频的M帧全景图像,并将该M帧全景图像的每一帧全景图像分别输入至该预设模型中,以获取该M帧全景图像中每一帧全景图像分别对应的掩码图像,即获取M张掩码图像。After step 201, the computer device can extract the target panoramic video when it determines that the target panoramic video is subjected to sky segmentation processing, that is, the target panoramic video has a large proportion of sky elements and is suitable for sky segmentation processing of the target panoramic video. M frames of panoramic images of the video, and input each frame of the panoramic images of the M frames of panoramic images into the preset model to obtain the mask images corresponding to each frame of the panoramic images in the M frames of panoramic images, that is, Get M mask images.
步骤203,根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。Step 203: Perform sky segmentation processing on the panoramic image corresponding to the mask image among the M frames of panoramic images according to the mask image.
在得到每一帧全景图像分别对应的掩码图像之后,可以根据该掩码图像对与该掩码图像对应的那一帧全景图像进行天空分割处理,即去除该帧全景图像中与该掩码图像中天空区域对应的各像素值,保留非天空区域对应的像素值,即可得到将天空区域分割后的非天空区域图像。After obtaining the mask image corresponding to each frame of panoramic image, the frame of the panoramic image corresponding to the mask image can be subjected to sky segmentation processing according to the mask image, that is, to remove the frame of the panoramic image and the mask image. For each pixel value corresponding to the sky area in the image, and retaining the pixel value corresponding to the non-sky area, the non-sky area image obtained by dividing the sky area can be obtained.
本实施例中,计算机设备根据目标全景视频中天空元素的占比,确定是否对该目标全景视频进行天空分割处理;在确定对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;进而,可以根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理;其中,该掩码图像包括天空区域和非天空区域。可见,本实施例在进行目标全景视频的天空分割处理之前,先对该目标全景视频进行判断,来确定该目标全景视频是否适合进行天空分割,并在该目标全景视频适合进行天空分割时,采用预设的模型对该目标全景视频进行天空分割处理;这样能够避免现有技术中在全景视频包含天空区域较少的情况下仍然进行天空分割,而导致的天空分割效果差的问题,本实施例通过考虑全景视频的天空占比可以有效地过滤天空区域较少不适合进行天空分割的场景,进而提升天空分割效果;进一步地,通过本实施例中的预设模型能够准确得到每一帧全景图像分别对应的掩码图像,提高对全景图像的边缘处理精度,以及提高天空分割的处理速度,实现对全景图像和全景视频的准确识别,大大提高了对全景图像和全景视频识别的准确性,从而提升对全景图像和全景视频的分割效果。因此,采用本实施例中的天空区域分割方法,能够极大地提高对全景图像和全景视频的天空分割效果。In this embodiment, the computer device determines whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; if it is determined to perform sky segmentation processing on the target panoramic video, extract the target panoramic video M frames of panoramic images, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain a mask image of each frame of panoramic images in the M frames of panoramic images; The panoramic image corresponding to the mask image in the M frames of panoramic images is subjected to sky segmentation processing; wherein, the mask image includes a sky area and a non-sky area. It can be seen that in this embodiment, before the sky segmentation processing of the target panoramic video is performed, the target panoramic video is first judged to determine whether the target panoramic video is suitable for sky segmentation, and when the target panoramic video is suitable for sky segmentation, the The preset model performs sky segmentation processing on the target panoramic video; this can avoid the problem of poor sky segmentation effect caused by still performing sky segmentation when the panoramic video contains less sky areas in the prior art. By considering the sky proportion of the panoramic video, the scenes with less sky area that are not suitable for sky segmentation can be effectively filtered, thereby improving the sky segmentation effect; further, each frame of panoramic image can be accurately obtained through the preset model in this embodiment. Respectively corresponding mask images, improve the edge processing accuracy of panoramic images, and improve the processing speed of sky segmentation, realize accurate recognition of panoramic images and panoramic videos, and greatly improve the accuracy of panoramic image and panoramic video recognition. Improve the segmentation effect of panoramic images and panoramic videos. Therefore, by using the sky region segmentation method in this embodiment, the sky segmentation effect on panoramic images and panoramic videos can be greatly improved.
图3另一个实施例中天空区域分割方法的流程示意图。本实施例涉及的是根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理的一种可选的实现过程;在上述实施例的基础上,如图3所示,上述步骤201包括:FIG. 3 is a schematic flowchart of a method for segmenting a sky region in another embodiment. This embodiment relates to an optional implementation process of judging whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; on the basis of the above embodiment, as shown in FIG. 3 , the above step 201 includes:
步骤301,从该M帧全景图像中确定N帧全景图像。Step 301: Determine N frames of panoramic images from the M frames of panoramic images.
在本实施例的一种可选的实现方式中,在确定该目标全景视频中天空元素的占比时,可以从该目标全景视频对应的所有帧全景图像中选择部分全景图像,根据该部分全景图像中天空元素的占比,来确定是否对该目标全景视频进行天空分割处理,以降低计算机设备的数据处理量,减少内存的运算量。也就是,可以从该M帧全景图像中确定N帧全景图像;可选地,可以从该M帧全景图像中随机抽取连续的N帧全景图像,也可以从该M帧全景图像中随机抽取不连续的N帧全景图像。本实施例中对获取N帧全景图像的方式并不做限定。In an optional implementation manner of this embodiment, when determining the proportion of sky elements in the target panoramic video, a partial panoramic image may be selected from all frames of panoramic images corresponding to the target panoramic video, and according to the partial panoramic video The proportion of sky elements in the image is used to determine whether to perform sky segmentation processing on the target panoramic video, so as to reduce the amount of data processing of computer equipment and the amount of calculation of memory. That is, N frames of panoramic images can be determined from the M frames of panoramic images; alternatively, continuous N frames of panoramic images can be randomly selected from the M frames of panoramic images, or different frames of panoramic images can be randomly selected from the M frames of panoramic images. Consecutive N frames of panoramic images. The manner of acquiring N frames of panoramic images is not limited in this embodiment.
步骤302,将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像。Step 302: Input the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images.
步骤303,根据该N个掩码图像中天空像素的占比,判断是否对该目标全景视频进行天空分割处理。Step 303, according to the proportion of sky pixels in the N mask images, determine whether to perform sky segmentation processing on the target panoramic video.
在本实施例的一种可选的实现方式中,在得到该N帧全景图像分别对应的掩码图像之后,由于该掩码图像包括天空区域和非天空区域,即该天空区域和非天空区域通过二值数值0和1,或者0和255,进行像素的标注;进而,可以根据该N个掩码图像中天空像素的占比,来判断是否对该目标全景视频进行天空分割处理;可选地,可以根据该N个掩码图像中天空像素的数量和该N个掩码图像中非天空像素的数量,确定该天空像素的占比;并根据该天空像素的占比和第一预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。例如:可以将该N个掩码图像中天空像素的数量表示为sky_pixels、可以将该N个掩码图像中非天空像素的数量表示为background_pixels,那么,该天空像素的占比sky_ratio可以表示为:sky_ratio=sky_pixels/(sky_pixels+background_pixels);进一步地,可以根据该天空像素的占比sky_ratio,和第一预设阈值,判断是否对该目标全景视频进行天空分割处理;可选地,在该天空像素的占比sky_ratio大于该第一预设阈值时,可以判断对该目标全景视频进行天空分割处理;在该天空像素的占比sky_ratio不大于该第一预设阈值时,可以判断不对该目标全景视频进行天空分割处理。In an optional implementation manner of this embodiment, after obtaining the mask images corresponding to the N frames of panoramic images respectively, since the mask image includes a sky area and a non-sky area, that is, the sky area and the non-sky area Pixels are marked by binary values of 0 and 1, or 0 and 255; further, it can be judged whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky pixels in the N mask images; optional The proportion of the sky pixels can be determined according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images; and according to the proportion of the sky pixels and the first preset The size relationship of the threshold value determines whether to perform sky segmentation processing on the target panoramic video. For example, the number of sky pixels in the N mask images can be expressed as sky_pixels, and the number of non-sky pixels in the N mask images can be expressed as background_pixels, then the sky_ratio of the sky pixels can be expressed as: sky_ratio=sky_pixels/(sky_pixels+background_pixels); further, according to the ratio sky_ratio of the sky pixels and the first preset threshold, it can be judged whether to perform sky segmentation processing on the target panoramic video; optionally, in the sky pixel When the proportion sky_ratio is greater than the first preset threshold, it can be judged that the target panoramic video is subjected to sky segmentation processing; when the proportion sky_ratio of the sky pixels is not greater than the first preset threshold, it can be judged that the target panoramic video is not to be processed. Perform sky segmentation processing.
本实施例中,计算机设备从该M帧全景图像中确定N帧全景图像,并将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像;接着,根据该N个掩码图像中天空像素的占比,确定是否对该目标全景视频进行天空分割处理;也就是说,本实施例中计算机设备通过选取部分全景图像,并将该部分全景图像的天空像素的占比作为目标全景视频的判断依据,来判断是否对该目标全景视频进行天空分割处理,能够降低计算机设备的数据处理量;另外,通过将选取的N张全景图像输入至上述预设模型中,得到对应的N个掩码图像,由于该预设模型能够准确识别全景图像中的天空区域和非天空区域,因此,根据该N个掩码图像得到的天空像素的占比,进而根据该天空像素的占比判断是否对该目标全景视频进行天空分割处理,极大地提高了对目标全景视频判断的准确性。In this embodiment, the computer device determines N frames of panoramic images from the M frames of panoramic images, and inputs the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images; then, according to The proportion of sky pixels in the N mask images determines whether to perform sky segmentation processing on the target panoramic video; that is, in this embodiment, the computer device selects a part of the panoramic image and divides the sky pixels of the part of the panoramic image. The proportion of the target panoramic video is used as the judgment basis for the target panoramic video to determine whether to perform sky segmentation processing on the target panoramic video, which can reduce the data processing volume of the computer equipment; in addition, by inputting the selected N panoramic images into the above-mentioned preset model. , obtain the corresponding N mask images, since the preset model can accurately identify the sky area and non-sky area in the panoramic image, therefore, according to the proportion of sky pixels obtained from the N mask images, and then according to the sky area The proportion of pixels determines whether to perform sky segmentation processing on the target panoramic video, which greatly improves the accuracy of judging the target panoramic video.
图4另一个实施例中天空区域分割方法的流程示意图。本实施例涉及的是根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理的另一种可选的实现过程;在上述实施例的基础上,如图4所示,上述步骤201包括:FIG. 4 is a schematic flowchart of a method for segmenting a sky region in another embodiment. This embodiment relates to another optional implementation process of judging whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video; on the basis of the above embodiment, as shown in FIG. 4 As shown, the above step 201 includes:
步骤401,从该M帧目标全景图像中确定N帧全景图像。Step 401: Determine N frames of panoramic images from the M frames of target panoramic images.
参考步骤301的论述,在此不再赘述。Referring to the discussion of step 301, details are not repeated here.
步骤402,利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果。Step 402, using the second preset model to identify the N frames of panoramic images to obtain N output results.
其中,该第二预设模型的输入为全景图像,输出为该全景图像包含天空或者该全景图像不包含天空。可选地,可以将含有天空区域的正样本图像和不含有天空区域的负样本图像,输入至任一传统分类算法模型中,训练得到天空分类算法模型,将该天空分类算法模型作为该第二预设模型;其中,该任一传统分类算法模型可以是基于支持向量机(Support Vector Machine,简称SVM)、邻近算法(K-NearestNeighbor,简称KNN)、以及深度学习卷积神经网络(Convolutional Neural Networks,简称CNN)等的分类算法;其中,深度学习CNN算法可以包括:残差神经网络(Residual Neural Network,简称ResNet)、高分辨率网络(High-Resoultion Net,简称HRNet)、以及用于移动和嵌入式视觉应用的高效模型(简称MobileNet)等;本实施例对使用何种传统分类算法模型训练得到的第二预设模型并不做限定。Wherein, the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky. Optionally, a positive sample image containing a sky area and a negative sample image not containing a sky area can be input into any traditional classification algorithm model, and the sky classification algorithm model can be obtained by training, and the sky classification algorithm model can be used as the second classification algorithm model. A preset model; wherein, any traditional classification algorithm model can be based on a support vector machine (Support Vector Machine) Machine, referred to as SVM), adjacent algorithm (K-NearestNeighbor, referred to as KNN), and deep learning convolutional neural network (Convolutional Neural Networks, CNN for short) and other classification algorithms; among them, deep learning CNN algorithms may include: Residual Neural Networks (Residual Neural Networks) Network, referred to as ResNet), high-resolution network (High-Resoultion Net, referred to as HRNet), and high-efficiency models for mobile and embedded vision applications (referred to as MobileNet), etc.; this embodiment uses which traditional classification algorithm model training The obtained second preset model is not limited.
在本实施例的一种可选的实现方式中,在得到N帧全景图像之后,可以将该N帧全景图像分别输入至该第二预设模型中,利用该第二预设模型对该N帧全景图像分别进行识别,得到每一帧全景图像分别对应的输出结果,即得到N个输出结果;其中,每一个输出结果表示对应的该帧全景图像为包含天空的全景图像,还是不包含天空的全景图像。In an optional implementation manner of this embodiment, after N frames of panoramic images are obtained, the N frames of panoramic images may be respectively input into the second preset model, and the N frames of panoramic images may be input by using the second preset model. Each frame of panoramic image is identified separately, and the corresponding output results of each frame of panoramic image are obtained, that is, N output results are obtained; wherein, each output result indicates whether the corresponding frame of panoramic image is a panoramic image containing the sky, or does not contain the sky. panoramic image.
步骤403,根据该N个输出结果中包含天空的全景图像的占比,判断是否对该目标全景视频进行天空分割处理。Step 403 , according to the proportion of panoramic images including the sky in the N output results, determine whether to perform sky segmentation processing on the target panoramic video.
在本实施例的一种可选的实现方式中,在得到N个输出结果之后,可以根据该N个输出结果中包含天空的全景图像的占比,来判断是否对该目标全景视频进行天空分割处理;可选地,根据该N个输出结果中包含天空的全景图像的数量和该N个输出结果中不包含天空的全景图像的数量,确定该包含天空的全景图像的占比;进而根据该包含天空的全景图像的占比和第二预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。例如:可以将N个输出结果中包含天空的全景图像的数量表示为sky_nums,将N个输出结果中不包含天空的全景图像的数量表示为background_nums,那么,该包含天空的全景图像的占比sky_ratio可以表示为:sky_ratio=sky_nums/(sky_nums+background_nums);进一步地,可以根据该包含天空的全景图像的占比和第二预设阈值,判断是否对该目标全景视频进行天空分割处理;可选地,在该包含天空的全景图像的占比sky_ratio大于第二预设阈值时,可以判断对该目标全景视频进行天空分割处理;在该包含天空的全景图像的占比sky_ratio不大于第二预设阈值时,可以判断不对该目标全景视频进行天空分割处理。In an optional implementation manner of this embodiment, after N output results are obtained, it may be determined whether to perform sky segmentation on the target panoramic video according to the proportion of panoramic images containing the sky in the N output results processing; optionally, according to the number of panoramic images that contain the sky in the N output results and the number of panoramic images that do not contain the sky in the N output results, determine the proportion of the panoramic images that contain the sky; and then according to the Whether to perform sky segmentation processing on the target panoramic video is determined according to the relationship between the proportion of panoramic images including the sky and the second preset threshold. For example, the number of panoramic images containing the sky in the N output results can be expressed as sky_nums, and the number of panoramic images that do not contain the sky in the N output results can be expressed as background_nums, then, the proportion of the panoramic images containing the sky sky_ratio It can be expressed as: sky_ratio=sky_nums/(sky_nums+background_nums); further, according to the proportion of the panoramic image containing the sky and the second preset threshold, it can be judged whether to perform sky segmentation processing on the target panoramic video; optionally , when the proportion sky_ratio of the panoramic image including the sky is greater than the second preset threshold, it can be determined that the target panoramic video is subjected to sky segmentation processing; when the proportion of the panoramic image including the sky sky_ratio is not greater than the second preset threshold When , it can be determined that the sky segmentation process is not to be performed on the target panoramic video.
本实施例中,计算机设备从该M帧目标全景图像中确定N帧全景图像,并利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果,进而,根据该N个输出结果中包含天空的全景图像的占比,确定是否对该目标全景视频进行天空分割处理;也就是说,本实施例中计算机设备通过选取部分全景图像,并将该部分全景图像的包含天空的全景图像的占比作为目标全景视频的判断依据,来判断是否对该目标全景视频进行天空分割处理,能够降低计算机设备的数据处理量;另外,通过预先训练好的能够准确识别全景图像是否包含天空的第二预设模型,对该部分全景图像分别进行识别,得到对应的输出结果,进而根据该输出结果确定包含天空的全景图像的占比以及判断是否对该目标全景视频进行天空分割处理,能够提高对目标全景视频判断的准确性。In this embodiment, the computer device determines N frames of panoramic images from the M frames of target panoramic images, and uses the second preset model to identify the N frames of panoramic images to obtain N output results, and then, according to the N outputs The proportion of the panoramic images containing the sky in the result determines whether to perform sky segmentation processing on the target panoramic video; that is, in this embodiment, the computer equipment selects a part of the panoramic image and divides the panoramic image of the part of the panoramic image including the sky. The proportion of images is used as the basis for judging the target panoramic video to determine whether to perform sky segmentation processing on the target panoramic video, which can reduce the data processing volume of computer equipment; in addition, pre-trained can accurately identify whether the panoramic image contains sky. The second preset model is to identify the part of the panoramic images respectively to obtain the corresponding output results, and then determine the proportion of the panoramic images containing the sky according to the output results and determine whether to perform sky segmentation processing on the target panoramic video, which can improve the The accuracy of the target panoramic video judgment.
在本申请的一个可选的实施例中,该预设模型的训练样本集可以包括多帧全景图像以及该多帧全景图像中每一帧全景图像对应的参考图像,该参考图像用于指示该参考图像对应的全景图像的天空区域,也就是说,根据该参考图像能够区分出该参考图像对应的全景图像中的天空区域和非天空区域;本实施例中可以通过任一形式对该全景图像的天空区域进行标注,得到能够区别出该全景图像中天空区域的参考图像。可选地,该参考图像可以是每一帧全景图像分别对应的掩码图像,该掩码图像可以通过相关软件进行标注,例如:可以通过PS软件对一帧全景图像进行标注,以区分出天空区域和非天空区域,得到该帧全景图像对应的掩码图像,其中,该掩码图像中的天空区域可以标注为1或者255,非天空区域可以标注为0;该参考图像还可以是以分割线的形式,将天空区域包含在内,得到能够标记出天空区域的参考图像等;本实施例中对参考图形的形式并不做限定,只要能区分出全景图像的天空区域和非天空区域即可。另外,该多帧全景图像中可以包括不同场景下对应的多帧全景图像,也可以包括不同清晰度对应的全景图像,还可以包括任一存在畸变或者天空与非天空的界限不明显的全景图像等;本实施例对此并不做限定。通过采集不同类型的全景图像,能够大大提高预测模型对全景图像的处理效果,以及提高对全景图像的边缘处理精度。In an optional embodiment of the present application, the training sample set of the preset model may include multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the The sky area of the panoramic image corresponding to the reference image, that is to say, the sky area and the non-sky area in the panoramic image corresponding to the reference image can be distinguished according to the reference image; in this embodiment, the panoramic image can be in any form. The sky area is marked to obtain a reference image that can distinguish the sky area in the panoramic image. Optionally, the reference image can be a mask image corresponding to each frame of panoramic image, and the mask image can be marked by relevant software, for example: a frame of panoramic image can be marked by PS software to distinguish the sky. area and non-sky area to obtain the mask image corresponding to the frame of panoramic image, wherein the sky area in the mask image can be marked as 1 or 255, and the non-sky area can be marked as 0; the reference image can also be divided into In the form of a line, the sky area is included to obtain a reference image that can mark the sky area. Can. In addition, the multi-frame panoramic images may include multi-frame panoramic images corresponding to different scenes, may also include panoramic images corresponding to different resolutions, and may also include any panoramic image with distortion or an indistinct boundary between sky and non-sky etc.; this embodiment does not limit it. By collecting different types of panoramic images, the processing effect of the prediction model on the panoramic image can be greatly improved, and the edge processing accuracy of the panoramic image can be improved.
在本申请的一个可选的实施例中,该预设模型的训练过程包括:将该训练样本集中的全景图像输入神经网络模型,根据该神经网络模型的输出与该参考图像的损失值调整该神经网络模型的参数,以获得该预设模型。可选地,可以将该训练样本集中的部分全景图像和该部分全景图像中每张全景图像分别对应的参考图像输入至神经网络模型中,进行模型训练,以得到全景天空分割算法;接着,可以将该训练样本集中的另一部分全景图像输入至训练好的神经网络模型中,进行该全景天空分割算法的测试,得到该神经网络模型的输出,也就是得到每张全景图像分别对应的掩码图像;根据该每张全景图像分别对应的掩码图像和每张全景图像分别对应的参考图像的损失值调整该神经网络模型的参数,以对该神经网络模型进行进一步地优化处理,得到输出结果更精确的全景天空分割算法的神经网络模型,作为该预设模型;其中,该参考图像的损失值为该神经网络模型的输出,即掩码图像,与该参考图像之间的损失,其损失值越大,说明该掩码图像与该参考图像之间的误差也就越大;根据该损失值对该神经网络模型进行进一步地优化处理,直到该损失值达到最小,也就是,该神经网络模型输出的掩码图像,与对应的参考图像之间的误差最小,即使得该神经网络模型的输出更精确。其中,该神经网络模型可以采用全卷积网络(Fully Convolutional Networks,简称FCN)、深度卷积网络(Deeplab)、金字塔场景解析网络(Pyramid Scene Parsing Network,简称PSPNet)、高分辨率网络(High-Resoultion Net,简称HRNet)等基于深度学习的卷积神经网络模型;本申请实施例对此并不做限定。In an optional embodiment of the present application, the training process of the preset model includes: inputting the panoramic images in the training sample set into a neural network model, and adjusting the neural network model according to the output of the neural network model and the loss value of the reference image parameters of the neural network model to obtain the preset model. Optionally, a partial panoramic image in the training sample set and a reference image corresponding to each panoramic image in the partial panoramic image can be input into a neural network model, and model training can be performed to obtain a panoramic sky segmentation algorithm; Input another part of the panoramic image in the training sample set into the trained neural network model, test the panoramic sky segmentation algorithm, and obtain the output of the neural network model, that is, obtain the mask image corresponding to each panoramic image. ; Adjust the parameters of the neural network model according to the loss value of the mask image corresponding to each panoramic image and the reference image corresponding to each panoramic image respectively, so as to further optimize the neural network model, and obtain a better output result. The neural network model of the accurate panoramic sky segmentation algorithm is used as the preset model; wherein, the loss value of the reference image is the loss between the output of the neural network model, that is, the mask image, and the reference image, and the loss value is The larger the value is, the larger the error between the mask image and the reference image is; the neural network model is further optimized according to the loss value until the loss value reaches the minimum, that is, the neural network model The output mask image has the smallest error with the corresponding reference image, which makes the output of the neural network model more accurate. Among them, the neural network model can use a fully convolutional network (Fully Convolutional Networks (FCN for short), Deep Convolutional Network (Deeplab), Pyramid Scene Parsing Network (PSPNet), High-Resoultion Net (HRNet) and other deep learning-based convolutional neural networks Network model; this is not limited in this embodiment of the present application.
可选地,在得到训练好的预设模型后,即得到训练好的全景天空分割算法后,可以对该预设模型进行性能评估,计算该预设模型的精度,以及实测该预设模型在计算机设备上的处理速度;可选地,可以将任意多张全景图像分别输入至该预设模型中,输出该多张全景图像分别对应的掩码图像,并根据该多张掩码图像计算该预设模型的精度,该预设模型的精度可以包括计算该预设模型的平均交并比(mean Intersection over Union,简称mIoU),以及计算该预设模型的像素精度(Accuracy,简称acc)等;以及计算该预设模型平均处理一张全景图像的平均耗时,即模型的处理速度。Optionally, after the trained preset model is obtained, that is, after the trained panoramic sky segmentation algorithm is obtained, the performance evaluation of the preset model can be performed, the accuracy of the preset model can be calculated, and the actual measurement of the preset model can be performed. The processing speed on the computer equipment; optionally, any number of panoramic images can be input into the preset model, respectively, the mask images corresponding to the multiple panoramic images are output, and the mask images are calculated according to the multiple mask images. The accuracy of the preset model, the accuracy of the preset model may include calculating the average intersection ratio of the preset model (mean Intersection over Union, referred to as mIoU), and calculate the pixel accuracy of the preset model (Accuracy, referred to as acc), etc.; and calculate the average time-consuming of the preset model to process a panoramic image, that is, the processing speed of the model.
在本申请的一个可选的实施例中,还可以利用模型压缩算法处理该神经网络模型,以更新该神经网络模型。可选地,在将该训练样本集中的全景图像输入神经网络模型之前,可以通过模型压缩算法对该神经网络模型进行模型压缩,以降低模型的数据处理量;进而根据模型压缩后的神经网络模型进行全景天空分割算法模型的训练,以提高计算机设备执行该全景天空分割算法的处理速度,达到实时处理的效果。可选地,该模型压缩算法可以包括对该神经网络模型进行模型剪枝、降低通道数、减少网络层数、降低输入分辨率、知识蒸馏、消融实验、以及替换更轻量级提取特征的神经网络模型等,以较少该神经网络模型的参数和计算量,在保证模型精度不出现明显降低的情况下,提高模型的处理速度,达到实时处理的要求。本实施例中对模型压缩算法并不做具体限定,只要在保证神经网络模型精度不出现明显降低的情况下,能够提高神经网络模型的处理速度即可。In an optional embodiment of the present application, a model compression algorithm may also be used to process the neural network model to update the neural network model. Optionally, before the panoramic images in the training sample set are input into the neural network model, model compression can be performed on the neural network model through a model compression algorithm to reduce the data processing volume of the model; and then according to the neural network model after model compression. The training of the panoramic sky segmentation algorithm model is carried out to improve the processing speed of the computer equipment to execute the panoramic sky segmentation algorithm and achieve the effect of real-time processing. Optionally, the model compression algorithm may include model pruning, reducing the number of channels, reducing the number of network layers, reducing the input resolution, knowledge distillation, ablation experiments, and replacing the neural network model with more lightweight feature extraction. In order to reduce the parameters and calculation amount of the neural network model, and ensure that the accuracy of the model is not significantly reduced, the processing speed of the model is improved to meet the requirements of real-time processing. The model compression algorithm is not specifically limited in this embodiment, as long as the processing speed of the neural network model can be improved under the condition that the accuracy of the neural network model is not significantly reduced.
应该理解的是,虽然图2-4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-4中的至少一部分步骤可以包括多个步骤或者多个阶段,这些步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤中的步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the steps in the flowcharts of FIGS. 2-4 are shown in sequence according to the arrows, these steps are not necessarily executed in the sequence shown by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order, and these steps may be performed in other orders. Moreover, at least a part of the steps in FIGS. 2-4 may include multiple steps or multiple stages. These steps or stages are not necessarily executed and completed at the same time, but may be executed at different times. The execution of these steps or stages The order is also not necessarily sequential, but may be performed alternately or alternately with other steps or at least a portion of the steps or phases within the other steps.
在一个实施例中,如图5所示,提供了一种天空区域分割装置,包括:判断模块501、获取模块502和分割模块503,其中:In one embodiment, as shown in FIG. 5, a sky area segmentation device is provided, including: a judgment module 501, an acquisition module 502 and a segmentation module 503, wherein:
判断模块501,用于根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理。The judgment module 501 is configured to judge whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video.
获取模块502,用于在判断对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域。The acquisition module 502 is configured to extract M frames of panoramic images of the target panoramic video when it is judged to perform sky segmentation processing on the target panoramic video, and input each frame of panoramic images in the M frames of panoramic images into a preset model, A mask image of each frame of panoramic images in the M frames of panoramic images is obtained; the mask image includes a sky area and a non-sky area.
分割模块503,用于根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。The segmentation module 503 is configured to perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
在其中一个实施例中,上述判断模块501,具体用于在根据目标全景视频中天空元素的占比,确定对该目标全景视频进行天空分割处理之前,从该M帧全景图像中确定N帧全景图像;将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像;根据该N个掩码图像中天空像素的占比,确定是否对该目标全景视频进行天空分割处理。In one embodiment, the above judgment module 501 is specifically configured to determine N frames of panoramic images from the M frames of panoramic images before determining to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video image; input the N frames of panoramic images into the preset model, and obtain N mask images corresponding to the N frames of panoramic images; according to the proportion of sky pixels in the N mask images, determine whether to perform Sky segmentation processing.
在其中一个实施例中,上述判断模块501,具体用于根据该N个掩码图像中天空像素的数量和该N个掩码图像中非天空像素的数量,确定该天空像素的占比;根据该天空像素的占比和第一预设阈值的大小关系,确定是否对该目标全景视频进行天空分割处理。In one embodiment, the above judgment module 501 is specifically configured to determine the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images; The relationship between the proportion of the sky pixels and the first preset threshold determines whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,上述判断模块501,还用于在根据目标全景视频中天空元素的占比,确定对该目标全景视频进行天空分割处理之前,从该M帧目标全景图像中确定N帧全景图像;利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果;该第二预设模型的输入为全景图像,输出为该全景图像包含天空或者该全景图像不包含天空;根据该N个输出结果中包含天空的全景图像的占比,确定是否对该目标全景视频进行天空分割处理。In one embodiment, the above judgment module 501 is further configured to determine N frames from the M frames of target panoramic images before determining to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video Panoramic image; use the second preset model to identify the N frames of panoramic images, and obtain N output results; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky ; According to the proportion of panoramic images containing the sky in the N output results, determine whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,上述判断模块501,具体用于根据该N个输出结果中包含天空的全景图像的数量和该N个输出结果中不包含天空的全景图像的数量,确定该包含天空的全景图像的占比;根据该包含天空的全景图像的占比和第二预设阈值的大小关系,确定是否对该目标全景视频进行天空分割处理。In one embodiment, the above judgment module 501 is specifically configured to determine the number of panoramic images containing the sky according to the number of panoramic images containing the sky in the N output results and the number of panoramic images that do not contain the sky in the N output results. The proportion of the panoramic image; according to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
在其中一个实施例中,该预设模型的训练样本集包括多帧全景图像以及该多帧全景图像中每一帧全景图像对应的参考图像,该参考图像用于指示该参考图像对应的全景图像的天空区域。In one embodiment, the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, where the reference image is used to indicate the panoramic image corresponding to the reference image sky area.
在其中一个实施例中,所述装置还包括:模型训练模块;该模型训练模块,用于将该训练样本集中的全景图像输入神经网络模型,根据该神经网络模型的输出与该参考图像的损失值调整该神经网络模型的参数,以获得该预设模型。In one embodiment, the apparatus further includes: a model training module; the model training module is used for inputting the panoramic images in the training sample set into a neural network model, and according to the output of the neural network model and the loss of the reference image value to adjust the parameters of the neural network model to obtain the preset model.
在其中一个实施例中,该模型训练模块,还用于利用模型压缩算法处理该神经网络模型,以更新该神经网络模型。In one embodiment, the model training module is further configured to process the neural network model by using a model compression algorithm to update the neural network model.
关于天空区域分割装置的具体限定可以参见上文中对于天空区域分割方法的限定,在此不再赘述。上述天空区域分割装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the sky area segmentation device, reference may be made to the definition of the sky area segmentation method above, which will not be repeated here. All or part of the modules in the above-mentioned sky area segmentation device can be implemented by software, hardware and combinations thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是上述终端,其内部结构图可以如图6所示。该计算机设备包括通过系统总线连接的处理器、存储器、通信接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的通信接口用于与外部的终端进行有线或无线方式的通信,无线方式可通过WIFI、运营商网络、NFC(近场通信)或其他技术实现。该计算机程序被处理器执行时以实现一种天空区域分割方法。该计算机设备的显示屏可以是液晶显示屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided, and the computer device may be the above-mentioned terminal, and its internal structure diagram may be as shown in FIG. 6 . The computer equipment includes a processor, memory, a communication interface, a display screen, and an input device connected by a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium, an internal memory. The nonvolatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the execution of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with an external terminal, and the wireless communication can be realized by WIFI, operator network, NFC (Near Field Communication) or other technologies. The computer program, when executed by a processor, implements a sky region segmentation method. The display screen of the computer equipment may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment may be a touch layer covered on the display screen, or a button, a trackball or a touchpad set on the shell of the computer equipment , or an external keyboard, trackpad, or mouse.
本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 6 is only a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. Include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, a computer program is stored in the memory, and the processor implements the following steps when executing the computer program:
根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
在判断对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;In the case of judging that the target panoramic video is subjected to sky segmentation processing, extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the M frames of panoramic images The mask image of each frame of panoramic image in ; the mask image includes sky area and non-sky area;
根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。According to the mask image, sky segmentation processing is performed on the panoramic image corresponding to the mask image among the M frames of panoramic images.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:从该M帧全景图像中确定N帧全景图像;将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像;根据该N个掩码图像中天空像素的占比,判断是否对该目标全景视频进行天空分割处理。In one embodiment, the processor further implements the following steps when executing the computer program: determining N frames of panoramic images from the M frames of panoramic images; inputting the N frames of panoramic images into the preset model to obtain the corresponding N frames of panoramic images. N mask images; according to the proportion of sky pixels in the N mask images, determine whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:根据该N个掩码图像中天空像素的数量和该N个掩码图像中非天空像素的数量,确定该天空像素的占比;根据该天空像素的占比和第一预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。In one embodiment, the processor further implements the following steps when executing the computer program: determining the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images ; According to the relationship between the proportion of the sky pixels and the first preset threshold, it is judged whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:从该M帧目标全景图像中确定N帧全景图像;利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果;该第二预设模型的输入为全景图像,输出为该全景图像包含天空或者该全景图像不包含天空;根据该N个输出结果中包含天空的全景图像的占比,判断是否对该目标全景视频进行天空分割处理。In one embodiment, the processor further implements the following steps when executing the computer program: determining N frames of panoramic images from the M frames of target panoramic images; identifying the N frames of panoramic images by using a second preset model to obtain N outputs Result; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky; according to the proportion of the panoramic images containing the sky in the N output results, it is judged whether the target The panoramic video is processed by sky segmentation.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:根据该N个输出结果中包含天空的全景图像的数量和该N个输出结果中不包含天空的全景图像的数量,确定该包含天空的全景图像的占比;根据该包含天空的全景图像的占比和第二预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。In one embodiment, when the processor executes the computer program, the following steps are further implemented: according to the number of panoramic images including the sky in the N output results and the number of panoramic images that do not include the sky in the N output results, determine the number of the panoramic images including the sky. The proportion of the panoramic image of the sky; according to the relationship between the proportion of the panoramic image containing the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:该预设模型的训练样本集包括多帧全景图像以及该多帧全景图像中每一帧全景图像对应的参考图像,该参考图像用于指示该参考图像对应的全景图像的天空区域。In one embodiment, the processor further implements the following steps when executing the computer program: the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, the reference image It is used to indicate the sky area of the panoramic image corresponding to the reference image.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:将该训练样本集中的全景图像输入神经网络模型,根据该神经网络模型的输出与该参考图像的损失值调整该神经网络模型的参数,以获得该预设模型。In one embodiment, when the processor executes the computer program, the following steps are further implemented: input the panoramic images in the training sample set into a neural network model, and adjust the output of the neural network model according to the output of the neural network model and the loss value of the reference image. parameters to obtain the preset model.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:利用模型压缩算法处理该神经网络模型,以更新该神经网络模型。In one embodiment, the processor further implements the following steps when executing the computer program: processing the neural network model with a model compression algorithm to update the neural network model.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
根据目标全景视频中天空元素的占比,判断是否对该目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
在判断对该目标全景视频进行天空分割处理的情况下,提取该目标全景视频的M帧全景图像,将该M帧全景图像中的每一帧全景图像输入预设模型,获取该M帧全景图像中每一帧全景图像的掩码图像;该掩码图像包括天空区域和非天空区域;In the case of judging that the target panoramic video is subjected to sky segmentation processing, extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the M frames of panoramic images The mask image of each frame of panoramic image in ; the mask image includes sky area and non-sky area;
根据该掩码图像对该M帧全景图像中与该掩码图像对应的全景图像进行天空分割处理。According to the mask image, sky segmentation processing is performed on the panorama image corresponding to the mask image among the M frames of panorama images.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:从该M帧全景图像中确定N帧全景图像;将该N帧全景图像输入该预设模型,得到该N帧全景图像对应的N个掩码图像;根据该N个掩码图像中天空像素的占比,判断是否对该目标全景视频进行天空分割处理。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining N frames of panoramic images from the M frames of panoramic images; inputting the N frames of panoramic images into the preset model to obtain the corresponding N frames of panoramic images. N mask images of ; according to the proportion of sky pixels in the N mask images, it is judged whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:根据该N个掩码图像中天空像素的数量和该N个掩码图像中非天空像素的数量,确定该天空像素的占比;根据该天空像素的占比和第一预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determining the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images ratio; according to the relationship between the proportion of the sky pixels and the first preset threshold, it is judged whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:从该M帧目标全景图像中确定N帧全景图像;利用第二预设模型对该N帧全景图像进行识别,得到N个输出结果;该第二预设模型的输入为全景图像,输出为该全景图像包含天空或者该全景图像不包含天空;根据该N个输出结果中包含天空的全景图像的占比,判断是否对该目标全景视频进行天空分割处理。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: determine N frames of panoramic images from the M frames of target panoramic images; identify the N frames of panoramic images by using the second preset model, and obtain N frames of panoramic images. The output result; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain the sky; according to the proportion of the panoramic images containing the sky in the N output results, determine whether to The target panoramic video is subjected to sky segmentation processing.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:根据该N个输出结果中包含天空的全景图像的数量和该N个输出结果中不包含天空的全景图像的数量,确定该包含天空的全景图像的占比;根据该包含天空的全景图像的占比和第二预设阈值的大小关系,判断是否对该目标全景视频进行天空分割处理。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: according to the number of panoramic images including the sky in the N output results and the number of panoramic images not including the sky in the N output results, determine the The proportion of the panoramic image including the sky; according to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:该预设模型的训练样本集包括多帧全景图像以及该多帧全景图像中每一帧全景图像对应的参考图像,该参考图像用于指示该参考图像对应的全景图像的天空区域。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: the training sample set of the preset model includes multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, the reference The image is used to indicate the sky area of the panoramic image corresponding to the reference image.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:将该训练样本集中的全景图像输入神经网络模型,根据该神经网络模型的输出与该参考图像的损失值调整该神经网络模型的参数,以获得该预设模型。In one embodiment, the computer program further implements the following steps when executed by the processor: inputting the panoramic images in the training sample set into a neural network model, and adjusting the neural network model according to the output of the neural network model and the loss value of the reference image parameters to obtain the preset model.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:利用模型压缩算法处理该神经网络模型,以更新该神经网络模型。In one embodiment, the computer program, when executed by the processor, further implements the step of: processing the neural network model with a model compression algorithm to update the neural network model.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和易失性存储器中的至少一种。非易失性存储器可包括只读存储器(Read-Only Memory,ROM)、磁带、软盘、闪存或光存储器等。易失性存储器可包括随机存取存储器(Random Access Memory,RAM)或外部高速缓冲存储器。作为说明而非局限,RAM可以是多种形式,比如静态随机存取存储器(Static Random Access Memory,SRAM)或动态随机存取存储器(Dynamic Random Access Memory,DRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage In the medium, when the computer program is executed, it may include the processes of the above-mentioned method embodiments. Wherein, any reference to memory, storage, database or other media used in the various embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (Random Access Memory, RAM) or external cache memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (Dynamic Random Access Memory). Access Memory, DRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features It is considered to be the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several embodiments of the present application, and the descriptions thereof are specific and detailed, but should not be construed as a limitation on the scope of the invention patent. It should be pointed out that for those skilled in the art, without departing from the concept of the present application, several modifications and improvements can be made, which all belong to the protection scope of the present application. Therefore, the scope of protection of the patent of the present application shall be subject to the appended claims.

Claims (11)

  1. 一种天空区域分割方法,其特征在于,所述方法包括:A method for segmenting a sky area, characterized in that the method comprises:
    根据目标全景视频中天空元素的占比,判断是否对所述目标全景视频进行天空分割处理;According to the proportion of sky elements in the target panoramic video, determine whether to perform sky segmentation processing on the target panoramic video;
    若是,则提取所述目标全景视频的M帧全景图像,将所述M帧全景图像中的每一帧全景图像输入预设模型,获取所述M帧全景图像中每一帧全景图像的掩码图像;所述掩码图像包括天空区域和非天空区域;If so, extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain the mask of each frame of panoramic images in the M frames of panoramic images an image; the mask image includes a sky area and a non-sky area;
    根据所述掩码图像对所述M帧全景图像中与所述掩码图像对应的全景图像进行天空分割处理。Perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
  2. 根据权利要求1所述的方法,其特征在于,所述根据目标全景视频中天空元素的占比,判断是否对所述目标全景视频进行天空分割处理,包括:The method according to claim 1, wherein, according to the proportion of sky elements in the target panoramic video, judging whether to perform sky segmentation processing on the target panoramic video, comprising:
    从所述M帧全景图像中确定N帧全景图像;Determine N frames of panoramic images from the M frames of panoramic images;
    将所述N帧全景图像输入所述预设模型,得到所述N帧全景图像对应的N个掩码图像;Inputting the N frames of panoramic images into the preset model to obtain N mask images corresponding to the N frames of panoramic images;
    根据所述N个掩码图像中天空像素的占比,判断是否对所述目标全景视频进行天空分割处理。According to the proportion of sky pixels in the N mask images, it is determined whether to perform sky segmentation processing on the target panoramic video.
  3. 根据权利要求2所述的方法,其特征在于,所述根据所述N个掩码图像中天空像素的占比,判断是否对所述目标全景视频进行天空分割处理,包括:The method according to claim 2, wherein, according to the proportion of sky pixels in the N mask images, judging whether to perform sky segmentation processing on the target panoramic video, comprising:
    根据所述N个掩码图像中天空像素的数量和所述N个掩码图像中非天空像素的数量,确定所述天空像素的占比;Determine the proportion of the sky pixels according to the number of sky pixels in the N mask images and the number of non-sky pixels in the N mask images;
    根据所述天空像素的占比和第一预设阈值的大小关系,判断是否对所述目标全景视频进行天空分割处理。According to the relationship between the proportion of the sky pixels and the first preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
  4. 根据权利要求1所述的方法,其特征在于,所述根据目标全景视频中天空元素的占比,判断是否对所述目标全景视频进行天空分割处理,包括:The method according to claim 1, wherein, according to the proportion of sky elements in the target panoramic video, judging whether to perform sky segmentation processing on the target panoramic video, comprising:
    从所述M帧目标全景图像中确定N帧全景图像;Determine N frames of panoramic images from the M frames of target panoramic images;
    利用第二预设模型对所述N帧全景图像进行识别,得到N个输出结果;所述第二预设模型的输入为全景图像,输出为所述全景图像包含天空或者所述全景图像不包含天空;Use the second preset model to identify the N frames of panoramic images, and obtain N output results; the input of the second preset model is a panoramic image, and the output is that the panoramic image contains the sky or the panoramic image does not contain Sky;
    根据所述N个输出结果中包含天空的全景图像的占比,判断是否对所述目标全景视频进行天空分割处理。According to the proportion of panoramic images including the sky in the N output results, it is determined whether to perform sky segmentation processing on the target panoramic video.
  5. 根据权利要求4所述的方法,其特征在于,所述根据所述N个输出结果中包含天空的全景图像的占比,判断是否对所述目标全景视频进行天空分割处理,包括:The method according to claim 4, wherein determining whether to perform sky segmentation processing on the target panoramic video according to the proportion of panoramic images containing the sky in the N output results, comprising:
    根据所述N个输出结果中包含天空的全景图像的数量和所述N个输出结果中不包含天空的全景图像的数量,确定所述包含天空的全景图像的占比;According to the number of panoramic images that include the sky in the N output results and the number of panoramic images that do not include the sky in the N output results, determine the proportion of the panoramic images that include the sky;
    根据所述包含天空的全景图像的占比和第二预设阈值的大小关系,判断是否对所述目标全景视频进行天空分割处理。According to the relationship between the proportion of the panoramic image including the sky and the second preset threshold, it is determined whether to perform sky segmentation processing on the target panoramic video.
  6. 根据权利要求1所述的方法,其特征在于,所述预设模型的训练样本集包括多帧全景图像以及所述多帧全景图像中每一帧全景图像对应的参考图像,所述参考图像用于指示所述参考图像对应的全景图像的天空区域。The method according to claim 1, wherein the training sample set of the preset model comprises multiple frames of panoramic images and a reference image corresponding to each frame of panoramic images in the multiple frames of panoramic images, and the reference images are is used to indicate the sky area of the panoramic image corresponding to the reference image.
  7. 根据权利要求6所述的方法,其特征在于,所述预设模型的训练过程包括:The method according to claim 6, wherein the training process of the preset model comprises:
    将所述训练样本集中的全景图像输入神经网络模型,根据所述神经网络模型的输出与所述参考图像的损失值调整所述神经网络模型的参数,以获得所述预设模型。The panoramic images in the training sample set are input into a neural network model, and the parameters of the neural network model are adjusted according to the output of the neural network model and the loss value of the reference image to obtain the preset model.
  8. 根据权利要求7所述的方法,其特征在于,所述预设模型的训练过程还包括:The method according to claim 7, wherein the training process of the preset model further comprises:
    利用模型压缩算法处理所述神经网络模型,以更新所述神经网络模型。The neural network model is processed using a model compression algorithm to update the neural network model.
  9. 一种天空区域分割装置,其特征在于,所述装置包括:A sky area segmentation device, characterized in that the device includes:
    判断模块,用于根据目标全景视频中天空元素的占比,判断是否对所述目标全景视频进行天空分割处理;a judgment module, configured to judge whether to perform sky segmentation processing on the target panoramic video according to the proportion of sky elements in the target panoramic video;
    获取模块,用于若是,则提取所述目标全景视频的M帧全景图像,将所述M帧全景图像中的每一帧全景图像输入预设模型,获取所述M帧全景图像中每一帧全景图像的掩码图像;所述掩码图像包括天空区域和非天空区域;an acquisition module, configured to extract M frames of panoramic images of the target panoramic video, input each frame of panoramic images in the M frames of panoramic images into a preset model, and obtain each frame of the M frames of panoramic images A mask image of a panoramic image; the mask image includes a sky area and a non-sky area;
    分割模块,用于根据所述掩码图像对所述M帧全景图像中与所述掩码图像对应的全景图像进行天空分割处理。A segmentation module, configured to perform sky segmentation processing on the panoramic image corresponding to the mask image in the M frames of panoramic images according to the mask image.
  10. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至8中任一项所述的方法的步骤。A computer device, comprising a memory and a processor, wherein the memory stores a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 8 when the processor executes the computer program.
  11. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至8中任一项所述的方法的步骤。A computer-readable storage medium on which a computer program is stored, characterized in that, when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
PCT/CN2022/080598 2021-03-19 2022-03-14 Sky region segmentation method and apparatus, computer device, and storage medium WO2022194079A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110295509.3A CN113034514A (en) 2021-03-19 2021-03-19 Sky region segmentation method and device, computer equipment and storage medium
CN202110295509.3 2021-03-19

Publications (1)

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

Family

ID=76471741

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/080598 WO2022194079A1 (en) 2021-03-19 2022-03-14 Sky region segmentation method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN113034514A (en)
WO (1) WO2022194079A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113034514A (en) * 2021-03-19 2021-06-25 影石创新科技股份有限公司 Sky region segmentation method and device, computer equipment and storage medium
CN113808073A (en) * 2021-08-03 2021-12-17 北京中科慧眼科技有限公司 Sky removing method and system based on binocular stereo matching algorithm and intelligent terminal
CN115705666A (en) * 2021-08-09 2023-02-17 北京字跳网络技术有限公司 Image processing method, device, equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170236287A1 (en) * 2016-02-11 2017-08-17 Adobe Systems Incorporated Object Segmentation, Including Sky Segmentation
US20170294000A1 (en) * 2016-04-08 2017-10-12 Adobe Systems Incorporated Sky editing based on image composition
CN111127307A (en) * 2019-12-09 2020-05-08 上海传英信息技术有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111210434A (en) * 2019-12-19 2020-05-29 上海艾麒信息科技有限公司 Image replacement method and system based on sky identification
CN111428582A (en) * 2020-03-05 2020-07-17 南京大学 Method for calculating city sky opening width by using internet street view photos
CN111464834A (en) * 2020-04-07 2020-07-28 腾讯科技(深圳)有限公司 Video frame processing method and device, computing equipment and storage medium
CN112258380A (en) * 2019-07-02 2021-01-22 北京小米移动软件有限公司 Image processing method, device, equipment and storage medium
CN113034514A (en) * 2021-03-19 2021-06-25 影石创新科技股份有限公司 Sky region segmentation method and device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109003237A (en) * 2018-07-03 2018-12-14 深圳岚锋创视网络科技有限公司 Sky filter method, device and the portable terminal of panoramic picture
CN110944163A (en) * 2019-11-21 2020-03-31 维沃移动通信有限公司 Image processing method and electronic equipment
CN111489322B (en) * 2020-04-09 2023-05-26 广州光锥元信息科技有限公司 Method and device for adding sky filter to static picture
CN111833372A (en) * 2020-07-23 2020-10-27 浙江大华技术股份有限公司 Foreground target extraction method and device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170236287A1 (en) * 2016-02-11 2017-08-17 Adobe Systems Incorporated Object Segmentation, Including Sky Segmentation
US20170294000A1 (en) * 2016-04-08 2017-10-12 Adobe Systems Incorporated Sky editing based on image composition
CN112258380A (en) * 2019-07-02 2021-01-22 北京小米移动软件有限公司 Image processing method, device, equipment and storage medium
CN111127307A (en) * 2019-12-09 2020-05-08 上海传英信息技术有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium
CN111210434A (en) * 2019-12-19 2020-05-29 上海艾麒信息科技有限公司 Image replacement method and system based on sky identification
CN111428582A (en) * 2020-03-05 2020-07-17 南京大学 Method for calculating city sky opening width by using internet street view photos
CN111464834A (en) * 2020-04-07 2020-07-28 腾讯科技(深圳)有限公司 Video frame processing method and device, computing equipment and storage medium
CN113034514A (en) * 2021-03-19 2021-06-25 影石创新科技股份有限公司 Sky region segmentation method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113034514A (en) 2021-06-25

Similar Documents

Publication Publication Date Title
US10453204B2 (en) Image alignment for burst mode images
WO2020192483A1 (en) Image display method and device
WO2022199583A1 (en) Image processing method and apparatus, computer device, and storage medium
CN109344742B (en) Feature point positioning method and device, storage medium and computer equipment
WO2021073418A1 (en) Face recognition method and apparatus, device, and storage medium
WO2022194079A1 (en) Sky region segmentation method and apparatus, computer device, and storage medium
EP2864933B1 (en) Method, apparatus and computer program product for human-face features extraction
WO2021135500A1 (en) Vehicle loss detection model training method and apparatus, vehicle loss detection method and apparatus, and device and medium
US11900676B2 (en) Method and apparatus for detecting target in video, computing device, and storage medium
CN111275034B (en) Method, device, equipment and storage medium for extracting text region from image
CN113469092B (en) Character recognition model generation method, device, computer equipment and storage medium
WO2021115242A1 (en) Super-resolution image processing method and related apparatus
WO2022206680A1 (en) Image processing method and apparatus, computer device, and storage medium
CN114511041B (en) Model training method, image processing method, device, equipment and storage medium
CN111489322A (en) Method and device for adding sky filter to static picture
CN111915541B (en) Image enhancement processing method, device, equipment and medium based on artificial intelligence
CN114445651A (en) Training set construction method and device of semantic segmentation model and electronic equipment
CN112101386A (en) Text detection method and device, computer equipment and storage medium
WO2024041108A1 (en) Image correction model training method and apparatus, image correction method and apparatus, and computer device
CN110689478B (en) Image stylization processing method and device, electronic equipment and readable medium
CN111160240A (en) Image object recognition processing method and device, intelligent device and storage medium
CN111428740A (en) Detection method and device for network-shot photo, computer equipment and storage medium
CN109934783B (en) Image processing method, image processing device, computer equipment and storage medium
WO2022206679A1 (en) Image processing method and apparatus, computer device and storage medium
CN116403200A (en) License plate real-time identification system based on hardware acceleration

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22770434

Country of ref document: EP

Kind code of ref document: A1