CN109240572B - A method for acquiring pictures, and a method and device for processing pictures - Google Patents
A method for acquiring pictures, and a method and device for processing pictures Download PDFInfo
- Publication number
- CN109240572B CN109240572B CN201810806509.3A CN201810806509A CN109240572B CN 109240572 B CN109240572 B CN 109240572B CN 201810806509 A CN201810806509 A CN 201810806509A CN 109240572 B CN109240572 B CN 109240572B
- Authority
- CN
- China
- Prior art keywords
- picture
- pixel
- line
- image
- value
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G5/00—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators
- G09G5/02—Control arrangements or circuits for visual indicators common to cathode-ray tube indicators and other visual indicators characterised by the way in which colour is displayed
- G09G5/026—Control of mixing and/or overlay of colours in general
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/14—Digital output to display device ; Cooperation and interconnection of the display device with other functional units
- G06F3/147—Digital output to display device ; Cooperation and interconnection of the display device with other functional units using display panels
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04847—Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/03—Arrangements for converting the position or the displacement of a member into a coded form
- G06F3/041—Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means
- G06F3/0414—Digitisers, e.g. for touch screens or touch pads, characterised by the transducing means using force sensing means to determine a position
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0481—Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04842—Selection of displayed objects or displayed text elements
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0484—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
- G06F3/04845—Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/01—Input arrangements or combined input and output arrangements for interaction between user and computer
- G06F3/048—Interaction techniques based on graphical user interfaces [GUI]
- G06F3/0487—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser
- G06F3/0488—Interaction techniques based on graphical user interfaces [GUI] using specific features provided by the input device, e.g. functions controlled by the rotation of a mouse with dual sensing arrangements, or of the nature of the input device, e.g. tap gestures based on pressure sensed by a digitiser using a touch-screen or digitiser, e.g. input of commands through traced gestures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/18—Image warping, e.g. rearranging pixels individually
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T3/00—Geometric image transformations in the plane of the image
- G06T3/20—Linear translation of whole images or parts thereof, e.g. panning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/13—Edge detection
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M1/00—Substation equipment, e.g. for use by subscribers
- H04M1/72—Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
- H04M1/724—User interfaces specially adapted for cordless or mobile telephones
- H04M1/72403—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
- H04M1/72427—User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality for supporting games or graphical animations
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2320/00—Control of display operating conditions
- G09G2320/04—Maintaining the quality of display appearance
- G09G2320/041—Temperature compensation
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2320/00—Control of display operating conditions
- G09G2320/06—Adjustment of display parameters
- G09G2320/0686—Adjustment of display parameters with two or more screen areas displaying information with different brightness or colours
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2330/00—Aspects of power supply; Aspects of display protection and defect management
- G09G2330/02—Details of power systems and of start or stop of display operation
- G09G2330/021—Power management, e.g. power saving
- G09G2330/022—Power management, e.g. power saving in absence of operation, e.g. no data being entered during a predetermined time
-
- G—PHYSICS
- G09—EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
- G09G—ARRANGEMENTS OR CIRCUITS FOR CONTROL OF INDICATING DEVICES USING STATIC MEANS TO PRESENT VARIABLE INFORMATION
- G09G2354/00—Aspects of interface with display user
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04M—TELEPHONIC COMMUNICATION
- H04M2250/00—Details of telephonic subscriber devices
- H04M2250/52—Details of telephonic subscriber devices including functional features of a camera
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Computer Hardware Design (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- User Interface Of Digital Computer (AREA)
- Image Processing (AREA)
- Image Analysis (AREA)
Abstract
本申请公开了一种获取图片的方法、对图片进行处理的方法及装置,属于通信领域。所述方法包括:获取第一图片对应的灰度图像和第一图像,所述第一图片的尺寸等于所述第一图像的尺寸,所述第一图像包括相互平行的N条线条,相邻两线条之间的间隔不超过间隔阈值,N为大于1的整数;根据所述灰度图像对所述第一图像中的各线条包括的像素点进行平移得到第二图像,所述第二图像中包括所述第一图片中的图像的轮廓;在所述第二图像中设置所述各线条包括的各像素点的像素值得到第二图片。本申请能够避免目前显示预设图片所带来的千篇一律,过于单一的问题。
The present application discloses a method for acquiring a picture, a method and a device for processing the picture, and belongs to the field of communication. The method includes: acquiring a grayscale image and a first image corresponding to a first picture, the size of the first picture is equal to the size of the first image, and the first image includes N lines parallel to each other, adjacent to each other. The interval between the two lines does not exceed the interval threshold, and N is an integer greater than 1; according to the grayscale image, the pixels included in each line in the first image are translated to obtain a second image, the second image including the outline of the image in the first picture; setting the pixel value of each pixel included in the line in the second image to obtain the second picture. The present application can avoid the monotony and too single problem caused by the current display of preset pictures.
Description
技术领域technical field
本申请涉及通信领域,特别涉及一种获取图片的方法、对图片进行处理的方法及装置。The present application relates to the field of communications, and in particular, to a method for acquiring pictures, and a method and apparatus for processing pictures.
背景技术Background technique
手机、穿戴设备和平板电脑等移动终端的屏幕在不使用时一般会进入熄灭状态。为了增加美观,在移动终端进入熄灭状态后,可以在移动终端的屏幕上显示预设图片。The screens of mobile terminals such as mobile phones, wearable devices, and tablet computers generally turn off when not in use. In order to increase the appearance, after the mobile terminal enters the off state, a preset picture may be displayed on the screen of the mobile terminal.
例如,可以在移动终端中事先存储用于表示天气的预设图片,在检测到移动终端进入熄灭状态后,可以获取移动终端中事先存储的该预设图案,然后在移动终端的屏幕上显示该预设图案。For example, a preset picture used to represent the weather may be stored in the mobile terminal in advance, and after it is detected that the mobile terminal has entered an off state, the preset pattern stored in advance in the mobile terminal may be acquired, and then displayed on the screen of the mobile terminal. Preset patterns.
在实现本申请的过程中,发明人发现现有技术至少存在以下问题:In the process of realizing this application, the inventor found that the prior art has at least the following problems:
目前移动终端在进入熄灭状态后,获取移动终端中存储的预设图片并显示该预设图片,这样在各移动终端上显示的预设图片千篇一律,过于单一。At present, after the mobile terminal enters the off state, it acquires a preset picture stored in the mobile terminal and displays the preset picture, so that the preset pictures displayed on each mobile terminal are the same, which is too singular.
发明内容SUMMARY OF THE INVENTION
为了解决在进入熄灭状态显示图片千篇一律,过于单一问题,本申请实施例提供了一种获取图片的方法、对图片进行处理的方法及装置。所述技术方案如下:In order to solve the problem that the displayed pictures are the same and too single in the off state, the embodiments of the present application provide a method for acquiring a picture, a method and an apparatus for processing the picture. The technical solution is as follows:
第一方面,本申请实施例提供了一种获取图片的方法,所述方法获取第一图片对应的灰度图像和第一图像,所述第一图片的尺寸等于所述第一图像的尺寸,所述第一图像包括相互平行的N条线条,相邻两线条之间的间隔不超过间隔阈值,N为大于1的整数;根据所述灰度图像对所述第一图像中的各线条包括的像素点进行平移得到第二图像,所述第二图像中包括所述第一图片中的图像的轮廓;在所述第二图像中设置所述各线条包括的各像素点的像素值得到第二图片。这样获取的第二图片可以用于在终端进入熄灭模式后显示,由于进入熄灭模式后,基于原始的第一图片生成第二图片,可以实现在不同终端上获取用于在熄灭模式下显示的不同图片,避免目前显示预设图片所带来的千篇一律,过于单一的问题。In a first aspect, an embodiment of the present application provides a method for obtaining a picture, the method obtains a grayscale image and a first image corresponding to a first picture, and the size of the first picture is equal to the size of the first image, The first image includes N lines that are parallel to each other, the interval between two adjacent lines does not exceed an interval threshold, and N is an integer greater than 1; according to the grayscale image, each line in the first image includes: The second image is obtained by translating the pixel points of the first picture, and the second image includes the outline of the image in the first picture; the pixel value of each pixel point included in the lines is set in the second image to obtain the first image. Two pictures. The second picture obtained in this way can be used for display after the terminal enters the extinguishing mode. Since the second picture is generated based on the original first picture after entering the extinguishing mode, different images for displaying in the extinguishing mode can be obtained on different terminals. pictures, to avoid the monotony and too single problem caused by the current display of preset pictures.
在第一方面的一种可能的实现方式中,将所述第一图像中的各线条变换成弯曲线条,得到第三图像;根据所述灰度图像对所述第三图像中的各线条包括的像素点进行平移,得到第二图像。由于灰度图像中包括第一图片的图像信息,因此使得平移后得到的第二图像中包括所述第一图片中的图像的轮廓。In a possible implementation manner of the first aspect, each line in the first image is transformed into a curved line to obtain a third image; according to the grayscale image, each line in the third image includes: The pixels are translated to obtain the second image. Since the grayscale image includes the image information of the first picture, the second image obtained after translation includes the outline of the image in the first picture.
在第一方面的一种可能的实现方式中,根据第一线条包括的像素点的位置,通过随机函数获取所述第一线条包括的像素点的随机值,所述第一线条为所述第一图像中的任一条线条;根据所述第一线条包括的像素点的随机值和所述第一线条与第二线条之间的间隔,获取所述第一线条包括的像素点的第一偏移值,所述第二线条是所述第一线条的一条相邻线条;根据所述第一线条包括的像素点的第一偏移值,分别平移所述第一线条包括的像素点,得到弯曲线条。通过随机函数获取第一线条包括的每个像素点的第一偏移值,每个像素点的第一偏移值不同,基于每个像素点的第一偏移值可以将第一线条变换为弯曲线条。In a possible implementation manner of the first aspect, random values of the pixels included in the first line are obtained by using a random function according to the positions of the pixels included in the first line, where the first line is the first line. Any line in an image; according to the random value of the pixels included in the first line and the interval between the first line and the second line, obtain the first offset of the pixels included in the first line The second line is an adjacent line of the first line; according to the first offset value of the pixel points included in the first line, the pixels included in the first line are respectively translated to obtain Curved lines. The first offset value of each pixel included in the first line is obtained through a random function. The first offset value of each pixel is different. Based on the first offset value of each pixel, the first line can be transformed into Curved lines.
在第一方面的一种可能的实现方式中,根据第三线条包括的像素点的位置,从所述灰度图像中获取所述第三线条包括的像素点的灰度值,所述第三线条是所述第三图像中的任一条线条;根据所述第三线条包括的像素点的灰度值,获取所述第三线条包括的像素点的第二偏移值;根据所述第三线条包括的像素点的第二偏移值,分别平移所述第三线条包括的像素点。由于灰度图像中包括第一图片的图像信息,因此使得平移后得到的第二图像中包括所述第一图片中的图像的轮廓。In a possible implementation manner of the first aspect, the grayscale value of the pixel included in the third line is obtained from the grayscale image according to the position of the pixel included in the third line, and the third line The line is any line in the third image; according to the gray value of the pixel point included in the third line, the second offset value of the pixel point included in the third line is obtained; according to the third line The second offset value of the pixel points included in the line, respectively translates the pixel points included in the third line. Since the grayscale image includes the image information of the first picture, the second image obtained after translation includes the outline of the image in the first picture.
在第一方面的一种可能的实现方式中,根据目标像素点的目标位置,从所述第一图片中获取目标图像区域,所述目标像素点为所述第二图像中的任一条线条包括的一个像素点,所述目标图像区域的中心像素点的位置为所述目标位置,所述目标图像区域的半径为第一半径阈值;根据所述目标图像区域中的各像素点的像素值计算目标像素值;将所述目标像素点的像素值设置为所述目标像素值。由于目标像素值是根据目标图像区域中的像素点的像素值得到的,所以给第二图像中的像素点设置像素值后得到的第二图片比第一图片更加抽象,更加具有艺术性。In a possible implementation manner of the first aspect, the target image area is obtained from the first picture according to the target position of the target pixel, where the target pixel is any line in the second image including , the position of the center pixel of the target image area is the target position, and the radius of the target image area is the first radius threshold; according to the pixel value of each pixel in the target image area, calculate target pixel value; set the pixel value of the target pixel point as the target pixel value. Since the target pixel value is obtained according to the pixel value of the pixel point in the target image area, the second picture obtained by setting the pixel value for the pixel point in the second image is more abstract and artistic than the first picture.
在第一方面的一种可能的实现方式中,获取当前环境的环境因素信息,所述环境因素信息包括地理环境类型、温度信息和时间信息中的至少一者;根据所述当前环境的环境因素信息,从环境因素信息与环境颜色像素值的对应关系中获取所述当前环境对应的环境颜色像素值;将所述第二图像中的所述各线条包括的各像素点的像素值设置为所述当前环境对应的环境颜色像素值,得到第二图片。这样第二图片中的图像颜色与当前环境相适应,提高了第二图片的显示效果。In a possible implementation manner of the first aspect, environmental factor information of the current environment is obtained, where the environmental factor information includes at least one of geographic environment type, temperature information and time information; according to the environmental factor of the current environment information, obtain the environmental color pixel value corresponding to the current environment from the corresponding relationship between the environmental factor information and the environmental color pixel value; set the pixel value of each pixel included in the lines in the second image to be The pixel value of the environment color corresponding to the current environment is obtained to obtain the second picture. In this way, the color of the image in the second picture is adapted to the current environment, which improves the display effect of the second picture.
在第一方面的一种可能的实现方式中,在终端屏幕中显示所述第二图片;或者,在所述第二图片上叠加渐变遮罩以得到第三图片,在终端屏幕中显示所述第三图片,所述渐变遮罩包括显示区域和非显示区域,所述非显示区域的透明度小于透明度阈值,所述显示区域的中心位置为所述终端屏幕的预设位置,所述显示区域的半径为第二半径阈值,所述显示区域的透明度大于或等于所述透明度阈值且所述显示区域中离所述中心位置越远的区域的透明度越小。通过渐变遮罩可以实现渐变显示,可以提高显示第三图片的显示效果。In a possible implementation manner of the first aspect, the second picture is displayed on the screen of the terminal; or, a gradient mask is superimposed on the second picture to obtain a third picture, and the screen of the terminal is displayed. In the third picture, the gradient mask includes a display area and a non-display area, the transparency of the non-display area is less than a transparency threshold, the center position of the display area is the preset position of the terminal screen, and the center position of the display area is the preset position of the terminal screen. The radius is a second radius threshold, the transparency of the display area is greater than or equal to the transparency threshold, and the transparency of the display area is smaller as the area farther from the center position is. Gradient display can be achieved through the gradient mask, which can improve the display effect of displaying the third picture.
在第一方面的一种可能的实现方式中,获取触摸所述终端屏幕的触摸参数,所述触摸参数包括触摸点位置、触摸面积和按压所述终端屏幕的压力中的至少一个;根据所述触摸参数,执行用于调整所述第三图片显示效果的操作。这样可以在用户触摸终端屏幕时动态改变显示第三图片的效果,实现调整第三图片的显示效果,提高了用户体验。In a possible implementation manner of the first aspect, a touch parameter for touching the terminal screen is acquired, where the touch parameter includes at least one of a touch point position, a touch area, and a pressure for pressing the terminal screen; according to the Touch the parameter to perform an operation for adjusting the display effect of the third picture. In this way, the effect of displaying the third picture can be dynamically changed when the user touches the screen of the terminal, so that the display effect of the third picture can be adjusted, and the user experience can be improved.
在第一方面的一种可能的实现方式中,在所述触摸参数包括触摸点位置时,从所述第三图片中的各线条包括的像素点中获取第一像素点集合和第二像素点集合,所述第一像素点集合包括与所述触摸点位置之间的距离小于或等于第一距离阈值的第一像素点,所述第二像素点集合包括与所述触摸点位置之间的距离大于所述第一距离阈值的第二像素点;获取所述第一像素点集合中的每个第一像素点的第三偏移值和所述第二像素点集合中的每个第二像素点的第四偏移值,所述每个第一像素点的第三偏移值均大于所述每个第二像素点的第四偏移值或者所述每个第一像素点的第三偏移值均小于所述每个第二像素点的第四偏移值;根据所述每个第一像素点的第三偏移值和所述每个第一像素点与所述触摸点位置之间的相对位置,分别平移所述每个第一像素点,以及,根据所述每个第二像素点的第四偏移值和所述每个第二像素点与所述触摸点位置之间的相对位置,分别平移所述每个第二像素点。这样在用户触摸第三图片时,可以使第三图片中的线条向靠近触摸点位置移动或向远离触摸点位置移动。In a possible implementation manner of the first aspect, when the touch parameter includes the position of the touch point, the first pixel point set and the second pixel point are obtained from the pixel points included in each line in the third picture set, the first set of pixels includes a first pixel whose distance from the position of the touch point is less than or equal to a first distance threshold, and the second set of pixels includes a distance between the set of pixels and the position of the touch point a second pixel whose distance is greater than the first distance threshold; obtain a third offset value of each first pixel in the first pixel set and each second pixel in the second pixel set The fourth offset value of the pixel point, the third offset value of each first pixel point is greater than the fourth offset value of each second pixel point or the third offset value of each first pixel point. The three offset values are all smaller than the fourth offset value of each second pixel point; according to the third offset value of each first pixel point and the touch point of each first pixel point and the touch point The relative position between the positions, respectively translate each first pixel point, and, according to the fourth offset value of each second pixel point and the position of each second pixel point and the touch point The relative positions between, respectively translate each of the second pixel points. In this way, when the user touches the third picture, the line in the third picture can be moved closer to the position of the touch point or moved away from the position of the touch point.
在第一方面的一种可能的实现方式中,在所述触摸参数包括触摸点位置时,获取所述第三图片中的各线条包括的像素点与所述触摸点位置之间的距离;根据所述第三图片中的各线条包括的像素点与所述触摸点位置之间的距离,获取所述第三图片中的各线条包括的像素点的第一亮度调整值;根据所述第三图片中的各线条包括的像素点的第一亮度调整值,调整显示所述第三图片中的各线条包括的像素点的亮度。这样可以实现将距离用户触摸点位置较近的像素点以较高的亮度进行显示。In a possible implementation manner of the first aspect, when the touch parameter includes the position of the touch point, obtain the distance between the pixel point included in each line in the third picture and the position of the touch point; according to the distance between the pixel points included in each line in the third picture and the position of the touch point, obtain the first brightness adjustment value of the pixel points included in each line in the third picture; according to the third picture The first brightness adjustment value of the pixels included in the lines in the picture is adjusted to display the brightness of the pixels included in the lines in the third picture. In this way, pixels that are closer to the user's touch point can be displayed with higher brightness.
在第一方面的一种可能的实现方式中,在所述触摸参数包括按压所述终端屏幕的压力时,根据按压所述终端屏幕的压力获取第二亮度调整值,并根据所述第二亮度调整值,调整显示所述第三图片中的各线条包括的像素点的亮度;和/或,在所述触摸参数包括触摸面积时,根据所述触摸面积获取所述渐变遮罩包括的显示区域的半径,根据所述半径调整所述渐变遮罩包括的显示区域的面积。这样可以实现在用户在按压终端屏幕时,可以改变显示图片的亮度和/或渐变遮罩包括的显示区域的面积,提高显示效果。In a possible implementation manner of the first aspect, when the touch parameter includes the pressure of pressing the terminal screen, a second brightness adjustment value is obtained according to the pressure of pressing the terminal screen, and the second brightness adjustment value is obtained according to the pressure of pressing the terminal screen. adjusting the value to adjust the brightness of the pixels included in the display lines in the third picture; and/or, when the touch parameter includes a touch area, obtain the display area included in the gradient mask according to the touch area , and adjust the area of the display area included in the gradient mask according to the radius. In this way, when the user presses the screen of the terminal, the brightness of the displayed picture and/or the area of the display area included in the gradient mask can be changed, thereby improving the display effect.
在第一方面的一种可能的实现方式中,获取所述终端中的至少一个传感器采集的数据,根据所述采集的数据获取第三亮度调整值,根据所述第三亮度调整值调整显示所述第三图片中的各线条包括的像素点的亮度;或者,获取穿戴设备采集的用户体征数据,根据所述用户体征数据获取第四亮度调整值,根据所述第四亮度调整值调整显示所述第三图片中的各线条包括的像素点的亮度。这样可以实现基于传感器采集的数据或用户体征数据改变显示图片的亮度,提高显示效果。In a possible implementation manner of the first aspect, data collected by at least one sensor in the terminal is obtained, a third brightness adjustment value is obtained according to the collected data, and the display device is adjusted according to the third brightness adjustment value. the brightness of the pixels included in the lines in the third picture; or, obtain the user sign data collected by the wearable device, obtain a fourth brightness adjustment value according to the user sign data, and adjust the display according to the fourth brightness adjustment value. the brightness of the pixels included in each line in the third picture. In this way, the brightness of the displayed picture can be changed based on the data collected by the sensor or the user's sign data, and the display effect can be improved.
在第一方面的一种可能的实现方式中,在显示所述第三图片的时间长度达到时长阈值时,获取所述终端的前置摄像头拍摄的第四图片;当所述第四图片中包括人眼图像时,在第一时间段内显示所述第三图片,所述第一时间段为离当前最近且时长为预设时长的时间段。当显示时间长度达到时长阈值时,如果所述第四图片中包括人眼图像,表示用户正在观看终端屏幕,继续显示可以提高用户体验。In a possible implementation manner of the first aspect, when the duration of displaying the third picture reaches a duration threshold, a fourth picture captured by the front camera of the terminal is acquired; when the fourth picture includes In the case of a human eye image, the third picture is displayed in a first time period, and the first time period is a time period closest to the current time and the duration is a preset duration. When the display time length reaches the time length threshold, if the fourth picture includes a human eye image, it means that the user is watching the terminal screen, and continuing to display can improve user experience.
在第一方面的一种可能的实现方式中,当所述第四图片中不包括人眼图像且检测到所述终端被用户操作或所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第二距离阈值时,在所述第一时间段内显示所述第三图片。当检测到所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第二距离阈值时,表示用户靠近终端,在用户靠近终端或操作终端时,用户可能会观看终端屏幕,所以显示第三图片,可以提高用户体验。In a possible implementation manner of the first aspect, when the fourth picture does not include a human eye image and it is detected that the terminal is operated by the user or that there is a gap between an obstacle in front of the terminal screen and the terminal screen When the distance is less than the second distance threshold, the third picture is displayed within the first time period. When it is detected that the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, it means that the user is approaching the terminal. When the user approaches the terminal or operates the terminal, the user may watch the terminal screen, so the display The third picture can improve the user experience.
在第一方面的一种可能的实现方式中,检测到所述终端被用户操作且进入熄灭模式时,在所述终端屏幕中显示所述第三图片;或者,检测到所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第一距离阈值且进入熄灭模式时,在所述终端屏幕中显示所述第三图片。用户操作终端时可能会观看终端屏幕,或者当检测到所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第二距离阈值时,表示用户靠近终端,在用户靠近终端或操作终端时,用户可能会观看终端屏幕,所以显示第三图片,可以提高用户体验。In a possible implementation manner of the first aspect, when it is detected that the terminal is operated by a user and enters an off mode, the third picture is displayed on the screen of the terminal; or, it is detected that a picture in front of the screen of the terminal is detected The third picture is displayed on the terminal screen when the distance between the obstacle and the terminal screen is less than the first distance threshold and the power-off mode is entered. The user may watch the terminal screen when operating the terminal, or when it is detected that the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, it means that the user is approaching the terminal, and when the user approaches the terminal or operates the terminal , the user may watch the terminal screen, so the third picture is displayed, which can improve the user experience.
第二方面,本申请实施例提供了一种对图片进行处理的方法,所述方法显示目标图片,所述目标图片包括基于线条生成的图像的轮廓;获取触摸所述终端屏幕的触摸参数,所述触摸参数包括触摸点位置、触摸面积和按压所述终端屏幕的压力中的至少一个;根据所述触摸参数,执行用于调整所述目标图片显示效果的操作。这样可以在用户触摸终端屏幕时动态改变显示目标图片的效果,实现调整目标图片的显示效果,提高了用户体验。其中,目标图片的生成方法可以参考第一方面及各种实现方式中所揭示的获取包括轮廓的图片(如第二图片)的方法。In a second aspect, an embodiment of the present application provides a method for processing a picture, the method displays a target picture, and the target picture includes an outline of an image generated based on a line; acquires touch parameters for touching the screen of the terminal, and the The touch parameter includes at least one of a touch point position, a touch area and a pressure for pressing the terminal screen; an operation for adjusting the display effect of the target picture is performed according to the touch parameter. In this way, the effect of displaying the target picture can be dynamically changed when the user touches the screen of the terminal, so that the display effect of the target picture can be adjusted, and the user experience can be improved. For the method for generating the target picture, reference may be made to the method for obtaining a picture including an outline (eg, the second picture) disclosed in the first aspect and various implementation manners.
在第二方面的一种可能的实现方式中,在所述触摸参数包括触摸点位置时,从所述目标图片中的各线条包括的像素点中获取第一像素点集合和第二像素点集合,所述第一像素点集合包括与所述触摸点位置之间的距离小于或等于第一距离阈值的第一像素点,所述第二像素点集合包括与所述触摸点位置之间的距离大于所述第一距离阈值的第二像素点;获取所述第一像素点集合中的每个第一像素点的第一偏移值和所述第二像素点集合中的每个第二像素点的第二偏移值,所述每个第一像素点的第一偏移值均大于所述每个第二像素点的第二偏移值或者所述每个第一像素点的第一偏移值均小于所述每个第二像素点的第二偏移值;根据所述每个第一像素点的第一偏移值和所述每个第一像素点与所述触摸点位置之间的相对位置,分别平移所述每个第一像素点,以及,根据所述每个第二像素点的第二偏移值和所述每个第二像素点与所述触摸点位置之间的相对位置,分别平移所述每个第二像素点。这样在用户触摸目标图片时,可以使目标图片中的线条向靠近触摸点位置移动或向远离触摸点位置移动。In a possible implementation manner of the second aspect, when the touch parameter includes the position of the touch point, a first set of pixels and a second set of pixels are obtained from the pixels included in each line in the target image , the first pixel point set includes a first pixel point whose distance from the touch point position is less than or equal to a first distance threshold, and the second pixel point set includes a distance from the touch point position A second pixel point greater than the first distance threshold; obtaining the first offset value of each first pixel point in the first pixel point set and each second pixel in the second pixel point set The second offset value of the point, the first offset value of each first pixel point is greater than the second offset value of each second pixel point or the first offset value of each first pixel point The offset value is smaller than the second offset value of each second pixel point; according to the first offset value of each first pixel point and the position of each first pixel point and the touch point The relative position between each of the first pixel points is translated respectively, and, according to the second offset value of each second pixel point and the difference between the each second pixel point and the touch point position The relative positions between the two pixels are respectively translated. In this way, when the user touches the target picture, the line in the target picture can be moved to a position close to the touch point or to a position far away from the touch point.
在第二方面的一种可能的实现方式中,在所述触摸参数包括触摸点位置时,获取所述目标图片中的各线条包括的像素点与所述触摸点位置之间的距离;根据所述目标图片中的各线条包括的像素点与所述触摸点位置之间的距离,获取所述目标图片中的各线条包括的像素点的第一亮度调整值;根据所述目标图片中的各线条包括的像素点的第一亮度调整值,调整显示所述目标图片中的各线条包括的像素点的亮度。这样可以实现将距离用户触摸点位置较近的像素点以较高的亮度进行显示。In a possible implementation manner of the second aspect, when the touch parameter includes the position of the touch point, the distance between the pixel points included in each line in the target picture and the position of the touch point is obtained; The distance between the pixels included in the lines in the target picture and the position of the touch point is obtained, and the first brightness adjustment value of the pixels included in the lines in the target picture is obtained; The first brightness adjustment value of the pixels included in the lines adjusts and displays the brightness of the pixels included in the lines in the target picture. In this way, pixels that are closer to the user's touch point can be displayed with higher brightness.
在第二方面的一种可能的实现方式中,在所述触摸参数包括按压所述终端屏幕的压力时,根据按压所述终端屏幕的压力获取第二亮度调整值,并根据所述第二亮度调整值,调整显示所述目标图片中的各线条包括的像素点的亮度。这样可以实现在用户在按压终端屏幕时,可以改变显示图片的亮度,提高显示效果。In a possible implementation manner of the second aspect, when the touch parameter includes the pressure of pressing the terminal screen, a second brightness adjustment value is obtained according to the pressure of pressing the terminal screen, and the second brightness adjustment value is obtained according to the pressure of pressing the terminal screen. The adjustment value is used to adjust the brightness of the pixels included in each line in the target image. In this way, when the user presses the screen of the terminal, the brightness of the displayed picture can be changed, and the display effect can be improved.
在第二方面的一种可能的实现方式中,在所述目标图片上叠加渐变遮罩,所述渐变遮罩包括显示区域和非显示区域,所述非显示区域的透明度小于透明度阈值以得到第三图片,显示所述第三图片,所述显示区域的中心位置为所述终端屏幕的预设位置,所述显示区域的半径为第二半径阈值,所述显示区域的透明度大于或等于所述透明度阈值且所述显示区域中离所述中心位置越远的区域的透明度越小。通过渐变遮罩可以实现渐变显示,可以提高显示图片的显示效果。In a possible implementation manner of the second aspect, a gradient mask is superimposed on the target image, the gradient mask includes a display area and a non-display area, and the transparency of the non-display area is less than a transparency threshold to obtain the first Three pictures, the third picture is displayed, the center position of the display area is the preset position of the terminal screen, the radius of the display area is the second radius threshold, and the transparency of the display area is greater than or equal to the Transparency threshold and the further away from the center position in the display area, the less transparency. Gradient display can be achieved through the gradient mask, which can improve the display effect of the displayed picture.
在第二方面的一种可能的实现方式中,在所述触摸参数包括触摸面积时,根据所述触摸面积获取所述渐变遮罩包括的显示区域的半径,根据所述半径调整所述渐变遮罩包括的显示区域的面积。这样可以实现在用户在按压终端屏幕时,可以改变渐变遮罩包括的显示区域的面积,提高显示效果。In a possible implementation manner of the second aspect, when the touch parameter includes a touch area, the radius of the display area included in the gradient mask is acquired according to the touch area, and the gradient mask is adjusted according to the radius The area of the display area that the cover includes. In this way, when the user presses the terminal screen, the area of the display area included in the gradient mask can be changed, thereby improving the display effect.
在第二方面的一种可能的实现方式中,获取所述终端中的至少一个传感器采集的数据,根据所述采集的数据获取第三亮度调整值,根据所述第三亮度调整值调整显示所述目标图片中的各线条包括的像素点的亮度;或者,获取穿戴设备采集的用户体征数据,根据所述用户体征数据获取第四亮度调整值,根据所述第四亮度调整值调整显示所述目标图片中的各线条包括的像素点的亮度。这样可以实现基于传感器采集的数据或用户体征数据改变显示图片的亮度,提高显示效果。In a possible implementation manner of the second aspect, data collected by at least one sensor in the terminal is obtained, a third brightness adjustment value is obtained according to the collected data, and the display device is adjusted according to the third brightness adjustment value. the brightness of the pixels included in each line in the target picture; or, obtain the user sign data collected by the wearable device, obtain a fourth brightness adjustment value according to the user sign data, and adjust and display the The brightness of the pixels included in each line in the target image. In this way, the brightness of the displayed picture can be changed based on the data collected by the sensor or the user's sign data, and the display effect can be improved.
在第二方面的一种可能的实现方式中,在显示所述目标图片的时间长度达到时长阈值时,获取所述终端的前置摄像头拍摄的图片;当所述图片中包括人眼图像时,在第一时间段内显示所述目标图片,所述第一时间段为离当前最近且时长为预设时长的时间段。当显示时间长度达到时长阈值时,如果所述图片中包括人眼图像,表示用户正在观看终端屏幕,继续显示可以提高用户体验。In a possible implementation manner of the second aspect, when the duration of displaying the target picture reaches a duration threshold, a picture taken by the front camera of the terminal is acquired; when the picture includes a human eye image, The target picture is displayed in a first time period, where the first time period is a time period closest to the current time and a preset time period. When the display time length reaches the time length threshold, if the picture includes a human eye image, it means that the user is watching the terminal screen, and continuing the display can improve the user experience.
在第二方面的一种可能的实现方式中,当所述图片中不包括人眼图像且检测到所述终端被用户操作或所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第二距离阈值时,在所述第一时间段内显示所述目标图片。当检测到所述终端屏幕前方的障碍物与所述终端屏幕之间的距离小于第二距离阈值时,表示用户靠近终端,在用户靠近终端或操作终端时,用户可能会观看终端屏幕,所以显示目标图片,可以提高用户体验。In a possible implementation manner of the second aspect, when the image does not include human eye images and it is detected that the terminal is operated by the user or the distance between an obstacle in front of the terminal screen and the terminal screen When the distance is less than the second distance threshold, the target picture is displayed within the first time period. When it is detected that the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, it means that the user is close to the terminal. When the user is close to the terminal or operates the terminal, the user may watch the terminal screen, so the display The target image can improve the user experience.
第三方面,本申请提供了一种获取图片的装置,用于执行第一方面或第一方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第一方面或第一方面的任意一种可能的实现方式的方法的单元。In a third aspect, the present application provides an apparatus for acquiring a picture, which is used to execute the method in the first aspect or any possible implementation manner of the first aspect. Specifically, the apparatus includes means for performing the method of the first aspect or any one of possible implementations of the first aspect.
第四方面,本申请提供了一种对图片进行处理的装置,用于执行第二方面或第二方面的任意一种可能的实现方式中的方法。具体地,所述装置包括用于执行第二方面或第二方面的任意一种可能的实现方式的方法的单元。In a fourth aspect, the present application provides an apparatus for processing a picture, which is used to execute the method in the second aspect or any possible implementation manner of the second aspect. Specifically, the apparatus includes means for performing the method of the second aspect or any one of possible implementations of the second aspect.
第五方面,本申请提供了一种获取图片的装置,所述装置包括:至少一个处理器;和至少一个存储器;所述至少一个存储器存储有一个或多个程序,所述一个或多个程序被配置成由所述至少一个处理器执行,所述一个或多个程序包含用于进行第一方面或第一方面的任意一种可能的实现方式的方法的指令。In a fifth aspect, the present application provides an apparatus for acquiring pictures, the apparatus comprising: at least one processor; and at least one memory; the at least one memory stores one or more programs, and the one or more programs Configured to be executed by the at least one processor, the one or more programs contain instructions for carrying out the method of the first aspect or any one possible implementation of the first aspect.
第六方面,本申请提供了一种对图片进行处理的装置,所述装置包括:至少一个处理器;和至少一个存储器;所述至少一个存储器存储有一个或多个程序,所述一个或多个程序被配置成由所述至少一个处理器执行,所述一个或多个程序包含用于进行第二方面或第二方面的任意一种可能的实现方式的方法的指令。In a sixth aspect, the present application provides an apparatus for processing pictures, the apparatus comprising: at least one processor; and at least one memory; the at least one memory stores one or more programs, the one or more A program is configured to be executed by the at least one processor, the one or more programs containing instructions for carrying out the method of the second aspect or any one possible implementation of the second aspect.
第七方面,本申请提供了一种计算机程序产品,所述计算机程序产品包括在计算机可读存储介质中存储的计算机程序,并且所述计算程序通过处理器进行加载来实现上述第一方面、第二方面、第一方面的任意可能的实现方式或第二方面的任意可能的实现方式的方法。In a seventh aspect, the present application provides a computer program product, the computer program product includes a computer program stored in a computer-readable storage medium, and the computer program is loaded by a processor to implement the above-mentioned first aspect and the first aspect. The second aspect, any possible implementation manner of the first aspect, or any possible implementation manner of the second aspect.
第八方面,本申请提供了一种非易失性计算机可读存储介质,用于存储计算机程序,所述计算机程序通过处理器进行加载来执行上述第一方面、第二方面、第一方面的任意可能的实现方式或第二方面的任意可能的实现方式的方法的指令。In an eighth aspect, the present application provides a non-volatile computer-readable storage medium for storing a computer program, and the computer program is loaded by a processor to execute the first aspect, the second aspect, and the first aspect. Instructions for any possible implementation or method of any possible implementation of the second aspect.
第九方面,本申请提实施例供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,当所述芯片运行时用于实现上述第一方面、第二方面、第一方面的任意可能的实现方式或第二方面的任意可能的实现方式的方法。In a ninth aspect, an embodiment of the present application provides a chip, the chip includes a programmable logic circuit and/or program instructions, and is used to implement the first aspect, the second aspect, and the first aspect when the chip is running Any possible implementation of or a method of any possible implementation of the second aspect.
附图说明Description of drawings
图1是本申请实施例提供的提供的一种通信系统结构示意图;FIG. 1 is a schematic structural diagram of a communication system provided by an embodiment of the present application;
图2-1是本申请实施例提供的一种获取图片的装置的结构示意图;FIG. 2-1 is a schematic structural diagram of an apparatus for acquiring pictures provided by an embodiment of the present application;
图2-2是本申请实施例提供的另一种获取图片的装置的结构示意图;2-2 is a schematic structural diagram of another apparatus for acquiring pictures provided by an embodiment of the present application;
图3-1是本申请实施例提供的一种获取图片的方法流程图;3-1 is a flowchart of a method for acquiring a picture provided by an embodiment of the present application;
图3-2是本申请实施例提供的一种第一图像的效果图;3-2 is an effect diagram of a first image provided by an embodiment of the present application;
图3-3是本申请实施例提供的一种平移后的第三图像的效果图;3-3 is an effect diagram of a translated third image provided by an embodiment of the present application;
图3-4是本申请实施例提供的一种平移后的第二图像的效果图;3-4 are effect diagrams of a translated second image provided by an embodiment of the present application;
图3-5是本申请实施例提供的一种设置像素值后的第二图片的效果图;3-5 are renderings of a second picture after pixel values are set according to an embodiment of the present application;
图4-1是本申请实施例提供的一种对图片进行处理的方法流程图;4-1 is a flowchart of a method for processing a picture provided by an embodiment of the present application;
图4-2是本申请实施例提供的一种渐变遮罩的显示效果图;4-2 is a display effect diagram of a gradient mask provided by an embodiment of the present application;
图4-3是本申请实施例提供的一种触摸图片的显示效果图;4-3 is a display effect diagram of a touch picture provided by an embodiment of the present application;
图5是本申请实施例提供的一种获取图片的装置结构示意图;5 is a schematic structural diagram of an apparatus for acquiring pictures provided by an embodiment of the present application;
图6是本申请实施例提供的一种对图片进行处理的装置结构示意图;6 is a schematic structural diagram of an apparatus for processing pictures provided by an embodiment of the present application;
图7是本申请实施例提供的另一种获取图片的装置结构示意图;7 is a schematic structural diagram of another apparatus for acquiring pictures provided by an embodiment of the present application;
图8是本申请实施例提供的另一种对图片进行处理的装置结构示意图。FIG. 8 is a schematic structural diagram of another apparatus for processing pictures provided by an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施方式作进一步地详细描述。The embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
参见图1,本申请实施例提供了一种通信系统,该通信系统可以包括终端1和服务器2;Referring to FIG. 1 , an embodiment of the present application provides a communication system, and the communication system may include a terminal 1 and a
终端1和服务器2之间建立有网络连接,该网络连接可以为有线连接或无线连接等。A network connection is established between the terminal 1 and the
终端1可以获取在其进入熄灭模式后需要显示的图片,并在其进入熄灭模式后显示该图片。The terminal 1 can acquire a picture to be displayed after it enters the extinguishing mode, and display the picture after it enters the extinguishing mode.
可选的,终端1自己生成该图片,或者,服务器2可以生成该图片并向终端1发送该图片。Optionally, the terminal 1 generates the picture by itself, or the
可选的,终端1可以手机、平板电脑、个人计算机或笔记本电脑等。Optionally, the terminal 1 may be a mobile phone, a tablet computer, a personal computer, or a notebook computer.
为了更好地对本申请进行说明,下面先对本申请中的图片以及图像等概念进行具体介绍。本申请中,图片是指计算机系统中用于保存图像的一种数据结构,图片的格式包括但不限于各种现有的图片格式(如JPG、GIF、PNG等等)。图片文件中的数据既包括直接反映图像的数据(以下简称“图像数据”,例如,图像有若干个像素点构成,每个像素点都可对应于一个数据),也包括用于反映图片格式的一些其他的信息(如文件头信息)。可以理解,对图片的处理最主要的就是对图像数据的处理,通过对图像处理的数据,使得图像数据对应的图像发生改变。同时,为了说明方便,本申请在描述“对图像进行某种处理时”,其真实的意思是指通过对图像数据进行处理,使得图像达到某种效果。例如,“将图像进行增加亮度的处理”表示的是“对图像数据进行特定的调整,使得最终图像的亮度增加”。In order to better describe the present application, concepts such as pictures and images in the present application will be specifically introduced below. In this application, a picture refers to a data structure used to save an image in a computer system, and the format of the picture includes but is not limited to various existing picture formats (such as JPG, GIF, PNG, etc.). The data in the picture file includes not only the data that directly reflects the image (hereinafter referred to as "image data", for example, the image is composed of several pixels, and each pixel can correspond to one piece of data), but also the data used to reflect the format of the picture. some other information (such as file header information). It can be understood that the most important thing in the processing of pictures is the processing of image data, and the image corresponding to the image data is changed by processing the data of the image. At the same time, for the convenience of description, in this application, when describing "a certain processing is performed on an image", the true meaning of the description refers to processing the image data to make the image achieve a certain effect. For example, "processing the image to increase the brightness" means "making a specific adjustment to the image data so that the brightness of the final image is increased".
参见图2-1,本申请提供了一种获取图片的装置200,该装置200可以为上述终端1、终端1中的部分、服务器2或服务器2中的部分,包括:Referring to FIG. 2-1, the present application provides an
处理模块201、存储模块202和网络接口203;a processing module 201, a storage module 202 and a network interface 203;
存储模块202可以存储处理模块201和该装置200中的其他模块所需的静态数据和规则,还用于存储可以被处理模块201执行的软件程序。The storage module 202 can store static data and rules required by the processing module 201 and other modules in the
网络接口203可以提供语音或数据的通信能力,可以提供有线或无线的接口,其包括RF接收元件、GPS接收元件和/或其他元件,可以是软件和硬件(天线、调制/解调器、编/解码器、模拟/数字处理电路等)的结合。Network interface 203 may provide voice or data communication capabilities, may provide wired or wireless interfaces, and may include RF receiving elements, GPS receiving elements, and/or other elements, and may be software and hardware (antennas, modems/demodulators, encoders, etc.). /decoder, analog/digital processing circuits, etc.).
处理模块201可以用于获取终端1在进入熄灭模式后需要显示的图片。如果该装置200为服务器2或服务器2的部分,处理模块201还可以通过网络接口203向终端1发送该图片。The processing module 201 may be configured to acquire a picture to be displayed after the terminal 1 enters the off mode. If the
可选的,参见图2-2,在该装置200为终端1或终端1的部分时,该装置200还可以包括输入模块204和显示模块205。Optionally, referring to FIG. 2-2 , when the
输入模块204和显示模块205可以用来提供用户界面。输入模块204可以包括触摸屏、键盘、触控板、鼠标或其他指示设备。Input module 204 and display module 205 may be used to provide a user interface. Input module 204 may include a touch screen, keyboard, trackpad, mouse, or other pointing device.
显示模块205可以显示处理模块201获取图片或者可以显示服务器2发送的图片。The display module 205 can display the picture obtained by the processing module 201 or can display the picture sent by the
参见图3-1,本申请实施例提供了一种获取图片的方法,该方法可以应用于图1所示的系统,该方法包括:Referring to FIG. 3-1, an embodiment of the present application provides a method for acquiring a picture, and the method can be applied to the system shown in FIG. 1, and the method includes:
步骤301:获取第一图片对应的灰度图像和第一图像,第一图片的尺寸(也即图片对应的图像的尺寸)等于第一图像的尺寸,第一图像包括相互平行的N条线条,相邻两线条之间的间隔不超过间隔阈值,N为大于1的整数。Step 301: Obtain the grayscale image and the first image corresponding to the first picture, the size of the first picture (that is, the size of the image corresponding to the picture) is equal to the size of the first image, and the first image includes N lines that are parallel to each other, The interval between two adjacent lines does not exceed the interval threshold, and N is an integer greater than 1.
间隔阈值的取值可以由用户根据其需求进行设置,例如,可以设置间隔阈值等于10个像素、20个像素、50个像素、80个像素或100个像素等。用户需要第一图像包括的线条较密一些,则可以设置间隔阈值的取值较小,用户需要第一图像包括的线条较稀疏,则可以设置间隔阈值的取值较大。The value of the interval threshold can be set by the user according to their needs. For example, the interval threshold can be set to be equal to 10 pixels, 20 pixels, 50 pixels, 80 pixels, or 100 pixels. If the user needs the lines included in the first image to be denser, the value of the interval threshold can be set smaller, and the user needs the lines included in the first image to be sparse, then the value of the interval threshold can be set larger.
在执行本步骤之前,先获取第一图片。Before performing this step, obtain the first picture.
当本实施例的执行主体为终端时,终端获取第一图片的方式可以为:从网上下载一张图片作为第一图片、拍摄一张图片作为第一图片、从本地相册中获取一张图片作为第一图片或从本地用于存放壁纸图片的文件夹中获取一张壁纸图片作为第一图片等实现方式。When the executing subject of this embodiment is a terminal, the terminal may acquire the first picture in the following manner: downloading a picture from the Internet as the first picture, taking a picture as the first picture, and acquiring a picture from a local album as the first picture The first picture or a wallpaper picture obtained from a local folder for storing wallpaper pictures as the first picture is implemented in such a manner.
当本实施例的执行主体为服务器时,终端按上述方式获取第一图片,向服务器发送第一图片。相应的,服务器接收终端发送的第一图片,以实现获取第一图片。When the execution body of this embodiment is the server, the terminal acquires the first picture in the above-mentioned manner, and sends the first picture to the server. Correspondingly, the server receives the first picture sent by the terminal, so as to obtain the first picture.
可选的,对于获取第一图片的灰度图的操作,该操作可以包括如下3011至3013的步骤来实现,可以为:Optionally, for the operation of acquiring the grayscale image of the first picture, the operation may include the following steps 3011 to 3013 to implement, which may be:
3031:判断第一图片是否为深度图片,如果是深度图片,则执行3032,如果不是深度图片,则执行30333031: Determine whether the first picture is a depth image, if it is a depth image, execute 3032, and if it is not a depth image, execute 3033
深度图片的格式为RGBD格式,深度图片中的每个像素点存在对应的像素值和深度值。像素点的像素值中包括R通道像素值、B通道像素值和G通道像素值。像素点的深度值是该像素点在物体上对应的点到摄像设备镜头的距离。The format of the depth image is RGBD format, and each pixel in the depth image has a corresponding pixel value and depth value. The pixel value of the pixel point includes the pixel value of the R channel, the pixel value of the B channel, and the pixel value of the G channel. The depth value of a pixel is the distance from the corresponding point of the pixel on the object to the lens of the camera device.
在本步骤中,可以获取第一图片的格式,如果该格式是RGBD格式,则判断出第一图片是深度图片,如果该格式不是RGBD格式,则判断出第一图片不是深度图片。In this step, the format of the first picture can be obtained. If the format is RGBD format, it is determined that the first picture is a depth picture, and if the format is not RGBD format, it is determined that the first picture is not a depth picture.
3032:根据第一图片中的每个像素点的深度值,获取每个像素点的灰度值,得到第一图片对应的灰度图像,结束返回。3032: Acquire the grayscale value of each pixel point according to the depth value of each pixel point in the first picture, obtain a grayscale image corresponding to the first picture, and end the return.
灰度图像中的每个像素点的灰度值为大于或等于0且小于或等于255中的整数。The grayscale value of each pixel in the grayscale image is an integer greater than or equal to 0 and less than or equal to 255.
在本步骤中,创建一个空白的灰度图像,该灰度图像的尺寸等于第一图片的尺寸,即该灰度图像的长度和宽度分别等于第一图片的长度和宽度。从第一图片包括的每个像素点的深度值中获取最小深度值D1和最大深度值D2,根据最小深度值D1和最大深度值D2计算灰度值系数X=255/(D2-D1)。对于第一图片中的每个像素点,为了便于说明,称该像素点为目标像素点,从第一图片中读取目标像素点的深度值d和在第一图片中的位置,根据目标像素点的深度值d、最小深度值D1和灰度值系数X,计算目标像素点的灰度值H=(d-D1)*X,其中*为乘法运算。根据目标像素点的位置,将目标像素点的灰度值H填写在灰度图像中,即在灰度图像的该位置处填写目标像素点的灰度值H。和上述获取目标像素点的灰度值相同的方式,获取第一图片中的其他每个像素点的灰度值和位置,并根据其他每个像素点的位置,将其他每个像素点的灰度值填写到灰度图像中,从而得到第一图片对应的灰度图像。In this step, a blank grayscale image is created, and the size of the grayscale image is equal to the size of the first picture, that is, the length and width of the grayscale image are respectively equal to the length and width of the first picture. The minimum depth value D1 and the maximum depth value D2 are obtained from the depth values of each pixel included in the first picture, and the gray value coefficient X=255/(D2-D1) is calculated according to the minimum depth value D1 and the maximum depth value D2. For each pixel in the first picture, for the convenience of description, the pixel is called the target pixel, and the depth value d of the target pixel and its position in the first picture are read from the first picture, according to the target pixel The depth value d of the point, the minimum depth value D1 and the gray value coefficient X are used to calculate the gray value of the target pixel point H=(d-D1)*X, where * is a multiplication operation. According to the position of the target pixel, fill in the grayscale value H of the target pixel in the grayscale image, that is, fill in the grayscale value H of the target pixel at this position of the grayscale image. In the same way as the above-mentioned acquisition of the gray value of the target pixel, the gray value and position of each other pixel in the first picture are obtained, and according to the position of each other pixel, the gray value of each other pixel is The degree value is filled in the grayscale image, so as to obtain the grayscale image corresponding to the first picture.
3033:根据第一图片中的每个像素点的像素值,获取每个像素点的灰度值,得到第一图片对应的灰度图像,结束返回。3033: Obtain the grayscale value of each pixel point according to the pixel value of each pixel point in the first picture, obtain a grayscale image corresponding to the first picture, and end the return.
在本步骤中,创建一个空白的灰度图像,该灰度图像的尺寸等于第一图片的尺寸,即该灰度图像的长度和宽度分别等于第一图片的长度和宽度。对于第一图片中的每个像素点,为了便于说明,称该像素点为目标像素点,从第一图片中读取目标像素点的像素值和在第一图片中的位置。根据目标像素点的像素值计算出目标像素点的灰度值。根据目标像素点的位置,将目标像素点的灰度值填写在灰度图像中,即在灰度图像的该位置处填写目标像素点的灰度值。和上述获取目标像素点的灰度值相同的方式,获取第一图片中的其他每个像素点的灰度值和位置,并根据其他每个像素点的位置,将其他每个像素点的灰度值填写到灰度图像中,从而得到第一图片对应的灰度图像。In this step, a blank grayscale image is created, and the size of the grayscale image is equal to the size of the first picture, that is, the length and width of the grayscale image are respectively equal to the length and width of the first picture. For each pixel in the first picture, for the convenience of description, the pixel is called a target pixel, and the pixel value and the position of the target pixel in the first picture are read from the first picture. The gray value of the target pixel is calculated according to the pixel value of the target pixel. According to the position of the target pixel, fill in the gray value of the target pixel in the grayscale image, that is, fill in the gray value of the target pixel at this position of the grayscale image. In the same way as the above-mentioned acquisition of the gray value of the target pixel, the gray value and position of each other pixel in the first picture are obtained, and according to the position of each other pixel, the gray value of each other pixel is The degree value is filled in the grayscale image, so as to obtain the grayscale image corresponding to the first picture.
可选的,根据目标像素点的像素值计算出目标像素点的灰度值的实现方式有多种,例如在本实施例中列举了一种实现方式,该实现方式可以为:Optionally, there are various implementations for calculating the grayscale value of the target pixel according to the pixel value of the target pixel. For example, an implementation is listed in this embodiment, and the implementation may be:
目标像素点的像素值包括R通道像素值r、G通道像素值g和B通道像素值b,根据R通道像素值r、G通道像素值g和B通道像素值b,计算出目标像素点的灰度值H=r*s1+g*s2+b*s3,其中s1为R通道对应的第一系数、s2为G通道对应的第二系数、s3为B通道对应的第三系数,第一系数、第二系数和第三系数均为预设数值。The pixel value of the target pixel includes the R channel pixel value r, the G channel pixel value g and the B channel pixel value b. According to the R channel pixel value r, the G channel pixel value g and the B channel pixel value b, the target pixel value is calculated. The gray value H=r*s1+g*s2+b*s3, where s1 is the first coefficient corresponding to the R channel, s2 is the second coefficient corresponding to the G channel, and s3 is the third coefficient corresponding to the B channel. The coefficient, the second coefficient and the third coefficient are all preset values.
可选的,对于获取第一图像的操作,可以为,创建一个空白的第一图像,第一图像的尺寸等于第一图片的尺寸,即第一图像的长度和宽度分别等于第一图片的长度和宽度;在第一图像中生成N条相互平行的线条,且相邻两个线条之间的间隔不超过间隔阈值。Optionally, for the operation of obtaining the first image, a blank first image can be created, and the size of the first image is equal to the size of the first image, that is, the length and width of the first image are respectively equal to the length of the first image. and width; N mutually parallel lines are generated in the first image, and the interval between two adjacent lines does not exceed the interval threshold.
可选的,可以在第一图像中生成N条相互平行且等间隔的线条,这样可以使该N条线条均匀地分布在第一图像中。Optionally, N mutually parallel and equally spaced lines may be generated in the first image, so that the N lines may be evenly distributed in the first image.
可选的,第一图像中的每条线条可以与第一图像的宽度方向平行,第一图像中的每条线条的长度可以等于第一图像的宽度。例如,参见图3-2所示的第一图像,第一图像包括相互平行且等间隔的多条线条。Optionally, each line in the first image may be parallel to the width direction of the first image, and the length of each line in the first image may be equal to the width of the first image. For example, referring to the first image shown in Figures 3-2, the first image includes a plurality of lines parallel to each other and equally spaced.
N为大于1的整数,在实现时,N可以为250、260、270、280、290或300等数值,通常N的取值可以与第一图片的长度成正比,第一图片的长度越大,N的取值可以随之越大,第一图片的长度越小,N的取值可以随之越小。N is an integer greater than 1. During implementation, N can be a value such as 250, 260, 270, 280, 290 or 300. Usually, the value of N can be proportional to the length of the first picture, and the longer the first picture is. , the value of N can be larger accordingly, the length of the first picture is smaller, the value of N can be smaller accordingly.
步骤302:根据该灰度图像对第一图像中的各线条进行平移得到第二图像,第二图像中包括第一图片中的图像的轮廓。Step 302: Translate each line in the first image according to the grayscale image to obtain a second image, where the second image includes the outline of the image in the first picture.
第二图像包括的图像由线条组成,第二图像包括的图像比第一图片包括的图像更抽象。第一图像包括一个图像坐标系,第一图像中的每条线条上的像素点的位置可以为该像素点在该图像坐标系中的坐标。The image included in the second image is composed of lines, and the image included in the second image is more abstract than the image included in the first picture. The first image includes an image coordinate system, and the position of a pixel on each line in the first image may be the coordinate of the pixel in the image coordinate system.
本步骤可以通过如下3021至3022的操作来实现,分别为:This step can be implemented through the following operations from 3021 to 3022, respectively:
3021:将第一图像中的各线条变换成弯曲线条,得到第三图像。3021: Transform each line in the first image into a curved line to obtain a third image.
对于第一图像中的任一条线条,为了便于说明,称该线条为第一线条,根据第一线条包括的像素点的位置,通过随机函数获取第一线条包括的像素点的随机值;根据第一线条包括的像素点的随机值和第一线条与第二线条之间的间隔,获取第一线条包括的像素点的第一偏移值,第二线条是第一线条的一条相邻线条;根据第一线条包括的像素点的第一偏移值,分别平移第一线条包括的像素点,得到弯曲线条。For any line in the first image, for the convenience of description, the line is called the first line, and according to the position of the pixel included in the first line, the random value of the pixel included in the first line is obtained through a random function; A random value of the pixels included in a line and the interval between the first line and the second line, obtaining the first offset value of the pixels included in the first line, and the second line is an adjacent line of the first line; According to the first offset value of the pixel points included in the first line, the pixel points included in the first line are respectively translated to obtain a curved line.
可选的,可以沿第一图像的图像坐标系中的一条坐标轴的方向,平移第一线条包括的像素点。Optionally, the pixels included in the first line may be translated along the direction of one coordinate axis in the image coordinate system of the first image.
可选的,随机函数可以为柏林噪声函数、三角函数或Perlin噪声函数等。对于第一线条上的任一个像素点,可以获取该像素点在第一图像中的位置,该位置可以为该像素点的坐标(x1,y1),将该像素点的坐标(x1,y1)输入到柏林噪声函数、三角函数和Perlin噪声函数中的任一个随机函数,使该随机函数根据该坐标(x1,y1)生成一个随机值p,根据该随机值P和第一线条与第二线条之间的间隔d,获取该像素点的第一偏移值为p*d,*为乘法运算;根据该像素点的第一偏移值p*d,沿第一图像的图像坐标系中的纵坐标轴的方向平移该像素点,平移后的该像素点的坐标为(x1,y1+p*d);或者,根据该像素点的第一偏移值p*d,沿第一图像的图像坐标系中的横坐标轴的方向平移该像素点,平移后的该像素点的坐标为(x1+p*d,y1)。Optionally, the random function may be a Perlin noise function, a trigonometric function, a Perlin noise function, or the like. For any pixel on the first line, the position of the pixel in the first image can be obtained, and the position can be the coordinates of the pixel (x1, y1), and the coordinates of the pixel (x1, y1) Input any random function among Perlin noise function, trigonometric function and Perlin noise function, so that the random function generates a random value p according to the coordinates (x1, y1), according to the random value P and the first line and the second line The interval d between, obtains the first offset value of the pixel point p*d, * is the multiplication operation; according to the first offset value p*d of the pixel point, along the image coordinate system of the first image Translate the pixel point in the direction of the ordinate axis, and the coordinates of the pixel point after translation are (x1, y1+p*d); or, according to the first offset value p*d of the pixel point, along the first image The pixel point is translated in the direction of the abscissa axis in the image coordinate system, and the coordinates of the pixel point after translation are (x1+p*d, y1).
由于将第一线条包括的每个像素点的位置输入到随机函数,随机函数生成的每个像素点的随机值可能不同,这样获取的每个像素点的第一偏移值也不同,在根据每个像素点的第一偏移值平行第一线条上的每个像素点时就会将第一线条平移成弯曲线条。例如,对图3-2所示的第一图像中的线条进行平移得到后,得到如图3-3所示的效果图。Since the position of each pixel included in the first line is input into the random function, the random value of each pixel generated by the random function may be different, and the first offset value of each pixel obtained in this way is also different. When the first offset value of each pixel is parallel to each pixel on the first line, the first line is translated into a curved line. For example, after translating the lines in the first image shown in Figure 3-2, the effect diagram shown in Figure 3-3 is obtained.
3022:根据该灰度图像对第三图像中的各线条包括的像素点进行平移,得到第二图像。3022: Translate the pixels included in each line in the third image according to the grayscale image to obtain a second image.
其中,由于第一图片的尺寸等于第一图像的尺寸,所以第一图片的灰度图像的尺寸也等于第三图像的尺寸。Wherein, since the size of the first picture is equal to the size of the first image, the size of the grayscale image of the first picture is also equal to the size of the third image.
可选的,对于第三图像中的任一条线条,为了便于说明称该条线条为第三线条,根据第三线条包括的像素点的位置,从该灰度图像中获取第三线条包括的像素点的灰度值,根据第三线条包括的像素点的灰度值,获取第三线条包括的像素点的第二偏移值;根据第三线条包括的像素点的第二偏移值,分别平移第三线条包括的像素点。对第三图像中的每条线条按上述方式进行平移,得到第二图像。Optionally, for any line in the third image, for the convenience of description, the line is called the third line, and the pixels included in the third line are obtained from the grayscale image according to the positions of the pixels included in the third line. The gray value of the point, according to the gray value of the pixel included in the third line, obtain the second offset value of the pixel included in the third line; according to the second offset value of the pixel included in the third line, respectively Translate the pixels included in the third line. The second image is obtained by translating each line in the third image as described above.
可选的,第三线条包括的像素点的位置可以为该像素点在第三图像的图像坐标系中的坐标,假设该像素点的坐标为(x2,y2),则从灰度图像中获取位于坐标(x2,y2)位置的灰度值,将该灰度值确定为该像素点的灰度值。Optionally, the position of the pixel included in the third line may be the coordinates of the pixel in the image coordinate system of the third image. Assuming that the coordinates of the pixel are (x2, y2), it is obtained from the grayscale image. The gray value at the position of coordinates (x2, y2) is determined as the gray value of the pixel.
可选的,可以沿第三图像的图像坐标系中的一条坐标轴的方向,平移第三线条包括的像素点。Optionally, the pixels included in the third line may be translated along the direction of one coordinate axis in the image coordinate system of the third image.
可选的,根据该像素点的灰度值获取该像素点的第二偏移值的实现方式有多种,在本申请实施例中仅列举了如下两种实现方式,对于其他的实现方式就不再一一列举。Optionally, there are multiple implementations for obtaining the second offset value of the pixel according to the grayscale value of the pixel. Only the following two implementations are listed in the embodiments of the present application, and other implementations are No more enumerating.
第一种实现方式,该像素点的灰度值包括R通道灰度值、G通道灰度值和B通道灰度值,根据该像素点的R通道灰度值、G通道灰度值和B通道灰度值,按如下第一公式获取该像素点的第二偏移值。In the first implementation manner, the gray value of the pixel includes the gray value of the R channel, the gray value of the G channel and the gray value of the B channel. According to the gray value of the R channel, the gray value of the G channel and the gray value of the B channel of the pixel The gray value of the channel, and the second offset value of the pixel is obtained according to the following first formula.
第一公式为: The first formula is:
在第一公式中,F为第二偏移值,HR、HG、HB分别为R通道灰度值、G通道灰度值和B通道灰度值,z1、z2、z3和z4均为预设系数,例如,z1、z2、z3和z4可以分别为3、6、1和8。In the first formula, F is the second offset value, H R , H G , and H B are the gray value of the R channel, the gray value of the G channel, and the gray value of the B channel, respectively, z 1 , z 2 , z 3 and z 4 are preset coefficients, for example, z 1 , z 2 , z 3 and z 4 may be 3, 6, 1 and 8, respectively.
第二种实现方式,根据该像素点的坐标(x2,y2),在灰度图像中确定位于坐标(x2,y2)的第一像素点的第一灰度值,从灰度图像中获取与第一像素点相邻的各第二像素点的第二灰度值,计算第一灰度值与每个第二灰度值之间的差值,根据计算的各差值计算平均值,将该平均值确定为该像素点的第二偏移值。In the second implementation, according to the coordinates (x2, y2) of the pixel, determine the first gray value of the first pixel at coordinates (x2, y2) in the grayscale image, and obtain the same value from the grayscale image. The second grayscale value of each second pixel point adjacent to the first pixel point, calculate the difference between the first grayscale value and each second grayscale value, calculate the average value according to the calculated difference values, and set the The average value is determined as the second offset value of the pixel point.
假设,该像素点的坐标为(x2,y2),该像素点的第二偏移值为F,根据该像素点的第二偏移值F,沿第三图像的图像坐标系中的纵坐标轴的方向平移该像素点,平移后的该像素点的坐标为(x2,y2+F);或者,根据该像素点的第二偏移值F,沿第三图像的图像坐标系中的横坐标轴的方向平移该像素点,平移后的该像素点的坐标为(x2+F,y2)。Assuming that the coordinates of the pixel point are (x2, y2), the second offset value of the pixel point is F, and according to the second offset value F of the pixel point, along the ordinate in the image coordinate system of the third image Translate the pixel point in the direction of the axis, and the coordinates of the pixel point after translation are (x2, y2+F); or, according to the second offset value F of the pixel point, along the horizontal direction in the image coordinate system of the third image. The direction of the coordinate axis translates the pixel point, and the coordinates of the pixel point after translation are (x2+F, y2).
其中,需要说明的是:由于灰度图像中包括第一图片中的图像信息,所以根据该灰度图像对第三图像中的各线条包括的像素点进行平移得到第二图像,且得到的第二图像中包括第一图片中的图像的轮廓。例如,假设第一图片中包括小鸟图像,则对图3-3所示的图片中的线条进行平移后得到的第二图像中包括小鸟图像的轮廓,如图3-4所示的效果图,在图3-4所示的第二图像的效果图中小鸟图像由线条组成。It should be noted that: since the grayscale image includes the image information in the first picture, the second image is obtained by translating the pixels included in each line in the third image according to the grayscale image, and the obtained first The second image includes an outline of the image in the first picture. For example, if the first image includes a bird image, the second image obtained by translating the lines in the image shown in Figure 3-3 includes the outline of the bird image, as shown in Figure 3-4. Figure, in the rendering of the second image shown in Figure 3-4, the bird image is composed of lines.
步骤303:在第二图像中设置各线条包括的各像素点的像素值得到第二图片。Step 303: Set the pixel value of each pixel included in each line in the second image to obtain a second picture.
第一图片可能是彩色图片,也可能是非彩色图片。当第一图片为彩色图片时,可以根据第一图片设置各线条包括的各像素点的像素值;当第一图片为非彩色图片时,可以将各线条包括的像素点的像素值设置为预设的环境颜色像素值。The first picture may be a color picture or a non-color picture. When the first picture is a color picture, the pixel value of each pixel included in each line can be set according to the first picture; when the first picture is an achromatic picture, the pixel value of each pixel included in each line can be set as a preset value. Set the ambient color pixel value.
对于根据第一图片设置各线条包括的各像素点的像素值的操作,该操作采用高斯模糊处理方式对第一图片的像素点进行处理,得到各线条包括的各像素点的像素值,从而使得得到的第二图片相对于第一图片变的更抽象且更具艺术感。在实现时可以包括如下3021至3023的步骤,分别为:For the operation of setting the pixel value of each pixel point included in each line according to the first picture, the operation adopts the Gaussian blurring method to process the pixel point of the first picture, and obtains the pixel value of each pixel point included in each line, so as to make The resulting second picture is more abstract and more artistic than the first picture. The implementation may include the following steps 3021 to 3023, respectively:
3021:根据目标像素点的目标位置,从第一图片中获取目标图像区域,目标像素点为第二图像中的任一条线条包括的一个像素点,目标图像区域的中心像素点的位置为目标位置,目标图像区域的半径为第一半径阈值。3021: According to the target position of the target pixel, obtain the target image area from the first picture, the target pixel is a pixel included in any line in the second image, and the position of the center pixel of the target image area is the target position , the radius of the target image area is the first radius threshold.
目标位置可以为目标像素点在第二图像的图像坐标系中的坐标。The target position may be the coordinates of the target pixel in the image coordinate system of the second image.
可选的,在第一图片中寻找出位于目标位置的像素点作为中心像素点,以该中心像素点为中心,以第一半径阈值为半径,在第一图片中获取一个图像区域作为目标图像区域。Optionally, find the pixel at the target position in the first picture as the center pixel, take the center pixel as the center, take the first radius threshold as the radius, and obtain an image area in the first picture as the target image area.
3022:根据目标图像区域中的各像素点的像素值计算目标像素值。3022: Calculate the target pixel value according to the pixel value of each pixel in the target image area.
像素点的像素值包括R通道像素值、G通道像素值和B通道像素值。The pixel value of the pixel point includes the pixel value of the R channel, the pixel value of the G channel and the pixel value of the B channel.
本步骤可以为,对于目标图像区域中的每个像素点,计算该像素点的R通道像素值、G通道像素值和B通道像素值的第一平均值,按上述方式计算出目标图像区域中的每个像素点的第一平均值。根据目标图像区域中的每个像素点的位置和目标位置,计算每个像素点与目标像素点之间的距离,根据每个像素点与目标像素点之间的距离获取每个像素点对应的权重值,将每个像素点的第一平均值分别与每个像素点的权重值相乘得到每个像素点的第一数值,根据每个像素点的第一数值计算第二平均值,将第二平均值确定目标像素值。In this step, for each pixel in the target image area, calculate the first average value of the pixel value of the R channel, the pixel value of the G channel and the pixel value of the B channel, and calculate the pixel value in the target image area according to the above method. The first average of each pixel of . According to the position of each pixel in the target image area and the target position, calculate the distance between each pixel and the target pixel, and obtain the corresponding pixel value according to the distance between each pixel and the target pixel. Weight value, multiply the first average value of each pixel point with the weight value of each pixel point to obtain the first value of each pixel point, calculate the second average value according to the first value of each pixel point, and set The second average determines the target pixel value.
可选的,可以事先保存距离范围与权重值的对应关系,这样对于每个像素点,确定该像素点与目标像素点之间的距离所在的距离范围,根据该距离范围,从距离范围与权重值的对应关系中获取对应的权重值,将该权重值确定为该像素点的权重值。Optionally, the correspondence between the distance range and the weight value can be saved in advance, so that for each pixel point, the distance range in which the distance between the pixel point and the target pixel point is located is determined. The corresponding weight value is obtained from the corresponding relationship of the values, and the weight value is determined as the weight value of the pixel point.
3023:将目标像素点的像素值设置为目标像素值。3023: Set the pixel value of the target pixel to the target pixel value.
其中,重复执行上述3021至3023的步骤,设置第二图像中各线条包括的各像素点的像素值得到第二图片。The above steps 3021 to 3023 are repeatedly performed, and the pixel value of each pixel included in each line in the second image is set to obtain the second picture.
对于将各线条包括的像素点的像素值设置为预设的环境颜色像素值的操作,在实现时可以包括如下3121至3123的步骤,分别为:For the operation of setting the pixel value of the pixel included in each line to the preset ambient color pixel value, the implementation may include the following steps 3121 to 3123, respectively:
3121:获取当前环境的环境因素信息,该环境因素信息包括地理环境类型、温度信息和时间信息中的至少一者。3121: Acquire environmental factor information of the current environment, where the environmental factor information includes at least one of geographic environment type, temperature information, and time information.
地理环境类型可以为雪地环境、沙漠环境、草原环境和大海环境等类型,温度信息可以为高温、温暖、低温或寒冷等,时间信息可以为早上、中午或晚上等。The geographic environment type can be snow environment, desert environment, grassland environment and sea environment, etc. The temperature information can be high temperature, warm, low temperature or cold, etc., and the time information can be morning, noon or evening.
在本实施例中,可以根据当前环境选择一种环境颜色像素值,以将第二图片的颜色设置成与当前环境相适应的颜色,因此在本步骤中获取当前环境的环境因数信息,以在后续步骤基于该环境因素信息选择与当前环境相适应的颜色对应的环境颜色像素值。In this embodiment, an environment color pixel value can be selected according to the current environment, so as to set the color of the second picture to a color suitable for the current environment, so in this step, the environment factor information of the current environment is obtained to The subsequent step selects the pixel value of the environment color corresponding to the color suitable for the current environment based on the environment factor information.
例如,当前为早上时,可以将第二图像中的线条颜色设置成金黄色,当前为中午时可以将第二图片设置成白色,当前为晚上时可以将第二图片设置成蓝色。或者,当前环境为雪地环境,可以将第二图片设置成白色,当前环境为沙漠环境,可以将第二图片设置成土黄色,当前环境为草原环境,可以将第二图片设置成草绿色,当前环境为大海环境,可以将第二图片设置成海蓝色。For example, when it is morning, the line color in the second image can be set to golden yellow, when it is noon, the second picture can be set to white, and when it is night, the second picture can be set to blue. Or, if the current environment is a snow environment, you can set the second image to white, the current environment is a desert environment, you can set the second image to khaki, and the current environment is a grassland environment, you can set the second image to grass green, The current environment is the sea environment, and the second picture can be set to sea blue.
在本步骤中,当本申请实施例的执行主体为终端时,对于地理环境类型,终端可以定位出当前位置,根据该当前位置从服务器中查找出当前位置所处的环境类型。In this step, when the execution subject of this embodiment of the present application is a terminal, for the type of geographical environment, the terminal can locate the current location, and find out the type of environment in which the current location is located from the server according to the current location.
对于温度信息,事先定义高温对应的温度值范围、低温对应的温度值范围、温暖对应的温度值范围以及寒冷对应的温度值范围,这样在获取温度信息时可以获取当前温度值,确定当前温度值所在的温度值范围,获取该温度值范围对应的温度信息。其中,可以从网络中查询其当前位置的当前温度值,或者,当终端内包括测量温度的传感器,可以通过该测量温度的传感器测量当前温度值。For temperature information, the temperature value range corresponding to high temperature, the temperature value range corresponding to low temperature, the temperature value range corresponding to warm and the temperature value range corresponding to cold are defined in advance, so that the current temperature value can be obtained when the temperature information is obtained, and the current temperature value can be determined. The temperature value range in which it is located, and the temperature information corresponding to the temperature value range is obtained. Wherein, the current temperature value of its current location can be queried from the network, or, when the terminal includes a temperature measuring sensor, the current temperature value can be measured through the temperature measuring sensor.
对于时间信息,事先定义早上对应的时间范围、中午对应的时间范围和晚上对应的时间范围,在获取时间信息时,可以获取当前时间,确定当前时间所在的时间范围,获取该时间范围对应的时间信息。For time information, the time range corresponding to morning, the time range corresponding to noon, and the time range corresponding to evening are defined in advance. When obtaining time information, the current time can be obtained, the time range in which the current time is located can be determined, and the time corresponding to the time range can be obtained. information.
在本步骤中,当本申请实施例的执行主体为服务器时,终端可以将定位的当前位置发送给服务器,这样服务器根据终端的当前位置获取终端当前环境的地理环境类型,还可以根据当前位置,从网络中查询出当前温度值,进而基于当前温度值获取温度信息。服务器可以获取当前时间,基于当前时间获取时间信息。In this step, when the execution body of the embodiment of the present application is the server, the terminal may send the current position of the positioning to the server, so that the server obtains the geographical environment type of the current environment of the terminal according to the current position of the terminal, and can also, according to the current position, The current temperature value is queried from the network, and then the temperature information is obtained based on the current temperature value. The server can obtain the current time and obtain time information based on the current time.
3122:根据该当前环境的环境因素信息,从环境因素信息与环境颜色像素值的对应关系中获取当前环境对应的环境颜色像素值。3122: According to the environmental factor information of the current environment, obtain the environmental color pixel value corresponding to the current environment from the correspondence between the environmental factor information and the environmental color pixel value.
对于环境因素信息与环境颜色像素值的对应关系中的任一条记录,该记录中包括环境颜色像素值和与该环境颜色像素值对应的环境因素信息,与该环境颜色像素值对应的环境因素信息可以包括地理环境类型、温度信息和时间信息中的至少一者。也就是说与该环境颜色像素值对应的环境因素信息可以为地理环境类型、温度信息或时间信息,或者,与该环境颜色像素值对应的环境因素信息可以包括地理环境类型和温度信息,或者包括温度信息和时间信息,或者包括地理环境类型和时间信息,或者包括地理环境类型、温度信息和时间信息。For any record in the correspondence between the environmental factor information and the environmental color pixel value, the record includes the environmental color pixel value and the environmental factor information corresponding to the environmental color pixel value, and the environmental factor information corresponding to the environmental color pixel value. At least one of geographic environment type, temperature information, and time information may be included. That is to say, the environmental factor information corresponding to the ambient color pixel value may be geographic environment type, temperature information or time information, or the environmental factor information corresponding to the ambient color pixel value may include geographic environment type and temperature information, or include The temperature information and time information either include geographic environment type and time information, or include geographic environment type, temperature information and time information.
3123:将第二图像中的各线条包括的各像素点的像素值设置为当前环境对应的环境颜色像素值,得到第二图片。3123: Set the pixel value of each pixel included in each line in the second image as the pixel value of the environment color corresponding to the current environment, to obtain a second picture.
例如,对图3-4所示图片中的各线条包括的像素点,按上述两种方式设置像素点的像素值后,得到如图3-5所示的第二图片的显示效果。For example, for the pixels included in the lines in the picture shown in Figure 3-4, after setting the pixel values of the pixels in the above two ways, the display effect of the second picture shown in Figure 3-5 is obtained.
可选的,如果本申请实施例的执行主体为终端,则终端可以按如下图4-1所示的实施例显示第二图片;如果本申请实施例的执行主体为服务器,服务器可以向终端发送第二图片,以让终端按如下图4-1所示的实施例显示第二图片。Optionally, if the execution body of this embodiment of the present application is a terminal, the terminal may display the second picture according to the embodiment shown in Figure 4-1 below; if the execution body of this embodiment of the present application is a server, the server may send a message to the terminal. The second picture, so that the terminal can display the second picture according to the embodiment shown in Figure 4-1 below.
可选的,可以在终端需要显示图片时,按上述301至303的步骤获取第二图片,以使终端每次显示不一样的图片;或者,周期性的获取第二图片,以使终端在每个周期内显示不一样的图片。Optionally, when the terminal needs to display a picture, it can obtain the second picture according to the
在本申请实施例中,通过获取第一图片对应的灰度图和第一图像,根据该灰度图像对第一图像中的各线条进行平移得到第二图像,第二图像中包括第一图片中的图像的轮廓,在第二图像中设置第二图像中的各线条包括的各像素点的像素值得到第二图片。这样获取的第二图片可以用于在终端进入熄灭模式后显示,由于进入熄灭模式后,基于原始的第一图片生成第二图片,可以实现在不同终端上获取用于在熄灭模式下显示的不同图片,避免目前显示预设图片所带来的千篇一律,过于单一的问题。In this embodiment of the present application, a grayscale image and a first image corresponding to the first picture are obtained, and each line in the first image is translated according to the grayscale image to obtain a second image, where the second image includes the first picture The outline of the image in the second image is set by setting the pixel value of each pixel included in each line in the second image in the second image to obtain the second picture. The second picture obtained in this way can be used for display after the terminal enters the extinguishing mode. Since the second picture is generated based on the original first picture after entering the extinguishing mode, different images for displaying in the extinguishing mode can be obtained on different terminals. pictures, to avoid the monotony and too single problem caused by the current display of preset pictures.
参见图4-1,本申请实施例提供了一种显示图片的方法,该图片可以是通过图3-1所示的实施例获取的第二图片。该方法可以用于图1所示的系统,执行主体可以为终端,包括:Referring to FIG. 4-1, an embodiment of the present application provides a method for displaying a picture, and the picture may be the second picture obtained by the embodiment shown in FIG. 3-1. The method can be used in the system shown in FIG. 1, and the execution subject can be a terminal, including:
步骤401:在终端屏幕中显示第二图片;或者,在第二图片上叠加渐变遮罩以得到第三图处片,在终端屏幕中显示第三图片。Step 401: Display the second picture on the terminal screen; or superimpose a gradient mask on the second picture to obtain a third picture, and display the third picture on the terminal screen.
第二图片可以是终端通过上述图3-1所示的实施例获取的;或者,第二图片是终端接收服务器发送的,服务器在通过图3-1所示的实施例获取第二图片后向终端发送第二图片。The second picture may be obtained by the terminal through the embodiment shown in Figure 3-1 above; or, the second picture may be sent by the terminal receiving the server, and the server sends the second picture after obtaining the second picture through the embodiment shown in Figure 3-1. The terminal sends the second picture.
可选的,在终端进入熄灭模式后可以在终端屏幕上显示第二图片;或者,在第二图片上叠加渐变遮罩以得到第三图处片,在终端屏幕中显示第三图片。在实现时,可以在如下几种情况显示第二图片,分别为:Optionally, after the terminal enters the off mode, the second picture may be displayed on the terminal screen; or, a gradient mask is superimposed on the second picture to obtain the third picture, and the third picture is displayed on the terminal screen. During implementation, the second picture can be displayed in the following situations:
第一种情况,在终端刚进入熄灭模式时,在终端屏幕上显示第二图片。或者,在第二图片上叠加渐变遮罩以得到第三图处片,在终端屏幕中显示第三图片。In the first case, when the terminal just enters the off mode, the second picture is displayed on the screen of the terminal. Alternatively, a gradient mask is superimposed on the second picture to obtain a third picture, and the third picture is displayed on the terminal screen.
可选的,可以在终端刚进入熄灭模式时,在终端的屏幕上显示第二图片或第三图片的时长可以等于预设时长阈值。Optionally, when the terminal just enters the off mode, the duration of displaying the second picture or the third picture on the screen of the terminal may be equal to the preset duration threshold.
第二种情况,在终端进入熄灭模式后且检测到终端被用户操作时,在终端屏幕中显示第二图片。或者,在第二图片上叠加渐变遮罩以得到第三图处片,在终端屏幕中显示第三图片。In the second case, after the terminal enters the off mode and it is detected that the terminal is operated by the user, a second picture is displayed on the screen of the terminal. Alternatively, a gradient mask is superimposed on the second picture to obtain a third picture, and the third picture is displayed on the terminal screen.
通常用户在拿起终端观看终端屏幕或操作终端时,终端随之发生抖动。例如,用户从随身携带的包中拿起终端观看终端屏幕,或者,用户从衣服口袋中拿起终端观看终端屏幕。此时终端可以检测到抖动发生,进而确定终端被用户操作,由于用户在操作终端时会观看终端屏幕,因此可以显示第二图片或第三图片供用户观看。Usually, when a user picks up the terminal to watch the terminal screen or operate the terminal, the terminal shakes accordingly. For example, the user picks up the terminal from a bag he carries with him to watch the screen of the terminal, or the user picks up the terminal from his clothes pocket to watch the screen of the terminal. At this time, the terminal can detect the occurrence of shaking, and then determine that the terminal is operated by the user. Since the user watches the terminal screen when operating the terminal, the second picture or the third picture can be displayed for the user to watch.
可选的,终端中包括陀螺仪、重力传感器和加速度传感器等中的至少一个运动传感器,通过运动传感器采集终端的运动参数,在该运动参数超过预设参数阈值时,确定终端发生抖动。Optionally, the terminal includes at least one motion sensor among a gyroscope, a gravity sensor, an acceleration sensor, etc., and the motion parameter of the terminal is collected by the motion sensor, and when the motion parameter exceeds a preset parameter threshold, it is determined that the terminal shakes.
第三种情况,在终端进入熄灭模式后且检测到终端屏幕前方的障碍物与终端屏幕之间的距离小于第一距离阈值时,在终端屏幕中显示第二图片。或者,在第二图片上叠加渐变遮罩以得到第三图处片,在终端屏幕中显示第三图片。In the third case, after the terminal enters the off mode and it is detected that the distance between the obstacle in front of the terminal screen and the terminal screen is smaller than the first distance threshold, the second picture is displayed on the terminal screen. Alternatively, a gradient mask is superimposed on the second picture to obtain a third picture, and the third picture is displayed on the terminal screen.
在第三种情况下,终端可以为电视机或显示器等终端设备,终端往往固定在某个位置,通常用户会向靠近终端方向走动,当用户走近终端,即用户与终端屏幕之间的距离小于第一距离阈值时,显示第二图片或第三图片,以让用户观看显示的第二图片或第三图片。In the third case, the terminal can be a terminal device such as a TV set or a monitor. The terminal is often fixed in a certain position. Usually, the user will walk towards the terminal. When the user approaches the terminal, the distance between the user and the terminal screen is When the distance is less than the first distance threshold, the second picture or the third picture is displayed, so that the user can view the displayed second picture or the third picture.
可选的,终端可以包括距离传感器或接近传感器,该距离传感器或该接近传感器可以检测终端屏幕前方是否有障碍物,以及该障碍物与终端屏幕之间的距离。Optionally, the terminal may include a distance sensor or a proximity sensor, and the distance sensor or the proximity sensor can detect whether there is an obstacle in front of the screen of the terminal and the distance between the obstacle and the screen of the terminal.
可选的,渐变遮罩包括显示区域和非显示区域,非显示区域的透明度小于或等于透明度阈值,显示区域的中心位置为终端屏幕的预设位置,显示区域的半径为第二半径阈值,显示区域中离中心位置越远的区域的透明度越小。Optionally, the gradient mask includes a display area and a non-display area, the transparency of the non-display area is less than or equal to a transparency threshold, the center position of the display area is a preset position of the terminal screen, the radius of the display area is the second radius threshold, and the display area is Regions that are farther from the center have less transparency.
透明度阈值可以为0、1%或2%等透明度较低的值,这样使得位于非显示区域下方的第四片无法被显示出来。The transparency threshold can be a lower transparency value such as 0, 1%, or 2%, so that the fourth slice below the non-display area cannot be displayed.
当显示区域是一个规则的图形区域时,显示区域的中心位置是显示区域的几何中心位置,例如,当显示区域是一个正圆形区域时,显示区域的中心位置是显示区域的几何中心位置。当显示区域是一个不规则的图形区域时,显示区域的中心位置是显示区域的重心位置。When the display area is a regular graphic area, the center position of the display area is the geometric center position of the display area. For example, when the display area is a perfect circular area, the center position of the display area is the geometric center position of the display area. When the display area is an irregular graphics area, the center position of the display area is the center of gravity of the display area.
终端屏幕的预设位置是预先定义的位置,例如预设位置可以是终端屏幕中心位置正下方且距离中心位置的距离为预设值的位置,或者,可以是终端屏幕中心位置正上方且距离中心位置的距离为预设值的位置。假设预设值为200像素,则预设位置为终端屏幕中心位置正下方且距离中心位置200像素的位置,或者,预设位置为终端屏幕中心位置正上方且距离中心位置200像素的位置。The preset position of the terminal screen is a pre-defined position, for example, the preset position may be a position directly below the center position of the terminal screen and the distance from the center position is a preset value, or it may be directly above the center position of the terminal screen and away from the center The distance of the position is the position of the preset value. Assuming that the preset value is 200 pixels, the preset position is directly below the center of the terminal screen and 200 pixels away from the center, or the preset position is directly above the center of the terminal screen and 200 pixels away from the center.
本步骤可以通过如下4021至4022的步骤在第二图片上叠加渐变遮罩,可以为:In this step, a gradient mask can be superimposed on the second image through the following steps 4021 to 4022, which can be:
4021:在第二图片叠加一层遮罩,其中,该遮罩的透明度小于或等于透明度阈值。4021: Superimpose a layer of mask on the second picture, wherein the transparency of the mask is less than or equal to the transparency threshold.
由于该遮罩的透明度较小,小于或等于透明度阈值,所以该遮罩可以挡住第二图片显示。Since the transparency of the mask is small, which is less than or equal to the transparency threshold, the mask can block the display of the second picture.
可选的,该遮罩的颜色可以为黑色。该遮罩可以是图层。Optionally, the color of the mask can be black. The mask can be a layer.
4022:在该遮罩上设置显示区域,形成渐变遮罩,以得到第三图片,该渐变遮罩除显示区域以外的其他区域为非显示区域。4022 : Set a display area on the mask to form a gradient mask to obtain a third picture, and other areas of the gradient mask except the display area are non-display areas.
首先,可以确定终端屏幕的预设位置,例如,可以寻找出终端屏幕中心位置正下方且距离中心位置的距离为预设值的位置并作为预设位置,或者,可以寻找出终端屏幕中心位置正上方且距离中心位置的距离为预设值的位置并作为预设位置。First, the preset position of the terminal screen can be determined. For example, the position directly below the center position of the terminal screen and the distance from the center position is the preset value can be found and used as the preset position, or the position directly below the center position of the terminal screen can be found. The distance above and from the center position is the position of the preset value and is used as the preset position.
然后,在遮罩中以预设位置为圆心且以第二半径阈值为半径确定一个圆形区域作为显示区域。Then, a circular area is determined in the mask with the preset position as the center and the second radius threshold as the radius as the display area.
其中,第二半径阈值包括第一半径和第二半径,第一半径大于第二半径或者,第一半径小于第二半径;如果当前终端屏幕竖屏放置,则在遮罩中以预设位置为圆心且以第一半径确定一个圆形区域作为显示区域;如果当前终端屏幕横屏放置,则在遮罩中以预设位置为圆心且以第二半径确定一个圆形区域作为显示区域。Wherein, the second radius threshold includes a first radius and a second radius, the first radius is greater than the second radius or the first radius is less than the second radius; if the current terminal screen is placed in the vertical screen, the preset position in the mask is set as The center of the circle and the first radius are used to determine a circular area as the display area; if the current terminal screen is placed horizontally, the preset position in the mask is used as the center and the second radius is used to determine a circular area as the display area.
最后,在显示区域中设置离中心位置越远的区域的透明度越小。其中,显示区域的中心位置的透明度可以为100%,显示区域边缘的透明度可以为预设透明度阈值。Finally, set the transparency of areas farther from the center in the display area to be less. The transparency of the center position of the display area may be 100%, and the transparency of the edge of the display area may be a preset transparency threshold.
在本步骤中,通过在第二图片上叠加渐变遮罩,例如在图3-5所示的图片上添加渐变遮罩,得到的第三图片的效果图为图4-2所示,添加渐变遮罩可以实现渐变显示,可以提高显示效果,增加用户体验。In this step, by superimposing a gradient mask on the second picture, for example, adding a gradient mask to the picture shown in Figure 3-5, the resulting image of the third picture is shown in Figure 4-2, adding a gradient The mask can realize gradient display, which can improve the display effect and increase the user experience.
为了提高显示效果以及增加用户体验,在用户手指触摸终端屏幕时,可以调整显示第二图片或第三图片的亮度和/或调整渐变遮罩的显示区域的面积,详细实现如下:In order to improve the display effect and increase the user experience, when the user's finger touches the screen of the terminal, the brightness of the second picture or the third picture can be adjusted and/or the area of the display area of the gradient mask can be adjusted. The details are as follows:
步骤402:获取触摸终端屏幕的触摸参数,该触摸参数包括触摸点位置、触摸面积和按压终端屏幕的压力中的至少一个。Step 402: Acquire a touch parameter of the touch terminal screen, where the touch parameter includes at least one of a touch point position, a touch area, and a pressure for pressing the terminal screen.
其中,终端屏幕可以是触摸屏,在用户的手指触摸终屏幕时,可以检测到触摸屏产生触摸事件,并获取终端屏幕被触摸的触摸面积和/或按压终端屏幕的压力。触摸点位置可以为该触摸面积的中心位置The terminal screen may be a touch screen. When a user's finger touches the terminal screen, a touch event generated by the touch screen can be detected, and the touched touch area of the terminal screen and/or the pressure pressing the terminal screen can be obtained. The touch point position can be the center position of the touch area
步骤403:根据该触摸参数,执行用于调整第二图片或第三图片显示效果的操作。Step 403: According to the touch parameter, perform an operation for adjusting the display effect of the second picture or the third picture.
调整第二图片显示效果的操作可以包括平移第二图片中的线条包括的像素点,调整第二图片中的条线包括的像素点的亮度;调整第三图片显示效果的操作可以包括平移第三图片中的线条包括的像素点,调整第三图片中的条线包括的像素点的亮度和/或调整渐变遮罩包括的显示区域的面积等。The operation of adjusting the display effect of the second picture may include translating the pixels included in the lines in the second picture, and adjusting the brightness of the pixels included in the lines in the second picture; the operation of adjusting the display effect of the third picture may include translating the third picture. The pixels included in the lines in the picture, the brightness of the pixels included in the lines in the third picture is adjusted, and/or the area of the display area included in the gradient mask is adjusted, etc.
可选的,在触摸参数包括触摸点位置时,可以平移第二图片或第三图片中的线条包括的像素点,详细平移过程可以包括如下41a至43a的操作,分别为:Optionally, when the touch parameter includes the position of the touch point, the pixels included in the lines in the second picture or the third picture may be translated, and the detailed translation process may include the following operations 41a to 43a, respectively:
41a:从第二图片或第三图片中的各线条包括的像素点中获取第一像素点集合和第二像素点集合,第一像素点集合包括与该触摸点位置之间的距离小于或等于第一距离阈值的第一像素点,第二像素点集合包括与该触摸点位置之间的距离大于第一距离阈值的第二像素点。41a: Obtain the first pixel point set and the second pixel point set from the pixel points included in each line in the second picture or the third picture, where the first pixel point set includes the distance between the touch point and the position of the touch point less than or equal to For the first pixel point of the first distance threshold, the second pixel point set includes the second pixel point whose distance from the touch point position is greater than the first distance threshold.
可选的,可以根据第二图片或第三图片中的各线条包括的像素点的位置和该触摸点位置,计算出各线条包括的像素点与该触摸点位置之间的距离,将与该触摸点位置之间的距离小于或等于第一距离阈值的像素点作为第一像素点并组成第一像素点集合,以及将与该触摸点位置之间的距离大于第一距离阈值的像素点作为第二像素点并组成第二像素点集合。Optionally, according to the position of the pixel included in each line in the second picture or the third picture and the position of the touch point, the distance between the pixel included in each line and the position of the touch point can be calculated, and the distance between the pixel and the position of the touch point can be calculated. Pixels whose distance between the touch point positions is less than or equal to the first distance threshold are used as the first pixel points and form a first set of pixel points, and the pixels whose distance from the touch point position is greater than the first distance threshold are used as the first pixel points. The second pixel points form a second set of pixel points.
42a:获取第一像素点集合中的每个第一像素点的第三偏移值和第二像素点集合中的每个第二像素点的第四偏移值,每个第一像素点的第三偏移值均大于每个第二像素点的第四偏移值或者每个第一像素点的第三偏移值均小于每个第二像素点的第四偏移值。42a: Obtain the third offset value of each first pixel point in the first pixel point set and the fourth offset value of each second pixel point in the second pixel point set, and the The third offset value is larger than the fourth offset value of each second pixel point or the third offset value of each first pixel point is smaller than the fourth offset value of each second pixel point.
可选的,预设第一分段函数和第二分段函数,第一分段函数对应的曲线变化幅度大于第二分段函数对应的曲线变化幅度。例如第一分段函数可以为正弦函数,第二分段函数可以为正态分布函数。Optionally, the first piecewise function and the second piecewise function are preset, and the variation range of the curve corresponding to the first piecewise function is greater than the variation range of the curve corresponding to the second piecewise function. For example, the first piecewise function may be a sine function, and the second piecewise function may be a normal distribution function.
在本步骤中,可以根据第一像素点集合中的每个第一像素点与该触摸点位置之间的距离,通过第一分段函数计算出每个第一像素点的第三偏移值,以及,可以根据第二像素点集合中的每个第二像素点与该触摸点位置之间的距离,通过第二分段函数计算出每个第二像素点的第四偏移值,且每个第一像素点的第三偏移值均大于每个第二像素点的第四偏移值。或者,In this step, the third offset value of each first pixel point can be calculated by the first piecewise function according to the distance between each first pixel point in the first pixel point set and the position of the touch point , and, according to the distance between each second pixel point in the second pixel point set and the position of the touch point, the fourth offset value of each second pixel point can be calculated by the second piecewise function, and The third offset value of each first pixel point is greater than the fourth offset value of each second pixel point. or,
可以根据第一像素点集合中的每个第一像素点与该触摸点位置之间的距离,通过第二分段函数计算出每个第一像素点的第三偏移值,以及,可以根据第二像素点集合中的每个第二像素点与该触摸点位置之间的距离,通过第一分段函数计算出每个第二像素点的第四偏移值,且每个第一像素点的第三偏移值均小于每个第二像素点的第四偏移值。The third offset value of each first pixel point can be calculated by the second piecewise function according to the distance between each first pixel point in the first pixel point set and the position of the touch point, and, according to The distance between each second pixel point in the second pixel point set and the position of the touch point is calculated by using the first piecewise function to calculate the fourth offset value of each second pixel point, and each first pixel point The third offset value of each point is smaller than the fourth offset value of each second pixel point.
43a:根据每个第一像素点的第三偏移值和每个第一像素点与触摸点位置之间的相对位置,分别平移每个第一像素点,以及,根据每个第二像素点的第四偏移值和每个第二像素点与触摸点位置之间的相对位置,分别平移每个第二像素点。43a: Translate each first pixel point according to the third offset value of each first pixel point and the relative position between each first pixel point and the touch point position, and, according to each second pixel point The fourth offset value of , and the relative position between each second pixel point and the touch point position, respectively translate each second pixel point.
可选的,本步骤可以使第二图片或第三图片中的像素点向远离触摸点位置的方向平移,实现过程可以为:Optionally, in this step, the pixels in the second picture or the third picture can be moved in a direction away from the position of the touch point, and the implementation process can be as follows:
对于任一个第一像素点,如果该第一像素点位于该触摸点位置的上方,则根据该第一像素点的第三偏移值,向上平移该第一像素点,如果该第一像素点位于该触摸点位置的下方,则根据该第一像素点的第三偏移值,向下平移该第一像素点。以及,对于任一个第二像素点,如果该第二像素点位于该触摸点位置的上方,则根据该第二像素点的第四偏移值,向上平移该第二像素点,如果该第二像素点位于该触摸点位置的下方,则根据该第一像素点的第三偏移值,向下平移该第一像素点。For any first pixel, if the first pixel is located above the touch point, the first pixel is shifted upward according to the third offset value of the first pixel. If the first pixel is Below the touch point, the first pixel is shifted downward according to the third offset value of the first pixel. And, for any second pixel point, if the second pixel point is located above the touch point position, then according to the fourth offset value of the second pixel point, translate the second pixel point upward, if the second pixel point If the pixel point is located below the position of the touch point, the first pixel point is shifted downward according to the third offset value of the first pixel point.
可选的,本步骤可以使第二图片或第三图片中的像素点向靠近触摸点位置的方向平移,实现过程可以为:Optionally, in this step, the pixels in the second picture or the third picture can be translated in a direction close to the position of the touch point, and the implementation process can be as follows:
对于任一个第一像素点,如果该第一像素点位于该触摸点位置的上方,则根据该第一像素点的第三偏移值,向下平移该第一像素点,如果该第一像素点位于该触摸点位置的下方,则根据该第一像素点的第三偏移值,向上平移该第一像素点。以及,对于任一个第二像素点,如果该第二像素点位于该触摸点位置的上方,则根据该第二像素点的第四偏移值,向下平移该第二像素点,如果该第二像素点位于该触摸点位置的下方,则根据该第一像素点的第三偏移值,向上平移该第一像素点。For any first pixel, if the first pixel is located above the touch point, the first pixel is shifted downward according to the third offset value of the first pixel. If the point is located below the position of the touch point, the first pixel point is translated upward according to the third offset value of the first pixel point. And, for any second pixel point, if the second pixel point is located above the touch point position, then according to the fourth offset value of the second pixel point, move the second pixel point downward, if the second pixel point If two pixels are located below the position of the touch point, the first pixel is shifted upward according to the third offset value of the first pixel.
可选的,在触摸参数包括触摸点位置时,可以调整第二图片或第三图片中的条线包括的像素点的亮度,详细调整过程可以包括如下41b至43b的操作,分别为:Optionally, when the touch parameter includes the position of the touch point, the brightness of the pixels included in the lines in the second picture or the third picture may be adjusted, and the detailed adjustment process may include the following operations 41b to 43b, respectively:
41b:获取第二图片或第三图片中的各线条包括的像素点与触摸点位置之间的距离。41b: Acquire the distance between the pixel point included in each line in the second picture or the third picture and the position of the touch point.
可选的,可以根据第二图片或第三图片中的各线条包括的像素点的位置和该触摸点位置,计算出各线条包括的像素点与该触摸点位置之间的距离。Optionally, the distance between the pixel points included in each line and the position of the touch point may be calculated according to the position of the pixel point included in each line in the second picture or the third picture and the position of the touch point.
42b:根据第二图片中的各线条包括的像素点与该触摸点位置之间的距离,获取第二图片中的各线条包括的像素点的第一亮度调整值。或者,根据第三图片中的各线条包括的像素点与该触摸点位置之间的距离,获取第三图片中的各线条包括的像素点的第一亮度调整值。42b: Acquire a first brightness adjustment value of the pixels included in the lines in the second picture according to the distance between the pixels included in the lines in the second picture and the position of the touch point. Alternatively, the first brightness adjustment value of the pixels included in the lines in the third picture is obtained according to the distance between the pixels included in the lines in the third picture and the position of the touch point.
可选的,对于第二图片或第三图片中的任一线条中的任一个像素点,该像素点的第一亮度调整值可以为k1/d,d为该像素点与该触摸点位置之间的距离,k1为第一预设系数。这样当该像素点与该触摸点位置之间的距离越大,该像素点的第一亮度调整值越小,当该像素点与该触摸点位置之间的距离越小,该像素点的第一亮度调整值越大。Optionally, for any pixel point in any line in the second picture or the third picture, the first brightness adjustment value of the pixel point may be k1/d, and d is the difference between the pixel point and the touch point position. The distance between them, k1 is the first preset coefficient. In this way, when the distance between the pixel point and the touch point position is larger, the first brightness adjustment value of the pixel point is smaller, and when the distance between the pixel point and the touch point position is smaller, the first brightness adjustment value of the pixel point is smaller. A brightness adjustment value is larger.
43b:根据第二图片中的各线条包括的像素点的第一亮度调整值,调整显示第二图片中的各线条包括的像素点的亮度。根据第三图片中的各线条包括的像素点的第一亮度调整值,调整显示第三图片中的各线条包括的像素点的亮度。43b: Adjust and display the brightness of the pixels included in the lines in the second picture according to the first brightness adjustment value of the pixels included in the lines in the second picture. According to the first brightness adjustment value of the pixels included in the lines in the third picture, the brightness of the pixels included in the lines in the third picture is adjusted and displayed.
可选的,对于第二图片或第三图片中的各线条包括的任一像素点,可以将该像素点的高度值增加该像素点的第一亮度调整值。其中,与该触摸点位置之间的距离越近的像素点的第一亮度调整值变化幅度较大,所以当用户手指划过显示的第二图片或第三图片时,离触摸点位置附近的像素点的第一亮度调整值较大,离触摸点位置较远的像素点的第一亮度调整值较小,所以在手指划过的位置可以显示出发光较亮的线条,如图4-3所示的效果图,从而提高了显示效果。Optionally, for any pixel point included in each line in the second picture or the third picture, the height value of the pixel point may be increased by the first brightness adjustment value of the pixel point. Among them, the first brightness adjustment value of the pixel that is closer to the position of the touch point has a larger variation range, so when the user's finger swipes the displayed second or third picture, the pixel near the touch point The first brightness adjustment value of the pixel point is larger, and the first brightness adjustment value of the pixel point farther from the touch point is smaller, so the brighter line can be displayed at the position where the finger is swiped, as shown in Figure 4-3 As shown in the renderings, the display effect is improved.
可选的,在该触摸参数包括按压终端屏幕的压力时,可以调整第二图片或第三图片中的条线包括的像素点的亮度,详细调整过程可以:Optionally, when the touch parameter includes the pressure of pressing the terminal screen, the brightness of the pixels included in the lines in the second picture or the third picture can be adjusted, and the detailed adjustment process can be as follows:
根据按压终端屏幕的压力获取第二亮度调整值,并根据第二亮度调整值,调整显示第二图片或第三图片中的各线条包括的像素点的亮度。The second brightness adjustment value is obtained according to the pressure of pressing the screen of the terminal, and the brightness of the pixels included in the lines in the displayed second picture or the third picture is adjusted according to the second brightness adjustment value.
可选的,第二亮度调整值可以为k2*w,其中k2为第二预设系数,w为按压终端屏幕的压力,或者为按压终端屏幕的压力所在的级别。Optionally, the second brightness adjustment value may be k2*w, where k2 is a second preset coefficient, and w is the pressure of pressing the terminal screen, or the level of the pressure of pressing the terminal screen.
其中,事先建立压力范围与级别的对应关系。所以按压终端屏幕的压力所在的级别可以按如下方式得到:确定按压终端屏幕的压力所在压力范围,根据确定的压力范围,从压力范围与级别的对应关系获取按压终端屏幕的压力所在的级别。Among them, the corresponding relationship between the pressure range and the level is established in advance. Therefore, the level of the pressure pressing the terminal screen can be obtained as follows: determine the pressure range of the pressure pressing the terminal screen, and obtain the level of the pressure pressing the terminal screen from the corresponding relationship between the pressure range and the level according to the determined pressure range.
可选的,在触摸参数包括触摸面积时,可以调整渐变遮罩包括的显示区域的面积,详细调整的过程可以为:根据该触摸面积获取渐变遮罩包括的显示区域的半径,根据该半径调整该渐变遮罩包括的显示区域的面积。Optionally, when the touch parameter includes the touch area, the area of the display area included in the gradient mask may be adjusted, and the detailed adjustment process may be: obtaining the radius of the display area included in the gradient mask according to the touch area, and adjusting according to the radius. The area of the display area covered by the gradient mask.
可选的,当该触摸面积S大于预设接触面积S0时,渐变遮罩包括的显示区域的半径R=(R0*S)/S0,R0为第二半径阈值。Optionally, when the touch area S is greater than the preset contact area S0, the radius of the display area included in the gradient mask is R=(R0*S)/S0, where R0 is the second radius threshold.
可选的,终端中包括至少一个传感器,为了提高显示效果以及增加用户体验,可以获取终端中的至少一个传感器采集的数据,根据采集的数据调整终端显示第二图片或第三图片的亮度和/或渐变遮罩的显示区域的面积大小。Optionally, the terminal includes at least one sensor. In order to improve the display effect and increase the user experience, data collected by at least one sensor in the terminal can be obtained, and the brightness and/or brightness of the second picture or the third picture displayed by the terminal can be adjusted according to the collected data. Or the size of the display area of the gradient mask.
其中,终端中可以包括紫外线传感器、心率/血氧传感器、声音传感器(麦克风)、距离传感器、气压传感器和磁场传感器等中的至少一个。The terminal may include at least one of an ultraviolet sensor, a heart rate/blood oxygen sensor, a sound sensor (microphone), a distance sensor, an air pressure sensor, a magnetic field sensor, and the like.
可选的,当终端包括紫外线传感器时,获取紫外线传感器采集的紫外线指数a。根据第三预设系数k3和该紫外线指数a,计算第三亮度调整值为k3*a,将终端显示第二图片或第三图片的亮度增加或减小第三亮度调整值;和/或,根据第一半径系数r1和该紫外线指数a,计算第一半径调整值为r1*a,将渐变遮罩的显示区域的半径增加或减小第一半径调整值。Optionally, when the terminal includes an ultraviolet sensor, the ultraviolet index a collected by the ultraviolet sensor is acquired. Calculate the third brightness adjustment value k3*a according to the third preset coefficient k3 and the ultraviolet index a, and increase or decrease the brightness of the second picture or the third picture displayed by the terminal by the third brightness adjustment value; and/or, According to the first radius coefficient r1 and the ultraviolet index a, the first radius adjustment value is calculated as r1*a, and the radius of the display area of the gradient mask is increased or decreased by the first radius adjustment value.
可选的,当终端包括心率/血氧传感器时,获取心率/血氧传感器采集的心率值b和血氧值c。根据第四预设系数k4、该心率值b和该血氧值c,计算第四亮度调整值为(k4*b)/c,将终端显示第二图片或第三图片的亮度增加或减小第四亮度调整值;和/或,根据第二半径系数r2、该心率值b和该血氧值c,计算第二半径调整值为(r2*b)/c,将渐变遮罩的显示区域的半径增加或减小第二半径调整值。Optionally, when the terminal includes a heart rate/blood oxygen sensor, acquire the heart rate value b and the blood oxygen value c collected by the heart rate/blood oxygen sensor. According to the fourth preset coefficient k4, the heart rate value b and the blood oxygen value c, the fourth brightness adjustment value is calculated as (k4*b)/c, and the brightness of the second picture or the third picture displayed by the terminal is increased or decreased a fourth brightness adjustment value; and/or, according to the second radius coefficient r2, the heart rate value b and the blood oxygen value c, the second radius adjustment value is calculated as (r2*b)/c, and the display area of the gradient mask is Radius increases or decreases the second radius adjustment value.
可选的,当终端包括气压传感器或声音传感器(麦克风)时,获取气压传感器或声音传感器(麦克风)采集的气体流速v。根据第五预设系数k5和该气体流速v,计算第五亮度调整值为k5*v,将终端显示第二图片或第三图片的亮度增加或减小第五亮度调整值;和/或,根据第三半径系数r3和该气体流速v,计算第三半径调整值为r3*v,将渐变遮罩的显示区域的半径增加或减小第三半径调整值。Optionally, when the terminal includes an air pressure sensor or a sound sensor (microphone), the gas flow velocity v collected by the air pressure sensor or the sound sensor (microphone) is acquired. Calculate the fifth brightness adjustment value k5*v according to the fifth preset coefficient k5 and the gas flow velocity v, and increase or decrease the brightness of the second picture or the third picture displayed by the terminal by the fifth brightness adjustment value; and/or, According to the third radius coefficient r3 and the gas flow velocity v, the third radius adjustment value is calculated as r3*v, and the radius of the display area of the gradient mask is increased or decreased by the third radius adjustment value.
其中,气压传感器或声音传感器(麦克风)采集的气体流速v可以是用户对终端进行吹气产生的,这样当用户吹气的流速越大,显示第二图片的亮度越高,或者显示第三图片的亮度越高和/或显示区域的面积越大;或者,当用户吹气的流速越大,显示第二图片的亮度越低,或者显示第三图片的亮度越低和/或显示区域的面积越小,从而提高了显示效果和用户体验。Wherein, the gas flow rate v collected by the air pressure sensor or the sound sensor (microphone) may be generated by the user blowing air on the terminal, so that when the user blows air at a higher flow rate, the brightness of the second picture displayed will be higher, or the third picture will be displayed. The higher the brightness and/or the larger the area of the display area; or, when the flow rate of the user blowing air is larger, the lower the brightness of the displayed second picture, or the lower the brightness of the displayed third picture and/or the area of the display area The smaller it is, the display effect and user experience are improved.
可选的,当终端包括声音传感器(麦克风)时,获取声音传感器(麦克风)采集的音量值e。根据第六预设系数k6和该音量值e,计算第六亮度调整值为k6*e,将终端显示第二图片或第三图片的亮度增加或减小第六亮度调整值;和/或,根据第四半径系数r4和该音量值e,计算第四半径调整值为r4*e,将渐变遮罩的显示区域的半径增加或减小第四半径调整值。Optionally, when the terminal includes a sound sensor (microphone), the volume value e collected by the sound sensor (microphone) is acquired. According to the sixth preset coefficient k6 and the volume value e, the sixth brightness adjustment value is calculated as k6*e, and the brightness of the second picture or the third picture displayed by the terminal is increased or decreased by the sixth brightness adjustment value; and/or, According to the fourth radius coefficient r4 and the volume value e, the fourth radius adjustment value is calculated as r4*e, and the radius of the display area of the gradient mask is increased or decreased by the fourth radius adjustment value.
可选的,当终端包括光线传感器时,获取光线传感器采集的光线强度值f。根据第七预设系数k7和该光线强度值f,计算第七亮度调整值为k7*f,将终端显示第二图片或第三图片的亮度增加或减小第七亮度调整值;和/或,根据第五半径系数r5和该光线强度值f,计算第五半径调整值为r5*f,将渐变遮罩的显示区域的半径增加或减小第五半径调整值。Optionally, when the terminal includes a light sensor, the light intensity value f collected by the light sensor is acquired. Calculate the seventh brightness adjustment value k7*f according to the seventh preset coefficient k7 and the light intensity value f, and increase or decrease the brightness of the second picture or the third picture displayed by the terminal by the seventh brightness adjustment value; and/or , according to the fifth radius coefficient r5 and the light intensity value f, the fifth radius adjustment value is calculated as r5*f, and the radius of the display area of the gradient mask is increased or decreased by the fifth radius adjustment value.
可选的,当终端包括气压传感器时,获取气压传感器采集的气压值f。根据第七预设系数k7和该气压值f,计算第七亮度调整值为k7*f,将终端显示第二图片或第三图片的亮度增加或减小第七亮度调整值;和/或,根据第六半径系数r6和该气压值f,计算第六半径调整值为r6*f,将渐变遮罩的显示区域的半径增加或减小第六半径调整值。Optionally, when the terminal includes an air pressure sensor, the air pressure value f collected by the air pressure sensor is obtained. According to the seventh preset coefficient k7 and the air pressure value f, the seventh brightness adjustment value is calculated as k7*f, and the brightness of the second picture or the third picture displayed by the terminal is increased or decreased by the seventh brightness adjustment value; and/or, According to the sixth radius coefficient r6 and the air pressure value f, the sixth radius adjustment value is calculated as r6*f, and the radius of the display area of the gradient mask is increased or decreased by the sixth radius adjustment value.
可选的,当终端包括磁场传感器时,获取磁场传感器采集的磁场强度值g。根据第八预设系数k8和该磁场强度值g,计算第八亮度调整值为k8*g,将终端显示第二图片或第三图片的亮度增加或减小第八亮度调整值;和/或,根据第六半径系数r6和该磁场强度值g,计算第六半径调整值为r6*g,将渐变遮罩的显示区域的半径增加或减小第六半径调整值。Optionally, when the terminal includes a magnetic field sensor, acquire the magnetic field strength value g collected by the magnetic field sensor. Calculate the eighth brightness adjustment value k8*g according to the eighth preset coefficient k8 and the magnetic field strength value g, and increase or decrease the brightness of the second picture or the third picture displayed by the terminal by the eighth brightness adjustment value; and/or , according to the sixth radius coefficient r6 and the magnetic field strength value g, the sixth radius adjustment value is calculated as r6*g, and the radius of the display area of the gradient mask is increased or decreased by the sixth radius adjustment value.
可选的,当终端包括距离传感器时,获取距离传感器采集的终端屏幕前方的障碍物与终端屏幕之间的距离h。根据第九预设系数k9和该距离h,计算第九亮度调整值为k9*h,将终端显示第二图片或第三图片的亮度增加或减小第九亮度调整值;和/或,根据第七半径系数r7和该距离h,计算第七半径调整值为r7*h,将渐变遮罩的显示区域的半径增加或减小第七半径调整值。Optionally, when the terminal includes a distance sensor, the distance h between the obstacle in front of the terminal screen and the terminal screen collected by the distance sensor is acquired. According to the ninth preset coefficient k9 and the distance h, the ninth brightness adjustment value is calculated as k9*h, and the brightness of the second picture or the third picture displayed by the terminal is increased or decreased by the ninth brightness adjustment value; and/or, according to For the seventh radius coefficient r7 and the distance h, the seventh radius adjustment value is calculated as r7*h, and the radius of the display area of the gradient mask is increased or decreased by the seventh radius adjustment value.
其中,用户手指可以远离终端屏幕或靠近终端屏幕,距离传感器采集的终端屏幕前方的障碍物与终端屏幕之间的距离h,该距离可以为用户手指与终端屏幕之间的距离。这样当用户手指靠近终端屏幕时,显示第二图片的亮度越高,或者显示第三图片的亮度越高和/或显示区域的面积越大;或者,当用户手指远离终端屏幕时,显示第二图片的亮度越低,或者显示第三图片的亮度越低和/或显示区域的面积越小,从而提高了显示效果和用户体验。Wherein, the user's finger can be far away from the terminal screen or close to the terminal screen, and the distance h between the obstacle in front of the terminal screen collected by the sensor and the terminal screen can be the distance between the user's finger and the terminal screen. In this way, when the user's finger is close to the terminal screen, the brightness of the displayed second picture is higher, or the brightness of the displayed third picture is higher and/or the area of the display area is larger; or, when the user's finger is far away from the terminal screen, the second picture is displayed. The lower the brightness of the picture, or the lower the brightness of the third picture displayed and/or the smaller the area of the display area, thereby improving the display effect and user experience.
可选的,用户往往会配载穿戴设备,穿戴设备可以采集到用户的体征数据,为了提高显示效果以及增加用户体验,可以获取穿戴设备采集的用户体征数据,根据用户体征数据调整终端显示第二图片或第三图片的亮度。Optionally, the user is often equipped with a wearable device, and the wearable device can collect the user's vital signs data. In order to improve the display effect and increase the user experience, the user's vital signs data collected by the wearable device can be obtained, and the terminal display second can be adjusted according to the user's vital signs data. The brightness of the picture or third picture.
可选的,该体征数据可以包括心率值b和血氧值c,或者可以包括血压值等。Optionally, the sign data may include a heart rate value b and a blood oxygen value c, or may include a blood pressure value and the like.
当该体征数据包括心率值b和血氧值c,可以根据第四预设系数k4、该心率值b和该血氧值c,计算第四亮度调整值为(k4*b)/c,将终端显示第二图片或第三图片的亮度增加或减小第四亮度调整值。When the sign data includes the heart rate value b and the blood oxygen value c, the fourth brightness adjustment value can be calculated according to the fourth preset coefficient k4, the heart rate value b and the blood oxygen value c, and the fourth brightness adjustment value is (k4*b)/c, The terminal displays the brightness of the second picture or the third picture to increase or decrease the fourth brightness adjustment value.
当该体征数据包括血压值p,可以根据第十预设系数k10和该距离p,计算第十亮度调整值为k10*p,将终端显示第二图片或第三图片的亮度增加或减小第十亮度调整值。When the sign data includes the blood pressure value p, the tenth brightness adjustment value can be calculated according to the tenth preset coefficient k10 and the distance p, and the tenth brightness adjustment value can be calculated as k10*p, and the brightness of the second picture or the third picture displayed by the terminal can be increased or decreased by the first Ten brightness adjustment values.
可选的,在终端屏幕中显示第二图片或第三图片之后,当显示第二图片或第三图片的时间长度达到时长阈值时,获取终端的前置摄像头拍摄的第四图片;当第四图片中包括人眼图像时,在第一时间段内显示第二图片或第三图片,第一时间段为离当前最近且时长为预设时长的时间段。Optionally, after displaying the second picture or the third picture on the screen of the terminal, when the length of time for displaying the second picture or the third picture reaches the duration threshold, acquire the fourth picture taken by the front camera of the terminal; When the picture includes a human eye image, the second picture or the third picture is displayed in a first time period, where the first time period is a time period closest to the current time and the duration is a preset duration.
当显示第二图片或第三图片的时间长度达到时长阈值时,如果终端的前置摄像头拍摄的第四图片包括人眼图像,表明当前用户还在观看终端的屏幕,因此继续显示预设时长的第二图片或第三图片,从而可以提高用户体验。When the duration of displaying the second picture or the third picture reaches the duration threshold, if the fourth picture captured by the front camera of the terminal includes an image of the human eye, it indicates that the current user is still watching the screen of the terminal, so the preset duration continues to be displayed. The second picture or the third picture, so that the user experience can be improved.
可选的,在获取终端的前置摄像头拍摄的第四图片之后,当第四图片中不包括人眼图像且检测到终端被用户操作或终端屏幕前方的障碍物与终端屏幕之间的距离小于第二距离阈值时,在第一时间段内显示第二图片或第三图片。Optionally, after acquiring the fourth picture taken by the front camera of the terminal, when the fourth picture does not include a human eye image and it is detected that the terminal is operated by the user or the distance between the obstacle in front of the terminal screen and the terminal screen is less than At the second distance threshold, the second picture or the third picture is displayed within the first time period.
当显示第二图片或第三图片的时间长度达到时长阈值时,如果终端的前置摄像头拍摄的第四图片不包括人眼图像,表明当前用户可能没有在观看终端的屏幕。但仍然判断终端是否被用户操作或终端屏幕前方的障碍物与终端屏幕之间的距离是否小于第二距离阈值,如果判断终端被用户操作,则表明用户在操作终端时可能会观看终端屏幕,因此可以继续显示预设时长的第二图片或第三图片,从而可以提高用户体验。或者,如果判断终端屏幕前方的障碍物与终端屏幕之间的距离是否小于第二距离阈值,则表明用户可能在靠近终端屏幕,在靠近时可能会观看终端屏幕,因此可以继续显示预设时长的第二图片或第三图片,从而可以提高用户体验。When the duration of displaying the second picture or the third picture reaches the duration threshold, if the fourth picture captured by the front camera of the terminal does not include the human eye image, it indicates that the current user may not be watching the screen of the terminal. However, it is still judged whether the terminal is operated by the user or whether the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold. If it is judged that the terminal is operated by the user, it means that the user may watch the terminal screen when operating the terminal. The second picture or the third picture for a preset duration may continue to be displayed, thereby improving user experience. Alternatively, if it is determined whether the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, it indicates that the user may be approaching the terminal screen, and may watch the terminal screen when approaching, so the preset duration can continue to be displayed. The second picture or the third picture, so that the user experience can be improved.
其中,终端中还可以包括接近传感器,距离传感器、加速度传感器和/或陀螺仪等传感器,可以通过终端的加速度传感器和/或陀螺仪等传感器检测终端是否发生抖动,如果发生抖动,则判断出终端被用户操作。可以通过终端的接近传感器和/或距离传感器获取终端屏幕前方的障碍物与终端屏幕之间的距离。The terminal may also include sensors such as proximity sensors, distance sensors, acceleration sensors, and/or gyroscopes, and sensors such as acceleration sensors and/or gyroscopes of the terminal may be used to detect whether the terminal shakes, and if shaking occurs, it is determined that the terminal operated by the user. The distance between the obstacle in front of the screen of the terminal and the screen of the terminal may be acquired through the proximity sensor and/or the distance sensor of the terminal.
可选的,还可以根据终端的陀螺仪或加速度传感器检测终端屏幕,当检测到终端屏幕由横屏切换到竖屏时,将渐变遮罩的显示区域的半径设置为第一半径,当检测到终端屏幕由竖屏切换到横屏时,将渐变遮罩的显示区域的半径设置为第二半径,第一半径小于第二半径或者第一半径大于第二半径。Optionally, the terminal screen can also be detected according to the gyroscope or acceleration sensor of the terminal. When it is detected that the terminal screen is switched from the horizontal screen to the vertical screen, the radius of the display area of the gradient mask is set to the first radius. When the terminal screen is switched from the vertical screen to the horizontal screen, the radius of the display area of the gradient mask is set to the second radius, and the first radius is smaller than the second radius or the first radius is greater than the second radius.
可选的,在本实施例中,也可以按上述显示第二图片或第三图片的方式显示除第二图片或第三图片以外的其他图片,该其他图片包括基于线条生成的图像的轮廓。Optionally, in this embodiment, other pictures other than the second picture or the third picture may also be displayed in the above-mentioned manner of displaying the second picture or the third picture, and the other pictures include the outline of the image generated based on the line.
在本申请实施例中,在用户触摸显示的第二图片或第三图片时,获取触摸终端屏幕的触摸参数,根据该触摸参数,执行用于调整第二图片或第三图片显示效果的操作,从而可以提高显示第二图片或第三图片的效果。In the embodiment of the present application, when the user touches the displayed second picture or the third picture, the touch parameter of the touch terminal screen is acquired, and the operation for adjusting the display effect of the second picture or the third picture is performed according to the touch parameter, Thus, the effect of displaying the second picture or the third picture can be improved.
参见图5,本申请实施例提供了一种获取图片的装置500,所述装置500可以为上述任一实施例中的终端、终端中的部分、服务器或服务器中的部分,包括:Referring to FIG. 5 , an embodiment of the present application provides an
获取单元501,用于获取第一图片对应的灰度图像和第一图像,第一图片的尺寸等于第一图像的尺寸,第一图像包括相互平行的N条线条,相邻两线条之间的间隔不超过间隔阈值,N为大于1的整数;The obtaining
平移单元502,用于根据该灰度图像对第一图像中的各线条包括的像素点进行平移得到第二图像,第二图像中包括第一图片中的图像的轮廓;a
设置单元503,用于在第二图像中设置该各线条包括的各像素点的像素值得到第二图片。The
可选的,平移单元502,用于:Optionally, the
将第一图像中的各线条变换成弯曲线条,得到第三图像;Transform each line in the first image into a curved line to obtain a third image;
根据该灰度图像对第三图像中的各线条包括的像素点进行平移,得到第二图像。The pixel points included in each line in the third image are translated according to the grayscale image to obtain the second image.
可选的,平移单元502,用于:Optionally, the
根据第一线条包括的像素点的位置,通过随机函数获取第一线条包括的像素点的随机值,第一线条为第一图像中的任一条线条;According to the position of the pixel point included in the first line, the random value of the pixel point included in the first line is obtained through a random function, and the first line is any line in the first image;
根据第一线条包括的像素点的随机值和第一线条与第二线条之间的间隔,获取第一线条包括的像素点的第一偏移值,第二线条是第一线条的一条相邻线条;Obtain the first offset value of the pixels included in the first line according to the random value of the pixels included in the first line and the interval between the first line and the second line, and the second line is an adjacent one of the first line line;
根据第一线条包括的像素点的第一偏移值,分别平移第一线条包括的像素点,得到弯曲线条。According to the first offset value of the pixel points included in the first line, the pixel points included in the first line are respectively translated to obtain a curved line.
可选的,平移单元502,用于:Optionally, the
根据第三线条包括的像素点的位置,从该灰度图像中获取第三线条包括的像素点的灰度值,第三线条是第三图像中的任一条线条;According to the positions of the pixels included in the third line, the grayscale values of the pixels included in the third line are obtained from the grayscale image, and the third line is any line in the third image;
根据第三线条包括的像素点的灰度值,获取第三线条包括的像素点的第二偏移值;According to the gray value of the pixel point included in the third line, obtain the second offset value of the pixel point included in the third line;
根据第三线条包括的像素点的第二偏移值,分别平移第三线条包括的像素点。According to the second offset value of the pixel points included in the third line, the pixel points included in the third line are respectively translated.
可选的,设置单元503,用于:Optionally, the
根据目标像素点的目标位置,从第一图片中获取目标图像区域,目标像素点为第二图像中的任一条线条包括的一个像素点,目标图像区域的中心像素点的位置为该目标位置,目标图像区域的半径为第一半径阈值;According to the target position of the target pixel point, the target image area is obtained from the first picture, the target pixel point is a pixel point included in any line in the second image, and the position of the center pixel point of the target image area is the target position, The radius of the target image area is the first radius threshold;
根据目标图像区域中的各像素点的像素值计算目标像素值;Calculate the target pixel value according to the pixel value of each pixel in the target image area;
将目标像素点的像素值设置为目标像素值。Sets the pixel value of the target pixel point to the target pixel value.
可选的,在设置单元503,用于:Optionally, in the
获取当前环境的环境因素信息,该环境因素信息包括地理环境类型、温度信息和时间信息中的至少一者;Obtain environmental factor information of the current environment, where the environmental factor information includes at least one of geographic environment type, temperature information and time information;
根据当前环境的环境因素信息,从环境因素信息与环境颜色像素值的对应关系中获取当前环境对应的环境颜色像素值;According to the environmental factor information of the current environment, obtain the environmental color pixel value corresponding to the current environment from the corresponding relationship between the environmental factor information and the environmental color pixel value;
将第二图像中的各线条包括的各像素点的像素值设置为当前环境对应的环境颜色像素值,得到第二图片。The pixel value of each pixel included in each line in the second image is set as the pixel value of the environment color corresponding to the current environment to obtain the second picture.
可选的,所述装置500还包括:Optionally, the
显示单元,用于在终端屏幕中显示第二图片;或者,a display unit, used for displaying the second picture on the screen of the terminal; or,
所述装置500还包括:The
叠加单元,用于在第二图片上叠加渐变遮罩以得到第三图片,该渐变遮罩包括显示区域和非显示区域,非显示区域的透明度小于透明度阈值,显示区域的中心位置为终端屏幕的预设位置,显示区域的半径为第二半径阈值,显示区域的透明度大于或等于该透明度阈值且显示区域中离该中心位置越远的区域的透明度越小;A superimposing unit, used for superimposing a gradient mask on the second picture to obtain a third picture, the gradient mask includes a display area and a non-display area, the transparency of the non-display area is less than the transparency threshold, and the center position of the display area is the terminal screen The preset position, the radius of the display area is the second radius threshold, the transparency of the display area is greater than or equal to the transparency threshold, and the transparency of the area farther from the center position in the display area is smaller;
显示单元,用于在终端屏幕中显示第三图片。The display unit is used for displaying the third picture on the screen of the terminal.
可选的,所述装置500,还包括:Optionally, the
处理单元,用于获取触摸终端屏幕的触摸参数,该触摸参数包括触摸点位置、触摸面积和按压终端屏幕的压力中的至少一个;根据该触摸参数,执行用于调整第三图片显示效果的操作。a processing unit, configured to acquire touch parameters of the touch terminal screen, the touch parameters include at least one of the position of the touch point, the touch area and the pressure of pressing the terminal screen; according to the touch parameters, perform an operation for adjusting the display effect of the third picture .
可选的,所述处理单元,用于:Optionally, the processing unit is used for:
在该触摸参数包括触摸点位置时,从第三图片中的各线条包括的像素点中获取第一像素点集合和第二像素点集合,第一像素点集合包括与触摸点位置之间的距离小于或等于第一距离阈值的第一像素点,第二像素点集合包括与该触摸点位置之间的距离大于第一距离阈值的第二像素点;When the touch parameter includes the position of the touch point, a first set of pixels and a second set of pixels are obtained from the pixels included in each line in the third picture, and the first set of pixels includes the distance from the position of the touch point a first pixel that is less than or equal to a first distance threshold, and the second set of pixels includes a second pixel whose distance from the touch point position is greater than the first distance threshold;
获取第一像素点集合中的每个第一像素点的第三偏移值和第二像素点集合中的每个第二像素点的第四偏移值,每个第一像素点的第三偏移值均大于每个第二像素点的第四偏移值或者每个第一像素点的第三偏移值均小于每个第二像素点的第四偏移值;Obtain the third offset value of each first pixel point in the first pixel point set and the fourth offset value of each second pixel point in the second pixel point set, and the third offset value of each first pixel point The offset value is greater than the fourth offset value of each second pixel point or the third offset value of each first pixel point is smaller than the fourth offset value of each second pixel point;
根据每个第一像素点的第三偏移值和每个第一像素点与触摸点位置之间的相对位置,分别平移每个第一像素点,以及,根据每个第二像素点的第四偏移值和每个第二像素点与触摸点位置之间的相对位置,分别平移每个第二像素点。According to the third offset value of each first pixel point and the relative position between each first pixel point and the touch point position, translate each first pixel point respectively, and, according to the third offset value of each second pixel point Four offset values and the relative position between each second pixel point and the touch point position, respectively translate each second pixel point.
可选的,所述处理单元,用于:Optionally, the processing unit is used for:
在该触摸参数包括触摸点位置时,获取第三图片中的各线条包括的像素点与触摸点位置之间的距离;When the touch parameter includes the position of the touch point, obtain the distance between the pixel point included in each line in the third picture and the position of the touch point;
根据第三图片中的各线条包括的像素点与触摸点位置之间的距离,获取第三图片中的各线条包括的像素点的第一亮度调整值;According to the distance between the pixels included in the lines in the third picture and the position of the touch point, obtain the first brightness adjustment value of the pixels included in the lines in the third picture;
根据第三图片中的各线条包括的像素点的第一亮度调整值,调整显示第三图片中的各线条包括的像素点的亮度。According to the first brightness adjustment value of the pixels included in the lines in the third picture, the brightness of the pixels included in the lines in the third picture is adjusted and displayed.
可选的,所述处理单元,用于:Optionally, the processing unit is used for:
在该触摸参数包括按压终端屏幕的压力时,根据按压终端屏幕的压力获取第二亮度调整值,并根据第二亮度调整值,调整显示第三图片中的各线条包括的像素点的亮度;和/或,When the touch parameter includes the pressure of pressing the screen of the terminal, a second brightness adjustment value is obtained according to the pressure of pressing the screen of the terminal, and the brightness of the pixels included in the lines in the display third picture is adjusted according to the second brightness adjustment value; and /or,
在该触摸参数包括触摸面积时,根据该触摸面积获取渐变遮罩包括的显示区域的半径,根据该半径调整渐变遮罩包括的显示区域的面积。When the touch parameter includes a touch area, the radius of the display area included in the gradient mask is obtained according to the touch area, and the area of the display area included in the gradient mask is adjusted according to the radius.
可选的,所述处理单元,还用于:Optionally, the processing unit is further configured to:
获取终端中的至少一个传感器采集的数据,根据采集的数据获取第三亮度调整值,根据第三亮度调整值调整显示第三图片中的各线条包括的像素点的亮度;或者,Acquire data collected by at least one sensor in the terminal, obtain a third brightness adjustment value according to the collected data, and adjust and display the brightness of the pixels included in each line in the third picture according to the third brightness adjustment value; or,
获取穿戴设备采集的用户体征数据,根据该用户体征数据获取第四亮度调整值,根据第四亮度调整值调整显示第三图片中的各线条包括的像素点的亮度。Obtain user sign data collected by the wearable device, obtain a fourth brightness adjustment value according to the user sign data, and adjust the brightness of the pixels included in the lines in the displayed third picture according to the fourth brightness adjustment value.
可选的,所述处理单元,还用于:Optionally, the processing unit is further configured to:
在显示第三图片的时间长度达到时长阈值时,获取终端的前置摄像头拍摄的第四图片;When the duration of displaying the third picture reaches the duration threshold, acquiring the fourth picture captured by the front camera of the terminal;
当第四图片中包括人眼图像时,在第一时间段内显示第三图片,第一时间段为离当前最近且时长为预设时长的时间段。When the fourth picture includes a human eye image, the third picture is displayed in a first time period, where the first time period is a time period closest to the current time and the duration is a preset duration.
可选的,所述处理单元,还用于:Optionally, the processing unit is further configured to:
当第四图片中不包括人眼图像且检测到终端被用户操作或终端屏幕前方的障碍物与终端屏幕之间的距离小于第二距离阈值时,在第一时间段内显示第三图片。When the fourth picture does not include a human eye image and it is detected that the terminal is operated by the user or the distance between an obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, the third picture is displayed in the first time period.
在本申请实施例中,通过获取第一图片对应的灰度图和第一图像,根据该灰度图像对第一图像中的各线条进行平移得到第二图像,第二图像中包括第一图片中的图像的轮廓,在第二图像中设置第二图像中的各线条包括的各像素点的像素值得到第三图片。这样获取的第三图片可以用于在终端进入熄灭模式后显示,由于进入熄灭模式后,基于原始的第一图片生成第三图片,可以实现在不同终端上获取用于在熄灭模式下显示的不同图片,避免目前显示预设图片所带来的千篇一律,过于单一的问题。In this embodiment of the present application, a grayscale image and a first image corresponding to the first picture are obtained, and each line in the first image is translated according to the grayscale image to obtain a second image, where the second image includes the first picture In the second image, the pixel value of each pixel included in each line in the second image is set to obtain a third picture. The third picture obtained in this way can be used for displaying after the terminal enters the extinguishing mode. Since the third picture is generated based on the original first picture after entering the extinguishing mode, different images for displaying in the extinguishing mode can be obtained on different terminals. pictures, to avoid the monotony and too single problem caused by the current display of preset pictures.
参见图6,本申请实施例提供了一种对图片进行处理的装置600,所述装置600可以为上述任一实施例中的终端、终端中的部分、服务器或服务器中的部分,包括:Referring to FIG. 6 , an embodiment of the present application provides an
显示单元601,用于显示目标图片,目标图片包括基于线条生成的图像的轮廓;A
处理单元602,用于获取触摸所述终端屏幕的触摸参数,所述触摸参数包括触摸点位置、触摸面积和按压所述终端屏幕的压力中的至少一个;根据所述触摸参数,执行用于调整所述目标图片显示效果的操作。The
可选的,处理单元602,用于:Optionally, the
在该触摸参数包括触摸点位置时,从目标图片中的各线条包括的像素点中获取第一像素点集合和第二像素点集合,第一像素点集合包括与触摸点位置之间的距离小于或等于第一距离阈值的第一像素点,第二像素点集合包括与触摸点位置之间的距离大于第一距离阈值的第二像素点;When the touch parameter includes the position of the touch point, a first set of pixels and a second set of pixels are obtained from the pixels included in each line in the target image, and the first set of pixels includes a distance between the touch point and the position of the touch point less than or a first pixel that is equal to a first distance threshold, and the second set of pixels includes a second pixel whose distance from the touch point position is greater than the first distance threshold;
获取第一像素点集合中的每个第一像素点的第一偏移值和第二像素点集合中的每个第二像素点的第二偏移值,每个第一像素点的第一偏移值均大于每个第二像素点的第二偏移值或者每个第一像素点的第一偏移值均小于每个第二像素点的第二偏移值;Obtain the first offset value of each first pixel point in the first pixel point set and the second offset value of each second pixel point in the second pixel point set, and the first offset value of each first pixel point The offset value is greater than the second offset value of each second pixel point or the first offset value of each first pixel point is smaller than the second offset value of each second pixel point;
根据每个第一像素点的第一偏移值和每个第一像素点与触摸点位置之间的相对位置,分别平移每个第一像素点,以及,根据每个第二像素点的第二偏移值和每个第二像素点与触摸点位置之间的相对位置,分别平移每个第二像素点。According to the first offset value of each first pixel point and the relative position between each first pixel point and the touch point, translate each first pixel point respectively, and, according to the first pixel point of each second pixel point Two offset values and the relative position between each second pixel point and the touch point position, respectively translate each second pixel point.
可选的,处理单元602,用于:Optionally, the
在该触摸参数包括触摸点位置时,获取目标图片中的各线条包括的像素点与触摸点位置之间的距离;When the touch parameter includes the position of the touch point, obtain the distance between the pixel points included in each line in the target picture and the position of the touch point;
根据目标图片中的各线条包括的像素点与触摸点位置之间的距离,获取目标图片中的各线条包括的像素点的第一亮度调整值;According to the distance between the pixels included in the lines in the target picture and the position of the touch point, obtain the first brightness adjustment value of the pixels included in the lines in the target picture;
根据目标图片中的各线条包括的像素点的第一亮度调整值,调整显示目标图片中的各线条包括的像素点的亮度。According to the first brightness adjustment value of the pixels included in the lines in the target picture, the brightness of the pixels included in the lines in the display target picture is adjusted.
可选的,处理单元602,用于:Optionally, the
在该触摸参数包括按压终端屏幕的压力时,根据按压终端屏幕的压力获取第二亮度调整值,并根据第二亮度调整值,调整显示目标图片中的各线条包括的像素点的亮度。When the touch parameter includes the pressure of pressing the terminal screen, a second brightness adjustment value is obtained according to the pressure of pressing the terminal screen, and the brightness of the pixels included in each line in the display target picture is adjusted according to the second brightness adjustment value.
可选的,显示单元601,用于:Optionally, the
在目标图片上叠加渐变遮罩以得到第三图片,显示第三图片,渐变遮罩包括显示区域和非显示区域,非显示区域的透明度小于透明度阈值,显示区域的中心位置为终端屏幕的预设位置,显示区域的半径为第二半径阈值,显示区域的透明度大于或等于该透明度阈值且显示区域中离中心位置越远的区域的透明度越小。A gradient mask is superimposed on the target picture to obtain a third picture, and the third picture is displayed. The gradient mask includes a display area and a non-display area, the transparency of the non-display area is less than the transparency threshold, and the center position of the display area is the preset of the terminal screen position, the radius of the display area is the second radius threshold, the transparency of the display area is greater than or equal to the transparency threshold, and the transparency of the area farther from the center position in the display area is smaller.
可选的,处理单元602,用于:Optionally, the
在该触摸参数包括触摸面积时,根据触摸面积获取渐变遮罩包括的显示区域的半径,根据该半径调整渐变遮罩包括的显示区域的面积。When the touch parameter includes the touch area, the radius of the display area included in the gradient mask is obtained according to the touch area, and the area of the display area included in the gradient mask is adjusted according to the radius.
可选的,处理单元602,还用于:Optionally, the
获取终端中的至少一个传感器采集的数据,根据采集的数据获取第三亮度调整值,根据第三亮度调整值调整显示目标图片中的各线条包括的像素点的亮度;或者,Acquire data collected by at least one sensor in the terminal, obtain a third brightness adjustment value according to the collected data, and adjust the brightness of pixels included in each line in the display target image according to the third brightness adjustment value; or,
获取穿戴设备采集的用户体征数据,根据用户体征数据获取第四亮度调整值,根据第四亮度调整值调整显示目标图片中的各线条包括的像素点的亮度。Obtain user sign data collected by the wearable device, obtain a fourth brightness adjustment value according to the user sign data, and adjust the brightness of pixels included in each line in the display target image according to the fourth brightness adjustment value.
可选的,处理单元602,还用于在显示目标图片的时间长度达到时长阈值时,获取终端的前置摄像头拍摄的图片;Optionally, the
显示单元601,还用于当该图片中包括人眼图像时,在第一时间段内显示目标图片,第一时间段为离当前最近且时长为预设时长的时间段。The
可选的,显示单元601,还用于:Optionally, the
当所述图片中不包括人眼图像且检测到终端被用户操作或终端屏幕前方的障碍物与终端屏幕之间的距离小于第二距离阈值时,在第一时间段内显示目标图片。When the picture does not include a human eye image and it is detected that the terminal is operated by the user or the distance between the obstacle in front of the terminal screen and the terminal screen is less than the second distance threshold, the target picture is displayed in the first time period.
在本申请实施例中,在用户触摸显示的目标图片时,获取触摸终端屏幕的触摸参数,根据该触摸参数,执行用于调整目标图片显示效果的操作,从而可以提高显示目标图片的效果。In the embodiment of the present application, when the user touches the displayed target picture, the touch parameters of the touch terminal screen are acquired, and the operation for adjusting the display effect of the target picture is performed according to the touch parameters, so that the effect of displaying the target picture can be improved.
参见图7,图7所示为本申请实施例提供的一种获取图片的装置700示意图。该装置700包括至少一个处理器701,总线系统702和存储器703。Referring to FIG. 7 , FIG. 7 shows a schematic diagram of an
该装置700是一种硬件结构的装置,可以用于实现图5所述的装置中的功能单元。例如,本领域技术人员可以想到图5所示的装置500中的获取单元501、平移单元502和设置单元503可以通过该至少一个处理器701调用存储器703中的代码来实现。The
可选的,该装置700还可用于实现如图1所述的实施例中终端的功能,或者实现图1所示的实施例中服务器的功能。Optionally, the
可选的,上述处理器701可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the above-mentioned
上述总线系统702可包括一通路,在上述组件之间传送信息。The bus system 702 described above may include a path to transfer information between the above described components.
上述存储器703可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compactdisc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The above-mentioned
其中,存储器703用于存储执行本申请方案的应用程序代码,并由处理器701来控制执行。处理器701用于执行存储器703中存储的应用程序代码,从而实现本专利方法中的功能。Wherein, the
在具体实现中,作为一种实施例,处理器701可以包括一个或多个CPU,例如图7中的CPU0和CPU1。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,该装置700可以包括多个处理器,例如图7中的处理器701和处理器708。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,该装置700还可以包括输出设备705和输入设备706。输出设备705和处理器701通信,可以以多种方式来显示信息。例如,输出设备705可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备706和处理器701通信,可以以多种方式接受用户的输入。例如,输入设备706可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the
参见图8,图8所示为本申请实施例提供的一种对图片进行处理的装置800示意图。该装置800包括至少一个处理器801,总线系统802、存储器803和输出设备805。Referring to FIG. 8 , FIG. 8 shows a schematic diagram of an
该装置800是一种硬件结构的装置,可以用于实现图6所述的装置中的功能单元。例如,本领域技术人员可以想到图6所示的装置600中的处理单元602可以通过该至少一个处理器801调用存储器803中的代码来实现,显示单元601可以通过输出设备805来实现。The
可选的,该装置800还可用于实现如图1所述的实施例中终端的功能,或者实现图1所示的实施例中服务器的功能。Optionally, the
可选的,上述处理器801可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请方案程序执行的集成电路。Optionally, the above-mentioned
上述总线系统802可包括一通路,在上述组件之间传送信息。The bus system 802 described above may include a path to transfer information between the above described components.
上述存储器803可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compactdisc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。The above-mentioned
其中,存储器803用于存储执行本申请方案的应用程序代码,并由处理器801来控制执行。处理器801用于执行存储器803中存储的应用程序代码,从而实现本专利方法中的功能。Wherein, the
在具体实现中,作为一种实施例,处理器801可以包括一个或多个CPU,例如图8中的CPU0和CPU1。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,该装置800可以包括多个处理器,例如图8中的处理器801和处理器808。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the
在具体实现中,作为一种实施例,该装置800还可以包括输入设备806。输出设备805和处理器801通信,可以以多种方式来显示信息。例如,输出设备805可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备806和处理器801通信,可以以多种方式接受用户的输入。例如,输入设备806可以是鼠标、键盘、触摸屏设备或传感设备等。In a specific implementation, as an embodiment, the
本领域普通技术人员可以理解实现上述实施例的全部或部分步骤可以通过硬件来完成,也可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium. The storage medium mentioned may be a read-only memory, a magnetic disk or an optical disk, etc.
以上所述仅为本申请的可选实施例,并不用以限制本申请,凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above descriptions are only optional embodiments of the present application, and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present application shall be included in the protection of the present application. within the range.
Claims (28)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810806509.3A CN109240572B (en) | 2018-07-20 | 2018-07-20 | A method for acquiring pictures, and a method and device for processing pictures |
PCT/CN2019/096694 WO2020015724A1 (en) | 2018-07-20 | 2019-07-19 | Picture acquisition method, and picture processing method and device |
US17/033,223 US11302286B2 (en) | 2018-07-20 | 2020-09-25 | Picture obtaining method and apparatus and picture processing method and apparatus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810806509.3A CN109240572B (en) | 2018-07-20 | 2018-07-20 | A method for acquiring pictures, and a method and device for processing pictures |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109240572A CN109240572A (en) | 2019-01-18 |
CN109240572B true CN109240572B (en) | 2021-01-05 |
Family
ID=65072763
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810806509.3A Active CN109240572B (en) | 2018-07-20 | 2018-07-20 | A method for acquiring pictures, and a method and device for processing pictures |
Country Status (3)
Country | Link |
---|---|
US (1) | US11302286B2 (en) |
CN (1) | CN109240572B (en) |
WO (1) | WO2020015724A1 (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109240572B (en) * | 2018-07-20 | 2021-01-05 | 华为技术有限公司 | A method for acquiring pictures, and a method and device for processing pictures |
CN110865856B (en) * | 2018-08-27 | 2022-04-22 | 华为技术有限公司 | A kind of interface element color display method and device |
CN111176602B (en) * | 2019-12-27 | 2021-09-28 | 惠州Tcl移动通信有限公司 | Picture display method and device, storage medium and intelligent device |
CN111973410A (en) * | 2020-06-30 | 2020-11-24 | 北京迈格威科技有限公司 | Obstacle detection method and device, obstacle avoidance equipment and computer readable storage medium |
CN114115615B (en) * | 2020-08-10 | 2024-06-18 | 深圳市万普拉斯科技有限公司 | Interface display method, device, electronic device and storage medium |
CN112051995B (en) * | 2020-10-09 | 2022-01-28 | 腾讯科技(深圳)有限公司 | Image rendering method, related device, equipment and storage medium |
CN113012037B (en) * | 2021-03-11 | 2022-08-05 | 桂林电子科技大学 | Deep learning training data set synthesis method for underwater image restoration |
CN112987906B (en) * | 2021-03-26 | 2024-05-07 | 北京小米移动软件有限公司 | Method and device for reducing display power consumption |
CN114837645B (en) * | 2022-04-28 | 2023-07-07 | 西南石油大学 | Device and method for researching migration-blocking process of temporary blocking agent in hydraulic fracture |
CN115150390B (en) * | 2022-06-27 | 2024-04-09 | 山东信通电子股份有限公司 | Image display method, device, equipment and medium |
CN116772803B (en) * | 2023-08-24 | 2024-02-09 | 陕西德鑫智能科技有限公司 | Unmanned aerial vehicle detection method and device |
CN117114978B (en) * | 2023-10-24 | 2024-03-29 | 深圳软牛科技集团股份有限公司 | Picture cropping and restoring method and device based on iOS and related medium thereof |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5313570A (en) * | 1993-03-31 | 1994-05-17 | Miles, Inc. | Method for determining color boundaries for correcting for plate misregistration in color printing |
CN1765119A (en) * | 2003-12-08 | 2006-04-26 | 株式会社理光 | Image processing method and apparatus, image forming apparatus and system, program and recording medium |
CN103927727A (en) * | 2014-04-22 | 2014-07-16 | 成都品果科技有限公司 | Method for converting scalar image into vector image |
CN107622504A (en) * | 2017-09-30 | 2018-01-23 | 北京百度网讯科技有限公司 | Method and apparatus for handling picture |
Family Cites Families (32)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5825919A (en) * | 1992-12-17 | 1998-10-20 | Xerox Corporation | Technique for generating bounding boxes for word spotting in bitmap images |
JP4573977B2 (en) * | 1999-09-22 | 2010-11-04 | 富士重工業株式会社 | Distance correction device for monitoring system and vanishing point correction device for monitoring system |
JP2009239394A (en) | 2008-03-26 | 2009-10-15 | Seiko Epson Corp | Coloring image generating apparatus and method |
GB0818280D0 (en) * | 2008-10-06 | 2008-11-12 | Advanced Risc Mach Ltd | Graphics processing systems |
US8384740B1 (en) * | 2009-02-24 | 2013-02-26 | A9.Com, Inc. | Method and system for virtually placing a tangible item on an appendage |
CN102043434A (en) * | 2009-10-23 | 2011-05-04 | 富港电子(东莞)有限公司 | Electronic product, control device for electronic product and control method thereof |
JP4948586B2 (en) * | 2009-11-06 | 2012-06-06 | シャープ株式会社 | Document image generation apparatus, document image generation method, computer program, and recording medium |
CN102331838B (en) | 2011-11-18 | 2014-04-16 | 东南大学 | Method for expressing vibration tactility of image based on depth contour |
CN102496021A (en) | 2011-11-23 | 2012-06-13 | 南开大学 | Wavelet transform-based thresholding method of image |
TW201433161A (en) * | 2013-02-04 | 2014-08-16 | Hon Hai Prec Ind Co Ltd | Electronic device and method for shooting operation |
CN103236071B (en) | 2013-04-24 | 2016-06-01 | 上海电机学院 | A kind of generation method of stipple effect picture |
CN103279965B (en) | 2013-04-24 | 2016-01-13 | 上海电机学院 | A kind of generation method of two-value stipple effect picture and video |
CN103236070B (en) | 2013-04-24 | 2020-07-10 | 中云开源数据技术(上海)有限公司 | Method for generating weaving effect picture |
KR20150019165A (en) * | 2013-08-12 | 2015-02-25 | 엘지전자 주식회사 | Mobile terminal and method for controlling the same |
JP6311360B2 (en) * | 2014-03-06 | 2018-04-18 | ブラザー工業株式会社 | Image processing device |
US9998663B1 (en) * | 2015-01-07 | 2018-06-12 | Car360 Inc. | Surround image capture and processing |
CN104915976A (en) * | 2015-06-03 | 2015-09-16 | 厦门美图之家科技有限公司 | Image processing method and system for simulating pencil sketch |
US10354364B2 (en) * | 2015-09-14 | 2019-07-16 | Intel Corporation | Automatic perspective control using vanishing points |
EP3358295B1 (en) * | 2015-09-28 | 2020-10-07 | Kyocera Corporation | Image processing device, stereo camera device, vehicle, and image processing method |
KR20170046969A (en) * | 2015-10-22 | 2017-05-04 | 엘지전자 주식회사 | Mobile device and, the method thereof |
US10417489B2 (en) * | 2015-11-19 | 2019-09-17 | Captricity, Inc. | Aligning grid lines of a table in an image of a filled-out paper form with grid lines of a reference table in an image of a template of the filled-out paper form |
CN105574161B (en) * | 2015-12-15 | 2017-09-26 | 徐庆 | A kind of brand logo key element recognition methods, device and system |
CN106933474B (en) * | 2015-12-30 | 2020-02-04 | 网易(杭州)网络有限公司 | Image mixing processing method and device |
CN110133899A (en) * | 2018-02-09 | 2019-08-16 | 京东方科技集团股份有限公司 | Pixel arrangement structure, display base plate, display device |
US10854684B2 (en) * | 2016-02-18 | 2020-12-01 | Boe Technology Group Co., Ltd. | Pixel arrangement structure and driving method thereof, display substrate and display device |
JP6705251B2 (en) * | 2016-03-29 | 2020-06-03 | ブラザー工業株式会社 | Program and information processing device |
CN105975239B (en) * | 2016-04-29 | 2019-08-20 | 广东远峰汽车电子有限公司 | A kind of generation method and device of vehicle electronic device display screen dynamic background |
US10366469B2 (en) * | 2016-06-28 | 2019-07-30 | Abbyy Production Llc | Method and system that efficiently prepares text images for optical-character recognition |
GB2554668B (en) * | 2016-09-30 | 2022-06-22 | Apical Ltd | Image manipulation |
WO2018205232A1 (en) * | 2017-05-11 | 2018-11-15 | 上海联影医疗科技有限公司 | Method for automatically and accurately positioning reference line according to spliced result |
CN109104596B (en) * | 2017-06-21 | 2021-02-26 | 中强光电股份有限公司 | Projection system and correction method of display image |
CN109240572B (en) * | 2018-07-20 | 2021-01-05 | 华为技术有限公司 | A method for acquiring pictures, and a method and device for processing pictures |
-
2018
- 2018-07-20 CN CN201810806509.3A patent/CN109240572B/en active Active
-
2019
- 2019-07-19 WO PCT/CN2019/096694 patent/WO2020015724A1/en active Application Filing
-
2020
- 2020-09-25 US US17/033,223 patent/US11302286B2/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5313570A (en) * | 1993-03-31 | 1994-05-17 | Miles, Inc. | Method for determining color boundaries for correcting for plate misregistration in color printing |
CN1765119A (en) * | 2003-12-08 | 2006-04-26 | 株式会社理光 | Image processing method and apparatus, image forming apparatus and system, program and recording medium |
CN103927727A (en) * | 2014-04-22 | 2014-07-16 | 成都品果科技有限公司 | Method for converting scalar image into vector image |
CN107622504A (en) * | 2017-09-30 | 2018-01-23 | 北京百度网讯科技有限公司 | Method and apparatus for handling picture |
Also Published As
Publication number | Publication date |
---|---|
WO2020015724A8 (en) | 2020-10-22 |
US20210020139A1 (en) | 2021-01-21 |
US11302286B2 (en) | 2022-04-12 |
WO2020015724A1 (en) | 2020-01-23 |
CN109240572A (en) | 2019-01-18 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109240572B (en) | A method for acquiring pictures, and a method and device for processing pictures | |
CN110059685B (en) | Character area detection method, device and storage medium | |
KR102796731B1 (en) | Electronic apparatus and operating method thereof | |
CN108537889A (en) | Adjustment method, device, storage medium and electronic device for augmented reality model | |
CN110321126B (en) | Method and device for generating page code | |
WO2022042425A1 (en) | Video data processing method and apparatus, and computer device and storage medium | |
CN107835367A (en) | A kind of image processing method, device and mobile terminal | |
KR20160097974A (en) | Method and electronic device for converting color of image | |
CN110930335B (en) | Image processing method and electronic equipment | |
WO2021143284A1 (en) | Image processing method and apparatus, terminal and storage medium | |
US20240144617A1 (en) | Methods and systems for anchoring objects in augmented or virtual reality | |
US11494961B2 (en) | Sticker generating method and apparatus, and medium and electronic device | |
CN111277752B (en) | Prompting method, device, storage medium and electronic device | |
CN108712641A (en) | Electronic equipment and its image providing method for providing VR images based on polyhedron | |
CN105430269B (en) | A kind of photographic method and device applied to mobile terminal | |
CN112150560A (en) | Method, apparatus and computer storage medium for determining vanishing point | |
WO2023142915A1 (en) | Image processing method, apparatus and device, and storage medium | |
CN108665510B (en) | Rendering method and device of continuous shooting image, storage medium and terminal | |
CN108604367B (en) | Display method and handheld electronic device | |
US9792671B2 (en) | Code filters for coded light depth acquisition in depth images | |
US20250047968A1 (en) | Method for supporting image capturing and electronic device supporting same | |
WO2023020468A1 (en) | Wallpaper display method and apparatus, and electronic device | |
CN114170068A (en) | Image special effect generation method, device, electronic device and storage medium | |
CN112181230A (en) | Data display method and device and electronic equipment | |
CN112308767A (en) | Data display method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |