WO2025148591A1 - 图像处理方法、装置、电子设备以及存储介质 - Google Patents

图像处理方法、装置、电子设备以及存储介质

Info

Publication number
WO2025148591A1
WO2025148591A1 PCT/CN2024/137957 CN2024137957W WO2025148591A1 WO 2025148591 A1 WO2025148591 A1 WO 2025148591A1 CN 2024137957 W CN2024137957 W CN 2024137957W WO 2025148591 A1 WO2025148591 A1 WO 2025148591A1
Authority
WO
WIPO (PCT)
Prior art keywords
type
image
light spot
spot pattern
target
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
PCT/CN2024/137957
Other languages
English (en)
French (fr)
Inventor
陈璐双
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
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 Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Publication of WO2025148591A1 publication Critical patent/WO2025148591A1/zh
Anticipated expiration legal-status Critical
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/77Retouching; Inpainting; Scratch removal
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement

Definitions

  • the present disclosure provides an image processing method, device, electronic device and storage medium.
  • the present disclosure provides an image processing method, comprising: acquiring a target image; determining a spot adding area in the target image; adding a spot pattern in the spot adding area of the target image to obtain a processed image; the spot pattern comprises a first type of spot pattern and a second type of spot pattern; the shape of the first type of spot pattern is a preset graphic, the second type of spot pattern is a scattered flash point, the brightness value of the pixel points in the first type of spot pattern and the second type of spot pattern is greater than or equal to a first set brightness threshold; the second type of spot pattern is located on an upper layer of the first type of spot pattern.
  • the present disclosure also provides an image processing device, including: an acquisition module, used to acquire a target image; a determination module, used to determine a light spot adding area in the target image; a processing module, used to add a light spot pattern in the light spot adding area of the target image to obtain a processed image;
  • the light spot pattern includes a first type of light spot pattern and a second type of light spot pattern;
  • the shape of the first type of light spot pattern is a preset graphic, and the second type of light spot pattern is a scattered flash point, and the brightness value of the pixel points in the first type of light spot pattern and the second type of light spot pattern is greater than or equal to a first set brightness threshold;
  • the second type of light spot pattern is located on the upper layer of the first type of light spot pattern.
  • the technical solution provided by the embodiment of the present disclosure determines a spot adding area in a target image; adds a spot pattern in the spot adding area of the target image to obtain a processed image; the spot pattern includes a first type of spot pattern and a second type of spot pattern; the shape of the first type of spot pattern is a preset graphic, and the second type of spot pattern is scattered flashing points, and the brightness value of the pixel points in the first type of spot pattern and the second type of spot pattern is greater than or equal to a first set brightness threshold; the second type of spot pattern is located on the upper layer of the first type of spot pattern.
  • it provides a method for automatically adding spot pattern special effects to a target image, which can meet the user's diverse needs for adding special effects.
  • FIG1 is a flow chart of an image processing method provided by an embodiment of the present disclosure.
  • FIG7 is a schematic diagram of the structure of an image processing device in an embodiment of the present disclosure.
  • determining the second type of light spot adding area in the target image may include: subtracting the target image from the third image to obtain the second type of light spot adding area.
  • adding a first type of light spot pattern in the first type of light spot adding area of the target image to obtain the first image includes: performing edge detection on the image in the first type of light spot adding area of the target image to obtain an edge contour image; performing connected domain detection on the edge contour image to obtain a connected domain; and adding the first type of light spot pattern in the connected domain to obtain the first image.
  • a connected domain is usually composed of a group of connected pixels, which have the same color, grayscale value or other characteristics.
  • the present application does not limit which specific characteristics of the pixels in the connected domain are the same.
  • the first type of light spot pattern may be added to each connected domain; or the first type of light spot pattern may be added only to some connected domains.
  • it may be configured to add the first type of spot pattern to all connected domains whose size is greater than a set size threshold.
  • the center point of the connected domain may be, for example, the geometric center of the connected domain.
  • the target area may be, for example, an area used to fill the first type of light spot pattern.
  • the spot adding area determination rule corresponding to the first type of spot pattern is used to obtain the first type of spot adding area, as shown in FIG3.
  • the image in the first type of spot adding area of the target image is subjected to edge detection to obtain an edge contour image; the edge contour image is subjected to connected domain detection, see FIG3, and two connected domains are obtained, namely, connected domain a and connected domain b.
  • Determine the center point position of connected domain a see FIG4, determine the target area a in the connected domain a, the target area a is a rectangle, and the center point of the target area a coincides with the center point of the connected domain a.
  • the target area a and the target area b are indicated by dotted lines, and the rectangular wireframes indicating the target area a and the target area b are not visible. That is, in practice, the target area a and the target area b are not displayed, and only the first type of spot pattern is displayed.
  • the specific implementation method of this step may include: dynamically sampling a preset gradient noise image that changes in time series to obtain a sampling result; based on the sampling result, adding a second type of light spot pattern to a second type of light spot adding area in the first image to obtain an intermediate processed image; blurring the second type of light spot adding area in the intermediate processed image to obtain a processed image.
  • the preset gradient noise image with time series variation can be a noise image with a gradient generated on time series data, in which the intensity or pattern of the noise varies with time and is adjusted in the gradient direction. Such an image can be used to simulate the dynamic changes of natural phenomena or random processes, and to generate time series data with specific characteristics.
  • the preset gradient noise image with time series variation can be a Perlin noise image, or a Simplex noise image, etc.
  • the preset gradient noise image with time series variation can be a Perlin noise image, or a Simplex noise image, etc., so that the added second type of spot pattern can simulate a sense of fluidity.
  • the sampling frequency is set to t1, and the preset gradient noise image with time-series variation is sampled periodically to obtain noise images S1, S2, S3, ....
  • the sampling frequency is set to t2, and the preset gradient noise image with time-series variation is sampled periodically to obtain noise images M1, M2, M3, ....
  • S1 is synthesized with M1 to obtain the sampling result F1;
  • S2 is synthesized with M2 to obtain the sampling result F2;
  • S3 is synthesized with M3 to obtain the sampling result F3; ....
  • the second type of spot pattern is added to the second type of spot adding area of the first image to obtain the intermediate processing image B1.
  • the second type of spot pattern is added to the second type of spot adding area of the first image to obtain the intermediate processing image B2.
  • the second type of spot pattern is added to the second type of spot adding area of the first image to obtain the intermediate processing image B3.
  • adding a second type of light spot pattern in the second type of light spot adding area of the first image to obtain an intermediate processed image may include: based on the target mask, adding the second type of light spot pattern in the area indicated by the target mask in the second type of light spot adding area of the first image to obtain an intermediate processed image.
  • the person's nose in the target image can be identified to obtain a target mask, where the area indicated by the target mask is the area where the person's nose is located.
  • a second type of spot pattern is added to the area where the person's nose is located.
  • the third brightness value is a pre-specified brightness value, and the present application does not limit its specific value.
  • the third brightness value is 0.
  • the above technical solution determines the spot adding area in the target image by setting; adds a spot pattern in the spot adding area of the target image to obtain a processed image; the spot pattern includes a first type of spot pattern and a second type of spot pattern; the shape of the first type of spot pattern is a preset graphic, and the second type of spot pattern is scattered flashing points, and the brightness value of the pixel points in the first type of spot pattern and the second type of spot pattern is greater than or equal to the first set brightness threshold; the second type of spot pattern is located on the upper layer of the first type of spot pattern.
  • it provides a method for automatically adding spot pattern special effects to the target image, which can meet the user's diverse special effects adding needs.
  • FIG7 is a schematic diagram of the structure of an image processing device in an embodiment of the present disclosure.
  • the image processing device provided in the embodiment of the present disclosure can be configured in a client, or can be configured in a server.
  • the image processing device specifically includes: an acquisition module 310 for acquiring a target image; a determination module 320 for determining a light spot adding area in the target image; a processing module 330 for adding a light spot pattern in the light spot adding area of the target image to obtain a processed image;
  • the light spot pattern includes a first type of light spot pattern and a second type of light spot pattern; the shape of the first type of light spot pattern is a preset graphic, and the second type of light spot pattern is a scattered flash point, and the brightness value of the pixel points in the first type of light spot pattern and the second type of light spot pattern is greater than or equal to a first set brightness threshold; the second type of light spot pattern is located on the upper layer of the first type of light spot pattern.
  • the processing module 330 is used to: determine the center point position of the connected domain; determine the target area based on the center point position of the connected domain, the center point of the target area coincides with the center point of the connected domain; add a first type of spot pattern in the target area to obtain a first image.
  • the processing module 330 is used to: dynamically sample the preset gradient noise image that changes in time series to obtain a sampling result; based on the sampling result, add the second type of light spot pattern to the second type of light spot adding area of the first image to obtain an intermediate processed image; blur the second type of light spot adding area in the intermediate processed image to obtain a processed image.
  • the determination module 320 is used to: perform smoothing filtering on the target image to obtain a third image; and determine a second type of spot adding area in the target image based on the third image and the target image.
  • the processing module 330 is used to: obtain a target mask based on the position information of the target object in the target image; and add the second type of spot pattern in the second type of spot adding area of the first image based on the target mask to obtain an intermediate processed image.
  • processing module 330 is used to: based on the target mask, add the second type of light spot pattern to the area indicated by the target mask in the second type of light spot adding area of the first image to obtain an intermediate processed image.
  • the processing module 330 is used to: based on the target mask, add the second type of light spot pattern in the second type of light spot adding area of the first image to obtain a second image; adjust the brightness value of the flash point in the area indicated by the target mask in the second image to a third brightness value.
  • FIG8 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure.
  • the electronic device 1000 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable electronic devices, etc., and fixed terminals such as digital TVs, desktop computers, smart home devices, etc.
  • the electronic device shown in FIG8 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
  • the electronic device 1000 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 to a random access memory (RAM) 1003 to implement the image processing method of the embodiment described in the present disclosure.
  • a processing device e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • various programs and information required for the operation of the electronic device 1000 are also stored.
  • the processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other via a bus 1004.
  • An input/output (I/O) interface 1005 is also connected to the bus 1004.
  • the following devices may be connected to the I/O interface 1005: input devices 1006 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1008 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009.
  • the communication devices 1009 may allow the electronic device 1000 to communicate wirelessly or wired with other devices to exchange information.
  • FIG. 8 shows an electronic device 1000 with various devices, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart, thereby realizing the image processing method as described above.
  • the computer program can be downloaded and installed from the network through the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002.
  • the processing device 1001 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include an information signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code.
  • This propagated information signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • the computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device.
  • the program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the client and server may communicate using any known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital information communication (e.g., a communication network).
  • HTTP HyperText Transfer Protocol
  • Examples of communication networks include a local area network ("LAN”), a wide area network ("WAN”), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any known or future developed network.
  • the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
  • the above-mentioned computer-readable medium carries one or more programs.
  • the electronic device When the above-mentioned one or more programs are executed by the electronic device, the electronic device is enabled to: acquire a target image; determine a light spot adding area in the target image; add a light spot pattern in the light spot adding area of the target image to obtain a processed image; the light spot pattern includes a first type of light spot pattern and a second type of light spot pattern; the shape of the first type of light spot pattern is a preset graphic, and the second type of light spot pattern is scattered flashing points, and the brightness values of the pixels in the first type of light spot pattern and the second type of light spot pattern are greater than or equal to a first set brightness threshold; the second type of light spot pattern is located on the upper layer of the first type of light spot pattern.
  • the electronic device may also execute other steps described in the above embodiments.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages.
  • the program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
  • LAN local area network
  • WAN wide area network
  • Internet service provider e.g., via the Internet using an Internet service provider
  • each square box in the block diagram and/or flow chart, and the combination of the square boxes in the block diagram and/or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chips
  • CPLDs complex programmable logic devices
  • the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the image processing method as described in any one of the present disclosure is implemented.
  • the embodiments of the present disclosure further provide a computer program product, which includes a computer program or instructions.
  • a computer program product which includes a computer program or instructions.
  • the image processing method described above is implemented.

Landscapes

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

Abstract

本公开涉及一种图像处理方法、装置、电子设备以及存储介质,方法包括获取目标图像;在所述目标图像中确定光斑添加区域;在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。其实质是给出了一种可以自动化为目标图像添加光斑图案特效的方法,可以满足用户多样化的特效添加需求。

Description

图像处理方法、装置、电子设备以及存储介质
本申请要求2024年01月10日递交的、标题为“图像处理方法、装置、电子设备以及存储介质”、申请号为202410039504.8的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开涉及图像处理技术领域,尤其涉及一种图像处理方法、装置、电子设备以及存储介质。
背景技术
随着数字图像技术的快速发展,人们对图像的视觉效果提出了更高的要求。为了增加图像的观赏性和艺术性,向图像添加特效成为了一种重要的技术手段。特效可以为图像带来更加丰富的视觉效果,使图像更具吸引力和观赏价值。
然而,目前市场上虽然已有一些软件或应用提供了添加特效的功能,但它们提供的特效种类有限,难以满足用户的多样化需求。
发明内容
为了解决上述技术问题或者至少部分地解决上述技术问题,本公开提供了一种图像处理方法、装置、电子设备以及存储介质。
第一方面,本公开提供了一种图像处理方法,包括:获取目标图像;在所述目标图像中确定光斑添加区域;在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
第二方面,本公开还提供了一种图像处理装置,包括:获取模块,用于获取目标图像;确定模块,用于在所述目标图像中确定光斑添加区域;处理模块,用于在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
第三方面,本公开还提供了一种电子设备,所述电子设备包括:一个或多个处理器;存储装置,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如上所述的图像处理方法。
第四方面,本公开还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如上所述的图像处理方法。
本公开实施例提供的技术方案与现有技术相比具有如下优点:
本公开实施例提供的技术方案通过设置在目标图像中确定光斑添加区域;在目标图像的光斑添加区域中添加光斑图案,得到处理后的图像;光斑图案包括第一类光斑图案和第一类光斑图案;第一类光斑图案的形状为预设图形,第二类光斑图案为分散的闪光点,第一类光斑图案和第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;第二类光斑图案位于第一类光斑图案的上层,其实质是给出了一种可以自动化为目标图像添加光斑图案特效的方法,可以满足用户多样化的特效添加需求。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的一种图像处理方法的流程图;
图2-图6为本公开实施例提供的图像处理方法的原理图;
图7为本公开实施例中的一种图像处理装置的结构示意图;以及
图8为本公开实施例中的一种电子设备的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
图1为本公开实施例提供的一种图像处理方法的流程图,本实施例可适用于客户端中进行图像处理的情况,该方法可以由图像处理装置执行,该装置可以采用软件和/或硬件的方式实现。该装置可配置于电子设备中,例如终端,具体包括但不限于智能手机、掌上电脑、平板电脑、带显示屏的可穿戴设备、台式机、笔记本电脑、一体机、智能家居设备等。或者,本实施例可适用于服务端中进行图像处理的情况,该方法可以由图像处理装置执行,该装置可以采用软件和/或硬件的方式实现。该装置可配置于电子设备中,例如服务器。
如图1所示,该方法具体可以包括:S110、获取目标图像。
目标图像例如可以是需要添加光斑图案特效的图像。目标图像可以由用户指定。具体可以为用户拍摄的图像,也可以是从网络中下载的图像。
可选地,目标图像例如可以是静态图像,也可以是动态图像,还可以是视频中的图像帧。
此外,目标图像可以是之前已经编辑过的图像,也可以是未被编辑过的图像。此处“已经编辑过的图像”例如可以是已添加过其他特效的图像。
需要说明的是,采用本申请提供的技术方案可以在目标图像中添加光斑图案。可添加的光斑图案可以包括第一类光斑图案和第二类光斑图案;第一类光斑图案的形状为预设图形,第二类光斑图案为分散的闪光点,第一类光斑图案和第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值。
第一设定亮度阈值是预先指定的亮度阈值。第一类光斑图案和第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值,意味着,第一类光斑图案和第二类光斑图案比较明显,容易被看到。
预设图形例如可以是三角形、正方形、菱形以及心形等。若预设图形为菱形,第一类光斑图案是指形状为菱形的光斑,且构成该光斑的像素点的亮度值的大于或等于第一设定亮度阈值。
分散的闪光点例如可以是离散的亮点。形成该亮点的像素点的亮度值的大于或等于第一设定亮度阈值。本申请对单位面积中,分散的闪光点的密度不作限制。
本申请对光斑图案(包括第一类光斑图案和第二类光斑图案)的颜色不作限制。在实际中,光斑图案的颜色可以由用户设置。
S120、在目标图像中确定光斑添加区域。
光斑添加区域例如可以是用于添加光斑的区域。可选地,光斑添加区域可以预先指定,或者,根据光斑添加区域确定规则确定。
在实际中,可以设置不同的光斑图案对应不同的光斑添加区域。即本步骤包括:在目标图像中确定第一类光斑添加区域和第二类光斑添加区域,第一类光斑添加区域用于添加第一类光斑图案,第二类光斑添加区域用于添加第二类光斑图案。由于第一类光斑添加区域和第二类光斑添加区域是不同的,通过设置在目标图像中确定第一类光斑添加区域和第二类光斑添加区域,实质是分别为第一类光斑图案和第二类光斑图案选择合适的添加位置,使得第一类光斑图案和第二类光斑图案更加明显,更易于被看到。
在一个实施例中,在目标图像中确定第一类光斑添加区域,可以包括:基于目标图像中像素点的亮度值,在目标图像中确定第一类光斑添加区域,第一类光斑添加区域中像素点的亮度值大于第二设定亮度阈值。
进一步地,“基于目标图像中像素点的亮度值,在目标图像中确定第一类光斑添加区域”可以包括:基于目标图像中像素点的亮度值以及第二设定亮度阈值,在目标图像中确定第一类光斑添加区域。其中,第二预设亮度阈值用于衡量是否将目标图像中的一个像素点占据的区域纳入第一类光斑添加区域。
可选地,还可以设置“基于目标图像中像素点的亮度值,在目标图像中确定第一类光斑添加区域”可以包括:基于目标图像中像素点的亮度值以及双边阈值,在目标图像中确定第一类光斑添加区域。
双边阈值是指,定义一个高阈值和一个低阈值,若一个像素点的亮度值大于高阈值时,确定该像素点占据位置属于第一类光斑添加区域;若一个像素点的亮度值低于低阈值时,确定该像素点占据位置不属于第一类光斑添加区域。若一个像素点的亮度值在低阈值和高阈值之间,根据该像素点与已确定的属于第一类光斑添加区域中的像素点的距离远近,确定该像素点占据位置是否属于第一类光斑添加区域。
在另一个实施例中,在目标图像中确定第二类光斑添加区域,包括:对目标图像进行平滑滤波,得到第三图像;基于第三图像和目标图像,在目标图像中确定第二类光斑添加区域。
对目标图像进行平滑滤波。示例性地,可以为对目标图像进行盒子滤波。
示例性地,基于第三图像和目标图像,在目标图像中确定第二类光斑添加区域,可以包括:将目标图像与第三图像做差,得到第二类光斑添加区域。
通过对目标图像进行平滑滤波,可以使得第三图像中的边缘变得平滑,降低边缘细节的锐利度。由于目标图像保留了边缘细节的锐利度,将目标图像与第三图像进行对比,可以准确地识别出边缘的具体位置。将这些边缘所围成的区域标记为第二类光斑添加区域,为后续添加第二类光斑图案做准备。
S130、在目标图像的光斑添加区域中添加光斑图案,得到处理后的图像;光斑图案包括第一类光斑图案和第一类光斑图案;第一类光斑图案的形状为预设图形,第二类光斑图案为分散的闪光点,第一类光斑图案和第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;第二类光斑图案位于第一类光斑图案的上层。
其中,第二类光斑图案位于第一类光斑图案的上层,是指,如果将目标图像、第一类光斑图案和第二类光斑图案分别视为一个图层,由底层到顶层,图像的排列顺序为目标图像、第一类光斑图案和第二类光斑图案。
本步骤的实现方法有多种,本申请对此不作限制。示例性地,光斑添加区域包括第一类光斑添加区域和第二类光斑添加区域;本步骤的实现方法包括:在目标图像的第一类光斑添加区域中添加第一类光斑图案,得到第一图像;在第一图像的第二类光斑添加区域中添加第二类光斑图案,得到处理后的图像。
进一步地,在一个实施例中,可选地,在目标图像的第一类光斑添加区域中添加第一类光斑图案,得到第一图像包括:对目标图像的第一类光斑添加区域中的图像进行边缘检测,得到边缘轮廓图像;对边缘轮廓图像进行连通域检测,得到连通域;在连通域中添加第一类光斑图案,得到第一图像。
连通域通常是由一组相连的像素点组成,这些像素点具有相同的颜色、灰度值或其它特征。本申请对连通域中像素点的具体哪些特征相同不作限制。
在实际中,可以在每一个连通域中均添加第一类光斑图案;也可以仅在部分连通域中均添加第一类光斑图案。
在实际中,可选地,可以设置在尺寸大于设定尺寸阈值的连通域中均添加第一类光斑图案。
在实际中,第一类光斑图案的可以添加在连通域中的任意位置处,本申请对此不作限制。在实际中,可选地,“在连通域中添加第一类光斑图案,得到第一图像”包括:确定连通域的中心点位置;基于连通域的中心点位置,确定目标区域,目标区域的中心点与连通域的中心点重合;在目标区域中添加第一类光斑图案,得到第一图像。
连通域的中心点例如可以是连通域的几何中心。
目标区域例如可以是用于填充第一类光斑图案的区域。
示例性地,若目标图像如图2所示,使用与第一类光斑图案对应的光斑添加区域确定规则,得到第一类光斑添加区域,如图3。对目标图像的第一类光斑添加区域中的图像进行边缘检测,得到边缘轮廓图像;对边缘轮廓图像进行连通域检测,参见图3,得到2个连通域,分别为连通域a和连通域b。确定连通域a的中心点位置,参见图4,在连通域a中确定目标区域a,目标区域a为矩形,目标区域a的中心点与连通域a的中心点重合。确定连通域b的中心点位置,参见图4,在连通域b中确定目标区域b,目标区域b为矩形,目标区域b的中心点与连通域b的中心点重合。参见图5,将预先设置或选择的第一类光斑图案添加至目标区域a和目标区域b。得到处理后的图像。示例性地,在图5中,第一类光斑图案的形状呈四角星形,发白光。
需要说明的是,在图5中,借助虚线表示目标区域a和目标区域b,意在表示目标区域a和目标区域b的矩形线框不可见。即在实际中,并不显示目标区域a和目标区域b,仅显示第一类光斑图案。
在另一个实施例中,若光斑图案包括第二类光斑图案;本步骤的具体实现方法可以包括:对时序变化的预设梯度噪声图像进行动态采样,得到采样结果;基于采样结果,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像;对中间处理图像中的第二类光斑添加区域进行模糊处理,得到处理后的图像。
时序变化的预设梯度噪声图像,例如可以是在时间序列数据上生成的,具有梯度的噪声图像,其中噪声的强度或模式随时间变化,并在梯度方向上有所调整。这种图像可以用于模拟自然现象或随机过程的动态变化,以及生成具有特定特征的时间序列数据。示例性地,时序变化的预设梯度噪声图像可以是柏林(Perlin)噪声图像,或者是Simplex噪声图像等。设置时序变化的预设梯度噪声图像可以是柏林噪声图像,或者是Simplex噪声图像等,可以使得所添加的第二类光斑图案模拟出流动感。
“对时序变化的预设梯度噪声图像进行动态采样”的本质是通过随机采样、均匀采样或根据某种规则进行周期性采样,从预设梯度噪声图像中抽取部分数据或信息,这些数据或信息代表了噪声的分布和强度。每一次采样结果为由一次抽取的部分数据或信息构成的噪声图像。换言之,采样结果包括多个噪声图像。
中间处理图像包括多个光点,不同光点在中间处理图像中的位置和/或亮度可能不同。
在实际中,可选地,“对时序变化的预设梯度噪声图像进行动态采样,得到采样结果”包括:以不同采样频率分别对时序变化的预设梯度噪声图像进行周期性采样,得到多个第一结果;不同的第一结果与不同的采样频率对应;每一个第一结果包括于不同采样时刻进行采样得到的噪声图像;将不同采样频率得到的噪声图像进行融合,得到多个采样结果。“基于采样结果,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像”,包括:分别基于每一个采样结果,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像。
示例地,设置采样频率为t1,周期性地对时序变化的预设梯度噪声图像进行采样,得到噪声图像S1、S2、S3、……。设置采样频率为t2,周期性地对时序变化的预设梯度噪声图像进行采样,得到噪声图像M1、M2、M3、……。将S1与M1合成得,到采样结果F1;将S2与M2合成,得到采样结果F2;将S3与M3合成,得到采样结果F3;……。基于采样结果F1,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像B1。基于采样结果F2,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像B2。基于采样结果F3,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像B3。……。
通过上述方法,当连续播放多个中间处理图像或基于多个中间处理图像得到的最终图像,可以使得光点产生一种闪烁的粒子效果,即使得光点转变为闪光点,使其看起来更加生动和逼真。
基于采样结果,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像,具体可以包括:将采样结果中的像素点处理为光点,在第一图像的第二类光斑添加区域添加该光点,得到中间处理图像。
“对中间处理图像中的第二类光斑添加区域进行模糊处理,得到处理后的图像”例如可以是,对中间处理图像中的第二类光斑添加区域进行高斯模糊,使得第二类光斑图案中的闪光点呈现发光的视觉效果。
需要说明的是,在实际中,可以对中间处理图像中的第二类光斑添加区域进行多层多次模糊处理。
示例性地,仍然以图2为目标图像,假设第二类光斑添加区域包括脸部的鼻尖区域、眼皮区域以及脸颊区域,添加第二类光斑图案的效果如图6所示。示例性地,在图6中,第二类光斑图案中闪光点的颜色为白色。
在上述各技术方案的基础上,若目标图像包括目标对象;基于采样结果,在第一图像的第二类光斑添加区域添加第二类光斑图案,得到中间处理图像,包括:基于目标对象在目标图像中的位置信息,得到目标掩膜;基于目标掩膜,在第一图像的第二类光斑添加区域中添加第二类光斑图案,得到中间处理图像。
目标对象例如可以是需要重点关注的对象。本申请对目标对象具体指代的事物不作限制。在一些场景中,目标对象可以是目标图像主体,或主体的局部。示例性地,目标对象例如可以是人物、动物、建筑物等;或者,目标对象可以是人物的脸部或动物的脸部等;或者,目标对象可以是人物或动物的鼻头、眼皮、眼头以及下巴等;或者,目标对象为目标图像主体的轮廓线。
目标掩膜例如可以用于指示目标对象在目标图像中的位置。
在一个实施例中,基于目标掩膜,在第一图像的第二类光斑添加区域中添加第二类光斑图案,得到中间处理图像,可以包括:基于目标掩膜,在第一图像的第二类光斑添加区域中目标掩膜指示的区域中添加第二类光斑图案,得到中间处理图像。
目标掩膜指示的区域即目标对象所在区域。
示例性地,若目标对象为人物的鼻头,可以对目标图像中的人物的鼻头进行识别,得到目标掩膜,目标掩膜指示的区域是人物的鼻头所在区域。在人物的鼻头所在区域添加第二类光斑图案。
或者,基于目标掩膜,在第一图像的第二类光斑添加区域中添加第二类光斑图案,得到中间处理图像,包括:基于目标掩膜,在第一图像的第二类光斑添加区域中添加第二类光斑图案,得到第二图像;将第二图像中目标掩膜指示的区域中的闪光点的亮度值调整为第三亮度值。
第三亮度值为预先指定的亮度值,本申请对其具体取值不作限制。示例性地,第三亮度值为0。
示例性地,若目标对象为人物的轮廓线,可以对目标图像中的主体进行识别,得到第一掩膜;对第一掩膜进行膨胀模糊处理,得到第二掩膜。将第二掩膜与第一掩膜相减,得到目标掩膜,目标掩膜指示的区域是人物的边缘区域。在第二类光斑添加区域中,添加第二类光斑图案,得到第二图像。将第二图像中目标掩膜指示的区域中闪光点(即人物边缘处的闪光点)的亮度值调整为0。即在视觉上在人物的边缘处,第二类光斑图案不可见。
上述技术方案通过设置在目标图像中确定光斑添加区域;在目标图像的光斑添加区域中添加光斑图案,得到处理后的图像;光斑图案包括第一类光斑图案和第一类光斑图案;第一类光斑图案的形状为预设图形,第二类光斑图案为分散的闪光点,第一类光斑图案和第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;第二类光斑图案位于第一类光斑图案的上层,其实质是给出了一种可以自动化为目标图像添加光斑图案特效的方法,可以满足用户多样化的特效添加需求。
可以理解的是,在使用本公开各实施例公开的技术方案之前,均应当依据相关法律法规通过恰当的方式对本公开所涉及个人信息的类型、使用范围、使用场景等告知用户并获得用户的授权。
例如,在响应于接收到用户的主动请求时,向用户发送提示信息,以明确地提示用户,其请求执行的操作将需要获取和使用到用户的个人信息。从而,使得用户可以根据提示信息来自主地选择是否向执行本公开技术方案的操作的电子设备、应用程序、服务器或存储介质等软件或硬件提供个人信息。
作为一种可选的但非限定性的实现方式,响应于接收到用户的主动请求,向用户发送提示信息的方式例如可以是弹窗的方式,弹窗中可以以文字的方式呈现提示信息。此外,弹窗中还可以承载供用户选择“同意”或者“不同意”向电子设备提供个人信息的选择控件。
可以理解的是,上述通知和获取用户授权过程仅是示意性的,不对本公开的实现方式构成限定,其它满足相关法律法规的方式也可应用于本公开的实现方式中。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明并不受所描述的动作顺序的限制,因为依据本发明,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作和模块并不一定是本发明所必须的。
图7为本公开实施例中的一种图像处理装置的结构示意图。本公开实施例所提供的图像处理装置可以配置于客户端中,或者可以配置于服务端中。参见图7,该图像处理装置具体包括:获取模块310,用于获取目标图像;确定模块320,用于在所述目标图像中确定光斑添加区域;处理模块330,用于在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
进一步地,所述光斑添加区域包括第一类光斑添加区域和第二类光斑添加区域;处理模块330,用于:在所述目标图像的所述第一类光斑添加区域中添加第一类光斑图案,得到第一图像;在所述第一图像的所述第二类光斑添加区域中添加第二类光斑图案,得到处理后的图像。
进一步地,处理模块330,用于:对所述目标图像的所述第一类光斑添加区域中的图像进行边缘检测,得到边缘轮廓图像;对所述边缘轮廓图像进行连通域检测,得到连通域;在所述连通域中添加第一类光斑图案,得到第一图像。
进一步地,处理模块330,用于:确定所述连通域的中心点位置;基于所述连通域的中心点位置,确定目标区域,所述目标区域的中心点与所述连通域的中心点重合;在所述目标区域中添加第一类光斑图案,得到第一图像。
进一步地,确定模块320,用于:基于所述目标图像中像素点的亮度值,在所述目标图像中确定第一类光斑添加区域,所述第一类光斑添加区域中像素点的亮度值大于第二设定亮度阈值。
进一步地,处理模块330,用于:对时序变化的预设梯度噪声图像进行动态采样,得到采样结果;基于所述采样结果,在所述第一图像的第二类光斑添加区域添加所述第二类光斑图案,得到中间处理图像;对所述中间处理图像中的第二类光斑添加区域进行模糊处理,得到处理后的图像。
进一步地,确定模块320,用于:对所述目标图像进行平滑滤波,得到第三图像;基于所述第三图像和所述目标图像,在所述目标图像中确定第二类光斑添加区域。
进一步地,处理模块330,用于:基于所述目标对象在所述目标图像中的位置信息,得到目标掩膜;基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到中间处理图像。
进一步地,处理模块330,用于:基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中所述目标掩膜指示的区域中添加所述第二类光斑图案,得到中间处理图像。
进一步地,处理模块330,用于:基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到第二图像;将所述第二图像中所述目标掩膜指示的区域中的闪光点的亮度值调整为第三亮度值。
本公开实施例提供的图像处理装置,可执行本公开方法实施例所提供的图像处理方法中客户端或服务端所执行的步骤,具备执行步骤和有益效果,此处不再赘述。
图8为本公开实施例中的一种电子设备的结构示意图。下面具体参考图8,其示出了适于用来实现本公开实施例中的电子设备1000的结构示意图。本公开实施例中的电子设备1000可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)、可穿戴电子设备等等的移动终端以及诸如数字TV、台式计算机、智能家居设备等等的固定终端。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。
如图8所示,电子设备1000可以包括处理装置(例如中央处理器、图形处理器等)1001,其可以根据存储在只读存储器(ROM)1002中的程序或者从存储装置1008加载到随机访问存储器(RAM)1003中的程序而执行各种适当的动作和处理以实现如本公开所述的实施例的图像处理方法。在RAM 1003中,还存储有电子设备1000操作所需的各种程序和信息。处理装置1001、ROM 1002以及RAM 1003通过总线1004彼此相连。输入/输出(I/O)接口1005也连接至总线1004。
通常,以下装置可以连接至I/O接口1005:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置1006;包括例如液晶显示器(LCD)、扬声器、振动器等的输出装置1007;包括例如磁带、硬盘等的存储装置1008;以及通信装置1009。通信装置1009可以允许电子设备1000与其他设备进行无线或有线通信以交换信息。虽然图8示出了具有各种装置的电子设备1000,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在非暂态计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码,从而实现如上所述的图像处理方法。在这样的实施例中,该计算机程序可以通过通信装置1009从网络上被下载和安装,或者从存储装置1008被安装,或者从ROM 1002被安装。在该计算机程序被处理装置1001执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的信息信号,其中承载了计算机可读的程序代码。这种传播的信息信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
在一些实施方式中,客户端、服务器可以利用诸如HTTP(HyperText Transfer Protocol,超文本传输协议)之类的任何已知或未来研发的网络协议进行通信,并且可以与任意形式或介质的数字信息通信(例如,通信网络)互连。通信网络的示例包括局域网(“LAN”),广域网(“WAN”),网际网(例如,互联网)以及端对端网络(例如,ad hoc端对端网络),以及任何已知或未来研发的网络。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备:获取目标图像;在所述目标图像中确定光斑添加区域;在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
可选的,当上述一个或者多个程序被该电子设备执行时,该电子设备还可以执行上述实施例所述的其他步骤。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括但不限于面向对象的程序设计语言-诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言-诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)-连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
根据本公开的一个或多个实施例,本公开提供了一种电子设备,包括:一个或多个处理器;存储器,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本公开提供的任一所述的图像处理方法。
根据本公开的一个或多个实施例,本公开提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本公开提供的任一所述的图像处理方法。
本公开实施例还提供了一种计算机程序产品,该计算机程序产品包括计算机程序或指令,该计算机程序或指令被处理器执行时实现如上所述的图像处理方法。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文所述的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (14)

  1. 一种图像处理方法,包括:
    获取目标图像;
    在所述目标图像中确定光斑添加区域;
    在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
  2. 根据权利要求1所述的方法,其中所述光斑添加区域包括第一类光斑添加区域和第二类光斑添加区域;
    在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像,包括:
    在所述目标图像的所述第一类光斑添加区域中添加第一类光斑图案,得到第一图像;
    在所述第一图像的所述第二类光斑添加区域中添加第二类光斑图案,得到处理后的图像。
  3. 根据权利要求2所述的方法,其中所述在所述目标图像的所述第一类光斑添加区域中添加第一类光斑图案,得到第一图像包括:
    对所述目标图像的所述第一类光斑添加区域中的图像进行边缘检测,得到边缘轮廓图像;
    对所述边缘轮廓图像进行连通域检测,得到连通域;
    在所述连通域中添加第一类光斑图案,得到第一图像。
  4. 根据权利要求3所述的方法,其中所述在所述连通域中添加第一类光斑图案,得到第一图像,包括:
    确定所述连通域的中心点位置;
    基于所述连通域的中心点位置,确定目标区域,所述目标区域的中心点与所述连通域的中心点重合;
    在所述目标区域中添加第一类光斑图案,得到第一图像。
  5. 根据权利要求2所述的方法,其中在所述目标图像中确定所述第一类光斑添加区域,包括:
    基于所述目标图像中像素点的亮度值,在所述目标图像中确定第一类光斑添加区域,所述第一类光斑添加区域中像素点的亮度值大于第二设定亮度阈值。
  6. 根据权利要求2所述的方法,其中所述在所述第一图像的所述第二类光斑添加区域中添加第二类光斑图案,得到处理后的图像,包括:
    对时序变化的预设梯度噪声图像进行动态采样,得到采样结果;
    基于所述采样结果,在所述第一图像的第二类光斑添加区域添加所述第二类光斑图案,得到中间处理图像;
    对所述中间处理图像中的第二类光斑添加区域进行模糊处理,得到处理后的图像。
  7. 根据权利要求2所述的方法,其中在所述目标图像中确定所述第二类光斑添加区域,包括:
    对所述目标图像进行平滑滤波,得到第三图像;
    基于所述第三图像和所述目标图像,在所述目标图像中确定第二类光斑添加区域。
  8. 根据权利要求6所述的方法,其中若所述目标图像包括目标对象;所述基于所述采样结果,在所述第一图像的第二类光斑添加区域添加所述第二类光斑图案,得到中间处理图像,包括:
    基于所述目标对象在所述目标图像中的位置信息,得到目标掩膜;
    基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到中间处理图像。
  9. 根据权利要求8所述的方法,其中所述基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到中间处理图像,包括:
    基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中所述目标掩膜指示的区域中添加所述第二类光斑图案,得到中间处理图像。
  10. 根据权利要求8所述的方法,其中所述基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到中间处理图像,包括:
    基于所述目标掩膜,在所述第一图像的第二类光斑添加区域中添加所述第二类光斑图案,得到第二图像;
    将所述第二图像中所述目标掩膜指示的区域中的闪光点的亮度值调整为第三亮度值。
  11. 一种图像处理装置,包括:
    获取模块,用于获取目标图像;
    确定模块,用于在所述目标图像中确定光斑添加区域;
    处理模块,用于在所述目标图像的所述光斑添加区域中添加光斑图案,得到处理后的图像;所述光斑图案包括第一类光斑图案和第二类光斑图案;所述第一类光斑图案的形状为预设图形,所述第二类光斑图案为分散的闪光点,所述第一类光斑图案和所述第二类光斑图案中像素点的亮度值大于或等于第一设定亮度阈值;所述第二类光斑图案位于所述第一类光斑图案的上层。
  12. 一种电子设备,所述电子设备包括:
    一个或多个处理器;
    存储装置,用于存储一个或多个程序;
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-10中任一项所述的方法。
  13. 一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如权利要求1-10中任一项所述的方法。
  14. 一种计算机程序产品,所述计算机程序产品被有形地存储在计算机存储介质中并且包括计算机可执行指令,计算机可执行指令在由设备执行时使设备执行根据权利要求1-10中任一项所述的方法。
PCT/CN2024/137957 2024-01-10 2024-12-09 图像处理方法、装置、电子设备以及存储介质 Pending WO2025148591A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410039504.8 2024-01-10
CN202410039504.8A CN120298258A (zh) 2024-01-10 2024-01-10 图像处理方法、装置、电子设备以及存储介质

Publications (1)

Publication Number Publication Date
WO2025148591A1 true WO2025148591A1 (zh) 2025-07-17

Family

ID=96282050

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2024/137957 Pending WO2025148591A1 (zh) 2024-01-10 2024-12-09 图像处理方法、装置、电子设备以及存储介质

Country Status (2)

Country Link
CN (1) CN120298258A (zh)
WO (1) WO2025148591A1 (zh)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106504220A (zh) * 2016-08-19 2017-03-15 华为机器有限公司 一种图像处理方法及装置
CN112561777A (zh) * 2019-09-25 2021-03-26 北京迈格威科技有限公司 图像添加光斑的方法及装置
CN114240742A (zh) * 2021-12-17 2022-03-25 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质
CN114758054A (zh) * 2022-02-23 2022-07-15 维沃移动通信有限公司 光斑添加方法、装置、设备及存储介质
CN117274041A (zh) * 2023-10-10 2023-12-22 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106504220A (zh) * 2016-08-19 2017-03-15 华为机器有限公司 一种图像处理方法及装置
CN112561777A (zh) * 2019-09-25 2021-03-26 北京迈格威科技有限公司 图像添加光斑的方法及装置
CN114240742A (zh) * 2021-12-17 2022-03-25 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质
CN114758054A (zh) * 2022-02-23 2022-07-15 维沃移动通信有限公司 光斑添加方法、装置、设备及存储介质
CN117274041A (zh) * 2023-10-10 2023-12-22 北京字跳网络技术有限公司 图像处理方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN120298258A (zh) 2025-07-11

Similar Documents

Publication Publication Date Title
CN110865862B (zh) 一种页面背景设置方法、装置及电子设备
CN111243049A (zh) 人脸图像的处理方法、装置、可读介质和电子设备
CN116578226A (zh) 图像处理方法、装置、设备、存储介质和程序产品
WO2024037556A1 (zh) 图像处理方法、装置、设备及存储介质
WO2024041637A1 (zh) 特效图生成方法、装置、设备及存储介质
WO2024016923A9 (zh) 特效图的生成方法、装置、设备及存储介质
CN114489910A (zh) 一种视频会议数据显示方法、装置、设备及介质
WO2024120223A1 (zh) 图像处理方法、装置、设备、存储介质及计算机程序产品
WO2025189959A1 (zh) 图像处理方法、装置、介质、程序产品及电子设备
WO2025011490A1 (zh) 视频特效添加方法、装置、设备、存储介质和程序产品
WO2024131563A1 (zh) 特效展示方法、装置、设备及存储介质
CN111292245B (zh) 图像处理方法和装置
WO2025067334A1 (zh) 特效添加方法、装置、电子设备以及存储介质
CN114820878B (zh) 图像编辑方法及设备
WO2025148591A1 (zh) 图像处理方法、装置、电子设备以及存储介质
WO2025113515A1 (zh) 一种增强现实方法、装置、电子设备及存储介质
CN118096936A (zh) 图像处理方法、装置、电子设备以及存储介质
WO2024051541A1 (zh) 特效图像生成方法、装置、电子设备及存储介质
CN118822864A (zh) 一种图像处理方法、装置、电子设备及存储介质
CN115801975B (zh) 视频处理方法、装置、设备及介质
CN117241061A (zh) 视频处理方法、装置、设备、计算机可读存储介质及产品
CN117234650A (zh) 图像展示方法、装置、存储介质以及电子设备
CN111200705B (zh) 图像处理方法和装置
JP2024506828A (ja) 画像輝度の調整方法、装置、電子機器及び媒体
CN111199519B (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: 24916638

Country of ref document: EP

Kind code of ref document: A1