WO2021114500A1 - Image processing method and apparatus, electronic device, and computer-readable storage medium - Google Patents

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

Info

Publication number
WO2021114500A1
WO2021114500A1 PCT/CN2020/078838 CN2020078838W WO2021114500A1 WO 2021114500 A1 WO2021114500 A1 WO 2021114500A1 CN 2020078838 W CN2020078838 W CN 2020078838W WO 2021114500 A1 WO2021114500 A1 WO 2021114500A1
Authority
WO
WIPO (PCT)
Prior art keywords
sky
area
image information
processed
sky area
Prior art date
Application number
PCT/CN2020/078838
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 WO2021114500A1 publication Critical patent/WO2021114500A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • This application relates to the field of data processing technology, and in particular to an image processing method, device, electronic equipment, and computer-readable storage medium.
  • the sky in the image can be processed, for example, the sky area in the image can be replaced with a sky template of blue sky and white clouds.
  • the embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium to solve the technical problem of poor fusion between the replaced template and the original image, resulting in poor visual effect of the processed image.
  • the first aspect of the embodiments of the present application provides an image processing method, including:
  • the sky area is optimized according to preset rules to obtain an optimized image.
  • the judging and segmenting the sky area of the image information includes: performing recognition processing on the image information to be processed to obtain the sky area and the non-sky area in the image information to be processed, and The sky edge transition zone between the sky area and the non-sky area; re-determine the sky area according to the sky area, the non-sky area, and the sky edge transition zone;
  • the optimizing processing of the sky area according to preset rules to obtain an optimized image includes: performing sky optimization processing on a portion corresponding to the re-determined sky area in the image information to be processed to obtain an optimized image .
  • the re-determining the sky area according to the sky area, the non-sky area, and the sky edge transition zone includes:
  • Refinement processing is performed on the sky edge of the sky segmentation mask map to obtain a sky segmentation mask map after edge refinement, so as to obtain the re-determined sky area.
  • the performing refinement processing on the sky edge of the sky segmentation mask includes:
  • the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistical method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
  • the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
  • the preset sky template is used to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed.
  • said using a preset sky template to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
  • the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
  • sky optimization processing is performed on the portion corresponding to the re-determined sky region in the image information to be processed.
  • a second aspect of the embodiments of the present application provides an image processing apparatus, including:
  • a segmentation module for judging and segmenting the sky area of the image information
  • the optimization module is used for optimizing processing of the sky area according to preset rules to obtain an optimized image.
  • optimization module is specifically used for:
  • the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistical method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
  • it also includes:
  • the processing module is configured to adjust the sky area according to template replacement of the sky area or according to the scene corresponding to the image information to be processed.
  • a third aspect of the embodiments of the present application provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor, and The computer program includes instructions for performing the method according to any one of the preceding first aspects.
  • a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of the foregoing first aspects is implemented.
  • the embodiment of the application provides an image processing method and device. It is found that the reason for the poor fusion of the replacement template and the original picture in the prior art is that it is usually difficult to obtain an accurate image when recognizing the sky area in the prior art.
  • the edge of the sky area may cause the non-sky area to be processed during the subsequent processing of the sky area, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed. Specifically, the image information to be processed is judged and segmented, and then the image information to be processed is determined and segmented according to the preprocessed image information. The result is further optimized.
  • the sky area is optimized according to the preset rules, that is, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area identified in the preprocessing, and then processed After the sky area corresponding to the re-determined sky area in the image information is optimized for the sky, the optimized image obtained can achieve accurate processing of the edge of the sky area, so the processing area and the image information to be processed have a better fusion. The visual effect of the adapted and optimized image is better.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of a user interface of an image processing method provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of image segmentation of the image processing method provided by an embodiment of the application.
  • FIG. 4 is a schematic diagram of the structure of the image processing device provided by this application.
  • the words “if” and “if” as used herein can be interpreted as “when” or “when” or “in response to determination” or “in response to detection”.
  • the phrase “if determined” or “if detected (statement or event)” can be interpreted as “when determined” or “in response to determination” or “when detected (statement or event) )” or “in response to detection (statement or event)”.
  • the embodiment of the application reveals that the reason for the poor fusion between the replacement template and the original picture in the prior art is that it is usually difficult to obtain an accurate edge of the sky area when recognizing the sky area in the prior art, or it is understandable Because the edge of the sky area identified in the prior art is inaccurate, resulting in the subsequent processing of the sky area, if the edge exceeds the actual sky area, it may appear that the non-sky area is processed, or if the edge is included in the actual sky area. In the sky area, it may appear that the sky area is not fully processed, resulting in poor fusion of the processed part with the original picture.
  • the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed. The sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results.
  • the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
  • the image processing method in the embodiment of the present application may be applied to a terminal or a server, and the terminal may include: a mobile phone, a tablet computer, a notebook computer, a desktop computer, and other electronic devices, which is not specifically limited in the embodiment of the present application.
  • the sky optimization process described in the embodiments of the present application may be to replace the sky of the image information to be processed with a preset template, or to adjust the brightness, contrast, saturation, color, filter, etc. of the sky in the image information to be processed.
  • the embodiments of the present application do not specifically limit this.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the application.
  • the method may specifically include:
  • S101 Acquire image information to be processed.
  • the image information to be processed may be an image obtained by the electronic device from the network or locally.
  • the image information to be processed can also be an image input by the user that the electronic device receives.
  • Figure 2 shows a user interface for receiving the image information to be processed by the user. By clicking a preset area in the user interface and inputting image information to be processed, the mobile phone can obtain the image information to be processed.
  • the sky area contained in the image information to be processed can be determined according to actual application scenarios. For example, if the sky area contained in the image information to be processed is very small, the sky area is subsequently optimized. The optimization effect of the image information to be processed may not be obvious. Therefore, the user may be prompted to input the image information to be processed that contains the sky area occupying a proportion of the image information to be processed that is greater than the set value.
  • S102 Determine and segment the sky area of the image information.
  • the image information to be processed may be identified to obtain the sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the image information to be processed .
  • any image recognition technology can be used to identify the image information to be processed.
  • a number of images containing the sky can be obtained in advance as a sample set, and the sky area and non-sky area of the image samples of the sample set can be obtained.
  • the sky edge transition zone is the boundary zone between the sky area and the non-sky area. In recognition, only the sky area and the non-sky area can be identified, and then the sky edge transition zone is obtained according to the boundary between the sky area and the non-sky area. The embodiments of the present application do not specifically limit this.
  • the boundary between the sky area and the non-sky area may be a narrow strip area, which may be called a dividing line, for example, a certain point of the dividing line may cover One or two pixels, as an example, to further determine the accurate dividing line later, you can include multiple pixels on both sides of the dividing line into the dividing line to obtain a sky edge transition zone that covers more pixels, such as an interface of the sky edge transition zone It can cover about 5-15 pixels, etc.
  • the sky regions 21, the non-sky regions 22, and the sky edge transition zone 23 can be segmented in FIG. 3.
  • the sky regions can include the sun, white clouds, etc., and the balance outside the sky region can be processed. It can be called non-sky areas.
  • the sky area may be re-determined according to the sky area, the non-sky area, and the sky edge transition zone.
  • any possible form may be used to re-determine the sky area according to the sky area, the non-sky area, and the sky edge transition zone to obtain a sky area that is more accurate than S102 .
  • the image content contained in the sky edge transition zone can be re-identified, and after the accurate sky edge line is obtained, the accurate sky area can be re-determined through the accurate sky edge line.
  • the re-determining the sky area according to the sky area, the non-sky area, and the sky edge transition zone includes:
  • the sky area, the non-sky area and the sky edge transition zone of the sample image when labeling the sample image, can be assigned different values, and the labeling accuracy can be fine to the pixel level.
  • AI semantic segmentation technology can be used to train the labeled sample images; for example, each pixel in the sample image can be labeled with a category label, such as people, trees, grass, sky, etc., and finally the sky area can be output. AI model of the sky segmentation of the mask map.
  • the sky segmentation AI model is used to obtain a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone.
  • the mask image may be a binary image composed of 0 and 1.
  • the 1 value area is processed, and the masked 0 value area is not included in the calculation.
  • the sky segmentation mask that needs to be processed can be obtained.
  • refinement processing is performed on the sky edge of the sky segmentation mask map to obtain the sky segmentation mask map after edge refinement, to obtain the re-determined sky area.
  • the performing refinement processing on the sky edge of the sky segmentation mask includes:
  • the coordinates of the pixel point are obtained separately, and the coordinates are used as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination to obtain an accurate edge of the sky.
  • the coordinates of each pixel in the sky edge transition zone of the sky segmentation mask can be obtained.
  • the coordinates of the pixel can be used as the center point, and the local voting method can be used to determine The center point is the exact edge in the adjacent area.
  • the similarity between the pixels of the center point and the pixels in the adjacent area of the center point can be calculated. If the similarity is low, the center point can be voted as an edge point, and if the similarity is high, the center point can be voted as the edge point.
  • the central point is voted as a non-edge point. After the central point and the pixels in the adjacent area of the central point are voted separately, the pixel with a higher score can be determined as the edge pixel to obtain an accurate edge.
  • sky optimization processing is performed on the re-determined sky region corresponding part in the image information to be processed to obtain an optimized image.
  • the sky after the re-determined accurate sky area is obtained, the sky can be optimized according to actual requirements to obtain an optimized image.
  • the performing sky optimization processing on the re-determined sky region corresponding part of the image information to be processed includes: adopting a preset sky template and re-determining the image information to be processed The corresponding part of the sky area is replaced.
  • the preset sky template may be a predefined standard sky template, such as a sunny white cloud sky template, a dark cloud sky template, etc. It is understandable that the sky area in the image information to be processed may not reach the preset sky template Therefore, a preset sky template is used to replace the portion corresponding to the re-determined sky area in the image information to be processed, and an image with a better sky effect can be obtained.
  • said using a preset sky template to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
  • the position of the preset sky template can be adjusted according to the position of the re-determined sky area, so that the preset sky template is exactly located in the re-determined sky area, thereby avoiding the replacement effect caused by the improper location of the preset sky template Poor problem.
  • the size of the preset sky template can be adjusted according to the size of the re-determined sky area, so that the size of the preset sky template matches the size of the re-determined sky area, thereby avoiding the improper size of the preset sky template The resulting picture violation problem.
  • the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
  • an algorithm can be used to identify the scene corresponding to the image information to be processed, for example, different scenes such as sunny days, cloudy days, night scenes, sunsets, grasslands, etc. can be identified. Then you can find the response adjustment mode, and realize the customized sky optimization processing.
  • the adjustment method is not limited to smart superimposing filters, or adjusting the brightness, contrast, saturation, color, and filters of the sky area. Wait.
  • an image processing method and device are provided in the embodiments of the present application, and it is found that the reason for the poor fusion between the replacement template and the original picture in the prior art is that in the prior art, when recognizing the sky area, It is usually difficult to obtain an accurate edge of the sky area. As a result, in the subsequent processing of the sky area, the non-sky area may be processed, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed.
  • the sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results.
  • the sky area and non-sky area As well as the sky edge transition zone, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
  • FIG. 4 is a schematic structural diagram of an embodiment of an image processing apparatus provided by this application. As shown in Figure 4, the image processing apparatus provided in this embodiment includes:
  • the segmentation module 31 is used to determine and segment the sky area of the image information to be processed
  • the optimization module 32 is configured to optimize processing of the sky area according to preset rules to obtain an optimized image.
  • optimization module is specifically used for:
  • the coordinates of the pixel point are obtained separately, and the coordinates are used as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
  • it also includes:
  • the processing module is configured to adjust the sky area according to template replacement of the sky area or according to the scene corresponding to the image information to be processed.
  • an image processing method and device are provided in the embodiments of the present application, and it is found that the reason for the poor fusion between the replacement template and the original picture in the prior art is that in the prior art, when recognizing the sky area, It is usually difficult to obtain an accurate edge of the sky area. As a result, in the subsequent processing of the sky area, the non-sky area may be processed, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed.
  • the sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results.
  • the sky area and non-sky area As well as the sky edge transition zone, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
  • the image processing apparatus provided in each embodiment of the present application can be used to execute the method shown in each corresponding embodiment described above, and the implementation manner and principle are the same, and details are not repeated here.
  • An embodiment of the present application further provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor, and the computer program It includes instructions for executing the method as described in any of the foregoing embodiments.
  • An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed, the method as described in any one of the foregoing embodiments is implemented.
  • the disclosed device and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • the size of the sequence number of the above-mentioned processes does not mean the order of execution.
  • the execution order of each process should be determined by its function and internal logic, and should not correspond to the difference in the embodiments of the present application.
  • the implementation process constitutes any limitation.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

An image processing method and apparatus, an electronic device, and a computer-readable storage medium. The method comprises: acquiring image information to be processed including a sky; preprocessing the image information, wherein the preprocessing specifically comprises performing determination and segmentation with respect to the image information; performing further optimization processing according to a preprocessing result, wherein the optimization processing specifically comprises performing optimization processing on a sky region according to a preset rule, that is, redetermining the sky region such that the edge of a redetermined sky region is more accurate than the edge of the sky region identified during the preprocessing; and performing sky optimization processing on a portion in the image information corresponding to the redetermined sky region, so as to obtain an optimized image in which the edge of the sky region is accurately processed. Thus, the method improves the degree of fusion between the processed region and the image information, and improves the visual effect of the adapted and optimized image.

Description

图像处理方法、装置、电子设备及计算机可读存储介质Image processing method, device, electronic equipment and computer readable storage medium
本申请要求于2019年12月9日提交中国专利局、申请号为201911249372.7、申请名称为“图像处理方法、装置、电子设备及计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on December 9, 2019, the application number is 201911249372.7, and the application name is "Image processing methods, devices, electronic equipment, and computer-readable storage media", and its entire contents Incorporated in this application by reference.
技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种图像处理方法、装置、电子设备及计算机可读存储介质。This application relates to the field of data processing technology, and in particular to an image processing method, device, electronic equipment, and computer-readable storage medium.
背景技术Background technique
在趣味图像处理中,可以对图像中的天空进行处理,例如,可以将图像中的天空区域替换为蓝天白云的天空模板等。In interesting image processing, the sky in the image can be processed, for example, the sky area in the image can be replaced with a sky template of blue sky and white clouds.
现有技术中,通常只是基于训练的天空识别模型进行天空区域的识别,并对识别出的天空区域进行模板替换等处理。In the prior art, usually only the sky area is recognized based on the trained sky recognition model, and processing such as template replacement is performed on the recognized sky area.
但是,现有技术中经常出现模板替换后,替换的模板与原始图像的融合度差,处理后的图像视觉效果较差。However, after template replacement often occurs in the prior art, the degree of fusion between the replaced template and the original image is poor, and the visual effect of the processed image is poor.
发明内容Summary of the invention
本申请实施例提供图像处理方法、装置、电子设备及计算机可读存储介质,以解决替换的模板与原始图像的融合度差,导致处理后的图像视觉效果较差的技术问题。The embodiments of the present application provide an image processing method, device, electronic device, and computer-readable storage medium to solve the technical problem of poor fusion between the replaced template and the original image, resulting in poor visual effect of the processed image.
本申请实施例第一方面提供一种图像处理的方法,包括:The first aspect of the embodiments of the present application provides an image processing method, including:
获取待处理的图像信息,待处理的图像信息;Obtain image information to be processed, image information to be processed;
判断并分割所述图像信息的天空区域;Judging and segmenting the sky area of the image information;
根据预设规则对所述天空区域优化处理,以获取优化后的图像。The sky area is optimized according to preset rules to obtain an optimized image.
可选的,所述判断并分割所述图像信息的天空区域,包括:对所述待处理的图像信息进行识别处理,以获取所述待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带;根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定;Optionally, the judging and segmenting the sky area of the image information includes: performing recognition processing on the image information to be processed to obtain the sky area and the non-sky area in the image information to be processed, and The sky edge transition zone between the sky area and the non-sky area; re-determine the sky area according to the sky area, the non-sky area, and the sky edge transition zone;
所述根据预设规则对所述天空区域优化处理,以获取优化后的图像,包括:对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,以获取优化后的图像。The optimizing processing of the sky area according to preset rules to obtain an optimized image includes: performing sky optimization processing on a portion corresponding to the re-determined sky area in the image information to be processed to obtain an optimized image .
可选的,所述根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定,包括:Optionally, the re-determining the sky area according to the sky area, the non-sky area, and the sky edge transition zone includes:
分别对包括天空区域和非天空区域的样本图像中的像素进行标注处理;Label the pixels in the sample image including the sky area and the non-sky area respectively;
采用AI语义分割技术,训练已标注的所述样本图像中的像素,得到天空分割AI模型;Using AI semantic segmentation technology, training the pixels in the sample image that have been labeled to obtain the sky segmentation AI model;
利用所述天空分割AI模型得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;Using the sky segmentation AI model to obtain a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone;
对所述天空分割掩膜图的天空边缘进行细化处理,以获取边缘细化后的天空分割掩膜图,以得到所述重新确定的天空区域。Refinement processing is performed on the sky edge of the sky segmentation mask map to obtain a sky segmentation mask map after edge refinement, so as to obtain the re-determined sky area.
可选的,所述对所述天空分割掩膜图的天空边缘进行细化处理,包括:Optionally, the performing refinement processing on the sky edge of the sky segmentation mask includes:
对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判定。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistical method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
可选的,所述对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,包括:Optionally, the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
采用预设天空模版,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理。The preset sky template is used to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed.
可选的,所述采用预设天空模板,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理,包括:Optionally, said using a preset sky template to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
根据所述重新确定的天空区域的位置和/或尺寸,对所述预设天空模板的位置和/或尺寸进行调整,并将调整后的天空模板替换到所述待处理的图像信息中重新确定的天空区域对应的部分。Adjust the position and/or size of the preset sky template according to the position and/or size of the re-determined sky area, and replace the adjusted sky template with the image information to be processed and re-determine The corresponding part of the sky area.
可选的,所述对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,包括:Optionally, the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
识别所述待处理的图像信息对应的场景,并查找获取所述场景对应的调节模式;Identifying the scene corresponding to the image information to be processed, and searching for and acquiring the adjustment mode corresponding to the scene;
根据所述调节模式,对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理。According to the adjustment mode, sky optimization processing is performed on the portion corresponding to the re-determined sky region in the image information to be processed.
本申请实施例第二方面提供一种图像处理的装置,包括:A second aspect of the embodiments of the present application provides an image processing apparatus, including:
分割模块,用于判断并分割所述图像信息的天空区域;A segmentation module for judging and segmenting the sky area of the image information;
优化模块,用于根据预设规则对所述天空区域优化处理,以获取优化后的图像。The optimization module is used for optimizing processing of the sky area according to preset rules to obtain an optimized image.
可选的,所述优化模块,具体用于:Optionally, the optimization module is specifically used for:
得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;Obtaining a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone;
对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判定。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistical method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
可选的,还包括:Optionally, it also includes:
处理模块,用于根据对所述天空区域进行模板替换,或根据所述待处理的图像信息对应的场景,对所述天空区域进行调节。The processing module is configured to adjust the sky area according to template replacement of the sky area or according to the scene corresponding to the image information to be processed.
本申请实施例第三方面提供一种电子设备,包括:处理器,存储器以及计算机程序;其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如前述第一方面任一项所述的方法的指令。A third aspect of the embodiments of the present application provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor, and The computer program includes instructions for performing the method according to any one of the preceding first aspects.
本申请实施例第四方面提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时,实现如前述第一方面任一项所述的方法。A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of the foregoing first aspects is implemented.
本申请实施例相对于现有技术的有益效果:The beneficial effects of the embodiments of the present application relative to the prior art:
本申请实施例中提供了一种图像处理的方法及装置,发现了现有技术中替换模板与原始图片的融合度差的原因是,现有技术中在识别天空区域时,通常难以得到准确的天空区域边缘,导致在对天空区域进行后续处理时,可能出现将非天空区域进行了处理,或对天空区域没有实现 完全处理,导致处理部分与原始图片的融合度较差。因此,本申请实施例中,在获取包含天空的待处理的图像信息后,先对该待处理的图像信息进行预处理,具体的,对待处理的图像信息进行判断和分割,然后根据预处理的结果进行进一步的优化处理,具体的,根据预设规则对天空区域优化处理,即对天空区域进行重新确定,重新确定的天空区域的边缘比预处理中识别的天空区域的边缘准确,进而对待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理后,得到的优化后的图像中,可以实现对天空区域边缘的准确处理,因此处理区域与待处理的图像信息的融合度较好,适应的优化后的图像的视觉效果较好。The embodiment of the application provides an image processing method and device. It is found that the reason for the poor fusion of the replacement template and the original picture in the prior art is that it is usually difficult to obtain an accurate image when recognizing the sky area in the prior art. The edge of the sky area may cause the non-sky area to be processed during the subsequent processing of the sky area, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed. Specifically, the image information to be processed is judged and segmented, and then the image information to be processed is determined and segmented according to the preprocessed image information. The result is further optimized. Specifically, the sky area is optimized according to the preset rules, that is, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area identified in the preprocessing, and then processed After the sky area corresponding to the re-determined sky area in the image information is optimized for the sky, the optimized image obtained can achieve accurate processing of the edge of the sky area, so the processing area and the image information to be processed have a better fusion. The visual effect of the adapted and optimized image is better.
附图说明Description of the drawings
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。The drawings herein are incorporated into the specification and constitute a part of the specification, show embodiments that conform to the application, and are used together with the specification to explain the principle of the application.
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述。这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。Through the above drawings, the specific embodiments of the present application have been shown, which will be described in more detail later. These drawings and text description are not intended to limit the scope of the concept of the present application in any way, but to explain the concept of the present application for those skilled in the art by referring to specific embodiments.
图1为本申请实施例提供的图像处理的方法的流程示意图;FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the application;
图2为本申请实施例提供的图像处理的方法的一用户界面示意图;2 is a schematic diagram of a user interface of an image processing method provided by an embodiment of the application;
图3为本申请实施例提供的图像处理的方法的一图像分割示意图;3 is a schematic diagram of image segmentation of the image processing method provided by an embodiment of the application;
图4为本申请提供的图像处理装置的结构示意图。FIG. 4 is a schematic diagram of the structure of the image processing device provided by this application.
具体实施方式Detailed ways
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。The exemplary embodiments will be described in detail here, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementation manners described in the following exemplary embodiments do not represent all implementation manners consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the application as detailed in the appended claims.
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚 地表示其他含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms of "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used in this text is only an association relationship describing the associated objects, indicating that there can be three types of relationships, for example, A and/or B can mean that A alone exists, and both A and A exist at the same time. B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the associated objects before and after are in an "or" relationship.
应当理解,本申请说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。It should be understood that the terms "first", "second", "third", "fourth", etc. (if any) in the description and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and It does not have to be used to describe a specific order or sequence.
取决于语境,如在此所使用的词语“如果”、“若”可以被解释成为“在……时”或“当……时”或“响应于确定”或“响应于检测”。类似地,取决于语境,短语“如果确定”或“如果检测(陈述的条件或事件)”可以被解释成为“当确定时”或“响应于确定”或“当检测(陈述的条件或事件)时”或“响应于检测(陈述的条件或事件)”。Depending on the context, the words "if" and "if" as used herein can be interpreted as "when" or "when" or "in response to determination" or "in response to detection". Similarly, depending on the context, the phrase "if determined" or "if detected (statement or event)" can be interpreted as "when determined" or "in response to determination" or "when detected (statement or event) )" or "in response to detection (statement or event)".
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的商品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种商品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的商品或者系统中还存在另外的相同要素。It should also be noted that the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a commodity or system that includes a series of elements not only includes those elements, but also includes those elements that are not explicitly listed. Other elements of, or also include elements inherent to this kind of commodity or system. If there are no more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the commodity or system that includes the element.
在研究中,本申请实施例揭示了现有技术中替换模板与原始图片的融合度差的原因是,现有技术中在识别天空区域时,通常难以得到准确的天空区域边缘,或者也可以理解为现有技术中识别的天空区域的边缘不准确,导致在对天空区域进行后续处理时,如果边缘超出了实际的天空区域,可能出现将非天空区域进行了处理,或如果边缘包含于实际的天空区域,可能出现对天空区域没有实现完全处理,导致处理部分与原始图片的融合度较差。In the research, the embodiment of the application reveals that the reason for the poor fusion between the replacement template and the original picture in the prior art is that it is usually difficult to obtain an accurate edge of the sky area when recognizing the sky area in the prior art, or it is understandable Because the edge of the sky area identified in the prior art is inaccurate, resulting in the subsequent processing of the sky area, if the edge exceeds the actual sky area, it may appear that the non-sky area is processed, or if the edge is included in the actual sky area. In the sky area, it may appear that the sky area is not fully processed, resulting in poor fusion of the processed part with the original picture.
因此,本申请实施例中,在获取包含天空的待处理的图像信息后,先对该待处理的图像信息进行预处理,具体的,对待处理的图像信息进行识别处理,以获取待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带,然后根据预处理的结果进 行进一步的优化处理,具体的,根据天空区域、非天空区域,以及天空边缘过渡带,对天空区域进行重新确定,重新确定的天空区域的边缘比预处理中识别的天空区域的边缘准确,进而对待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理后,得到的优化后的图像中,可以实现对天空区域边缘的准确处理,因此处理区域与待处理的图像信息的融合度较好,适应的优化后的图像的视觉效果较好。Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed. The sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results. Specifically, according to the sky area and non-sky area, As well as the sky edge transition zone, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
本申请实施例的图像处理方法可以应用于终端或服务器,终端可以包括:手机、平板电脑、笔记本电脑、台式电脑等电子设备,本申请实施例对此不作具体限定。The image processing method in the embodiment of the present application may be applied to a terminal or a server, and the terminal may include: a mobile phone, a tablet computer, a notebook computer, a desktop computer, and other electronic devices, which is not specifically limited in the embodiment of the present application.
本申请实施例所描述的天空优化处理可以是将待处理的图像信息的天空进行预设模板替换,或对待处理的图像信息中的天空进行亮度、对比度、饱和度、色彩、滤镜等调节,本申请实施例对此不作具体限定。The sky optimization process described in the embodiments of the present application may be to replace the sky of the image information to be processed with a preset template, or to adjust the brightness, contrast, saturation, color, filter, etc. of the sky in the image information to be processed. The embodiments of the present application do not specifically limit this.
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。Hereinafter, some embodiments of the present application will be described in detail with reference to the accompanying drawings. In the case of no conflict, the following embodiments and features in the embodiments can be combined with each other.
如图1所示,图1为本申请实施例提供的图像处理的方法的流程示意图。该方法具体可以包括:As shown in FIG. 1, FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the application. The method may specifically include:
S101:获取待处理的图像信息。S101: Acquire image information to be processed.
本申请实施例中,待处理的图像信息可以是电子设备从网络或本地中获取的图像。In the embodiment of the present application, the image information to be processed may be an image obtained by the electronic device from the network or locally.
待处理的图像信息也可以是电子设备接收用户输入的图像,示例性的,以电子设备为手机为例,如图2示出了一种接收用户输入待处理的图像信息的用户界面,用户可以通过点击用户界面中的预设区域,输入待处理的图像信息,则手机可以获取该待处理的图像信息。The image information to be processed can also be an image input by the user that the electronic device receives. Illustratively, taking the electronic device as a mobile phone as an example, Figure 2 shows a user interface for receiving the image information to be processed by the user. By clicking a preset area in the user interface and inputting image information to be processed, the mobile phone can obtain the image information to be processed.
本申请实施例中,待处理的图像信息中包含的天空区域可以根据实际应用场景确定,示例性的,如果待处理的图像信息中包含的天空的区域非常小,则后续对天空区域进行优化处理可能对待处理的图像信息的优化效果不明显,因此,可以提示用户输入包含天空区域占据待处理的图像信息的比例大于设定值的待处理的图像信息。In the embodiments of the present application, the sky area contained in the image information to be processed can be determined according to actual application scenarios. For example, if the sky area contained in the image information to be processed is very small, the sky area is subsequently optimized. The optimization effect of the image information to be processed may not be obvious. Therefore, the user may be prompted to input the image information to be processed that contains the sky area occupying a proportion of the image information to be processed that is greater than the set value.
可以理解,本申请实施例中也可以只要待处理的图像信息中包含天空即可,不对天空进行任何限制,本申请实施例对此不作具体限定。It can be understood that in the embodiment of the present application, as long as the image information to be processed includes the sky, there is no restriction on the sky, and the embodiment of the present application does not specifically limit this.
S102:判断并分割所述图像信息的天空区域。S102: Determine and segment the sky area of the image information.
具体的,可以对所述待处理的图像信息进行识别处理,以获取所述待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带。Specifically, the image information to be processed may be identified to obtain the sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the image information to be processed .
本申请实施例中,可以采用任意的图像识别技术识别待处理的图像信息,示例性的,可以预先获取若干包含天空的图像作为样本集,对样本集的图像样本进行天空区域和非天空区域的标注,之后通过标注的样本训练得到天空识别模型,将待处理的图像信息输入该天空识别模型中,可以获取该待处理的图像信息中的天空区域、非天空区域,以及天空区域和非天空区域之间的天空边缘过渡带。In the embodiments of this application, any image recognition technology can be used to identify the image information to be processed. For example, a number of images containing the sky can be obtained in advance as a sample set, and the sky area and non-sky area of the image samples of the sample set can be obtained. Label, and then train the labeled sample to obtain a sky recognition model, and input the image information to be processed into the sky recognition model to obtain the sky area, non-sky area, and sky area and non-sky area in the image information to be processed The transition zone between the edges of the sky.
需要说明的是,天空边缘过渡带为天空区域和非天空区域的交界带,在识别中,可以仅识别天空区域和非天空区域,之后根据天空区域和非天空区域的分界得到天空边缘过渡带,本申请实施例对此不作具体限定。It should be noted that the sky edge transition zone is the boundary zone between the sky area and the non-sky area. In recognition, only the sky area and the non-sky area can be identified, and then the sky edge transition zone is obtained according to the boundary between the sky area and the non-sky area. The embodiments of the present application do not specifically limit this.
一种可能的实现中,在识别到天空区域和飞天空区域后,天空区域和非天空区域的分界可能是较窄的带状区域,可以称为分割线,例如该分割线的某一点可能覆盖一个或二个像素,为例后续进一步确定准确的分割线,可以将分割线两边的多个像素包括进分割线中,得到覆盖像素较多的天空边缘过渡带,例如天空边缘过渡带的一个界面中可以覆盖5-15个左右的像素点等。In a possible implementation, after identifying the sky area and the flying sky area, the boundary between the sky area and the non-sky area may be a narrow strip area, which may be called a dividing line, for example, a certain point of the dividing line may cover One or two pixels, as an example, to further determine the accurate dividing line later, you can include multiple pixels on both sides of the dividing line into the dividing line to obtain a sky edge transition zone that covers more pixels, such as an interface of the sky edge transition zone It can cover about 5-15 pixels, etc.
示例性的,如图3所示,在图3中可以分割出天空各区域21、非天空区域22和天空边缘过渡带23,在天空区域中可以包括太阳、白云等,处理天空区域以外的均可以称为非天空各区域。Exemplarily, as shown in FIG. 3, the sky regions 21, the non-sky regions 22, and the sky edge transition zone 23 can be segmented in FIG. 3. The sky regions can include the sun, white clouds, etc., and the balance outside the sky region can be processed. It can be called non-sky areas.
可以理解,该步骤中获取的天空区域、非天空区域可能不准确,因此可以进行后续S103对天空区域进行重新确定。It can be understood that the sky area and the non-sky area obtained in this step may be inaccurate, so the sky area can be re-determined in the subsequent S103.
S103:根据预设规则对所述天空区域优化处理,以获取优化后的图像。S103: Optimize the sky area according to a preset rule to obtain an optimized image.
具体的,可以根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定。Specifically, the sky area may be re-determined according to the sky area, the non-sky area, and the sky edge transition zone.
本申请实施例中,可以采用任意的可能的形式根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定,以得到比S102准确的天空区域。In the embodiment of the present application, any possible form may be used to re-determine the sky area according to the sky area, the non-sky area, and the sky edge transition zone to obtain a sky area that is more accurate than S102 .
示例性的,可以对天空边缘过渡带包含的图像内容进行再次识别,得到准确的天空边缘线后,通过准确的天空边缘线重新确定准确的天空区域。Exemplarily, the image content contained in the sky edge transition zone can be re-identified, and after the accurate sky edge line is obtained, the accurate sky area can be re-determined through the accurate sky edge line.
一种可能的实现方式中,所述根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定,包括:In a possible implementation manner, the re-determining the sky area according to the sky area, the non-sky area, and the sky edge transition zone includes:
分别对包括天空区域和非天空区域的样本图像中的像素进行标注处理;采用AI语义分割技术,训练已标注的所述样本图像中的像素,得到天空分割AI模型;利用所述天空分割AI模型得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;对所述天空分割掩膜图的天空边缘进行细化处理,以获取边缘细化后的天空分割掩膜图,以得到所述重新确定的天空区域。Labeling the pixels in the sample image including the sky area and the non-sky area respectively; using AI semantic segmentation technology to train the labeled pixels in the sample image to obtain a sky segmentation AI model; using the sky segmentation AI model Obtain the sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone; refine the sky edge of the sky segmentation mask map to obtain the refined edge The sky is divided into a mask map to obtain the re-determined sky area.
本申请实施例中,在对样本图像标注时,可以将样本图像的天空区域、非天空区域和天空边缘过渡带可以赋予不同的值,标注精确度可以精细到像素级。In the embodiment of the present application, when labeling the sample image, the sky area, the non-sky area and the sky edge transition zone of the sample image can be assigned different values, and the labeling accuracy can be fine to the pixel level.
标注处理之后,可以采用AI语义分割技术,训练已标注的样本图像;例如可以对样本图像中的每个像素打上类别标签,如类似人、树木、草地、天空等标签,最终得到能输出天空区域的掩膜图的天空分割AI模型。After the labeling process, AI semantic segmentation technology can be used to train the labeled sample images; for example, each pixel in the sample image can be labeled with a category label, such as people, trees, grass, sky, etc., and finally the sky area can be output. AI model of the sky segmentation of the mask map.
进一步的,采用天空分割AI模型得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图。具体的,掩模图可以是由0和1组成的一个二进制图像。示例性的,当在某一功能中应用掩模时,1值区域被处理,被屏蔽的0值区域不被包括在计算中。通过掩膜处理,可以得到需要处理的天空分割掩膜图。Further, the sky segmentation AI model is used to obtain a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone. Specifically, the mask image may be a binary image composed of 0 and 1. Exemplarily, when a mask is applied in a certain function, the 1 value area is processed, and the masked 0 value area is not included in the calculation. Through mask processing, the sky segmentation mask that needs to be processed can be obtained.
进一步的,对所述天空分割掩膜图的天空边缘进行细化处理,以获取边缘细化后的天空分割掩膜图,得到所述重新确定的天空区域。Further, refinement processing is performed on the sky edge of the sky segmentation mask map to obtain the sky segmentation mask map after edge refinement, to obtain the re-determined sky area.
可选的,所述对所述天空分割掩膜图的天空边缘进行细化处理,包括:Optionally, the performing refinement processing on the sky edge of the sky segmentation mask includes:
对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判定,得到准确的天空边缘。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are used as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination to obtain an accurate edge of the sky.
本申请示例中,可以获取天空分割掩膜图的天空边缘过渡带中每个像 素点的坐标,对每个像素点,可以以该像素点的坐标为中心点,采用局部投票的判定方法,判定该中心点相邻区域内的准确边缘。示例性的,可以通过计算该中心点的像素与该中心点相邻区域的像素的相似度,如果相似度较低,可以为该中心点投票为边缘点,如果相似度较高,可以为该中心点投票为非边缘点,对中心点以及中心点的相邻区域内的像素点分别投票后,可以将得分较高的像素点确定为边缘像素点,从而得到准确的边缘。In the example of this application, the coordinates of each pixel in the sky edge transition zone of the sky segmentation mask can be obtained. For each pixel, the coordinates of the pixel can be used as the center point, and the local voting method can be used to determine The center point is the exact edge in the adjacent area. Exemplarily, the similarity between the pixels of the center point and the pixels in the adjacent area of the center point can be calculated. If the similarity is low, the center point can be voted as an edge point, and if the similarity is high, the center point can be voted as the edge point. The central point is voted as a non-edge point. After the central point and the pixels in the adjacent area of the central point are voted separately, the pixel with a higher score can be determined as the edge pixel to obtain an accurate edge.
进一步的,对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,以获取优化后的图像。Further, sky optimization processing is performed on the re-determined sky region corresponding part in the image information to be processed to obtain an optimized image.
本申请实施例中,在得到重新确定的准确的天空区域后,可以根据实际需求对天空进行优化处理,以获取优化后的图像。In the embodiment of the present application, after the re-determined accurate sky area is obtained, the sky can be optimized according to actual requirements to obtain an optimized image.
一种可能的实现方式中,所述对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,包括:采用预设天空模版,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理。In a possible implementation manner, the performing sky optimization processing on the re-determined sky region corresponding part of the image information to be processed includes: adopting a preset sky template and re-determining the image information to be processed The corresponding part of the sky area is replaced.
本申请实施例中,预设天空模板可以是预先定义的标准天空模板,例如晴天白云天空模板、乌云密布天空模板等,可以理解,待处理的图像信息中的天空区域可能无法达到预设天空模板的效果,因此,采用预设天空模版,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理,可以得到天空效果更好的图像。In this embodiment of the application, the preset sky template may be a predefined standard sky template, such as a sunny white cloud sky template, a dark cloud sky template, etc. It is understandable that the sky area in the image information to be processed may not reach the preset sky template Therefore, a preset sky template is used to replace the portion corresponding to the re-determined sky area in the image information to be processed, and an image with a better sky effect can be obtained.
可选的,所述采用预设天空模板,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理,包括:Optionally, said using a preset sky template to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
根据所述重新确定的天空区域的位置和/或尺寸,对所述预设天空模板的位置和/或尺寸进行调整,并将调整后的天空模板替换到所述待处理的图像信息中重新确定的天空区域对应的部分。Adjust the position and/or size of the preset sky template according to the position and/or size of the re-determined sky area, and replace the adjusted sky template with the image information to be processed and re-determine The corresponding part of the sky area.
本申请实施例中,可以根据重新确定的天空区域的位置调整预设天空模板的位置,使得预设天空模板正好位于重新确定的天空区域,从而可以避免预设天空模板位置不合适导致的替换效果不佳的问题。In the embodiment of the present application, the position of the preset sky template can be adjusted according to the position of the re-determined sky area, so that the preset sky template is exactly located in the re-determined sky area, thereby avoiding the replacement effect caused by the improper location of the preset sky template Poor problem.
本申请实施例中,可以根据重新确定的天空区域的尺寸调整预设天空模板的尺寸,使得预设天空模板的尺寸与重新确定的天空区域的尺寸匹配,从而可以避免预设天空模板尺寸不合适导致的画面违和的问题。In the embodiment of the present application, the size of the preset sky template can be adjusted according to the size of the re-determined sky area, so that the size of the preset sky template matches the size of the re-determined sky area, thereby avoiding the improper size of the preset sky template The resulting picture violation problem.
另一种可能的实现方式中,所述对所述待处理的图像信息中重新确定 的天空区域对应部分进行天空优化处理,包括:In another possible implementation manner, the performing sky optimization processing on the portion corresponding to the re-determined sky area in the image information to be processed includes:
识别所述待处理的图像信息对应的场景,并查找获取所述场景对应的调节模式;根据所述调节模式,对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理。Identify the scene corresponding to the image information to be processed, and search for and acquire the adjustment mode corresponding to the scene; according to the adjustment mode, perform sky optimization processing on the re-determined sky region corresponding part of the image information to be processed.
本申请实施例中,首先可以运用算法识别出待处理的图像信息对应的场景,例如识别出晴天、阴天、夜景、夕阳、草原等不同场景。进而可以查找响应的调节模式,实现定制化的天空优化处理。In the embodiment of the present application, first, an algorithm can be used to identify the scene corresponding to the image information to be processed, for example, different scenes such as sunny days, cloudy days, night scenes, sunsets, grasslands, etc. can be identified. Then you can find the response adjustment mode, and realize the customized sky optimization processing.
示例性的,下述列举了几种根据不同的场景,自动调节不同的天空图像风格,该调节方法不局限于智能叠加滤镜,或者调整天空区域的亮度、对比度、饱和度、色彩、滤镜等。Exemplarily, the following lists several automatic adjustments to different sky image styles according to different scenes. The adjustment method is not limited to smart superimposing filters, or adjusting the brightness, contrast, saturation, color, and filters of the sky area. Wait.
如果检测到为晴天场景,将天空区域的颜色调节为蓝天少云,并对画面中的太阳进行增强等。或者在天空区域智能叠加一张晴天天空滤镜等。If it is detected as a sunny scene, adjust the color of the sky area to blue sky with less clouds, and enhance the sun in the picture. Or intelligently overlay a sunny sky filter in the sky area.
如果检测到为阴天场景,将天空区域的颜色调节为灰暗多云,叠加不同的云类型形成不同的特效。或者在天空区域智能叠加一张阴天天空滤镜等。If it is detected as a cloudy scene, adjust the color of the sky area to dark and cloudy, and superimpose different cloud types to form different special effects. Or intelligently overlay a cloudy sky filter in the sky area.
如果检测到为夕阳场景,将天空区域的调节为相应的夕阳色,并增强图像的饱和度等。或者在天空区域智能叠加一张夕阳天空滤镜等。If it is detected as a sunset scene, adjust the sky area to the corresponding sunset color, and enhance the saturation of the image. Or intelligently overlay a sunset sky filter in the sky area.
如果检测到为夜景,在天空区域加入极光或者星光等特效,并对天空中的月亮进行增强等。或者在天空区域智能叠加一张夜景天空滤镜等。If it is detected as a night scene, add special effects such as aurora or starlight in the sky area, and enhance the moon in the sky. Or intelligently overlay a night sky filter in the sky area.
如果检测到为草原场景,将天空区域调节为蓝天白云,并提高图像的对比度,使图像更加通透。或者在天空区域智能叠加一张草原天空滤镜等。If it is detected as a grassland scene, adjust the sky area to blue sky and white clouds, and increase the contrast of the image to make the image more transparent. Or intelligently overlay a grassland sky filter in the sky area.
可以理解,具体实现中,还可以者根据不同的场景替换与场景匹配的天空模板,或者对分割出的天空区域和非天空区域进行不同强度和不同类型的图像增强等,以实现对待处理的图像信息的优化。本申请实施例对比不作具体限定。It can be understood that in specific implementation, it is also possible to replace the sky template matching the scene according to different scenes, or perform different intensities and different types of image enhancements on the segmented sky area and non-sky area, so as to realize the image to be processed. Information optimization. The comparison of the embodiments of this application is not specifically limited.
综上所述,本申请实施例中提供了一种图像处理的方法及装置,发现了现有技术中替换模板与原始图片的融合度差的原因是,现有技术中 在识别天空区域时,通常难以得到准确的天空区域边缘,导致在对天空区域进行后续处理时,可能出现将非天空区域进行了处理,或对天空区域没有实现完全处理,导致处理部分与原始图片的融合度较差。因此,本申请实施例中,在获取包含天空的待处理的图像信息后,先对该待处理的图像信息进行预处理,具体的,对待处理的图像信息进行识别处理,以获取待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带,然后根据预处理的结果进行进一步的优化处理,具体的,根据天空区域、非天空区域,以及天空边缘过渡带,对天空区域进行重新确定,重新确定的天空区域的边缘比预处理中识别的天空区域的边缘准确,进而对待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理后,得到的优化后的图像中,可以实现对天空区域边缘的准确处理,因此处理区域与待处理的图像信息的融合度较好,适应的优化后的图像的视觉效果较好。In summary, an image processing method and device are provided in the embodiments of the present application, and it is found that the reason for the poor fusion between the replacement template and the original picture in the prior art is that in the prior art, when recognizing the sky area, It is usually difficult to obtain an accurate edge of the sky area. As a result, in the subsequent processing of the sky area, the non-sky area may be processed, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed. The sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results. Specifically, according to the sky area and non-sky area, As well as the sky edge transition zone, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
图4为本申请提供的图像处理的装置一实施例的结构示意图。如图4所示,本实施例提供的图像处理的装置包括:FIG. 4 is a schematic structural diagram of an embodiment of an image processing apparatus provided by this application. As shown in Figure 4, the image processing apparatus provided in this embodiment includes:
分割模块31,用于判断并分割待处理的图像信息的天空区域;The segmentation module 31 is used to determine and segment the sky area of the image information to be processed;
优化模块32,用于根据预设规则对所述天空区域优化处理,以获取优化后的图像。The optimization module 32 is configured to optimize processing of the sky area according to preset rules to obtain an optimized image.
可选的,所述优化模块,具体用于:Optionally, the optimization module is specifically used for:
得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;Obtaining a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone;
对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判定。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are used as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
可选的,还包括:Optionally, it also includes:
处理模块,用于根据对所述天空区域进行模板替换,或根据所述待处理的图像信息对应的场景,对所述天空区域进行调节。The processing module is configured to adjust the sky area according to template replacement of the sky area or according to the scene corresponding to the image information to be processed.
综上所述,本申请实施例中提供了一种图像处理的方法及装置,发现了现有技术中替换模板与原始图片的融合度差的原因是,现有技术中 在识别天空区域时,通常难以得到准确的天空区域边缘,导致在对天空区域进行后续处理时,可能出现将非天空区域进行了处理,或对天空区域没有实现完全处理,导致处理部分与原始图片的融合度较差。因此,本申请实施例中,在获取包含天空的待处理的图像信息后,先对该待处理的图像信息进行预处理,具体的,对待处理的图像信息进行识别处理,以获取待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带,然后根据预处理的结果进行进一步的优化处理,具体的,根据天空区域、非天空区域,以及天空边缘过渡带,对天空区域进行重新确定,重新确定的天空区域的边缘比预处理中识别的天空区域的边缘准确,进而对待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理后,得到的优化后的图像中,可以实现对天空区域边缘的准确处理,因此处理区域与待处理的图像信息的融合度较好,适应的优化后的图像的视觉效果较好。In summary, an image processing method and device are provided in the embodiments of the present application, and it is found that the reason for the poor fusion between the replacement template and the original picture in the prior art is that in the prior art, when recognizing the sky area, It is usually difficult to obtain an accurate edge of the sky area. As a result, in the subsequent processing of the sky area, the non-sky area may be processed, or the sky area may not be fully processed, resulting in poor fusion of the processed part with the original image. Therefore, in the embodiment of the present application, after acquiring the image information to be processed including the sky, the image information to be processed is preprocessed first. Specifically, the image information to be processed is recognized to obtain the image information to be processed. The sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the information are then further optimized according to the preprocessing results. Specifically, according to the sky area and non-sky area, As well as the sky edge transition zone, the sky area is re-determined, and the edge of the re-determined sky area is more accurate than the edge of the sky area recognized in the preprocessing, and then the sky area corresponding to the re-determined sky area in the image information to be processed is optimized for the sky Then, in the optimized image obtained, accurate processing of the edge of the sky region can be realized, so the fusion degree of the processed region and the image information to be processed is better, and the visual effect of the adapted optimized image is better.
本申请各实施例提供的图像处理的装置可用于执行如前述各对应的实施例所示的方法,其实现方式与原理相同,不再赘述。The image processing apparatus provided in each embodiment of the present application can be used to execute the method shown in each corresponding embodiment described above, and the implementation manner and principle are the same, and details are not repeated here.
本申请实施例还提供一种电子设备,包括:处理器,存储器以及计算机程序;其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如前述实施例中任一项所述的方法的指令。An embodiment of the present application further provides an electronic device, including: a processor, a memory, and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor, and the computer program It includes instructions for executing the method as described in any of the foregoing embodiments.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时,实现如前述实施例中任一项所述的方法。An embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed, the method as described in any one of the foregoing embodiments is implemented.
读者应理解,在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构或者特点包含于本申请的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不必针对的是相同的实施例或示例。而且,描述的具体特征、结构或者特点可以在任一个或多个实施例或示例中以合适的方式结合。此外,在不相互矛盾的情况下,本领域的技术人员可以将本说明书中描述的不同实施例或示例以及不同实施例或示例的特征进行结合和组合。The reader should understand that, in the description of this specification, reference to the description of the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples", etc. means to combine the embodiments or examples. The described specific features, structures, or characteristics are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above-mentioned terms are not necessarily directed to the same embodiment or example. Moreover, the described specific features, structures or characteristics can be combined in any one or more embodiments or examples in an appropriate manner. In addition, those skilled in the art can combine and combine the different embodiments or examples and the features of the different embodiments or examples described in this specification without contradicting each other.
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅是示意性的,例如,单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。In the several embodiments provided in this application, it should be understood that the disclosed device and method may be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium. It includes several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
还应理解,在本申请各实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should also be understood that in each embodiment of the present application, the size of the sequence number of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not correspond to the difference in the embodiments of the present application. The implementation process constitutes any limitation.
以上,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易 想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the scope of protection of this application is not limited to this. Any person skilled in the art can easily think of various equivalent modifications or changes within the technical scope disclosed in this application. Replacement, these modifications or replacements shall be covered within the scope of protection of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (14)

  1. 一种图像处理方法,其中,包括:An image processing method, which includes:
    获取待处理的图像信息;Obtain the image information to be processed;
    判断并分割所述图像信息的天空区域;Judging and segmenting the sky area of the image information;
    根据预设规则对所述天空区域优化处理,以获取优化后的图像。The sky area is optimized according to preset rules to obtain an optimized image.
  2. 根据权利要求1所述的方法,其中,所述判断并分割所述图像信息的天空区域,包括:The method according to claim 1, wherein said determining and segmenting the sky area of the image information comprises:
    对所述待处理的图像信息进行识别处理,以获取所述待处理的图像信息中的天空区域、非天空区域,以及所述天空区域和非天空区域之间的天空边缘过渡带;根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定。Performing recognition processing on the image information to be processed to obtain the sky area, the non-sky area, and the sky edge transition zone between the sky area and the non-sky area in the image information to be processed; according to the The sky area, the non-sky area, and the sky edge transition zone are re-determined for the sky area.
  3. 根据权利要求2所述的方法,其中,所述根据预设规则对所述天空区域优化处理,以获取优化后的图像,包括:The method according to claim 2, wherein the optimizing processing of the sky area according to a preset rule to obtain an optimized image comprises:
    对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,以获取优化后的图像。Perform sky optimization processing on the re-determined sky region corresponding part in the image information to be processed to obtain an optimized image.
  4. 根据权利要求2所述的方法,其中,所述根据所述天空区域、所述非天空区域,以及所述天空边缘过渡带,对所述天空区域进行重新确定,包括:The method according to claim 2, wherein the re-determining the sky area according to the sky area, the non-sky area, and the sky edge transition zone comprises:
    分别对包括天空区域和非天空区域的样本图像中的像素进行标注处理;Label the pixels in the sample image including the sky area and the non-sky area respectively;
    采用AI语义分割技术,训练已标注的所述样本图像,得到天空分割AI模型。The AI semantic segmentation technology is used to train the labeled sample images to obtain the sky segmentation AI model.
  5. 根据权利要求4所述的方法,其中,还包括:The method according to claim 4, further comprising:
    利用所述天空分割AI模型得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;Using the sky segmentation AI model to obtain a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone;
    对所述天空分割掩膜图的天空边缘进行细化处理,以获取边缘细化后的天空分割掩膜图,以得到所述重新确定的天空区域。Refinement processing is performed on the sky edge of the sky segmentation mask map to obtain a sky segmentation mask map after edge refinement, so as to obtain the re-determined sky area.
  6. 根据权利要求5所述的方法,其中,所述对所述天空分割掩膜图的天空边缘进行细化处理,包括:The method according to claim 5, wherein the thinning processing of the sky edge of the sky segmentation mask map comprises:
    对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获 取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判定。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
  7. 根据权利要求1所述的方法,其中,所述对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,包括:The method according to claim 1, wherein the performing sky optimization processing on the re-determined sky region corresponding part in the image information to be processed includes:
    采用预设天空模版,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理。The preset sky template is used to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed.
  8. 根据权利要求7所述的方法,其中,所述采用预设天空模板,对所述待处理的图像信息中重新确定的天空区域对应的部分进行替换处理,包括:8. The method according to claim 7, wherein said using a preset sky template to perform replacement processing on the portion corresponding to the re-determined sky area in the image information to be processed comprises:
    根据所述重新确定的天空区域的位置和/或尺寸,对所述预设天空模板的位置和/或尺寸进行调整,并将调整后的天空模板替换到所述待处理的图像信息中重新确定的天空区域对应的部分。Adjust the position and/or size of the preset sky template according to the position and/or size of the re-determined sky area, and replace the adjusted sky template with the image information to be processed and re-determine The corresponding part of the sky area.
  9. 根据权利要求1所述的方法,其中,所述对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理,包括:The method according to claim 1, wherein the performing sky optimization processing on the re-determined sky region corresponding part in the image information to be processed includes:
    识别所述待处理的图像信息对应的场景,并查找获取所述场景对应的调节模式;Identifying the scene corresponding to the image information to be processed, and searching for and acquiring the adjustment mode corresponding to the scene;
    根据所述调节模式,对所述待处理的图像信息中重新确定的天空区域对应部分进行天空优化处理。According to the adjustment mode, sky optimization processing is performed on the portion corresponding to the re-determined sky region in the image information to be processed.
  10. 一种图像处理装置,其中,包括:An image processing device, which includes:
    分割模块,用于判断并分割待处理的图像信息的天空区域;The segmentation module is used to determine and segment the sky area of the image information to be processed;
    优化模块,用于根据预设规则对所述天空区域优化处理,以获取优化后的图像。The optimization module is used for optimizing processing of the sky area according to preset rules to obtain an optimized image.
  11. 根据权利要求10所述的装置,其中,所述优化模块,具体用于:The device according to claim 10, wherein the optimization module is specifically configured to:
    得到对应于所述天空区域、所述非天空区域,以及所述天空边缘过渡带的天空分割掩膜图;Obtaining a sky segmentation mask map corresponding to the sky area, the non-sky area, and the sky edge transition zone;
    对于所述天空分割掩膜图的天空边缘过渡带中每个像素点,分别获取所述像素点的坐标,并以所述坐标为中心点,采用局部像素相似度统计法,对所述中心点以及所述中心点的相邻区域内的像素点进行边缘判 定。For each pixel point in the sky edge transition zone of the sky segmentation mask, the coordinates of the pixel point are obtained separately, and the coordinates are taken as the center point, and the local pixel similarity statistics method is used to calculate the center point. And the pixel points in the adjacent area of the center point perform edge determination.
  12. 根据权利要求10或11所述的装置,其中,还包括:The device according to claim 10 or 11, further comprising:
    处理模块,用于根据对所述天空区域进行模板替换,或根据所述待处理的图像信息对应的场景,对所述天空区域进行调节。The processing module is configured to adjust the sky area according to template replacement of the sky area or according to the scene corresponding to the image information to be processed.
  13. 一种电子设备,其中,包括:An electronic device, including:
    处理器,存储器以及计算机程序;其中,所述计算机程序被存储在所述存储器中,并且被配置为由所述处理器执行,所述计算机程序包括用于执行如权利要求1任一项所述的方法的指令。A processor, a memory, and a computer program; wherein the computer program is stored in the memory and is configured to be executed by the processor, and the computer program includes a computer program for executing any one of claims 1 Method of instruction.
  14. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序被执行时,实现如权利要求1任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed, the method according to any one of claim 1 is realized.
PCT/CN2020/078838 2019-12-09 2020-03-11 Image processing method and apparatus, electronic device, and computer-readable storage medium WO2021114500A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911249372.7A CN111127307A (en) 2019-12-09 2019-12-09 Image processing method, image processing device, electronic equipment and computer readable storage medium
CN201911249372.7 2019-12-09

Publications (1)

Publication Number Publication Date
WO2021114500A1 true WO2021114500A1 (en) 2021-06-17

Family

ID=70497839

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/078838 WO2021114500A1 (en) 2019-12-09 2020-03-11 Image processing method and apparatus, electronic device, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN111127307A (en)
WO (1) WO2021114500A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113808037A (en) * 2021-09-02 2021-12-17 深圳东辉盛扬科技有限公司 Image optimization method and device
CN114494083A (en) * 2022-04-14 2022-05-13 杭州雄迈集成电路技术股份有限公司 Method and system for adaptively improving permeability of video

Families Citing this family (6)

* 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
CN113115085A (en) * 2021-04-16 2021-07-13 海信电子科技(武汉)有限公司 Video playing method and display equipment
CN113313658B (en) * 2021-07-29 2021-11-30 南昌虚拟现实研究院股份有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113610701B (en) * 2021-08-04 2023-12-26 同方鼎欣科技股份有限公司 Image paging conversion method, device, computer equipment and readable storage medium
CN115705666A (en) * 2021-08-09 2023-02-17 北京字跳网络技术有限公司 Image processing method, device, equipment and storage medium
WO2023039865A1 (en) * 2021-09-17 2023-03-23 深圳市大疆创新科技有限公司 Image processing method, video processing method, training method, device, program product, and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030108245A1 (en) * 2001-12-07 2003-06-12 Eastman Kodak Company Method and system for improving an image characteristic based on image content
CN107590811A (en) * 2017-09-29 2018-01-16 北京奇虎科技有限公司 Landscape image processing method, device and computing device based on scene cut
CN107680101A (en) * 2017-08-28 2018-02-09 浙江工业大学 Sky areas dividing method based on dark
CN110335277A (en) * 2019-05-07 2019-10-15 腾讯科技(深圳)有限公司 Image processing method, device, computer readable storage medium and computer equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030108245A1 (en) * 2001-12-07 2003-06-12 Eastman Kodak Company Method and system for improving an image characteristic based on image content
CN107680101A (en) * 2017-08-28 2018-02-09 浙江工业大学 Sky areas dividing method based on dark
CN107590811A (en) * 2017-09-29 2018-01-16 北京奇虎科技有限公司 Landscape image processing method, device and computing device based on scene cut
CN110335277A (en) * 2019-05-07 2019-10-15 腾讯科技(深圳)有限公司 Image processing method, device, computer readable storage medium and computer equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
水球喵 (SHUI QIU MIAO): "Sky is not limit: semantic aware sky replacement", HTTPS://WWW.JIANSHU.COM/P/421F4171D48A, 15 July 2017 (2017-07-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113808037A (en) * 2021-09-02 2021-12-17 深圳东辉盛扬科技有限公司 Image optimization method and device
CN114494083A (en) * 2022-04-14 2022-05-13 杭州雄迈集成电路技术股份有限公司 Method and system for adaptively improving permeability of video

Also Published As

Publication number Publication date
CN111127307A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
WO2021114500A1 (en) Image processing method and apparatus, electronic device, and computer-readable storage medium
US10762608B2 (en) Sky editing based on image composition
US10311574B2 (en) Object segmentation, including sky segmentation
US10255681B2 (en) Image matting using deep learning
CN108765278B (en) Image processing method, mobile terminal and computer readable storage medium
US20200111241A1 (en) Method and apparatus for processing video image and computer readable medium
US9430719B2 (en) System and method for providing objectified image renderings using recognition information from images
US8649572B2 (en) System and method for enabling the use of captured images through recognition
CN110717470B (en) Scene recognition method and device, computer equipment and storage medium
EP2902941A1 (en) System and method for visually distinguishing faces in a digital image
US11610433B2 (en) Skin tone assisted digital image color matching
US20060253491A1 (en) System and method for enabling search and retrieval from image files based on recognized information
US20170270142A1 (en) Modification of images and associated text
CN109063542A (en) Image identification method, device, computer equipment and storage medium
CN110298380A (en) Image processing method, device and electronic equipment
US20220207751A1 (en) Patch-Based Image Matting Using Deep Learning
WO2021077947A1 (en) Image processing method, apparatus and device, and storage medium
US11468571B2 (en) Apparatus and method for generating image
CN114972847A (en) Image processing method and device
CN113301382B (en) Video processing method, device, medium, and program product
CN111669657A (en) Video comment method and device, electronic equipment and storage medium
CN115063800B (en) Text recognition method and electronic equipment
CN116433703A (en) Image processing method, apparatus, computer device, storage medium, and program product
CN113901053A (en) Teaching material index management system based on big data
KR20150094108A (en) Method for generating saliency map based background location and medium for recording the same

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

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

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 20899464

Country of ref document: EP

Kind code of ref document: A1