CN112214273B - Digital clock display method and device, electronic equipment and storage medium - Google Patents

Digital clock display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112214273B
CN112214273B CN202011102200.XA CN202011102200A CN112214273B CN 112214273 B CN112214273 B CN 112214273B CN 202011102200 A CN202011102200 A CN 202011102200A CN 112214273 B CN112214273 B CN 112214273B
Authority
CN
China
Prior art keywords
pixel
value
pixel point
pixel value
transparency
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
Application number
CN202011102200.XA
Other languages
Chinese (zh)
Other versions
CN112214273A (en
Inventor
冯俊
曾德源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei Xinying Technology Co ltd
Original Assignee
Hefei Xinying Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hefei Xinying Technology Co ltd filed Critical Hefei Xinying Technology Co ltd
Priority to CN202011102200.XA priority Critical patent/CN112214273B/en
Publication of CN112214273A publication Critical patent/CN112214273A/en
Application granted granted Critical
Publication of CN112214273B publication Critical patent/CN112214273B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/60Editing figures and text; Combining figures or text
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • G06T5/70
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Abstract

The application provides a digital clock display method, a digital clock display device, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring a plurality of character images of a digital clock image to be generated; acquiring transparency and a first pixel value of each first pixel point of each character image; acquiring a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image; and fusing the background image with a plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain a digital clock image.

Description

Digital clock display method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of display technologies, and in particular, to a digital clock display method, a digital clock display device, an electronic device, and a storage medium.
Background
With the continuous development and progress of display technology, the application of the digital clock is also more and more widespread, such as always on display of wearing products, an AOD mode and the like, in which an image of the digital clock needs to be fused with a background image, and when the image of the digital clock is fused with the background image in the existing fusion mode, when the brightness difference between a pixel point in the digital clock image and a corresponding pixel point (for example, a junction between the digital image and the background image) in the background image is too large, the fused digital clock image has poor display effect.
Disclosure of Invention
An object of the embodiment of the present application is to provide a digital clock display method, apparatus, electronic device, and storage medium, which are used for solving the problem that when an image of a digital clock is fused with a background image in the existing fusion manner, when a difference between brightness of a pixel point in the digital clock image and a brightness of a corresponding pixel point in the background image is too large, the fused digital clock image has poor display effect.
In a first aspect, an embodiment of the present invention provides a digital clock display method, including: acquiring a plurality of character images of a digital clock image to be generated; acquiring the transparency and the first pixel value of each first pixel point of each character image; acquiring a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image; and fusing the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain the digital clock image.
In the digital clock display method, the transparency and the first pixel value of each first pixel point of the required character image are further obtained through obtaining the plurality of character images and the background image of the digital clock image to be generated, the second pixel value of each second pixel point of the background image is further obtained, the background image and the plurality of character images are fused according to the transparency and the first pixel value of each first pixel point of the character image and the second pixel value of each second pixel point of the background image, the digital clock image is obtained, the background image and the character image are fused according to the transparency of the character image when fused, the brightness of the fusion part of the character image and the background image is further combined better, fusion of the character image and the background image is more natural and smooth, and the problem that when the brightness of the corresponding pixel point in the digital clock image and the background image is fused in the existing fusion mode, the digital clock image has poor display effect after fusion is poor and the flatness is solved.
In an optional implementation manner of the first aspect, the acquiring the transparency and the first pixel value of each first pixel point of each character image includes: acquiring transparency of each first pixel point and an index value associated with the first pixel value; searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point.
In an optional implementation manner of the first aspect, before the acquiring the plurality of character images of the digital clock image to be generated, the method further includes: acquiring an original pixel value of each first pixel point of each character image in the digital clock image; clustering all first pixel points of the plurality of character images into vectors with preset numbers, and obtaining second pixel values corresponding to each vector and index values associated with each vector, wherein the pixel values of the plurality of pixel points in each vector are the same and are the second pixel values of the corresponding vector; determining a second pixel value corresponding to each first pixel point and an associated target index value according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector; determining the transparency corresponding to each first pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point; and associating and storing the transparency corresponding to each first pixel point and the first pixel value with the corresponding index value.
In an optional implementation manner of the first aspect, the determining, according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector, the second pixel value corresponding to each first pixel point and the associated target index value includes: and calculating the distance from each first pixel point to each vector according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector, and correlating the second pixel value corresponding to the vector nearest to the first pixel point and the associated index value with the corresponding first pixel point.
In an optional implementation manner of the first aspect, the determining, according to the second pixel value corresponding to each first pixel point, the transparency corresponding to each first pixel point and the first pixel value includes: determining the maximum channel value of three color channel values of the second pixel value corresponding to each first pixel point as the transparency corresponding to the first pixel point; and bringing the transparency corresponding to each first pixel point and the second pixel value corresponding to each first pixel point into a preset updating formula to calculate and obtain the first pixel value corresponding to each first pixel point.
In an optional implementation manner of the first aspect, the background image includes a text area and a background area, each second pixel point in the text area coincides with a corresponding first pixel point corresponding to the character image, and the fusing the background image with the plurality of character images according to transparency and a first pixel value of each first pixel point and a second pixel value of each second pixel point to obtain the digital clock image includes: respectively inputting a second pixel value of each second pixel point in the text region and the transparency and the first pixel value of the overlapped first pixel point in the corresponding character image of each second pixel point into a preset fusion formula to calculate and obtain an output pixel value of each second pixel point in the text region; and generating the digital clock image according to the output pixel value of each second pixel point in the text region and the pixel value of each second pixel point in the background region.
In an optional implementation manner of the first aspect, the preset fusion formula is:
Figure BDA0002722983080000041
Figure BDA0002722983080000042
Figure BDA0002722983080000043
wherein R in the above fusion formula Output of 、G Output of B, B Output of Represented byIs the red component output value, the green component output value and the blue component output value in the output pixel values of any second pixel point; r is R Actual practice is that of 、G Actual practice is that of B, B Actual practice is that of Representing a red component output value, a green component output value and a blue component output value in first pixel values of the overlapped first pixel points in the character image corresponding to any one of the second pixel points; r is R Background 、G Background B, B Background Representing a red component output value, a green component output value and a blue component output value in the second pixel value of any second pixel point in the text region; t represents the transparency of the overlapped first pixel point in the character image corresponding to any second pixel point; round represents a rounding function.
In a second aspect, an embodiment of the present invention provides a digital clock display apparatus, the apparatus including: an acquisition module; a plurality of character images for acquiring a digital clock image to be generated; acquiring the transparency and the first pixel value of each first pixel point of each character image; obtaining a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image; and the fusion module is used for fusing the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain the digital clock image.
In the digital clock display device designed as above, the method obtains the transparency and the first pixel value of each first pixel point of the required character image by obtaining the plurality of character images and the background image of the digital clock image to be generated, and further obtains the second pixel value of each second pixel point of the background image, and further fuses the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point of the character image and the second pixel value of each second pixel point of the background image, so that the background image and the character image are fused according to the transparency of the character image when fusion is performed, and further the brightness of the fusion part of the character image and the background image is better combined, so that the fusion of the character image and the background image is more natural and smooth, and the problem that the digital clock image after fusion has poor display effect and smoothness when the brightness of the corresponding pixel point in the digital clock image and the background image is fused in the existing fusion mode is too large is solved, and the nature of the digital clock image after fusion effect is improved.
In an optional implementation manner of the second aspect, the acquiring module is specifically configured to acquire a transparency of each first pixel point and an index value associated with the first pixel value; searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point.
In an optional implementation manner of the second aspect, the acquiring module is further configured to acquire an original pixel value of each first pixel point of each character image in the plurality of character images; the clustering module is used for clustering all the first pixel points of the plurality of character images into vectors with preset numbers, and obtaining second pixel values corresponding to each vector and index values associated with each vector, wherein the pixel values of the plurality of pixel points in each vector are the same and are the second pixel values of the corresponding vector; the determining module is used for determining a second pixel value corresponding to each first pixel point and an associated target index value according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector; determining the transparency corresponding to each pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point; and the association storage module is used for associating and storing the transparency corresponding to each first pixel point and the first pixel value with the corresponding index value.
In an optional implementation manner of the second aspect, the determining module is specifically configured to calculate a distance from each pixel to each vector according to an original pixel value of each pixel and a second pixel value corresponding to each vector, and associate the second pixel value corresponding to the vector closest to the pixel and an index value associated with the second pixel value.
In an optional implementation manner of the second aspect, the determining module is further specifically configured to determine a maximum channel value of three color channel values of the second pixel value corresponding to each pixel point as a transparency corresponding to the pixel point; and carrying the transparency corresponding to each pixel point and the second pixel value into a preset updating formula to calculate and obtain a first pixel value corresponding to each pixel point.
In an optional implementation manner of the second aspect, the background image includes a text area and a background area, each second pixel point in the text area coincides with a corresponding first pixel point corresponding to the character image, and the fusion module is specifically configured to input, into a preset fusion formula, a second pixel value of each second pixel point in the text area and a transparency and a first pixel value of a first pixel point coinciding with each second pixel point in the character image corresponding to each second pixel point, so as to calculate an output pixel value of each second pixel point in the text area; and generating the digital clock image according to the output pixel value of each second pixel point in the text region and the pixel value of each second pixel point in the background region.
In a third aspect, an embodiment provides an electronic device comprising a memory storing a computer program and a processor that when executing the computer program performs the method of the first aspect, any optional implementation of the first aspect.
In a fourth aspect, embodiments provide a storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect, any of the alternative implementations of the first aspect.
In a fifth aspect, embodiments provide a computer program product which, when run on a computer, causes the computer to perform the method of any of the alternative implementations of the first aspect.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a first flowchart of a digital clock display method according to an embodiment of the present disclosure;
FIG. 2 is a second flowchart of a digital clock display method according to an embodiment of the present disclosure;
FIG. 3 is a third flowchart of a digital clock display method according to an embodiment of the present disclosure;
FIG. 4 is a fourth flowchart of a digital clock display method according to an embodiment of the present disclosure;
FIG. 5 is a fifth flowchart of a digital clock display method according to an embodiment of the present disclosure;
FIG. 6 is a sixth flowchart of a digital clock display method according to an embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of a digital clock display device according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Icon: 200-an acquisition module; 201-a fusion module; 202-a clustering module; 203-a determination module; 204-an associative memory module; 3-an electronic device; 301-a processor; 302-memory; 303-communication bus.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The application provides a digital clock display method, which can be applied to a processor of a wearable product with an AOD mode, as shown in fig. 1, and specifically comprises the following steps:
Step S100: a plurality of character images of a digital clock image to be generated are acquired.
Step S102: the transparency and the first pixel value of each first pixel point of each character image are obtained.
Step S104: and acquiring a background image of the digital clock image to be generated and a second pixel value of each second pixel point of the background image.
Step S106: and fusing the background image with the plurality of character images according to the transparency of each first pixel point, the first pixel value and the second pixel value of each second pixel point to obtain a digital clock image.
In step S100, the plurality of character images of the digital clock image to be generated represent character images of the digital clock image to be generated according to the current time, for example, the current time is twelve thirty minutes, and then the plurality of character images of the digital clock image to be generated acquired in step S100 are character "1", character "2", character "in" 12:30 ": "character" 3", and character" 0", wherein all character images required for the digital clock including numerals 0 to 9 and characters": of course, besides the numbers 0-9, the scheme can also include greek numbers from one to nine, chinese uppercase and other characters, so as to be directly determined when the step S100 is executed later. After step S100 is performed to obtain a plurality of character images of the digital clock image to be generated, step S102 may be performed.
In step S102, the present scheme obtains the transparency of each first pixel point and the first pixel value of each first pixel point of each of the plurality of character images determined in step S100, for example, according to the foregoing example, when the current time is twelve points and thirty points, the present scheme obtains the characters "1", the characters "2", and the characters ": transparency of each first pixel point and first pixel value of each character of "," character "3" and "0". The transparency of each first pixel point of each character image and the first pixel value can be determined and stored in advance, and can be stored in a register of the device. After the transparency and the first pixel value of each first pixel point of each character image are obtained in step S102, step S104 may be performed.
In step S104, the scheme obtains a background image of the digital clock image to be generated and obtains a second pixel value of each second pixel point of the background image, where each second pixel point of the background image indicates that the background image integrally includes a plurality of second pixel points, and obtains a pixel value of each second pixel point; the background image represents other image presentation than the digital character display when the digital clock image is presented, for example, the background image may be entirely black, entirely white, or an image having other colors or shapes; after the background image and the second pixel value of each second pixel point of the background image are obtained in step S104, step S106 is required to be executed to fuse the background image with the character image, so as to obtain a complete digital clock image.
In step S106, the scheme fuses the background image with the plurality of character images determined in step S100 according to the transparency and the first pixel value of each first pixel point of each character image obtained in step S102 and the second pixel value of each second pixel point of the background image obtained in step S104, so as to obtain the target digital clock image.
In the digital clock display method, the transparency and the first pixel value of each first pixel point of the required character image are further obtained through obtaining the plurality of character images and the background image of the digital clock image to be generated, the second pixel value of each second pixel point of the background image is further obtained, the background image and the plurality of character images are fused according to the transparency and the first pixel value of each first pixel point of the character image and the second pixel value of each second pixel point of the background image, the digital clock image is obtained, the background image and the character image are fused according to the transparency of the character image when fused, the brightness of the fusion part of the character image and the background image is further combined better, fusion of the character image and the background image is more natural and smooth, and the problem that when the brightness of the corresponding pixel point in the digital clock image and the background image is fused in the existing fusion mode, the digital clock image has poor display effect after fusion is poor and the flatness is solved.
In an alternative implementation of this embodiment, the transparency and the first pixel value of each first pixel point of each character image described above may be stored in advance, and based on this, the manner in which step S102 obtains the transparency and the first pixel value of each first pixel point of each character image may be specifically as follows, as shown in fig. 2:
step S1020: and acquiring the transparency of each first pixel point and the index value associated with the first pixel value.
Step S1021: searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point.
In the above steps, the index value associated with the transparency and the first pixel value of each pixel point may be established in advance, and then the transparency and the first pixel value of the stored corresponding pixel point may be found out through the index value.
In an alternative implementation of this embodiment, it has been described that the transparency and the first pixel value of each first pixel point in the character image may be found by the index value, and before the implementation of step S100, the transparency and the first pixel value may be associated with the index value in advance, and the transparency and the first pixel value of each first pixel point in the character image are obtained by processing the original pixel value of the character image, as shown in fig. 3, which specifically includes the following steps:
Step S90: an original pixel value of each first pixel point of each character image in the digital clock image is obtained.
Step S91: and clustering all the first pixel points of the plurality of character images into vectors with preset numbers, and obtaining a second pixel value corresponding to each vector and an index value associated with each vector.
Step S92: and determining a target index value associated with the second pixel value corresponding to each first pixel point according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector.
Step S93: and determining the transparency corresponding to each first pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point.
Step S94: and associating and storing the transparency corresponding to each first pixel point and the first pixel value with the corresponding index value.
In step S90, it has been said that the device may store a series of character images, and then the pixel value of each pixel (first pixel) in the series of character images may be obtained, for example, the 0-9 character images have different colors, and then the pixel values are different, and after the original pixel value of each first pixel in each character image in the digital clock image is obtained, step S91 may be performed.
In step S91, the method clusters all the first pixels of the plurality of character images, specifically, a vector quantization algorithm is used to cluster the first pixels into a preset number of vectors, and a second pixel value corresponding to each vector is obtained, where each vector includes a plurality of pixels belonging to the same class, and the pixel values of the plurality of pixels belonging to the same class are the same and equal to the second pixel value corresponding to the vector, and in addition, an index value may be set for each vector according to the number of clustered vectors. For example, if the scheme is clustered into 256 vectors, and further can be clustered into 512, 1024, 2048 vectors, etc. according to the requirements or display effects in practical applications, the indexes of each vector can be set to be respectively corresponding to the index values of 0-255, and the second pixel values RGB corresponding to the vector with the index value of 0 are respectively assumed to be 0, 0 and 0, so that the second pixel values of the plurality of first pixel points belonging to the vector with the index value of 0 can be respectively 0, 0 and 0.
After the clustering is performed to obtain a plurality of vectors and the second pixel value and index value corresponding to each vector, step S92 may be performed, in which step S92, the scheme determines the vector to which each first pixel belongs, that is, the category to which each first pixel belongs, and further obtains the second pixel value and index value corresponding to each pixel, which may be specifically determined by the following steps as shown in fig. 4:
Step S920: and calculating the distance from each first pixel point to each vector according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector, and correlating the vector nearest to the first pixel point and the index value correlated with the vector with the first pixel point.
In step S920, the method sequentially calculates the distance from each first pixel point to each vector in the character image, specifically, calculates the distance from each pixel point to each vector by the original pixel value of each first pixel point and the second pixel value corresponding to each vector, where specific calculation modes may be: distance = (red component of first pixel point-red component of vector) 2+ (green component of first pixel point-green component of vector) 2+ (blue component of first pixel point-blue component of vector) according to the foregoing example, assuming that the obtained vector is 256, 256 distances are calculated for each first pixel point, 256 distance values obtained for each first pixel point are compared, the second pixel value corresponding to the vector with the smallest distance is selected as the second pixel value of the first pixel point, and the index value associated with the vector with the smallest distance is selected as the index value of the first pixel point.
After the step of determining the second pixel value and the associated index value corresponding to each first pixel point is performed, step S93 may be performed, in which step S93, the method may determine the transparency corresponding to each first pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point, where the specific process of determining the transparency corresponding to the first pixel point and the first pixel value may include the following steps:
step S930: and determining the maximum channel value of the three color channel values of the second pixel value corresponding to each first pixel point as the transparency corresponding to the first pixel point.
Step S931: and bringing the transparency corresponding to each first pixel point and the second pixel value corresponding to each first pixel point into a preset updating formula to calculate and obtain the first pixel value corresponding to each first pixel point.
In step S930, the second pixel value corresponding to each first pixel point includes three color channel values, i.e., a red component, a green component and a blue component, and the maximum channel value of the three color channel values is selected to be determined as the transparency corresponding to the first pixel point, for example, when the red component, the green component and the blue component of the second pixel value of a certain first pixel point are respectively 60, 80 and 100, then 100 is taken as the transparency of the first pixel point, and step S931 is performed on the basis of the selected transparency.
In step S931, the present solution updates the pixel value of each first pixel according to the transparency of each first pixel and the second pixel value corresponding to each first pixel determined in step S930, so as to obtain the first pixel value of each first pixel, and specifically, the present solution may bring the transparency corresponding to each first pixel and the second pixel value corresponding to each first pixel into a preset update formula, where the preset update formula is: first pixel value=second pixel value/transparency 255, and the transparency and second pixel value of each pixel point are brought into the update formula to obtain the first pixel value corresponding to each pixel point, so that step S94 can be further executed.
In step S94, the transparency and the first pixel value corresponding to each first pixel point are associated with the associated index value thereof and then stored, where, specifically, because the number of the pixels included in the character image is relatively large, the transparency and the first pixel value of each first pixel point of each character image may be stored in a register of the device, then the associated index value is stored in the memory, and when step S1020 and step S1021 are executed, the index value in the memory is read, and then the transparency and the first pixel value corresponding to the index value are searched in the register, so that the transparency and the first pixel value of each pixel point with relatively large data size are configured and stored in the register, and only the corresponding index value is stored in the memory, thereby reducing the memory storage space and saving the hardware resources.
In an alternative implementation of this embodiment, the background image may include a text area and a background area, where the text area represents a position where the character image is presented, each second pixel point in the text area overlaps with a corresponding first pixel point of the corresponding character image, and the background area represents an area where the character image is not presented and the background original image is presented, and on this basis, as shown in fig. 6, step S106 may specifically include the following steps:
step S1060: and respectively inputting the second pixel value of each second pixel point in the text region and the transparency and the first pixel value of the overlapped first pixel point in the corresponding character image of each second pixel point into a preset fusion formula to calculate and obtain the output pixel value of each second pixel point in the text region.
Step S1061: and generating a digital clock image according to the output pixel value of each second pixel point in the text region and the pixel value of each second pixel point in the background region.
In step S1060, the present scheme inputs the second pixel value of each second pixel in the text region and the transparency and the first pixel value of the first pixel overlapped in the character image corresponding to each second pixel into a preset fusion formula respectively, so as to calculate an output pixel value of each second pixel in the text region, where the preset fusion formula may be:
Figure BDA0002722983080000151
Figure BDA0002722983080000152
Figure BDA0002722983080000153
Wherein R in the above fusion formula Output of 、G Output of B, B Output of Representing the red component output value, the green component output value and the blue component in the output pixel values of any one of the second pixel pointsOutputting a value; r is R Actual practice is that of 、G Actual practice is that of B, B Actual practice is that of Representing a red component output value, a green component output value and a blue component output value in first pixel values of the overlapped first pixel points in the character image corresponding to any one of the second pixel points; r is R Background 、G Background B, B Background Representing a red component output value, a green component output value and a blue component output value in the second pixel value of any second pixel point in the text region; t represents the transparency of the overlapped first pixel point in the character image corresponding to any second pixel point; round represents a rounding function.
Through the fusion formula, the output pixel value of each second pixel point in the text region can be obtained through the transparency of each first pixel point of the character image, the first pixel value and the second pixel value of each second pixel point in the text region, and the transparency-based fusion is adopted to fuse the two pixel points, so that the brightness of the pixel point where the character image and the background image are overlapped is more similar, and the fusion cannot be abrupt;
After the output pixel value of each pixel in the text region is obtained by the above fusion formula, step S1061 may be executed to generate a digital clock image according to the output pixel value of each second pixel in the text region and the pixel value of each second pixel in the background region, that is to say, the background region is presented in the original presentation manner, and the text region needs to perform the fusion of the text region and the character image of the background image in step S1060 and then present the fused text region and the character image, so as to obtain the final digital clock image.
Fig. 7 shows a schematic block diagram of a digital clock display device provided in the present application, and it should be understood that the device corresponds to the method embodiment executed in fig. 1 to 6, and is capable of executing the steps involved in the method executed in the first embodiment, and specific functions of the device may be referred to the above description, and detailed descriptions thereof are omitted herein as appropriate to avoid redundancy. The device includes at least one software functional module that can be stored in memory in the form of software or firmware (firmware) or cured in an Operating System (OS) of the device. Specifically, the device comprises: an acquisition module 200; a plurality of character images for acquiring a digital clock image to be generated; acquiring transparency and a first pixel value of each first pixel point of each character image; obtaining a background image of the digital clock image to be generated and a second pixel value of each second pixel point of the background image; and the fusion module 201 is configured to fuse the background image with the plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain a digital clock image.
In the digital clock display device designed as above, the method obtains the transparency and the first pixel value of each first pixel point of the required character image by obtaining the plurality of character images and the background image of the digital clock image to be generated, and further obtains the second pixel value of each second pixel point of the background image, and further fuses the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point of the character image and the second pixel value of each second pixel point of the background image, so that the background image and the character image are fused according to the transparency of the character image when fusion is performed, and further the brightness of the fusion part of the character image and the background image is better combined, so that the fusion of the character image and the background image is more natural and smooth, and the problem that the digital clock image after fusion has poor display effect and smoothness when the brightness of the corresponding pixel point in the digital clock image and the background image is fused in the existing fusion mode is too large is solved, and the nature of the digital clock image after fusion effect is improved.
In an optional implementation manner of this embodiment, the obtaining module 200 is specifically configured to obtain transparency of each first pixel point and an index value associated with the first pixel value; searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point.
In an optional implementation manner of this embodiment, the obtaining module 200 is further configured to obtain an original pixel value of each first pixel point of each character image in the plurality of character images; the clustering module 202 is configured to cluster all the first pixel points of the plurality of character images into a preset number of vectors, and obtain a second pixel value corresponding to each vector and an index value associated with each vector, where the pixel values of the plurality of pixel points in each vector are the same and the pixel value is the second pixel value of the corresponding vector; a determining module 203, configured to determine a second pixel value corresponding to each first pixel point and an associated target index value according to an original pixel value of each first pixel point and a second pixel value corresponding to each vector; determining the transparency and the first pixel value corresponding to each first pixel point according to the second pixel value corresponding to each first pixel point; and the association storage module 204 is configured to associate and store the transparency corresponding to each first pixel point and the first pixel value with the corresponding index value.
In an optional implementation manner of this embodiment, the determining module 203 is specifically configured to calculate a distance from each pixel to each vector according to an original pixel value of each first pixel and a second pixel value corresponding to each vector, and associate the second pixel value corresponding to the vector closest to the pixel and an index value associated with the second pixel value.
In an optional implementation manner of this embodiment, the determining module 203 is further specifically configured to determine, as the transparency corresponding to the first pixel, a maximum channel value of three color channel values of the second pixel value corresponding to each first pixel; and bringing the transparency corresponding to each first pixel point and the second pixel value into a preset updating formula to calculate and obtain the first pixel value corresponding to each first pixel point.
In an alternative implementation manner of this embodiment, the background image includes a text area and a background area, each second pixel point in the text area coincides with a corresponding first pixel point of the corresponding character image, and the fusion module 201 is specifically configured to input, into a preset fusion formula, a second pixel value of each second pixel point in the text area and a transparency and a first pixel value of the first pixel point in the text area, where the second pixel value coincides with the corresponding first pixel point in the character image, respectively, so as to calculate an output pixel value of each second pixel point in the text area; and generating a digital clock image according to the output pixel value of each second pixel point in the text region and the pixel value of each second pixel point in the background region.
As shown in fig. 8, the present application provides an electronic apparatus 3, including: processor 301 and memory 302, the processor 301 and the memory 302 being interconnected and in communication with each other by a communication bus 303 and/or other form of connection mechanism (not shown), the memory 302 storing a computer program executable by the processor 301, which when executed by a computing device, the processor 301 executes the computer program to perform the method of the first embodiment, any alternative implementation of the first embodiment, such as step S100 to step S106: acquiring a plurality of character images of a digital clock image to be generated, and acquiring the transparency and the first pixel value of each first pixel point of each character image; acquiring a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image; and fusing the background image with the plurality of character images according to the transparency of each first pixel point, the first pixel value and the second pixel value of each second pixel point to obtain a digital clock image.
The present application provides a storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first embodiment, any of the alternative implementations of the first embodiment.
The storage medium may be implemented by any type of volatile or nonvolatile Memory device or combination thereof, such as static random access Memory (Static Random Access Memory, SRAM), electrically erasable Programmable Read-Only Memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), erasable Programmable Read-Only Memory (Erasable Programmable Read Only Memory, EPROM), programmable Read-Only Memory (PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The present application provides a computer program product which, when run on a computer, causes the computer to perform the method in the first embodiment, any optional implementation of the first embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be other manners of division in actual implementation, and for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some communication interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
Further, the units described as separate units may or may not be physically separate, and units displayed as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Furthermore, functional modules in various embodiments of the present application may be integrated together to form a single portion, or each module may exist alone, or two or more modules may be integrated to form a single portion.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM) random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application, and various modifications and variations may be suggested to one skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.

Claims (8)

1. A digital clock display method, the method comprising:
acquiring an original pixel value of each first pixel point of each character image in the digital clock image;
clustering all first pixel points of a plurality of character images into vectors with preset numbers, and obtaining second pixel values corresponding to each vector and index values associated with each vector, wherein the pixel values of the plurality of pixel points in each vector are the same and are the second pixel values of the corresponding vector;
determining a second pixel value corresponding to each first pixel point and an associated target index value according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector;
Determining the transparency corresponding to each first pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point;
the transparency corresponding to each first pixel point and the first pixel value are associated with the corresponding index value and stored;
acquiring a plurality of character images of a digital clock image to be generated;
acquiring the transparency and the first pixel value of each first pixel point of each character image;
acquiring a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image;
fusing the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain the digital clock image;
the acquiring the transparency and the first pixel value of each first pixel point of each character image comprises the following steps:
acquiring transparency of each first pixel point and an index value associated with the first pixel value;
searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point.
2. The method of claim 1, wherein determining the second pixel value and the associated target index value for each first pixel point based on the original pixel value for each first pixel point and the second pixel value for each vector comprises:
and calculating the distance from each first pixel point to each vector according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector, and correlating the second pixel value of the vector nearest to the first pixel point and the associated index value thereof with the corresponding first pixel point.
3. The method of claim 1, wherein determining the transparency and the first pixel value corresponding to each first pixel according to the second pixel value corresponding to each first pixel comprises:
determining the maximum channel value of three color channel values of the second pixel value corresponding to each first pixel point as the transparency corresponding to the first pixel point;
and bringing the transparency corresponding to each first pixel point and the second pixel value into a preset updating formula to calculate and obtain the first pixel value corresponding to each first pixel point.
4. The method of any of claims 1-2, wherein the background image includes a text region and a background region, each second pixel in the text region coincides with a corresponding first pixel of the corresponding character image, the fusing the background image with the plurality of character images based on the transparency and first pixel value of each first pixel, and the second pixel value of each second pixel to obtain the digital clock image, comprising:
Respectively inputting a second pixel value of each second pixel point in the text region and the transparency and the first pixel value of the overlapped first pixel point in the corresponding character image of each second pixel point into a preset fusion formula to calculate and obtain an output pixel value of each second pixel point in the text region;
and generating the digital clock image according to the output pixel value of each second pixel point in the text region and the pixel value of each second pixel point in the background region.
5. The method of claim 4, wherein the predetermined fusion formula is:
Figure FDA0003907047670000031
Figure FDA0003907047670000032
Figure FDA0003907047670000033
wherein R in the above fusion formula Output of 、G Output of B, B Output of Representing a red component output value, a green component output value and a blue component output value in the output pixel values of any one of the second pixel points; r is R Actual practice is that of 、G Actual practice is that of B, B Actual practice is that of Representing a red component output value, a green component output value and a blue component output value in first pixel values of the overlapped first pixel points in the character image corresponding to any one of the second pixel points; r is R Background 、G Background B, B Background Representing a red component output value, a green component output value and a blue component output value in the second pixel value of any second pixel point in the text region; t represents the transparency of the overlapped first pixel point in the character image corresponding to any second pixel point; round represents a rounding function.
6. A digital clock display apparatus, the apparatus comprising:
an acquisition module; a plurality of character images for acquiring a digital clock image to be generated; acquiring the transparency and the first pixel value of each first pixel point of each character image; obtaining a background image of a digital clock image to be generated and a second pixel value of each second pixel point of the background image;
the fusion module is used for fusing the background image and the plurality of character images according to the transparency and the first pixel value of each first pixel point and the second pixel value of each second pixel point to obtain the digital clock image;
the acquisition module is specifically configured to acquire transparency of each first pixel point and an index value associated with the first pixel value; searching the transparency and the first pixel value of each first pixel point associated with each prestored index value according to the transparency and the index value associated with the first pixel value of each first pixel point;
the acquisition module is further used for acquiring an original pixel value of each first pixel point of each character image in the plurality of character images; the clustering module is used for clustering all the first pixel points of the plurality of character images into vectors with preset numbers, and obtaining second pixel values corresponding to each vector and index values associated with each vector, wherein the pixel values of the plurality of pixel points in each vector are the same and are the second pixel values of the corresponding vector; the determining module is used for determining a second pixel value corresponding to each first pixel point and an associated target index value according to the original pixel value of each first pixel point and the second pixel value corresponding to each vector; determining the transparency corresponding to each pixel point and the first pixel value according to the second pixel value corresponding to each first pixel point; and the association storage module is used for associating and storing the transparency corresponding to each first pixel point and the first pixel value with the corresponding index value.
7. An electronic device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor implements the method of any one of claims 1 to 5 when executing the computer program.
8. A storage medium having stored thereon a computer program, which when executed by a processor, implements the method of any of claims 1 to 5.
CN202011102200.XA 2020-10-14 2020-10-14 Digital clock display method and device, electronic equipment and storage medium Active CN112214273B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011102200.XA CN112214273B (en) 2020-10-14 2020-10-14 Digital clock display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011102200.XA CN112214273B (en) 2020-10-14 2020-10-14 Digital clock display method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112214273A CN112214273A (en) 2021-01-12
CN112214273B true CN112214273B (en) 2023-04-21

Family

ID=74054273

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011102200.XA Active CN112214273B (en) 2020-10-14 2020-10-14 Digital clock display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112214273B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020095752A (en) * 2001-06-15 2002-12-28 한국전자통신연구원 Method for Stereo Image Disparity Map Fusion And Method for Display 3-Dimension Image By Using it
CN104715451A (en) * 2015-03-11 2015-06-17 西安交通大学 Seamless image fusion method based on consistent optimization of color and transparency
CN106940878A (en) * 2017-02-27 2017-07-11 深圳华盛昌机械实业有限公司 A kind of display methods and device
CN110163285A (en) * 2019-05-23 2019-08-23 阳光保险集团股份有限公司 Ticket recognition training sample synthetic method and computer storage medium
CN110971839A (en) * 2019-11-18 2020-04-07 咪咕动漫有限公司 Video fusion method, electronic device and storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9152881B2 (en) * 2012-09-13 2015-10-06 Los Alamos National Security, Llc Image fusion using sparse overcomplete feature dictionaries
US20160242623A1 (en) * 2015-02-20 2016-08-25 Cefla Societá Cooperativa Apparatus and method for visualizing data and images and for controlling a medical device through a wearable electronic device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20020095752A (en) * 2001-06-15 2002-12-28 한국전자통신연구원 Method for Stereo Image Disparity Map Fusion And Method for Display 3-Dimension Image By Using it
CN104715451A (en) * 2015-03-11 2015-06-17 西安交通大学 Seamless image fusion method based on consistent optimization of color and transparency
CN106940878A (en) * 2017-02-27 2017-07-11 深圳华盛昌机械实业有限公司 A kind of display methods and device
CN110163285A (en) * 2019-05-23 2019-08-23 阳光保险集团股份有限公司 Ticket recognition training sample synthetic method and computer storage medium
CN110971839A (en) * 2019-11-18 2020-04-07 咪咕动漫有限公司 Video fusion method, electronic device and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
Image fusion for a digital camera application based on wavelet domain hidden Markov models;S.X. Hu ET AL;《Proceedings of 2004 International Conference on Machine Learning and Cybernetics (IEEE Cat. No.04EX826)》;20050131;全文 *
基于超像素融合的文本分割;张矿等;《计算机应用》;20161210;第36卷(第12期);全文 *
针对视频运动向量隐写的深度神经网络检测方法;黄雄波等;《华南理工大学学报(自然科学版)》;20200815(第08期);全文 *

Also Published As

Publication number Publication date
CN112214273A (en) 2021-01-12

Similar Documents

Publication Publication Date Title
US20140126813A1 (en) Method and system for near-duplicate image searching
CN110390327B (en) Foreground extraction method and device, computer equipment and storage medium
CN110222775B (en) Image processing method, image processing device, electronic equipment and computer readable storage medium
US11347792B2 (en) Video abstract generating method, apparatus, and storage medium
CN108961267B (en) Picture processing method, picture processing device and terminal equipment
CN108830780A (en) Image processing method and device, electronic equipment, storage medium
CN112069341A (en) Background picture generation and search result display method, device, equipment and medium
WO2016183933A1 (en) Icon arrangement method and device
CN112214273B (en) Digital clock display method and device, electronic equipment and storage medium
JP2014099851A (en) Image division system and image division method
JP2014099852A (en) Image division system and image division method
CN110532425B (en) Video data distributed storage method and device, computer equipment and storage medium
CN112866797A (en) Video processing method and device, electronic equipment and storage medium
CN108932704B (en) Picture processing method, picture processing device and terminal equipment
CN111583376B (en) Method and device for eliminating black edge in illumination map, storage medium and electronic equipment
CN115269494A (en) Data archiving method and device
CN113724269A (en) Example segmentation method, training method of example segmentation network and related equipment
CN111104085B (en) Display screen adaptation method, device, computer equipment and storage medium
CN113377476A (en) Interface display method, related device and computer program product
CN112487943A (en) Method and device for removing duplicate of key frame and electronic equipment
CN117201874B (en) Face image replacement method and device, electronic equipment and storage medium
CN113077481B (en) Image processing method and device, computer equipment and storage medium
CN114691252B (en) Screen display method and device
CN110991270B (en) Text recognition method, device, electronic equipment and storage medium
CN117078327B (en) Electronic invoice issuing method, management system 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