WO2022033138A1 - 一种基于位图的手绘素材生成方法 - Google Patents

一种基于位图的手绘素材生成方法 Download PDF

Info

Publication number
WO2022033138A1
WO2022033138A1 PCT/CN2021/098208 CN2021098208W WO2022033138A1 WO 2022033138 A1 WO2022033138 A1 WO 2022033138A1 CN 2021098208 W CN2021098208 W CN 2021098208W WO 2022033138 A1 WO2022033138 A1 WO 2022033138A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
pixel value
bitmap
pixel
generate
Prior art date
Application number
PCT/CN2021/098208
Other languages
English (en)
French (fr)
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 WO2022033138A1 publication Critical patent/WO2022033138A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing

Definitions

  • the invention belongs to the technical field of hand-drawn animation, and in particular relates to a bitmap-based hand-drawn material generation method, device, electronic device and storage medium.
  • hand-drawn animation hand-drawn materials need to be obtained first.
  • the production of hand-painted materials is usually completed by drawing with professional tools, and the professional requirements and production costs for the production staff are relatively high.
  • Bitmap is a more common image format currently on the Internet. It can be obtained from various image websites.
  • the output files captured by cameras and mobile phone cameras are also bitmaps, but because the bitmap itself is composed of pixels, there is no path information. The hand-drawn animation display could not be completed.
  • the present invention provides a method for generating hand-painted materials based on bitmaps, which includes the following steps:
  • bitmap image to highlight the changing trend of the pixel value of the bitmap image
  • the bitmap image is embedded into the denoised image outline to generate hand-drawn material.
  • the bitmap-based hand-drawn material generation method highlights the change trend of the pixel value of the bitmap image by enhancing the bitmap image, and then generates the image outline by connecting the change trend of the pixel value, and denoises the generated image.
  • the outline of the denoised image is generated by embedding the bitmap image into the outline of the denoised image, so that the bitmap has an outline path and becomes a displayable hand-painted material.
  • Bitmap images can be restored realistically and efficiently, thereby greatly reducing drawing loss, accelerating the rapid generation of images, and improving user experience. In addition, it also reduces the threshold and cost for users to prepare hand-drawn animation materials, and enhances the hand-drawn animation effect.
  • the step of denoising the image contour to generate the denoised image contour includes:
  • the grouped image contours are sorted to generate the denoised image contours.
  • Grouping the deduplicated image contours can further highlight the pixel features of each part of the image contours, so that the image contours can be more realistically highlighted.
  • Sorting the grouped image contours can make the pixel features of each part of the image contours sorted according to a predetermined trend or rule, thereby making the image contours more realistic and prominent.
  • the image contour can be effectively denoised, and a clearer and more realistic denoised image contour can be generated.
  • the step of enhancing the bitmap image to highlight the changing trend of the pixel value of the bitmap image includes:
  • the color contrast is enhanced to highlight the changing trend of pixel values of the bitmap image.
  • the step of de-emphasizing the image contour includes:
  • the image contour is de-emphasized according to the duplicate point detection threshold.
  • the present invention provides an electronic device including a memory and a processor, wherein the memory stores a computer program, and the computer program is executed in the processor to implement any of the above methods.
  • the electronic device is a mobile terminal or a web terminal.
  • enhancing the bitmap image to highlight the changing trend of the pixel value of the bitmap image includes:
  • pixel value change processing is performed on the adjacent two pixels to highlight the pixel value change trend.
  • performing pixel value change processing on two adjacent pixels respectively includes:
  • X is the pixel value of one of the pixels before processing
  • Y is the pixel value of the other pixel before processing
  • X is the pixel value of one of the pixels after processing
  • Y is the pixel value of the other pixel after processing
  • k is the pixel value of the other pixel. constant.
  • the constant K is updated based on the average pixel value.
  • connecting the lines to generate the image contour includes:
  • Pixels whose pixel value difference is lower than a preset value in the bitmap image are connected to generate an image outline.
  • the present invention also provides a storage medium storing a computer program, wherein the computer program can be executed in a processor to implement any of the above methods.
  • the present invention provides a bitmap-based hand-drawn material generation device, including:
  • an enhancement module for enhancing the bitmap image to highlight the changing trend of the pixel value of the bitmap image
  • connection module configured to connect a line to generate an image outline according to the change trend of the pixel value
  • a denoising module for denoising the image contour to generate a denoised image contour
  • the embedding module is used for embedding the bitmap image into the outline of the denoised image to generate hand-painted material.
  • the denoising module includes:
  • a de-emphasis unit for de-emphasizing the image contour to generate a de-emphasized image contour
  • a grouping unit for grouping the deduplicated image contours to generate grouped image contours
  • a sorting unit configured to sort the grouped image contours to generate the denoised image contours.
  • the enhancement module includes:
  • the pixel retrieval unit is used to retrieve the pixels of the bitmap image
  • Contrast acquisition unit to acquire the color contrast of different pixels
  • a contrast enhancement unit configured to enhance the color contrast to highlight the changing trend of the pixel value of the bitmap image.
  • the enhancement module is also used to perform the following steps, including:
  • pixel value change processing is performed on the adjacent two pixels to highlight the pixel value change trend.
  • the enhancement module processes two adjacent pixels by the following formula, including:
  • X is the pixel value of one of the pixels before processing
  • Y is the pixel value of the other pixel before processing
  • X is the pixel value of one of the pixels after processing
  • Y is the pixel value of the other pixel after processing
  • k is the pixel value of the other pixel. constant.
  • an update unit is also included, and the update unit is configured to perform the following steps:
  • the constant K is updated based on the average pixel value.
  • connection module is also used to perform the following steps, including:
  • Pixels whose pixel value difference is lower than a preset value in the bitmap image are connected to generate an image outline.
  • the bitmap-based hand-drawn material generation method highlights the change trend of the pixel value of the bitmap image by enhancing the bitmap image, and then generates the image outline by connecting the change trend of the pixel value, and denoising to generate the denoised image outline, Then, the hand-drawn material is generated by embedding the bitmap image into the outline of the denoised image, so that the bitmap has an outline path and becomes a displayable hand-painted material.
  • the user draws by hand they can draw along the outline path of the bitmap, which can be realistic and efficient.
  • the bitmap image can be restored to the ground, which greatly reduces the drawing loss, accelerates the rapid generation of the image, and improves the user experience.
  • the threshold and cost for users to prepare hand-drawn animation materials are also lowered, and the hand-drawn animation effect is enhanced.
  • FIG. 1 is a flowchart of a method for generating a bitmap-based hand-drawn material provided by an embodiment
  • FIG. 2 is an apparatus architecture diagram corresponding to the method in FIG. 1 provided by an embodiment
  • FIG. 3 is a flowchart of an image contour denoising method provided by an embodiment
  • FIG. 4 is an apparatus architecture diagram corresponding to the method in FIG. 3 provided by an embodiment
  • FIG. 5 is a flowchart of a method for enhancing a bitmap image provided by an embodiment
  • FIG. 6 is an apparatus architecture diagram corresponding to the method in FIG. 5 provided by an embodiment.
  • the term “storage medium” may be various media that can store computer programs, such as ROM, RAM, magnetic disk or optical disk.
  • the term "processor” can be CPLD (Complex Programmable Logic Device: Complex Programmable Logic Device), FPGA (Field-Programmable Gate Array: Field Programmable Gate Array), MCU (Microcontroller Unit: Micro Control Unit), PLC (Programmable Logic) Controller: programmable logic controller) and CPU (Central Processing Unit: central processing unit) and other chips or circuits with data processing functions.
  • electronic device may be any device with data processing and storage functions, and may generally include both stationary and mobile terminals. Fixed terminals such as desktops, etc. Mobile terminals such as mobile phones, PADs and mobile robots. In addition, the technical features involved in the different embodiments of the present invention described later can be combined with each other as long as there is no conflict with each other.
  • this embodiment provides a bitmap-based hand-drawn material generation method, including the following steps:
  • this embodiment provides a bitmap-based hand-drawn material generation device, including:
  • the enhancement module 1 is used to enhance the bitmap image to highlight the changing trend of the pixel value of the bitmap image
  • connection module 2 is used to connect lines to generate image outlines according to the changing trend of pixel values
  • the denoising module 3 is used to denoise the image contour to generate the denoised image contour
  • the embedding module 4 is used to embed the bitmap image into the contour of the denoised image to generate hand-painted material.
  • the method or device for generating hand-drawn materials based on bitmaps enhances the bitmap image to highlight the change trend of the pixel value of the bitmap image, and then generates the image outline by connecting the change trend of the pixel value, and denoising generates denoising.
  • Image outline and then generate hand-drawn material by embedding the bitmap image into the denoised image outline, so that the bitmap has an outline path and becomes a displayable hand-painted material. It can restore bitmap images realistically and efficiently, thus greatly reducing drawing loss, accelerating the rapid generation of images, and improving user experience.
  • the image contour of the bitmap can be effectively extracted, and then the image contour and the bitmap image are creatively embedded to produce hand-painted materials. It greatly reduces the threshold and cost for hand-painted users to prepare hand-painted animation materials, and enhances the effect of hand-painted animation.
  • this embodiment provides a method for denoising an image contour to generate a denoised image contour, including the following steps:
  • this embodiment provides a denoising module, including:
  • a deduplication unit which is used to deduplicate the image contour to generate the deduplicated image contour
  • a grouping unit for grouping the deduplication image contours to generate the grouped image contours
  • a sorting unit configured to sort the outlines of the grouped images to generate the denoised image outlines.
  • grouping the deduplicated image contours can further highlight the pixel features of each part of the image contours, thereby making the image contours more realistic.
  • sorting the grouped image contours can make the pixel features of each part of the image contours sorted according to a predetermined trend or rule, so that the image contours can be more realistically highlighted.
  • the image contour can be effectively denoised, and a relatively clear and realistic denoised image contour can be generated.
  • the method of de-duplicating the image contour can check and filter the repeated points of the image contour by setting the repeated point detection threshold, and calling the repeated point detection threshold, which can eliminate the repeated points of the image contour, which is beneficial to Clear representation of image outlines.
  • the present embodiment provides a method for enhancing a bitmap image to highlight the changing trend of pixel values of the bitmap image, including:
  • this embodiment provides an enhancement module, including:
  • a pixel retrieving unit 10 for retrieving the pixels of the bitmap image
  • the contrast obtaining unit 11 obtains the color contrast of different pixels
  • the contrast enhancement unit 12 is used for enhancing the color contrast to highlight the changing trend of the pixel value of the bitmap image.
  • enhancing the bitmap image to highlight the changing trend of the pixel value of the bitmap image includes:
  • pixel value change processing is performed on the adjacent two pixels to highlight the pixel value change trend.
  • the change trend can be highlighted according to the difference between the two pixel values. For example, if the difference between two pixel values is 2, it is considered that these two adjacent pixels need to undergo pixel value change processing to highlight the change trend of the pixel value.
  • X is the pixel value of one of the pixels before processing
  • Y is the pixel value of the other pixel before processing
  • X is the pixel value of one of the pixels after processing
  • Y is the pixel value of the other pixel after processing
  • k is the pixel value of the other pixel.
  • the constant K is updated based on the average pixel value.
  • the average value of their pixel values needs to be considered when processing different bitmap images. If the average value is large, it is probable that each pixel in the bitmap image is The difference between the pixel values is large. If the average value is small, it is probable that the pixel value difference between each pixel in the bitmap image is small, so the constant K needs to be updated according to the average pixel value. , to choose a K value suitable for bitmap images.
  • Pixels whose pixel value difference is lower than a preset value in the bitmap image are connected to generate an image outline.
  • the preset value can be adjusted according to different bitmap images. For example, if the average pixel value of the bitmap image is lower, the preset value can be adjusted lower; the average pixel value of the bitmap image is higher, You can increase the preset value. The difference between the pixel values is used to determine whether two pixels are connected.
  • the technical scheme provided by the present invention can determine the corresponding enhanced bitmap image mode and connection mode according to the pixel values of different bitmaps, so that the process of enhancing the bitmap image and the connection is more in line with the bitmap image, so that the generated Hand-painted material works better.
  • the enhancement module is also used to perform the following steps, including:
  • pixel value change processing is performed on the adjacent two pixels to highlight the pixel value change trend.
  • the change trend can be highlighted according to the difference between the two pixel values. For example, if the difference between two pixel values is 2, it is considered that these two adjacent pixels need to undergo pixel value change processing to highlight the change trend of the pixel value.
  • the enhancement module processes two adjacent pixels by the following formula, including:
  • X is the pixel value of one of the pixels before processing
  • Y is the pixel value of the other pixel before processing
  • X is the pixel value of one of the pixels after processing
  • Y is the pixel value of the other pixel after processing
  • k is the pixel value of the other pixel.
  • the constant K is updated based on the average pixel value.
  • the average value of their pixel values needs to be considered when processing different bitmap images. If the average value is large, it is probable that each pixel in the bitmap image is The difference between pixel values is large. If the average value is small, it is probable that the pixel value difference between each pixel in the bitmap image is small, so the constant K needs to be updated according to the average pixel value. , to choose a K value suitable for bitmap images.
  • connection module is also used to perform the following steps, including:
  • Pixels whose pixel value difference is lower than a preset value in the bitmap image are connected to generate an image outline.
  • the preset value can be adjusted according to different bitmap images. For example, if the average pixel value of the bitmap image is lower, the preset value can be adjusted lower; the average pixel value of the bitmap image is higher, You can increase the preset value. The difference between the pixel values is used to determine whether two pixels are connected.
  • the technical scheme provided by the present invention can determine the corresponding enhanced bitmap image mode and connection mode according to the pixel values of different bitmaps, so that the process of enhancing the bitmap image and the connection is more in line with the bitmap image, so that the generated Hand-painted material works better.
  • the present invention also provides an electronic device including a memory and a processor, the memory stores a computer program, and the computer program is executed in the processor to implement any of the above methods.
  • the electronic device is a mobile terminal or a web terminal.
  • the present invention also provides a storage medium storing a computer program, wherein the computer program can be executed in a processor to implement any of the above methods.

Landscapes

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

Abstract

一种基于位图的手绘素材生成方法,涉及手绘动画技术领域,所述方法包括:增强位图图像,以突出位图图像的像素值变化趋势(S1),再通过连线像素值变化趋势生成图像轮廓(S2),去噪生成去噪图像轮廓(S3),再通过把位图图像嵌入到去噪图像轮廓中生成手绘素材(S4),从而使得位图具备轮廓路径,成为可展示的手绘素材,用户手绘时,沿着位图的轮廓路径进行绘画,就能逼真高效地还原位图图像,从而极大降低绘制损耗,加速图像快速生成,提升用户体验。另外,也降低了用户准备手绘动画素材的门槛和成本,增强手绘动画效果。

Description

一种基于位图的手绘素材生成方法 技术领域
本发明属于手绘动画技术领域,尤其涉及一种基于位图的手绘素材生成方法、装置、电子设备和存储介质。
背景技术
在手绘动画中,需要首先获取手绘素材。目前,制作手绘素材通常要通过专业工具绘制完成,对于制作人员的专业要求和制作成本都比较高。
位图是目前在网络上更常见的图像格式,在各个图片网站都可以获取到,相机和手机相机等设备拍摄的输出文件也是位图,但是位图本身因为是由像素组成,没有路径信息,无法完成手绘动画展示。
因此,如何用位图来生成手绘素材是一个亟需解决的问题。
发明内容
为解决上述技术问题,本发明提供一种基于位图的手绘素材生成方法,包括如下步骤:
增强位图图像,以突出所述位图图像的像素值变化趋势;
根据所述像素值变化趋势,连线生成图像轮廓;
对所述图像轮廓进行去噪,以生成去噪图像轮廓;
把所述位图图像嵌入到所述去噪图像轮廓中,以生成手绘素材。
技术效果说明:本发明提供的基于位图的手绘素材生成方法,通过增强位图图像,以突出位图图像的像素值变化趋势,再通过连线像素值变化趋势生成图像轮廓,去噪生成去噪图像轮廓,再通过把位图图像嵌入到去噪图像轮廓中生成手绘素材,从而使得位图具备轮廓路 径,成为可展示的手绘素材,用户手绘时,沿着位图的轮廓路径进行绘画,就能逼真高效地还原位图图像,从而极大降低绘制损耗,加速图像快速生成,提升用户体验。另外,也降低了用户准备手绘动画素材的门槛和成本,增强手绘动画效果。
改进的,所述的对所述图像轮廓进行去噪,以生成去噪图像轮廓的步骤包括:
对所述图像轮廓进行去重,以生成去重图像轮廓;
对所述去重图像轮廓进行分组,以生成分组图像轮廓;
对所述分组图像轮廓进行排序,以生成所述去噪图像轮廓。
技术效果说明:通过对图像轮廓进行去重,可以有效将图像轮廓中的重复去除,不仅有利于减小手绘素材的体积容量,节约计算资源,而且能让图像轮廓更为逼真突显。
对去重图像轮廓进行分组,可以进一步突出图像轮廓各部分的像素特征,从而让图像轮廓更为逼真突显。
对分组图像轮廓进行排序,可以让图像轮廓各部分的像素特征按照预定的趋势或规则进行排序,从而让图像轮廓更为逼真突显。
综上,通过有效组合利用去重、分组以及排序这些图像处理手段,可以有效对图像轮廓进行去噪,生成较为清晰和逼真的去噪图像轮廓。
改进的,所述的增强位图图像,以突出所述位图图像的像素值变化趋势的步骤包括:
调取位图图像的像素;
获取不同像素的颜色对比度;
增强所述颜色对比度,以突出所述位图图像的像素值变化趋势。
技术效果说明:由于位图中像素颜色存在差异,不同像素颜色会 产生对比度,因此,通过增强不同像素颜色的对比度,能够突出位图图像的像素值变化趋势,有利于位图轮廓的获取。
具体的,所述的对所述图像轮廓进行去重的步骤包括:
调取重复点检测阈值;
根据所述重复点检测阈值对所述图像轮廓进行去重。
技术效果说明:通过设置重复点检测阈值,调取重复点检测阈值对图像轮廓的重复点进行检查筛选,可以将图像轮廓的重复点进行剔除,有利于图像轮廓的清晰展现。
相应的,本发明提供一种电子设备,包括存储器和处理器,所述存储器存储计算机程序,所述计算机程序在所述处理器中执行可实现上述任一种方法。所述电子设备为移动终端或web端。
具体的,增强位图图像,以突出所述位图图像的像素值变化趋势包括:
获取位图图像中每个像素的像素值;
若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。
具体的,所述对相邻的两个像素分别做像素值变化处理包括:
通过以下公式对相邻的两个像素处理,包括:
Figure PCTCN2021098208-appb-000001
其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个像素处理后的像素值,k为常数。
具体的,还包括:
获取所述位图图像的平均像素值;
基于所述平均像素值对所述常数K进行更新处理。
具体的,根据所述像素值变化趋势,连线生成图像轮廓包括:
获取所述位图图像增强后的像素值;
将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
本发明还提供一种存储介质,存储计算机程序,其特征在于,所述计算机程序在处理器中执行可实现上述任一种方法。
对应的,本发明提供一种基于位图的手绘素材生成装置,包括:
增强模块,用于增强位图图像,以突出所述位图图像的像素值变化趋势;
连线模块,用于根据所述像素值变化趋势,连线生成图像轮廓;
去噪模块,用于对所述图像轮廓进行去噪,以生成去噪图像轮廓;
嵌入模块,用于把所述位图图像嵌入到所述去噪图像轮廓中,以生成手绘素材。
进一步,所述去噪模块包括:
去重单元,用于对所述图像轮廓进行去重,以生成去重图像轮廓;
分组单元,用于对所述去重图像轮廓进行分组,以生成分组图像轮廓;
排序单元,用于对所述分组图像轮廓进行排序,以生成所述去噪图像轮廓。
进一步,所述增强模块包括:
像素调取单元,用于调取位图图像的像素;
对比度获取单元,获取不同像素的颜色对比度;
对比度增强单元,用于增强所述颜色对比度,以突出所述位图图像的像素值变化趋势。
进一步,所述增强模块还用于执行以下步骤,包括:
获取位图图像中每个像素的像素值;
若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。
进一步,所述增强模块通过以下公式对相邻的两个像素处理,包括:
Figure PCTCN2021098208-appb-000002
其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个像素处理后的像素值,k为常数。
进一步,还包括更新单元,所述更新单元用于执行以下步骤:
获取所述位图图像的平均像素值;
基于所述平均像素值对所述常数K进行更新处理。
进一步,所述连线模块还用于执行以下步骤,包括:
获取所述位图图像增强后的像素值;
将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
本发明提供的基于位图的手绘素材生成方法,通过增强位图图像,以突出位图图像的像素值变化趋势,再通过连线像素值变化趋势生成图像轮廓,去噪生成去噪图像轮廓,再通过把位图图像嵌入到去噪图像轮廓中生成手绘素材,从而使得位图具备轮廓路径,成为可展示的手绘素材,用户手绘时,沿着位图的轮廓路径进行绘画,就能逼真高效地还原位图图像,从而极大降低绘制损耗,加速图像快速生成,提升用户体验。另外,也降低了用户准备手绘动画素材的门槛和成本, 增强手绘动画效果。
附图说明
图1为一实施例提供的基于位图的手绘素材生成方法的流程图;
图2为一实施例提供的对应图1中方法的装置架构图;
图3为一实施例提供的图像轮廓去噪方法的流程图;
图4为一实施例提供的对应图3中方法的装置架构图;
图5为一实施例提供的增强位图图像方法的流程图;
图6一实施例提供的对应图5中方法的装置架构图。
具体实施方式
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,在本发明的描述中,除非另有明确的规定和限定,术语“存储介质”可以是ROM、RAM、磁碟或者光盘等各种可以存储计算机程序的介质。术语“处理器”可以是CPLD(Complex Programmable Logic Device:复杂可编程逻辑器件)、FPGA(Field-Programmable Gate Array:现场可编程门阵列)、MCU(Microcontroller Unit:微控制单元)、PLC(Programmable Logic Controller:可编程逻辑控制器)以及CPU(Central Processing Unit:中央处理器)等具备数据处理功能的芯片或电路。术语“电子设备”可以是具有数据处理功能和存储功能的任何设备,通常可以包括固定终端和移动终端。固定终端如台式机等。移动终端如手机、PAD以及移动机器人等。此外,后续所描述的本发明不同实施方式中所涉及的技术特征只要彼此之间未构成冲突就可以相互结合。
下面,本发明提出部分优选实施例以教导本领域技术人员实现。
实施例一
参见图1,本实施例提供一种基于位图的手绘素材生成方法,包括如下步骤:
S1、增强位图图像,以突出位图图像的像素值变化趋势;
S2、根据像素值变化趋势,连线生成图像轮廓;
S3、对图像轮廓进行去噪,以生成去噪图像轮廓;
S4、把位图图像嵌入到去噪图像轮廓中,以生成手绘素材。
实施例二
参见图2,对应的,本实施例提供一种基于位图的手绘素材生成装置,包括:
增强模块1,用于增强位图图像,以突出位图图像的像素值变化趋势;
连线模块2,用于根据像素值变化趋势,连线生成图像轮廓;
去噪模块3,用于对图像轮廓进行去噪,以生成去噪图像轮廓;
嵌入模块4,用于把位图图像嵌入到去噪图像轮廓中,以生成手绘素材。
需要说明的是,基于位图的手绘素材生成方法或装置,通过增强位图图像,以突出位图图像的像素值变化趋势,再通过连线像素值变化趋势生成图像轮廓,去噪生成去噪图像轮廓,再通过把位图图像嵌入到去噪图像轮廓中生成手绘素材,从而使得位图具备轮廓路径,成为可展示的手绘素材,用户手绘时,沿着位图的轮廓路径进行绘画,就能逼真高效地还原位图图像,从而极大降低绘制损耗,加速图像快速生成,提升用户体验。
还需要说明的是,通过增强、连线以及去噪这些图像处理技术的 特定技术特征组合,有效提取位图的图像轮廓,再创造性地将图像轮廓与位图图像进行嵌入处理,生产手绘素材,极大降低了手绘用户准备手绘动画素材的门槛和成本,增强手绘动画效果。
实施例三
参见图3,本实施例提供一种对图像轮廓进行去噪,以生成去噪图像轮廓的方法,包括如下步骤:
S30、对图像轮廓进行去重,以生成去重图像轮廓;
S31、对去重图像轮廓进行分组,以生成分组图像轮廓;
S32、对分组图像轮廓进行排序,以生成去噪图像轮廓。
实施例四
参见图4,对应的,本实施例提供一种去噪模块,包括:
30、去重单元,用于对图像轮廓进行去重,以生成去重图像轮廓;
31、分组单元,用于对去重图像轮廓进行分组,以生成分组图像轮廓;
32、排序单元,用于对分组图像轮廓进行排序,以生成去噪图像轮廓。
需要说明的是,通过对图像轮廓进行去重,可以有效将图像轮廓中的重复去除,不仅有利于减小手绘素材的体积容量,节约计算资源,而且能让图像轮廓更为逼真突显。
另外,对去重图像轮廓进行分组,可以进一步突出图像轮廓各部分的像素特征,从而让图像轮廓更为逼真突显。
另外,对分组图像轮廓进行排序,可以让图像轮廓各部分的像素特征按照预定的趋势或规则进行排序,从而让图像轮廓更为逼真突显。
综上,通过有效组合利用去重、分组以及排序这些图像处理手段 在本实施例中的特定组合,可以有效对图像轮廓进行去噪,生成较为清晰和逼真的去噪图像轮廓。
还需要说明的是,对图像轮廓进行去重的方法可以通过设置重复点检测阈值,调取重复点检测阈值对图像轮廓的重复点进行检查筛选,可以将图像轮廓的重复点进行剔除,有利于图像轮廓的清晰展现。
实施例五
参见图5,本实施例提供一种增强位图图像,以突出位图图像的像素值变化趋势的方法,包括:
S10、调取位图图像的像素;
S11、获取不同像素的颜色对比度;
S12、增强颜色对比度,以突出位图图像的像素值变化趋势。
实施例六
参见图6,对应的,本实施例提供一种增强模块,包括:
像素调取单元10,用于调取位图图像的像素;
对比度获取单元11,获取不同像素的颜色对比度;
对比度增强单元12,用于增强颜色对比度,以突出位图图像的像素值变化趋势。
需要说明的是,由于位图中像素颜色存在差异,不同像素颜色会产生对比度,因此,通过增强不同像素颜色的对比度,能够突出位图图像的像素值变化趋势,有利于位图轮廓的获取。
实施例七
本发明提供的技术方案中,增强位图图像,以突出所述位图图像的像素值变化趋势包括:
获取位图图像中每个像素的像素值;其中每个图像会具有与其对应的像素值。
若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。在突出像素值变化趋势时,可以根据两个像素值的差值进行变化趋势的突出。例如说两个像素值相差为2,则认为这两个相邻的像素需要做素值变化处理以突出所述像素值变化趋势。
在对相邻的两个像素分别做像素值变化处理中,包括:
通过以下公式对相邻的两个像素处理,包括:
Figure PCTCN2021098208-appb-000003
其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个像素处理后的像素值,k为常数。两个相邻像素的像素值差值超过预设值时,则证明需要对这两个像素进行差异化处理,以实现突出像素值的变化趋势,并且在对两个像素值进行处理时,可以是一个向上调整、一个向下调整,即通过常数k进行调整。
本发明提供的技术方案中,还包括:
获取所述位图图像的平均像素值;
基于所述平均像素值对所述常数K进行更新处理。
由于不同的位图图像具有不同的像素值,所以在对不同的位图图像进行处理时需要考虑其像素值的平均值,如果平均值较大的话,则大概率证明该位图图像中各个像素之间的像素值差值较大,如果平均值较小的话,则大概率证明该位图图像中各个像素之间的像素值差值较小,所以需要根据平均像素值对常数K进行更新处理,以选取适用于位图图像的K值。
在根据所述像素值变化趋势,连线生成图像轮廓中,包括:
获取所述位图图像增强后的像素值;
将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
在连线的过程中,可以根据位图图像的不同调节预设值,例如说位图图像的的平均像素值较低,可以预设值调低;位图图像的的平均像素值较高,则可以预设值调高。通过像素值的差值来判断两个像素点之间是否相连。
本发明提供的技术方案,可以根据不同位图的像素值来确定相应的增强位图图像方式以及连线方式,使得在增强位图图像和连线的过程更加符合该位图图像,使得生成的手绘素材效果更佳。
实施例八
所述增强模块还用于执行以下步骤,包括:
获取位图图像中每个像素的像素值;其中每个图像会具有与其对应的像素值。
若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。在突出像素值变化趋势时,可以根据两个像素值的差值进行变化趋势的突出。例如说两个像素值相差为2,则认为这两个相邻的像素需要做素值变化处理以突出所述像素值变化趋势。
所述增强模块通过以下公式对相邻的两个像素处理,包括:
Figure PCTCN2021098208-appb-000004
其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个像素处理后的像素值,k为常数。两个相邻像素的像素值差值超过预 设值时,则证明需要对这两个像素进行差异化处理,以实现突出像素值的变化趋势,并且在对两个像素值进行处理时,可以是一个向上调整、一个向下调整,即通过常数k进行调整。
还包括更新单元,所述更新单元用于执行以下步骤:
获取所述位图图像的平均像素值;
基于所述平均像素值对所述常数K进行更新处理。
由于不同的位图图像具有不同的像素值,所以在对不同的位图图像进行处理时需要考虑其像素值的平均值,如果平均值较大的话,则大概率证明该位图图像中各个像素之间的像素值差值较大,如果平均值较小的话,则大概率证明该位图图像中各个像素之间的像素值差值较小,所以需要根据平均像素值对常数K进行更新处理,以选取适用于位图图像的K值。
所述连线模块还用于执行以下步骤,包括:
获取所述位图图像增强后的像素值;
将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
在连线的过程中,可以根据位图图像的不同调节预设值,例如说位图图像的的平均像素值较低,可以预设值调低;位图图像的的平均像素值较高,则可以预设值调高。通过像素值的差值来判断两个像素点之间是否相连。
本发明提供的技术方案,可以根据不同位图的像素值来确定相应的增强位图图像方式以及连线方式,使得在增强位图图像和连线的过程更加符合该位图图像,使得生成的手绘素材效果更佳。
相应的,本发明还提供一种电子设备,包括存储器和处理器,存储器存储计算机程序,计算机程序在处理器中执行可实现上述任一种 方法。电子设备为移动终端或web端。
本发明还提供一种存储介质,存储计算机程序,其特征在于,计算机程序在处理器中执行可实现上述任一种方法。
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。

Claims (18)

  1. 一种基于位图的手绘素材生成方法,其特征在于,包括如下步骤:
    增强位图图像,以突出所述位图图像的像素值变化趋势;
    根据所述像素值变化趋势,连线生成图像轮廓;
    对所述图像轮廓进行去噪,以生成去噪图像轮廓;
    把所述位图图像嵌入到所述去噪图像轮廓中,以生成手绘素材。
  2. 如权利要求1所述的方法,其特征在于,所述的对所述图像轮廓进行去噪,以生成去噪图像轮廓的步骤包括:
    对所述图像轮廓进行去重,以生成去重图像轮廓;
    对所述去重图像轮廓进行分组,以生成分组图像轮廓;
    对所述分组图像轮廓进行排序,以生成所述去噪图像轮廓。
  3. 如权利要求1所述的方法,其特征在于,所述的增强位图图像,以突出所述位图图像的像素值变化趋势的步骤包括:
    调取位图图像的像素;
    获取不同像素的颜色对比度;
    增强所述颜色对比度,以突出所述位图图像的像素值变化趋势。
  4. 如权利要求2所述的方法,其特征在于,所述的对所述图像轮廓进行去重的步骤包括:
    调取重复点检测阈值;
    根据所述重复点检测阈值对所述图像轮廓进行去重。
  5. 一种基于位图的手绘素材生成装置,其特征在于,包括:
    增强模块,用于增强位图图像,以突出所述位图图像的像素值变化趋势;
    连线模块,用于根据所述像素值变化趋势,连线生成图像轮廓;
    去噪模块,用于对所述图像轮廓进行去噪,以生成去噪图像轮廓;
    嵌入模块,用于把所述位图图像嵌入到所述去噪图像轮廓中,以生成手绘素材。
  6. 如权利要求5所述的装置,其特征在于,所述去噪模块包括:
    去重单元,用于对所述图像轮廓进行去重,以生成去重图像轮廓;
    分组单元,用于对所述去重图像轮廓进行分组,以生成分组图像轮廓;
    排序单元,用于对所述分组图像轮廓进行排序,以生成所述去噪图像轮廓。
  7. 如权利要求6所述的装置,其特征在于,所述增强模块包括:
    像素调取单元,用于调取位图图像的像素;
    对比度获取单元,获取不同像素的颜色对比度;
    对比度增强单元,用于增强所述颜色对比度,以突出所述位图图像的像素值变化趋势。
  8. 如权利要求1所述的方法,其特征在于,
    增强位图图像,以突出所述位图图像的像素值变化趋势包括:
    获取位图图像中每个像素的像素值;
    若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。
  9. 如权利要求8所述的方法,其特征在于,
    所述对相邻的两个像素分别做像素值变化处理包括:
    通过以下公式对相邻的两个像素处理,包括:
    Figure PCTCN2021098208-appb-100001
    其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个 像素处理后的像素值,k为常数。
  10. 如权利要求9所述的方法,其特征在于,还包括:
    获取所述位图图像的平均像素值;
    基于所述平均像素值对所述常数K进行更新处理。
  11. 如权利要求9所述的方法,其特征在于,
    根据所述像素值变化趋势,连线生成图像轮廓包括:
    获取所述位图图像增强后的像素值;
    将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
  12. 如权利要求5所述的装置,其特征在于,
    所述增强模块还用于执行以下步骤,包括:
    获取位图图像中每个像素的像素值;
    若判断任意两个相邻像素的像素值差值超过预设值时,对相邻的两个像素分别做像素值变化处理以突出所述像素值变化趋势。
  13. 如权利要求12所述的装置,其特征在于,
    所述增强模块通过以下公式对相邻的两个像素处理,包括:
    Figure PCTCN2021098208-appb-100002
    其中,X为其中一个像素处理前的像素值,Y为另外一个像素处理前的像素值,X 为其中一个像素处理后的像素值,Y 为另外一个像素处理后的像素值,k为常数。
  14. 如权利要求13所述的装置,其特征在于,还包括更新单元,所述更新单元用于执行以下步骤:
    获取所述位图图像的平均像素值;
    基于所述平均像素值对所述常数K进行更新处理。
  15. 如权利要求13所述的装置,其特征在于,
    所述连线模块还用于执行以下步骤,包括:
    获取所述位图图像增强后的像素值;
    将所述位图图像中像素值差值低于预设值的像素相连以生成图像轮廓。
  16. 一种电子设备,包括存储器和处理器,所述存储器存储计算机程序,其特征在于,所述计算机程序在所述处理器中执行可实现权利要求1-4、8-11中任一种方法。
  17. 一种存储介质,存储计算机程序,其特征在于,所述计算机程序在处理器中执行可实现权利要求1-4、8-11中任一种方法。
  18. 如权利要求16所述的电子设备,其特征在于,所述电子设备为移动终端或web端。
PCT/CN2021/098208 2020-08-11 2021-06-03 一种基于位图的手绘素材生成方法 WO2022033138A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010803252.3 2020-08-11
CN202010803252.3A CN111951352A (zh) 2020-08-11 2020-08-11 一种基于位图的手绘素材生成方法

Publications (1)

Publication Number Publication Date
WO2022033138A1 true WO2022033138A1 (zh) 2022-02-17

Family

ID=73332164

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/098208 WO2022033138A1 (zh) 2020-08-11 2021-06-03 一种基于位图的手绘素材生成方法

Country Status (2)

Country Link
CN (1) CN111951352A (zh)
WO (1) WO2022033138A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111951352A (zh) * 2020-08-11 2020-11-17 深圳市前海手绘科技文化有限公司 一种基于位图的手绘素材生成方法

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103489214A (zh) * 2013-09-10 2014-01-01 北京邮电大学 增强现实系统中基于虚拟模型预处理的虚实遮挡处理方法
CN106127841A (zh) * 2016-06-22 2016-11-16 丁焱 一种基于人脸照片生成个性卡通动态图的方法
US20180290399A1 (en) * 2017-04-10 2018-10-11 Xyzprinting, Inc. Method of three-dimensional printing and system thereof
CN109146991A (zh) * 2018-08-20 2019-01-04 广州视源电子科技股份有限公司 一种图片格式转换方法、装置、设备和存储介质
CN111047671A (zh) * 2019-12-24 2020-04-21 成都来画科技有限公司 一种手绘图片的绘画路径的优化方法及存储介质
CN111951352A (zh) * 2020-08-11 2020-11-17 深圳市前海手绘科技文化有限公司 一种基于位图的手绘素材生成方法

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9659279B2 (en) * 2013-10-25 2017-05-23 Palo Alto Research Center Incorporated Method and system for enhanced inferred mode user interface operations

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103489214A (zh) * 2013-09-10 2014-01-01 北京邮电大学 增强现实系统中基于虚拟模型预处理的虚实遮挡处理方法
CN106127841A (zh) * 2016-06-22 2016-11-16 丁焱 一种基于人脸照片生成个性卡通动态图的方法
US20180290399A1 (en) * 2017-04-10 2018-10-11 Xyzprinting, Inc. Method of three-dimensional printing and system thereof
CN109146991A (zh) * 2018-08-20 2019-01-04 广州视源电子科技股份有限公司 一种图片格式转换方法、装置、设备和存储介质
CN111047671A (zh) * 2019-12-24 2020-04-21 成都来画科技有限公司 一种手绘图片的绘画路径的优化方法及存储介质
CN111951352A (zh) * 2020-08-11 2020-11-17 深圳市前海手绘科技文化有限公司 一种基于位图的手绘素材生成方法

Also Published As

Publication number Publication date
CN111951352A (zh) 2020-11-17

Similar Documents

Publication Publication Date Title
CN108921806B (zh) 一种图像处理方法、图像处理装置及终端设备
CN110751218B (zh) 图像分类方法、图像分类装置及终端设备
CN111553923B (zh) 一种图像处理方法、电子设备及计算机可读存储介质
WO2021120685A1 (zh) 一种视频的生成方法、装置及计算机系统
CN111028170B (zh) 图像处理方法、图像处理装置、电子设备和可读存储介质
CN110211195B (zh) 生成图像集合的方法、装置、电子设备和计算机可读存储介质
CN111414879A (zh) 人脸遮挡程度识别方法、装置、电子设备及可读存储介质
CN111768468B (zh) 图像填充方法、装置、设备及存储介质
CN112967381B (zh) 三维重建方法、设备和介质
TWI778895B (zh) 顯著性檢測方法及其模型的訓練方法、設備及電腦可讀儲存介質
WO2021129466A1 (zh) 检测水印的方法、装置、终端及存储介质
CN111182367A (zh) 一种视频的生成方法、装置及计算机系统
JP7213291B2 (ja) 画像を生成するための方法及装置
WO2022033138A1 (zh) 一种基于位图的手绘素材生成方法
CN109587558A (zh) 视频处理方法、装置、电子设备以及存储介质
US11803944B2 (en) Image cleanup on a mobile device
CN111640123B (zh) 无背景图像的生成方法、装置、设备及介质
CN111598084B (zh) 缺陷分割网络训练方法、装置、设备及可读存储介质
Liu et al. Exemplar-based image inpainting with multi-resolution information and the graph cut technique
CN114004840A (zh) 图像处理方法、训练方法、检测方法、装置、设备及介质
US20230005171A1 (en) Visual positioning method, related apparatus and computer program product
CN111274145A (zh) 关系结构图生成方法、装置、计算机设备及存储介质
CN115393868B (zh) 文本检测方法、装置、电子设备和存储介质
US20220319141A1 (en) Method for processing image, device and storage medium
CN114387315A (zh) 图像处理模型训练、图像处理方法、装置、设备及介质

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

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

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

122 Ep: pct application non-entry in european phase

Ref document number: 21855194

Country of ref document: EP

Kind code of ref document: A1