Movatterモバイル変換


[0]ホーム

URL:


CN113033394B - Image signature generation method and device, electronic equipment and storage medium - Google Patents

Image signature generation method and device, electronic equipment and storage medium
Download PDF

Info

Publication number
CN113033394B
CN113033394BCN202110315365.3ACN202110315365ACN113033394BCN 113033394 BCN113033394 BCN 113033394BCN 202110315365 ACN202110315365 ACN 202110315365ACN 113033394 BCN113033394 BCN 113033394B
Authority
CN
China
Prior art keywords
image
pixel
value
preset
pixel array
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
CN202110315365.3A
Other languages
Chinese (zh)
Other versions
CN113033394A (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co LtdfiledCriticalBeijing Dajia Internet Information Technology Co Ltd
Priority to CN202110315365.3ApriorityCriticalpatent/CN113033394B/en
Publication of CN113033394ApublicationCriticalpatent/CN113033394A/en
Application grantedgrantedCritical
Publication of CN113033394BpublicationCriticalpatent/CN113033394B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The present disclosure relates to a method, an apparatus, an electronic device, and a storage medium for generating a signature of an image, the method comprising: acquiring a first pixel array of a target image, wherein the first pixel array comprises pixel information of each pixel point, and the pixel information comprises a color value and transparency; taking each pixel point as a center, and determining a preset area of a preset area; calculating a target color value of a central pixel point according to pixel information of each pixel point in a preset area, wherein the central pixel point is a pixel point positioned at the center of the preset area; determining an image to be converted at least according to all the target color values; and converting the image to be converted into a character string, and generating a signature of the target image. The method ensures flexible adjustment of the speed of acquiring the signature of the target image and the accuracy of the acquired signature of the target image, and solves the problem that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted aiming at the same picture in the prior art.

Description

Image signature generation method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the field of image comparison, and in particular relates to a method and a device for generating an image signature, electronic equipment and a storage medium.
Background
In the related art, the process of obtaining a picture signature generally includes: dividing the picture into grid blocks with the same set number and size; calculating the gray average value of each grid block according to a preset algorithm; determining the brightness contrast between each grid block and the adjacent grid block based on the gray average value; the contrast of brightness and darkness between each grid block and the adjacent grid blocks is determined as the signature of the picture.
The method cannot flexibly adjust the time required for acquiring the picture signature and the accuracy of the picture signature aiming at the same picture.
Disclosure of Invention
The disclosure provides a method, a device, an electronic device and a storage medium for generating an image signature, so as to at least solve the problem that the time required for acquiring the image signature and the accuracy of the image signature cannot be flexibly adjusted for the same image in the related art.
The technical scheme of the present disclosure is as follows:
According to a first aspect of an embodiment of the present disclosure, there is provided a method for generating an image signature, including: acquiring a first pixel array of a target image, wherein the first pixel array comprises pixel information of each pixel point, and the pixel information comprises a color value and transparency; taking each pixel point as a center, and determining a preset area of a preset area; calculating a target color value of a center pixel point according to the pixel information of each pixel point in the preset area, wherein the center pixel point is the pixel point positioned at the center of the preset area; determining an image to be converted at least according to all the target color values; and converting the image to be converted into a character string, and generating a signature of the target image.
Optionally, the step of determining the predetermined area with each pixel point as a center includes: and determining the preset area by taking the pixel point as a circle center and the preset distance as a radius.
Optionally, the step of calculating the target color value of the center pixel point according to the pixel information of each pixel point in the predetermined area includes: calculating an average color value of each pixel point, wherein the average color value is an average value of a first color channel value, a second color channel value and a third color channel value in the color values; acquiring an average color value of each pixel point of the preset area; and calculating the target color value of the corresponding central pixel point according to the average color value of each pixel point in the preset area.
Optionally, the step of calculating the target color value of the corresponding center pixel according to the average color value of each pixel in the predetermined area includes: calculating the average value of the average color values of all the pixel points in the preset area to obtain an updated average value; and taking the updated average value as the target color value of the corresponding central pixel point.
Optionally, the step of determining the image to be converted at least according to all the target color values includes: processing all the target color values to obtain a second pixel array; and determining the image to be converted according to the second pixel array.
Optionally, the step of processing all the target color values to obtain a second pixel array includes: determining a preset pixel point, wherein a preset number of the pixel points of the target image are arranged between two adjacent preset pixel points; and determining the second pixel array, wherein the second pixel array is formed by the target color values and the transparency of all the preset pixel points.
Optionally, the step of determining the image to be converted according to the second pixel array includes: acquiring an image corresponding to the second pixel array; and taking the image corresponding to the second pixel array as the image to be converted.
Optionally, the step of determining the image to be converted according to the second pixel array includes: acquiring a preset height and a preset width; scaling the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain a scaled image; and determining the image to be converted according to the scaled image.
Optionally, the step of performing scaling processing on the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain a scaled image includes: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the step of determining the image to be converted according to the scaled image comprises the following steps: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted.
Optionally, the step of performing scaling processing on the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain a scaled image includes: acquiring the aspect ratio of the image corresponding to the second pixel array; determining a scaling value according to the height-width ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the maximum value of the preset height and the preset width; and scaling one of the width and the height of the image corresponding to the second pixel array into the scaling value, and scaling the other of the width and the height of the image corresponding to the second pixel array into the preset size value to obtain the scaled image, wherein the aspect ratio of the scaled image is equal to the aspect ratio of the image corresponding to the second pixel array.
Optionally, the step of determining the image to be converted according to the scaled image includes: acquiring an initialization pixel array, wherein the initialization pixel array comprises initialization pixel information, the initialization pixel information comprises an initialization color value and an initialization transparency, and the length of the initialization pixel array is equal to the product of the preset height and the preset width; and processing the initialized pixel array and the scaled image to obtain the image to be converted.
Optionally, the step of processing the initialized pixel array and the scaled image to obtain the image to be converted includes: acquiring pixel information of each pixel point in the scaled image; replacing the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, wherein the pixel point corresponding to the replaced initialized pixel information is the same as the pixel point corresponding to the replaced pixel information in position; and acquiring the replaced image corresponding to the initialized pixel array to obtain the image to be converted.
Optionally, the initializing color value includes initializing a first color channel value, initializing a second color channel value, and initializing a third color channel value, where the initializing first color channel value, initializing the second color channel value, initializing the third color channel value, and initializing the transparency are equal.
Optionally, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
Optionally, the method further comprises: and storing the signature of the target image into a database.
Optionally, the signature of the target image is a digitized representation of image features in the target image.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for generating an image signature, including: acquiring a first pixel array of a target image, wherein the first pixel array comprises pixel information of each pixel point, and the pixel information comprises a color value and transparency; obtaining a scaled image according to the first pixel array, wherein the width of the scaled image is equal to a preset width and the height of the scaled image is equal to a preset height; determining an image to be converted according to the scaled image; and converting the image to be converted into a character string, and generating a signature of the target image.
Optionally, the step of obtaining a scaled image according to the first pixel array includes: calculating a target color value of a center pixel point according to the pixel information of each pixel point in a preset area, wherein the center pixel point is the pixel point positioned at the center of the preset area; and acquiring the scaled image according to all the target color values.
Optionally, before the step of calculating the target color value of the center pixel according to the pixel information of each pixel in the predetermined area, the step of obtaining the scaled image according to the first pixel array further includes: and determining the preset area by taking each pixel point as a center.
Optionally, the step of obtaining the scaled image according to all the target color values includes: processing all the target color values to obtain a second pixel array; acquiring a preset height and a preset width; and performing scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain the scaled image.
Optionally, the step of performing scaling processing on the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain a scaled image includes: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the step of determining the image to be converted according to the scaled image comprises the following steps: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted.
Optionally, the step of performing scaling processing on the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain the scaled image includes: acquiring the aspect ratio of the image corresponding to the second pixel array; determining a scaling value according to the height-width ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the maximum value of the preset height and the preset width; and scaling one of the width and the height of the image corresponding to the second pixel array into the scaling value, and scaling the other of the width and the height of the image corresponding to the second pixel array into the preset size value to obtain the scaled image, wherein the aspect ratio of the image corresponding to the second pixel array is equal to the aspect ratio of the scaled image.
Optionally, the step of determining the image to be converted from the scaled image includes: acquiring an initialization pixel array, wherein the initialization pixel array comprises initialization pixel information, the initialization pixel information comprises an initialization color value and an initialization transparency, and the length of the initialization pixel array is equal to the product of the preset height and the preset width; and processing the initialized pixel array and the scaled image to obtain the image to be converted.
Optionally, the step of processing the initialized pixel array and the scaled image to obtain the image to be converted includes: acquiring pixel information of each pixel point in the scaled image; replacing the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, wherein the pixel point corresponding to the replaced initialized pixel information is the same as the pixel point corresponding to the replaced pixel information in position; and acquiring the replaced image corresponding to the initialized pixel array to obtain the image to be converted.
Optionally, the initializing color value includes initializing a first color channel value, initializing a second color channel value, and initializing a third color channel value, where the initializing first color channel value, initializing the second color channel value, initializing the third color channel value, and initializing the transparency are equal.
Optionally, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
Optionally, the method further comprises: and storing the signature of the target image into a database.
Optionally, the signature of the target image is a digitized representation of image features in the target image.
According to a third aspect of the embodiments of the present disclosure, there is provided an image signature generating apparatus including a first acquiring unit configured to perform acquiring a first pixel array of a target image, the first pixel array including pixel information of each pixel point, the pixel information including a color value and transparency; a first determining unit configured to perform determination of a predetermined area of a preset area centering on each of the pixel points; a first calculation unit configured to perform calculation of a target color value of a center pixel point, which is the pixel point located at the center of the predetermined area, from the pixel information of each of the pixel points in the predetermined area; a second determining unit configured to perform determining an image to be converted based at least on all of the target color values; a first generation unit configured to perform conversion of the image to be converted into a character string, generating a signature of the target image.
Optionally, the first determining unit includes: and the first determination subunit is configured to determine the predetermined area of the preset area by taking the pixel point as a circle center and a predetermined distance as a radius.
Optionally, the first computing unit includes: a first calculating subunit configured to perform calculation of an average color value of each of the pixel points, the average color value being an average of a first color channel value, a second color channel value, and a third color channel value of the color values; a first acquisition subunit configured to perform acquisition of an average color value of each of the pixel points of the predetermined area; and a second calculating subunit configured to calculate the target color value of the corresponding center pixel point according to the average color value of each pixel point in the predetermined area.
Optionally, the second computing subunit includes: a first calculation module configured to perform calculation of an average value of the average color values of all the pixel points in the predetermined area, resulting in an updated average value; and the first determining module is used for taking the updated average value as the target color value of the corresponding central pixel point.
Optionally, the second determining unit includes: the first processing subunit is configured to perform processing on all the target color values to obtain a second pixel array; and a second determining subunit configured to perform determining the image to be converted according to the second pixel array.
Optionally, the first processing subunit includes: a second determining module configured to perform determining a predetermined pixel point, the pixel points having a predetermined number of the target images between two adjacent predetermined pixel points; and a third determining module configured to perform determining the second pixel array, where the second pixel array is formed by the target color values and the transparency of all the predetermined pixel points.
Optionally, the second determining subunit includes: the first acquisition module is configured to acquire the image corresponding to the second pixel array; and the fourth determining module is configured to execute the image corresponding to the second pixel array as the image to be converted.
Optionally, the second determining subunit includes: a second acquisition module configured to perform acquisition of a preset height and a preset width; the first scaling module is configured to perform scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain a scaled image; and a fifth determining module configured to determine the image to be converted according to the scaled image.
Optionally, the first scaling module is configured to perform: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height;
The fifth determination module is configured to perform: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted.
Optionally, the first scaling module includes: the first acquisition submodule is configured to acquire the aspect ratio of the image corresponding to the second pixel array; a first determining sub-module configured to perform a scaling value according to an aspect ratio of an image corresponding to the second pixel array and a predetermined size value, the predetermined size value being a maximum value of the preset height and the preset width; and the first scaling submodule is configured to perform scaling of one of the width and the height of the image corresponding to the second pixel array to the scaling value, and scaling of the other of the width and the height of the image corresponding to the second pixel array to the preset size value to obtain the scaled image, wherein the aspect ratio of the scaled image is equal to the aspect ratio of the image corresponding to the second pixel array.
Optionally, the fifth determining module includes: a second acquisition sub-module configured to perform acquisition of an initialization pixel array including initialization pixel information including an initialization color value and an initialization transparency, the length of the initialization pixel array being equal to a product of the preset height and the preset width; and the first processing submodule is configured to execute processing on the initialized pixel array and the scaled image to obtain the image to be converted.
Optionally, the first processing submodule includes: a third acquisition sub-module configured to perform acquisition of pixel information of each of the pixel points in the scaled image; a first replacing sub-module configured to replace the initialized pixel information with the pixel information to obtain a replaced initialized pixel array, wherein the pixel point corresponding to the replaced initialized pixel information is the same as the pixel point corresponding to the replaced pixel information; and the fourth acquisition sub-module is configured to acquire the image corresponding to the replaced initialized pixel array, and obtain the image to be converted.
Optionally, the initializing color value includes initializing a first color channel value, initializing a second color channel value, and initializing a third color channel value, where the initializing first color channel value, initializing the second color channel value, initializing the third color channel value, and initializing the transparency are equal.
Optionally, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
Optionally, the apparatus further comprises: a first storage unit configured to perform storing of a signature of the target image to a database.
Optionally, the signature of the target image is a digitized representation of image features in the target image.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an image signature generating apparatus, including: a second acquisition unit configured to perform acquisition of a first pixel array of a target image, the first pixel array including pixel information of each pixel point, the pixel information including a color value and transparency; a third obtaining unit configured to obtain a scaled image according to the first pixel array, wherein the width of the scaled image is equal to a preset width and the height of the scaled image is equal to a preset height; a third determination unit configured to perform determination of an image to be converted from the scaled image; and a second generation unit configured to perform conversion of the image to be converted into a character string, and generate a signature of the target image.
Optionally, the third obtaining unit includes: a third calculation subunit configured to perform calculation of a target color value of a center pixel point, which is the pixel point located at the center of a predetermined area, from the pixel information of each of the pixel points in the predetermined area; and a second acquisition subunit configured to perform acquisition of the scaled image according to all the target color values.
Optionally, the third obtaining unit further includes: and a third determination subunit configured to determine, before the step of calculating a target color value of a center pixel point based on the pixel information of each of the pixel points in the predetermined area, the predetermined area of a preset area with each of the pixel points as a center.
Optionally, the second acquisition subunit includes: the first processing module is configured to execute processing on all the target color values to obtain a second pixel array; a sixth acquisition module configured to perform acquisition of a preset height and a preset width; and the third scaling module is configured to perform scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain the scaled image.
Optionally, the third scaling module is configured to perform: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the third determination unit is configured to perform: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted.
Optionally, the third scaling module includes: a fifth obtaining sub-module configured to obtain an aspect ratio of the image corresponding to the second pixel array; a second determining sub-module configured to perform a scaling value according to an aspect ratio of an image corresponding to the second pixel array and a predetermined size value, the predetermined size value being a maximum value of the preset height and the preset width; and the second scaling submodule is configured to perform scaling of one of the width and the height of the image corresponding to the second pixel array into the scaling value, scaling of the other of the width and the height of the image corresponding to the second pixel array into the preset size value, and obtaining the scaled image, wherein the aspect ratio of the image corresponding to the second pixel array is equal to the aspect ratio of the scaled image.
Optionally, the third determining unit includes: a third acquisition subunit configured to perform acquisition of an initialization pixel array including initialization pixel information including an initialization color value and an initialization transparency, the length of the initialization pixel array being equal to a product of the preset height and the preset width; and the second processing subunit is configured to perform processing on the initialized pixel array and the scaled image to obtain the image to be converted.
Optionally, the second processing subunit includes: a seventh acquisition module configured to perform acquisition of pixel information of each of the pixel points in the scaled image; a second replacing module configured to replace the initialized pixel information with the pixel information to obtain a replaced initialized pixel array, wherein the pixel point corresponding to the replaced initialized pixel information is the same as the pixel point corresponding to the replaced pixel information; and the eighth acquisition module is configured to acquire the image corresponding to the replaced initialized pixel array, so as to obtain the image to be converted.
Optionally, the initializing color value includes initializing a first color channel value, initializing a second color channel value, and initializing a third color channel value, where the initializing first color channel value, initializing the second color channel value, initializing the third color channel value, and initializing the transparency are equal.
Optionally, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
Optionally, the apparatus further comprises: and a second storage unit configured to perform storing of the signature of the target image to a database.
Optionally, the signature of the target image is a digitized representation of image features in the target image.
According to a fifth aspect of embodiments of the present disclosure, there is provided an electronic device comprising a processor and a memory configured to execute instructions executable by the processor, wherein the processor is configured to execute the instructions to implement any of the image signature generation methods.
According to a sixth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform any of the image signature generation methods.
According to a seventh aspect of embodiments of the present disclosure, there is provided a computer program product comprising computer instructions which, when executed by a processor, implement any of the described generating methods.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
Firstly, acquiring a first pixel array of a target image, wherein the first pixel array comprises pixel information of each pixel point; then, a preset area is determined by taking each pixel point as a center; then, calculating a target color value of a center pixel point according to the pixel information of each pixel point in a preset area of the target image; then, determining an image to be converted at least according to all the target color values; and finally, converting the image to be converted into a character string, and generating the signature of the target image. In the scheme, the preset area of each pixel point is used as a center to determine the preset area, and the preset area can be flexibly adjusted, so that the accuracy of acquiring the scaled image and the acquired scaled image can be adjusted by adjusting the size of the preset area for the same target image, the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image are flexibly adjusted, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted for the same picture in the prior art are better solved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and, together with the description, are configured to perform the principles of the disclosure and not to constitute a undue limitation on the disclosure.
Fig. 1 is a schematic diagram of an application scenario of a method for generating an image signature according to an exemplary embodiment.
Fig. 2 is a flowchart illustrating a method of generating an image signature according to an exemplary embodiment.
Fig. 3 is a flowchart illustrating another image signature generation method according to an exemplary embodiment.
Fig. 4 is a block diagram illustrating an image signature generation apparatus according to an exemplary embodiment.
Fig. 5 is a block diagram illustrating another image signature generation apparatus according to an exemplary embodiment.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and the above figures are configured to perform a distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
Fig. 1 is an architecture diagram of an implementation environment in which the following image signature generation method may be configured to be executed, as shown in fig. 1, according to an exemplary embodiment. The implementation environment includes an electronic device 01 and a server 02. Wherein the electronic device 01 and the server 02 may be interconnected and communicate via a network.
The electronic device 01 may be a device that stores or displays a target image. The electronic device 01 may acquire the signature of the target image described above from the server 02. Or the electronic device 01 itself may determine the signature of the target image and store the signature of the target image.
The electronic device 01 may be any electronic product that can perform man-machine interaction with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, a voice interaction or handwriting device, such as a mobile phone, a tablet computer, a palm top computer, a personal computer (Personal Computer, PC), a wearable device, a smart television, and the like.
The server 02 may be a server, a server cluster formed by a plurality of servers, or a cloud computing service center. The server 02 may include a processor, memory, network interfaces, and the like.
Those skilled in the art will appreciate that the above-described electronic devices and servers are merely examples, and that other existing or future-occurring electronic devices or servers, as may be adapted to perform the present disclosure, are also intended to be encompassed within the scope of the present disclosure and are hereby incorporated by reference.
Based on this, embodiments of the present disclosure provide a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating an image signature.
The execution body of the image signature generation method provided in the embodiment of the present disclosure may be the above electronic device or server, or may be a functional module and/or a functional entity in the electronic device or server that can implement the image signature generation method, which may be specifically determined according to actual use requirements, and the embodiment of the present disclosure is not limited. The display method provided by the embodiment of the present disclosure is described below by taking an execution body as an electronic device as an example.
Fig. 2 is a flowchart illustrating a method of generating an image signature according to an exemplary embodiment, and as shown in fig. 2, the method of generating an image signature is configured to be executed in an electronic device, and includes the steps of:
In step S11, a first pixel array of the target image is acquired, where the first pixel array includes pixel information of each pixel point.
The pixel information includes a color value and a transparency a (Alpha), wherein the color value includes a first color channel value, a second color channel value and a third color channel value, the first color channel value may be a R (Red) value, the second color channel value may be a G (green) value, the third color channel value may be a B (Blue) value, and the pixel information ranges from 0 to 255, wherein 0 of transparency represents transparency and 255 of transparency represents full visibility.
In step S12, a predetermined area of a predetermined area is determined with each of the pixel points as a center.
In step S13, a target color value of a center pixel is calculated from the pixel information of each pixel in the predetermined area, the center pixel being the pixel located at the center of the predetermined area.
In step S14, determining an image to be converted according to at least all the target color values;
In step S15, the image to be converted is converted into a character string, and a signature of the target image is generated.
In the above embodiment, first, a first pixel array of a target image is acquired, where the first pixel array includes pixel information of each pixel point; then, a preset area is determined by taking each pixel point as a center; then, calculating a target color value of a center pixel point according to the pixel information of each pixel point in a preset area of the target image; then, determining an image to be converted at least according to all the target color values; and finally, converting the image to be converted into a character string to generate the signature of the target image. In the scheme, the preset area of each pixel point is used as a center to determine the preset area, and the preset area can be flexibly adjusted, so that the accuracy of acquiring the scaled image and the acquired scaled image can be adjusted by adjusting the size of the preset area for the same target image, the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image are flexibly adjusted, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted for the same picture in the prior art are better solved.
In the practical application process, when the area of the selected preset area is larger, the signature occupying the smaller image of the memory can be roughly obtained, and when the area of the selected preset area is smaller, the signature occupying the larger image of the memory can be more accurately obtained.
In an actual application process, the step of determining the predetermined area with each pixel point as a center includes: and determining the preset area corresponding to each pixel point by taking the pixel point as a circle center and a preset distance as a radius. Of course, the shape of the predetermined area is not limited to a circle, and may be rectangular or other irregular shape, and in addition, a person skilled in the art may flexibly adjust the predetermined distance to determine the predetermined area with different areas.
In order to obtain the target color value of the pixel more simply and more accurately, according to a specific embodiment of the present application, the step of calculating the target color value of the center pixel according to the pixel information of each of the pixels in the predetermined area of the target image includes: calculating an average color value of each pixel point, wherein the average color value is an average value of the first color channel value, the second color channel value and the third color channel value, namely calculating a gray value of each pixel point; acquiring an average color value of each pixel point of the preset area; and calculating the target color value of the corresponding center pixel according to the average color value of each pixel in the preset area. According to the method, the gray value of each pixel point in the preset area is calculated, and then the target color value is calculated according to the gray value, so that the target color value of the pixel point is ensured to be obtained simply and accurately, and a good data basis is provided for the follow-up determination of the signature of the target image.
According to another specific embodiment of the present application, the step of calculating the target color value of the corresponding pixel according to the average color value of each pixel in the predetermined area includes: calculating the average color values of all the pixel points in the preset area to obtain an updated average value; and respectively taking the updated average value as a target color value of the corresponding pixel point, wherein the target color value comprises a target first color channel value, a target second color channel value and a target third color channel value, and the target first color channel value, the target second color channel value and the target third color channel value form the target color value. Therefore, the noise of the image is ensured to be low, the detail level of the image is ensured to be low, and the image effect of the image under different proportions is ensured to be good.
It should be noted that, in the present application, the first color channel value, the second color channel value, and the third color channel value may correspond to an R value, a G value, and a B value, respectively.
In order to further ensure that the efficiency of acquiring the signature of the target image is high and that the smoothness and the sharpness of the image are good, according to another specific embodiment of the present application, the step of determining the image to be converted at least according to all the target color values includes: processing all the target color values to obtain a second pixel array; and determining the image to be converted according to the second pixel array. According to the method, the efficiency of acquiring the signature of the target image and the smoothness and definition effects of the image are considered by processing the target color value.
In another specific embodiment of the present application, the step of processing all the target color values to obtain a second pixel array includes: determining a preset pixel point, wherein a preset number of the pixel points are arranged between two adjacent preset pixel points; and determining the second pixel array, wherein the second pixel array is formed by the target color values and the transparency of all the preset pixel points.
In a specific embodiment, a value S is first set as a threshold, a predetermined pixel is obtained every S pixels, N predetermined pixels are obtained, the formula sa= [ [ R0 ], G0 ], B0 ], a 0], … [ [ R [ S ], G [ S ], B [ S ], a [ S ] ], …, [ [ R [ N ] S ], G [ N ] S ], B [ N ] S ], a [ N ] S ] is used, and SA is the second pixel array.
In an embodiment of the present application, the step of determining the image to be converted according to the second pixel array includes: acquiring an image corresponding to the second pixel array; and taking the image corresponding to the second pixel array as the image to be converted.
In order to further ensure that the signature of the image is obtained more quickly and accurately, according to another specific embodiment of the present application, the step of determining the image to be converted according to the second pixel array includes: acquiring a preset height and a preset width; scaling the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain a scaled image; and determining the image to be converted according to the scaled image.
In another specific embodiment of the present application, the step of scaling the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain a scaled image includes: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the step of determining the image to be converted according to the scaled image includes: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted. This embodiment ensures that images of different sizes can generate signatures of the same specification.
In the above embodiment, since the width and the height are set for the image corresponding to the second pixel array forcedly, the image corresponding to the second pixel array is stretched or compressed to a certain extent, and there is a certain distortion, in order to further ensure that the obtained signature of the target image is more accurate, in another specific embodiment of the present application, the step of performing scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height, includes: acquiring the aspect ratio of the image corresponding to the second pixel array; determining a scaling value according to the aspect ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the maximum value of the preset height and the preset width; and scaling one of the width and the height of the image corresponding to the second pixel array into the scaling value, and scaling the other of the width and the height of the image corresponding to the second pixel array into the preset size value to obtain the scaled image, wherein the aspect ratio of the scaled image is equal to the aspect ratio of the image corresponding to the second pixel array. The method performs equal proportion scaling on the image corresponding to the second pixel array without stretching or deforming the image corresponding to the second pixel array, so that the obtained signature of the target image can be ensured to be more accurate. For example, when the maximum value of the preset height and the preset width is the preset width, scaling the image corresponding to the second pixel array in an equal proportion based on the preset height, that is, scaling the height of the image corresponding to the second pixel array to the preset height, scaling the width of the image corresponding to the second pixel array to a scaling value, where the scaling value is equal to the ratio of the preset height to the aspect ratio of the image corresponding to the second pixel array, to obtain a scaled image, where the aspect ratio of the scaled image is identical to the aspect ratio of the image corresponding to the second pixel array, that is, equal proportion scaling of the image corresponding to the second pixel array is achieved.
In the practical application process, the scaling is not limited to the above-mentioned scaling based on the maximum value of the preset height and the preset width, and the scaling may be performed based on the minimum value of the preset height and the preset width. Specifically, the predetermined size value is the minimum value of the preset height and the preset width, a scaling value is calculated according to the aspect ratio and the preset width of the image corresponding to the second pixel array, that is, the height corresponding to the scaled image is calculated, and then, the width of the image corresponding to the second pixel array is scaled to the preset width, and the height is scaled to the scaling value, so that equal-proportion scaling is realized.
In order to further ensure that the obtained signature of the target image has a smaller distortion degree, so as to be more accurate, in an actual application process, in an embodiment, the step of determining the image to be converted according to the scaled image includes: acquiring an initialization pixel array, wherein the initialization pixel array comprises initialization pixel information, the initialization pixel information comprises an initialization color value and an initialization transparency, the initialization color value comprises an initialization first color channel value, an initialization second color channel value and an initialization third color channel value, and the length of the initialization pixel array is equal to the product of the preset height and the preset width; and processing the initialized pixel array and the scaled image to obtain the image to be converted.
In another embodiment of the present application, the step of processing the initialized pixel array and the scaled image to obtain the image to be converted includes: acquiring pixel information of each pixel point in the scaled image; the first replacing sub-module is configured to replace the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, and the pixel point corresponding to the replaced initialized pixel information and the pixel point corresponding to the replaced pixel information are the same in position; and acquiring the replaced image corresponding to the initialized pixel array to obtain the image to be converted. By means of replacement, a zoom image with preset width and preset height is obtained, and the fact that the distortion degree of the signature of the image is smaller is further guaranteed.
In a specific embodiment, the initialized color values include an initialized first color channel value, an initialized second color channel value, and an initialized third color channel value, where the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are equal. The specific values of the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency may be set according to practical situations.
In a more specific embodiment, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
In order to facilitate the subsequent use, in one embodiment of the present application, the method further includes: and storing the signature of the target image into a database. Specifically, the signature of the target image can be directly stored in a database or converted into a webpage image to be stored in the database for later use.
In a specific embodiment, the specific process of determining the signature step of the target image according to the image corresponding to the second pixel array may further be as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; acquiring the original width W and the original height H of the image by using an API algorithm of naturalWidth or naturalHeight to obtain the aspect ratio r of the image corresponding to the second pixel array; acquiring the preset width W1 and the preset height H1, wherein when the preset height is larger than the preset width, H1/r is the zoom size, namely the width of the zoomed image obtained after zooming, and the preset height is the height of the zoomed image obtained after zooming; scaling the image using the API algorithm of drawImage (IMG, 0, H1, H1/r); acquiring RGBA arrays ARR1 of all pixel points of the scaled image by using an API algorithm of GETIMAGEDATA, initializing an array with the length equal to W1X H1 to obtain the initialized pixel array, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value and the initialized transparency in the initialized pixel array are all equal to 0, i.e., the default fill color value is black, such as initializing pixel array arr2= [ [0, 0], …, [0, 0] ]; replacing pixel information in the same position as ARR1 in ARR2 with a value in ARR1 to obtain the replacement image; converting the replacement Image into a base64 representation by using toDataURL ("Image/Png") algorithm, wherein the base64 is the character string; the character string can be used as a normalized image signature to be directly stored in a database or converted into a webpage image to be stored in the database for use. Therefore, stretching or deformation operation is not needed to be carried out on the image corresponding to the second pixel array, and the obtained signature of the target image can be further ensured to be accurate.
In the practical application process, the preset height and the preset width are generally set according to the requirement of the user on the specific size of the normalized signature, and for convenience of subsequent use, the preset height and the preset width are the same. Of course, the predetermined height and the predetermined width may be different.
In a specific embodiment, the specific step of converting the image corresponding to the second pixel array into a character string may further include the following steps:
Rendering the second pixel array SA as canvas by using an API algorithm of putImageData;
the canvas is converted into a base64 representation of the target Image using the API algorithm of toDataURL ("Image/Png"), which base64 is the string.
In a specific embodiment, the specific procedure of determining the signature step of the target image according to the image corresponding to the second pixel array is as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; the image corresponding to the second pixel array is endowed with the preset width and the preset height, so that the signature of the target image with the same specification can be obtained, key information of the target image is reserved by the method, the target image can be directly stored into a database as the signature, or the scaled image can be converted into the character string to be stored into the database as the signature for reservation.
According to another exemplary embodiment of the present application, there is also provided a method for generating an image signature, and fig. 3 is a flowchart illustrating another method for generating an image signature according to an exemplary embodiment, as shown in fig. 3, including the steps of:
in step S21, a first pixel array of the target image is acquired, where the first pixel array includes pixel information of each pixel point.
The pixel information includes a color value and a transparency a (Alpha), wherein the color value includes a first color channel value, a second color channel value and a third color channel value, the first color channel value may be a R (Red) value, the second color channel value may be a G (green) value, the third color channel value may be a B (Blue) value, and the pixel information ranges from 0 to 255, wherein 0 of transparency represents transparency and 255 of transparency represents full visibility.
In step S22, a scaled image is obtained according to the first pixel array, where the width of the scaled image is equal to the preset width and the height is equal to the preset height.
In step S23, an image to be converted is determined according to the scaled image;
In step S24, the image to be converted is converted into a character string, and a signature of the target image is generated.
In the above embodiment, first, a first pixel array of a target image is acquired, where the first pixel array includes pixel information of each pixel point; then, obtaining a scaled image according to the first pixel array, wherein the width of the scaled image is equal to a preset width and the height of the scaled image is equal to a preset height; then, determining an image to be converted according to the scaled image; and finally, converting the image to be converted into a character string to generate the signature of the target image. According to the scheme, the signature of the target image is determined according to the zoom image by acquiring the zoom image, so that the signatures of the same specification can be generated by images with different sizes.
According to a specific embodiment of the present application, the step of obtaining the scaled image according to the first pixel array includes: calculating a target color value of a center pixel point, which is the pixel point located at the center of the predetermined area, based on the pixel information of each pixel point in the predetermined area; and acquiring the scaled image according to all the target color values.
According to another specific embodiment of the present application, before the step of calculating the target color value of the center pixel based on the pixel information of each of the pixel points in the predetermined area, the step of acquiring the scaled image based on the first pixel array further includes: and determining the preset area by taking each pixel point as a center. According to the method, the preset area of the preset area can be flexibly adjusted by taking each pixel point as a center, so that the obtained scaled image and the accuracy of the obtained scaled image can be adjusted by adjusting the size of the preset area for the same target image, the speed of obtaining the signature of the target image and the accuracy of the obtained signature of the target image are flexibly adjusted, and the problems that the time required for obtaining the picture signature and the accuracy of the picture signature cannot be flexibly adjusted for the same picture in the prior art are well solved.
In order to obtain the target color value of the pixel more simply and more accurately, according to a specific embodiment of the present application, the step of calculating the target color value of the center pixel according to the pixel information of each of the pixels in the predetermined area of the target image includes: calculating an average color value of each pixel point, wherein the average color value is an average value of the first color channel value, the second color channel value and the third color channel value, namely calculating a gray value of each pixel point; acquiring an average color value of each pixel point of the preset area; and calculating the target color value of the corresponding center pixel according to the average color value of each pixel in the preset area. According to the method, the gray value of each pixel point in the preset area is calculated, and then the target color value is calculated according to the gray value, so that the target color value of the pixel point is ensured to be obtained simply and accurately, and a good data basis is provided for the follow-up determination of the signature of the target image.
According to another specific embodiment of the present application, the step of calculating the target color value of the corresponding pixel according to the average color value of each pixel in the predetermined area includes: calculating the average color values of all the pixel points in the preset area to obtain an updated average value; and respectively taking the updated average value as a target color value of the corresponding pixel point, wherein the target color value comprises a target first color channel value, a target second color channel value and a target third color channel value, and the target first color channel value, the target second color channel value and the target third color channel value form the target color value. Therefore, the noise of the image is ensured to be low, the detail level of the image is ensured to be low, and the image effect of the image under different proportions is ensured to be good.
In an actual application process, before the step of calculating the target color value of the corresponding pixel according to the average color value of each pixel in the predetermined area, the method includes: and determining the preset area by taking the pixel point as a circle center and the preset distance as a radius. Of course, the shape of the predetermined area is not limited to a circle, and may be rectangular or other irregular shape, and a person skilled in the art may flexibly adjust the predetermined distance to determine the predetermined area with different shapes.
According to another specific embodiment of the present application, the step of obtaining the scaled image according to all the target color values includes: processing all the target color values to obtain a second pixel array; acquiring a preset height and a preset width; and performing scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain the scaled image. This ensures that images of different sizes can generate signatures of the same specification.
In accordance with another specific embodiment of the present application, the step of scaling the image corresponding to the second pixel array according to at least the preset width and the preset height to obtain a scaled image includes: scaling the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the step of determining the image to be converted according to the scaled image includes: and determining the scaled image with the width equal to the preset width and the height equal to the preset height as the image to be converted.
In a specific embodiment, the specific procedure of determining the signature step of the target image according to the image corresponding to the second pixel array is as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; the image corresponding to the second pixel array is endowed with the preset width and the preset height, so that the signature of the target image with the same specification can be obtained, key information of the target image is reserved by the method, the target image can be directly stored into a database as the signature, or the scaled image can be converted into the character string to be stored into the database as the signature for reservation.
In the above embodiment, since the width and the height are set for the image corresponding to the second pixel array forcedly, the image corresponding to the second pixel array is stretched or compressed to a certain extent, and there is a certain distortion, in order to further ensure that the obtained signature of the target image is more accurate, in another specific embodiment of the present application, the step of performing scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height, to obtain the scaled image includes: acquiring the aspect ratio of the image corresponding to the second pixel array; determining a scaling value according to the aspect ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the maximum value of the preset height and the preset width; and scaling one of the width and the height of the image corresponding to the second pixel array into the scaling value, and scaling the other of the width and the height of the image corresponding to the second pixel array into the preset size value to obtain the scaled image, wherein the aspect ratio of the image corresponding to the second pixel array is equal to the aspect ratio of the scaled image. The method performs equal proportion scaling on the image corresponding to the second pixel array without stretching or deforming the image corresponding to the second pixel array, so that the obtained signature of the target image can be ensured to be more accurate. For example, when the maximum value of the preset height and the preset width is the preset width, scaling the image corresponding to the second pixel array in an equal proportion based on the preset height, that is, scaling the height of the image corresponding to the second pixel array to the preset height, scaling the width of the image corresponding to the second pixel array to a scaling value, where the scaling value is equal to the ratio of the preset height to the aspect ratio of the image corresponding to the second pixel array, to obtain a scaled image, where the aspect ratio of the scaled image is identical to the aspect ratio of the image corresponding to the second pixel array, that is, equal proportion scaling of the image corresponding to the second pixel array is achieved.
In the practical application process, the scaling is not limited to the above-mentioned scaling based on the maximum value of the preset height and the preset width, and the scaling may be performed based on the minimum value of the preset height and the preset width. Specifically, the predetermined size value is the minimum value of the preset height and the preset width, a scaling value is calculated according to the aspect ratio and the preset width of the image corresponding to the second pixel array, that is, the height corresponding to the scaled image is calculated, and then, the width of the image corresponding to the second pixel array is scaled to the preset width, and the height is scaled to the scaling value, so that equal-proportion scaling is realized.
In order to further ensure that the obtained signature of the target image has a smaller distortion degree, so as to be more accurate, in an actual application process, in an embodiment, the step of determining the image to be converted according to the scaled image includes: acquiring an initialization pixel array, wherein the initialization pixel array comprises initialization pixel information, the initialization pixel information comprises an initialization color value and an initialization transparency, the initialization color value comprises an initialization first color channel value, an initialization second color channel value and an initialization third color channel value, and the length of the initialization pixel array is equal to the product of the preset height and the preset width; and processing the initialized pixel array and the scaled image to obtain the image to be converted.
In another embodiment of the present application, the step of processing the initialized pixel array and the scaled image to obtain the image to be converted includes: acquiring pixel information of each pixel point in the scaled image; the first replacing sub-module is configured to replace the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, and the pixel point corresponding to the replaced initialized pixel information and the pixel point corresponding to the replaced pixel information are the same in position; and acquiring the replaced image corresponding to the initialized pixel array to obtain the image to be converted. By means of replacement, a zoom image with preset width and preset height is obtained, and the fact that the distortion degree of the signature of the image is smaller is further guaranteed.
In a specific embodiment, the initialized color values include an initialized first color channel value, an initialized second color channel value, and an initialized third color channel value, where the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are equal. The specific values of the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency may be set according to practical situations.
In a more specific embodiment, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
In one embodiment of the present application, the signature of the target image is stored in a database for convenience of subsequent use. Specifically, the signature of the target image can be directly stored in a database or converted into a webpage image to be stored in the database for later use. In a specific embodiment, the specific process of determining the signature step of the target image according to the image corresponding to the second pixel array may further be as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; acquiring the original width W and the original height H of the image by using an API algorithm of naturalWidth or naturalHeight to obtain the aspect ratio r of the image corresponding to the second pixel array; acquiring the preset width W1 and the preset height H1, wherein when the preset height is larger than the preset width, H1/r is the zoom size, namely the width of the zoomed image obtained after zooming, and the preset height is the height of the zoomed image obtained after zooming; scaling the image using the API algorithm of drawImage (IMG, 0, H1, H1/r); acquiring RGBA arrays ARR1 of all pixel points of the scaled image by using an API algorithm of GETIMAGEDATA, initializing an array with the length equal to W1X H1 to obtain the initialized pixel array, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value and the initialized transparency in the initialized pixel array are all equal to 0, i.e., the default fill color value is black, such as initializing pixel array arr2= [ [0, 0], …, [0, 0] ]; replacing pixel information in the same position as ARR1 in ARR2 with a value in ARR1 to obtain the replacement image; converting the replacement Image into a base64 representation by using toDataURL ("Image/Png") algorithm, wherein the base64 is the character string; the character string can be used as a normalized image signature to be directly stored in a database or converted into a webpage image to be stored in the database for use. Therefore, stretching or deformation operation is not needed to be carried out on the image corresponding to the second pixel array, and the obtained signature of the target image can be further ensured to be accurate.
In the practical application process, the preset height and the preset width are generally set according to the requirement of the user on the specific size of the normalized signature, and for convenience of subsequent use, the preset height and the preset width are the same. Of course, the predetermined height and the predetermined width may be different.
According to still another exemplary embodiment of the present application, there is also provided an image signature generating apparatus, fig. 4 is a block diagram of an image signature generating apparatus according to an exemplary embodiment, and referring to fig. 4, the apparatus includes a first acquiring unit 10, a first determining unit 20, a first calculating unit 30, a second determining unit 40, and a first generating unit 50.
The first acquiring unit 10 is configured to perform acquisition of a first pixel array of a target image, where the first pixel array includes pixel information of each pixel point.
The pixel information includes a color value and a transparency a (Alpha), wherein the color value includes a first color channel value, a second color channel value and a third color channel value, the first color channel value may be a R (Red) value, the second color channel value may be a G (green) value, the third color channel value may be a B (Blue) value, and the pixel information ranges from 0 to 255, wherein 0 of transparency represents transparency and 255 of transparency represents full visibility.
The first determining unit 20 is configured to perform determination of a predetermined area of a preset area centering on each of the above-described pixel points.
A first calculating unit 30 configured to calculate a target color value of a center pixel point, which is the pixel point located at the center of the predetermined area, based on the pixel information of each of the pixel points in the predetermined area.
A second determining unit 40 configured to perform determining an image to be converted based at least on all of the above-mentioned target color values;
the first generating unit 50 is configured to perform conversion of the image to be converted into a character string, and generate a signature of the target image.
In the above-described embodiment, the first acquiring unit 10 acquires the first pixel array of the target image, which includes the pixel information of each pixel point; the first determining unit 20 determines a predetermined area of a preset area with each of the above pixel points as a center; the first calculating unit 30 calculates a target color value of a center pixel based on the pixel information of each pixel in a predetermined region of the target image; the second determining unit 40 determines an image to be converted based at least on all the target color values; the first generation unit 50 converts the image to be converted into a character string, and generates a signature of the target image. In the scheme, the preset area of each pixel point is used as a center to determine the preset area, and the preset area can be flexibly adjusted, so that the accuracy of acquiring the scaled image and the acquired scaled image can be adjusted by adjusting the size of the preset area for the same target image, the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image are flexibly adjusted, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted for the same picture in the prior art are better solved.
In the practical application process, when the area of the selected preset area is larger, the signature of the image can be obtained more quickly and roughly, and when the area of the selected preset area is smaller, the signature of the image can be obtained more slowly and more accurately.
In an actual application process, the first determining unit includes a first determining subunit, where the first determining subunit determines the predetermined area corresponding to each pixel point with the pixel point as a center and a predetermined distance as a radius. Of course, the shape of the predetermined area is not limited to a circle, and may be rectangular or other irregular shape, and in addition, a person skilled in the art may flexibly adjust the predetermined distance to determine the predetermined area with different areas.
In order to obtain the target color value of the pixel more simply and more accurately, according to a specific embodiment of the present application, the first calculating unit includes a first calculating subunit, a first obtaining subunit, and a second calculating subunit, where the first calculating subunit is configured to perform calculation of an average color value of each of the pixel, and the average color value is an average value of a first color channel value, a second color channel value, and a third color channel value in the color values, that is, calculate a gray value of each of the pixel; the first acquisition subunit is configured to acquire an average color value of each pixel point of the predetermined area; the second calculating subunit is configured to calculate the target color value of the corresponding center pixel according to the average color value of each pixel in the predetermined area. The device calculates the gray value of each pixel point in the preset area, and then calculates the target color value according to the gray value, so that the target color value of the pixel point is ensured to be obtained simply and accurately, and a better data basis is provided for the follow-up determination of the signature of the target image.
According to another specific embodiment of the present application, the second calculating subunit includes a first calculating module and a first determining module, where the first calculating module is configured to perform calculating the average color values of all the pixel points in the predetermined area to obtain an updated average value; the first determining module is configured to perform the updating of the average value as the target color value of the corresponding center pixel, i.e. the updating of the average value as the updated first color channel value, the updating of the second color channel value and the updating of the third color channel value of the corresponding pixel, respectively, the updating of the first color channel value, the updating of the second color channel value and the updating of the third color channel value forming the target color value. Therefore, the noise of the image is ensured to be low, the detail level of the image is ensured to be low, and the image effect of the image under different proportions is ensured to be good.
In order to further ensure that the efficiency of acquiring the signature of the target image is high and that the smoothness and the definition of the image are good, according to still another specific embodiment of the present application, the second determining unit includes a first processing subunit and a second determining subunit, where the first processing subunit is configured to perform processing on all the target color values to obtain a second pixel array; the second determining subunit is configured to determine the image to be converted according to the second pixel array. The device processes all the target color values, so that the efficiency of acquiring the signature of the target image and the smoothness and definition effects of the image are considered.
In yet another specific embodiment of the present application, the first processing subunit includes a second determining module and a third determining module, where the second determining module is configured to determine a predetermined pixel point, and a predetermined number of the pixel points are located between two adjacent predetermined pixel points; the third determining module is configured to determine the second pixel array, where the second pixel array is formed by the target color values and the transparency of all the predetermined pixel points.
In a specific embodiment, a value S is first set as a threshold, a predetermined pixel is obtained every S pixels, N predetermined pixels are obtained, the formula sa= [ [ R0 ], G0 ], B0 ], a 0], … [ [ R [ S ], G [ S ], B [ S ], a [ S ] ], …, [ [ R [ N ] S ], G [ N ] S ], B [ N ] S ], a [ N ] S ] is used, and SA is the second pixel array.
In one embodiment of the present application, the second determining subunit includes a first acquiring module and a fourth determining module, where the first acquiring module is configured to perform acquiring an image corresponding to the second pixel array; the fourth determining module is configured to perform the image corresponding to the second pixel array as an image to be converted.
In another specific embodiment of the present application, the second determining subunit includes a second acquiring module, a first scaling module, and a fifth determining module, where the second acquiring module is configured to perform acquiring a preset height and a preset width; the first scaling submodule is configured to perform scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height to obtain a scaled image; the fifth determining module is configured to determine the image to be converted based on the scaled image. This ensures that images of different sizes can generate signatures of the same specification.
In still another specific embodiment of the present application, the first scaling module is further configured to perform scaling of the width of the image corresponding to the second pixel array to the preset width; scaling the height of the image corresponding to the second pixel array to the preset height; the first determining submodule is further configured to determine that the scaled image with a width equal to the preset width and a height equal to the preset height is the image to be converted.
In the above embodiment, since the width and height are set for the image corresponding to the second pixel array, which may cause the image corresponding to the second pixel array to be stretched or compressed to a certain extent, and have a certain distortion, in order to further ensure that the obtained signature of the target image is more accurate, in another specific embodiment of the present application, the first scaling module includes a first obtaining sub-module, a first determining sub-module, and a first scaling sub-module, where the first obtaining sub-module is configured to perform obtaining the aspect ratio of the image corresponding to the second pixel array; the first determining submodule is configured to execute the height-width ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the minimum value of the preset height and the preset width, and a scaling value is determined; the first scaling sub-module is configured to perform scaling of one of a width and a height of the image corresponding to the second pixel array to the scaling value, and scaling of the other of the width and the height of the image corresponding to the second pixel array to the predetermined size value, so as to obtain the scaled image, wherein an aspect ratio of the scaled image is equal to an aspect ratio of the image corresponding to the second pixel array. The device performs equal-proportion scaling on the image corresponding to the second pixel array without stretching or deforming the image corresponding to the second pixel array, so that the obtained signature of the target image can be ensured to be more accurate. For example, when the maximum value of the preset height and the preset width is the preset width, scaling the image corresponding to the second pixel array in an equal proportion based on the preset height, that is, scaling the height of the image corresponding to the second pixel array to the preset height, scaling the width of the image corresponding to the second pixel array to a scaling value, where the scaling value is equal to the ratio of the preset height to the aspect ratio of the image corresponding to the second pixel array, to obtain a scaled image, where the aspect ratio of the scaled image is identical to the aspect ratio of the image corresponding to the second pixel array, that is, equal proportion scaling of the image corresponding to the second pixel array is achieved.
In the practical application process, the scaling is not limited to the above-mentioned scaling based on the maximum value of the preset height and the preset width, and the scaling may be performed based on the minimum value of the preset height and the preset width. Specifically, the predetermined size value is the minimum value of the preset height and the preset width, a scaling value is calculated according to the aspect ratio and the preset width of the image corresponding to the second pixel array, that is, the height corresponding to the scaled image is calculated, and then, the width of the image corresponding to the second pixel array is scaled to the preset width, and the height is scaled to the scaling value, so that equal-proportion scaling is realized.
In order to further ensure that the obtained signature of the target image has smaller distortion degree, so as to be more accurate, in an actual application process, the fifth determining module comprises a second obtaining sub-module and a first processing sub-module, wherein the second obtaining sub-module is configured to obtain an initialization pixel array, the initialization pixel array comprises initialization pixel information, the initialization pixel information comprises an initialization color value and an initialization transparency, the initialization color value comprises an initialization first color channel value, an initialization second color channel value and an initialization third color channel value, and the length of the initialization pixel array is equal to the product of the preset height and the preset width; the first processing sub-module is configured to perform processing on the initialized pixel array and the scaled image to obtain the image to be converted.
In another embodiment of the present application, the first processing submodule includes a third acquiring submodule, a first replacing submodule, and a fourth acquiring submodule, where the third acquiring submodule is configured to perform acquiring pixel information of each of the pixel points in the scaled image; the first replacing sub-module is configured to replace the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, and the pixel point corresponding to the replaced initialized pixel information and the pixel point corresponding to the replaced pixel information are the same in position; the fourth obtaining sub-module is configured to obtain the image to be converted by obtaining the image corresponding to the initialized pixel array after replacement. By means of replacement, a zoom image with preset width and preset height is obtained, and the fact that the distortion degree of the signature of the image is smaller is further guaranteed.
In a specific embodiment, the initialized color values include an initialized first color channel value, an initialized second color channel value, and an initialized third color channel value, where the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are equal. The specific values of the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency may be set according to practical situations.
In a more specific embodiment, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
In order to facilitate subsequent use, in one embodiment of the present application, the apparatus includes a first storage unit configured to perform storing a signature of the target image into a database. Specifically, the signature of the target image can be directly stored in a database or converted into a webpage image to be stored in the database for later use.
In a specific embodiment, the specific process of determining the signature step of the target image according to the image corresponding to the second pixel array may further be as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; acquiring the original width W and the original height H of the image by using an API algorithm of naturalWidth or naturalHeight to obtain the aspect ratio r of the image corresponding to the second pixel array; acquiring the preset width W1 and the preset height H1, wherein when the preset height is larger than the preset width, H1/r is the zoom size, namely the width of the zoomed image obtained after zooming, and the preset height is the height of the zoomed image obtained after zooming; scaling the image using the API algorithm of drawImage (IMG, 0, H1, H1/r); acquiring RGBA arrays ARR1 of all pixel points of the scaled image by using an API algorithm of GETIMAGEDATA, initializing an array with the length equal to W1X H1 to obtain the initialized pixel array, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value and the initialized transparency in the initialized pixel array are all equal to 0, i.e., the default fill color value is black, such as initializing pixel array arr2= [ [0, 0], …, [0, 0] ]; replacing pixel information in the same position as ARR1 in ARR2 with a value in ARR1 to obtain the replacement image; converting the replacement Image into a base64 representation by using toDataURL ("Image/Png") algorithm, wherein the base64 is the character string; the character string can be used as a normalized image signature to be directly stored in a database or converted into a webpage image to be stored in the database for use. Therefore, stretching or deformation operation is not needed to be carried out on the image corresponding to the second pixel array, and the obtained signature of the target image can be further ensured to be accurate.
In the practical application process, the preset height and the preset width are generally set according to the requirement of the user on the specific size of the normalized signature, and for convenience of subsequent use, the preset height and the preset width are the same. Of course, the predetermined height and the predetermined width may be different.
In a specific embodiment, the specific step of converting the image corresponding to the second pixel array into a character string may further include the following steps:
Rendering the second pixel array SA as canvas by using an API algorithm of putImageData;
the canvas is converted into a base64 representation of the target Image using the API algorithm of toDataURL ("Image/Png"), which base64 is the string.
In a specific embodiment, the specific procedure of determining the signature step of the target image according to the image corresponding to the second pixel array is as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; the image corresponding to the second pixel array is endowed with the preset width and the preset height, so that the signature of the target image with the same specification can be obtained, the device keeps key information of the target image, and the target image can be directly stored in a database as the signature or converted into the character string to be stored in the database as the signature for use.
According to still another exemplary embodiment of the present application, there is also provided an image signature generating apparatus, fig. 5 is a block diagram of another image signature generating apparatus shown according to an exemplary embodiment, and referring to fig. 5, the apparatus includes a second acquiring unit 60, a third acquiring unit 70, and a third determining unit 80, and a second generating unit 90.
The second acquisition unit 60 is configured to execute a first pixel array of the acquisition target image, the first pixel array including pixel information of each pixel point.
The pixel information includes a color value and a transparency a (Alpha), wherein the color value includes a first color channel value, a second color channel value and a third color channel value, the first color channel value may be a R (Red) value, the second color channel value may be a G (green) value, the third color channel value may be a B (Blue) value, and the pixel information ranges from 0 to 255, wherein 0 of transparency represents transparency and 255 of transparency represents full visibility.
The third obtaining unit 70 is configured to obtain a scaled image according to the first pixel array, where the width of the scaled image is equal to a preset width and the height is equal to a preset height.
The third determining unit 80 is configured to perform a determination of an image to be converted from the scaled image;
the second generating unit 90 is configured to perform conversion of the image to be converted into a character string, and generate a signature of the target image.
In the above embodiment, the first pixel array of the target image is acquired by the second acquiring unit, where the first pixel array includes pixel information of each pixel point; obtaining a scaled image by the third obtaining unit according to the first pixel array, wherein the width of the scaled image is equal to a preset width and the height of the scaled image is equal to a preset height; determining an image to be converted according to the scaled image by the third determining unit; the second generation unit converts the image to be converted into a character string and generates a signature of the target image. According to the scheme, the signature of the target image is determined according to the zoom image by acquiring the zoom image, so that the signatures of the same specification can be generated by images with different sizes.
According to a specific embodiment of the present application, the third obtaining unit includes a third calculating subunit and a second obtaining subunit, where the third calculating subunit is configured to perform calculation of a target color value of a center pixel point according to the pixel information of each of the pixel points in a predetermined area, the center pixel point being the pixel point located at a center of the predetermined area; the second acquisition subunit is configured to perform acquisition of the scaled image according to all of the target color values.
According to another specific embodiment of the present application, the third obtaining unit further includes a third determining subunit configured to determine the predetermined area of a preset area with each of the pixel points as a center before the step of calculating the target color value of the center pixel point based on the pixel information of each of the pixel points in the predetermined area. The device determines the preset area by taking each pixel point as the center, and the preset area of the preset area can be flexibly adjusted, so that the accuracy of acquiring the scaled image and the acquired scaled image can be adjusted by adjusting the size of the preset area for the same target image, the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image are flexibly adjusted, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted for the same picture in the prior art are better solved.
In order to obtain the target color value of the pixel more simply and more accurately, in a specific embodiment of the present application, the second calculating unit includes a fourth calculating subunit and a fifth calculating subunit, where the fourth calculating subunit is configured to perform calculation of an average color value of each pixel, where the average color value is an average value of the first color channel value, the second color channel value, and the third color channel value, that is, calculate a gray value of each pixel; the fifth calculating subunit is configured to calculate the target color value of the corresponding pixel according to the average color value of each pixel in the predetermined area. The device calculates the gray value of each pixel point in the preset area, and then calculates the target color value according to the gray value, so that the target color value of the pixel point is ensured to be obtained simply and accurately, and a better data basis is provided for the follow-up determination of the signature of the target image.
In another specific embodiment of the present application, the fourth calculating subunit includes a second calculating module and a sixth determining module, where the second calculating module is configured to calculate the average color value of all the pixel points in the predetermined area to obtain an updated average value; the sixth determining module is configured to perform the updating of the average value as the target color value of the corresponding center pixel point, i.e. the updating of the average value as the updated first color channel value, the updating of the second color channel value, and the updating of the third color channel value of the corresponding pixel point, respectively, the updating of the first color channel value, the updating of the second color channel value, and the updating of the third color channel value forming the target color value. Therefore, the noise of the image is ensured to be low, the detail level of the image is ensured to be low, and the image effect of the image under different proportions is ensured to be good.
In an actual application process, the third determining subunit of the apparatus is configured to determine the predetermined area corresponding to each pixel point with the pixel point as a center and a predetermined distance as a radius. Of course, the shape of the predetermined area is not limited to a circle, and may be rectangular or other irregular shape, and a person skilled in the art may flexibly adjust the predetermined distance to determine the predetermined area with different shapes.
According to another specific embodiment of the present application, the second obtaining subunit includes a first processing module, a sixth obtaining module, and a third scaling module, where the first processing module is configured to perform processing on all the target color values to obtain a second pixel array; the sixth acquisition module is configured to perform acquisition of a preset height and a preset width; the third scaling module is configured to perform scaling processing on the image corresponding to the second pixel array at least according to the preset width and the preset height, so as to obtain the scaled image. This ensures that images of different sizes can generate signatures of the same specification.
In a specific embodiment, the specific procedure of determining the signature step of the target image according to the image corresponding to the second pixel array is as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; the image corresponding to the second pixel array is endowed with the preset width and the preset height, so that the signature of the target image with the same specification can be obtained, the device keeps key information of the target image, and the target image can be directly stored in a database as the signature or converted into the character string to be stored in the database as the signature for use.
In the above embodiment, since the width and height are set for the image corresponding to the second pixel array forcedly, the image corresponding to the second pixel array is stretched or compressed to a certain extent, and there is a certain distortion, in order to further ensure that the obtained signature of the target image is more accurate, in another specific embodiment of the present application, the third scaling module includes a fifth acquiring sub-module, a second determining sub-module, and a second scaling sub-module, where the fifth acquiring sub-module is configured to perform acquiring the aspect ratio of the image corresponding to the second pixel array; the second determining submodule is configured to execute the height-width ratio of the image corresponding to the second pixel array and a preset size value, wherein the preset size value is the maximum value of the preset height and the preset width, and a scaling value is determined; the second scaling submodule is configured to perform scaling of one of a width and a height of an image corresponding to the second pixel array to the scaling value, scaling of the other of the width and the height of the image corresponding to the second pixel array to the predetermined size value, and obtaining the scaled image, wherein an aspect ratio of the image corresponding to the second pixel array is equal to an aspect ratio of the scaled image. The device does not need to stretch or deform the image corresponding to the second pixel array, so that the obtained signature of the target image can be ensured to be more accurate.
In the practical application process, the scaling is not limited to the above-mentioned scaling based on the maximum value of the preset height and the preset width, and the scaling may be performed based on the minimum value of the preset height and the preset width. Specifically, the predetermined size value is the minimum value of the preset height and the preset width, a scaling value is calculated according to the aspect ratio and the preset width of the image corresponding to the second pixel array, that is, the height corresponding to the scaled image is calculated, and then, the width of the image corresponding to the second pixel array is scaled to the preset width, and the height is scaled to the scaling value, so that equal-proportion scaling is realized.
In order to further ensure that the obtained signature of the target image has smaller distortion degree and is more accurate, in the practical application process, the third determining unit includes a third obtaining subunit configured to perform obtaining an initializing pixel array, where the initializing pixel array includes initializing pixel information, the initializing pixel information includes an initializing color value and an initializing transparency, and a length of the initializing pixel array is equal to a product of the preset height and the preset width; and the second processing subunit is configured to perform processing on the initialized pixel array and the scaled image to obtain the image to be converted.
In another embodiment of the present application, the second processing sub-module includes a seventh acquiring module, a second replacing module, and an eighth acquiring module, where the seventh acquiring module is configured to perform acquiring pixel information of each of the pixel points in the scaled image; the second replacing module is configured to replace the initialized pixel information by using the pixel information to obtain a replaced initialized pixel array, wherein the pixel point corresponding to the replaced initialized pixel information is the same as the pixel point corresponding to the replaced pixel information; the eighth obtaining module is configured to obtain the image to be converted by obtaining the image corresponding to the initialized pixel array after replacement. By means of replacement, a zoom image with preset width and preset height is obtained, and the fact that the distortion degree of the signature of the image is smaller is further guaranteed.
In a specific embodiment, the initialized color values include an initialized first color channel value, an initialized second color channel value, and an initialized third color channel value, where the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are equal. The specific values of the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency may be set according to practical situations.
In a more specific embodiment, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value, and the initialized transparency are all equal to 0.
In order to facilitate the subsequent use, in one embodiment of the present application, the apparatus further includes: and a second storage unit configured to perform storing of the signature of the target image in a database. Specifically, the signature of the target image can be directly stored in a database or converted into a webpage image to be stored in the database for later use.
In a specific embodiment, the specific process of determining the signature step of the target image according to the image corresponding to the second pixel array may further be as follows: the src attribute value of the IMG element in the HTML document is set as the character string (base 64), so that an image corresponding to the second pixel array is obtained in the webpage; acquiring the original width W and the original height H of the image by using an API algorithm of naturalWidth or naturalHeight to obtain the aspect ratio r of the image corresponding to the second pixel array; acquiring the preset width W1 and the preset height H1, wherein when the preset height is larger than the preset width, H1/r is the zoom size, namely the width of the zoomed image obtained after zooming, and the preset height is the height of the zoomed image obtained after zooming; scaling the image using the API algorithm of drawImage (IMG, 0, H1, H1/r); acquiring RGBA arrays ARR1 of all pixel points of the scaled image by using an API algorithm of GETIMAGEDATA, initializing an array with the length equal to W1X H1 to obtain the initialized pixel array, the initialized first color channel value, the initialized second color channel value, the initialized third color channel value and the initialized transparency in the initialized pixel array are all equal to 0, i.e., the default fill color value is black, such as initializing pixel array arr2= [ [0, 0], …, [0, 0] ]; replacing pixel information in the same position as ARR1 in ARR2 with a value in ARR1 to obtain the replacement image; converting the replacement Image into a base64 representation by using toDataURL ("Image/Png") algorithm, wherein the base64 is the character string; the character string can be used as a normalized image signature to be directly stored in a database or converted into a webpage image to be stored in the database for use. Therefore, stretching or deformation operation is not needed to be carried out on the image corresponding to the second pixel array, and the obtained signature of the target image can be further ensured to be accurate.
In the practical application process, the preset height and the preset width are generally set according to the requirement of the user on the specific size of the normalized signature, and for convenience of subsequent use, the preset height and the preset width are the same. Of course, the predetermined height and the predetermined width may be different.
According to another exemplary embodiment of the present application, there is also provided an electronic device including a processor and a memory configured to execute instructions executable by the processor, wherein the processor is configured to execute the instructions to implement any one of the above-described image signature generation methods.
The electronic device includes a processor and a memory configured to execute instructions executable by the processor, the processor configured to execute the instructions to implement any of the image signature generation methods described above. The electronic equipment can flexibly adjust the size of the preset area, and can adjust the speed of acquiring the second pixel array and the accuracy of acquiring the second pixel array by adjusting the size of the preset area aiming at the same target image, so that the flexible adjustment of the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image is ensured, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted aiming at the same picture in the prior art are better solved. Meanwhile, according to the scheme, the signature of the target image is determined according to the zoom image, so that the fact that the images with different sizes can generate the signature with the same specification is guaranteed, and the problem that the existing pictures with different specifications cannot generate the signature with the same specification is solved well.
According to still another exemplary embodiment of the present application, there is also provided a computer-readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform any one of the above-described image signature generation methods.
The storage medium may have instructions that, when executed by a processor of an electronic device, enable the electronic device to perform any one of the above-described methods of generating an image signature. The storage medium can flexibly adjust the size of the preset area, and can adjust the speed of acquiring the second pixel array and the accuracy of acquiring the second pixel array by adjusting the size of the preset area aiming at the same target image, so that the flexible adjustment of the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image is ensured, and the problems that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted aiming at the same picture in the prior art are better solved. Meanwhile, according to the scheme, the signature of the target image is determined according to the zoom image, so that the fact that the images with different sizes can generate the signature with the same specification is guaranteed, and the problem that the existing pictures with different specifications cannot generate the signature with the same specification is solved well.
In yet another exemplary embodiment of the present application, a computer program product is provided, comprising computer instructions which, when executed by a processor, implement any of the described generating methods.
The computer program product can flexibly adjust the size of the preset area when being executed by a processor, and can adjust the speed of acquiring the second pixel array and the accuracy of acquiring the second pixel array by adjusting the size of the preset area aiming at the same target image, thereby ensuring the flexible adjustment of the speed of acquiring the signature of the target image and the accuracy of acquiring the signature of the target image, and better solving the problem that the time required for acquiring the picture signature and the accuracy of the picture signature cannot be flexibly adjusted aiming at the same picture in the prior art. Meanwhile, according to the scheme, the signature of the target image is determined according to the zoom image, so that the fact that the images with different sizes can generate the signature with the same specification is guaranteed, and the problem that the existing pictures with different specifications cannot generate the signature with the same specification is solved well.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (49)

CN202110315365.3A2021-03-242021-03-24Image signature generation method and device, electronic equipment and storage mediumActiveCN113033394B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202110315365.3ACN113033394B (en)2021-03-242021-03-24Image signature generation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202110315365.3ACN113033394B (en)2021-03-242021-03-24Image signature generation method and device, electronic equipment and storage medium

Publications (2)

Publication NumberPublication Date
CN113033394A CN113033394A (en)2021-06-25
CN113033394Btrue CN113033394B (en)2024-05-14

Family

ID=76473419

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202110315365.3AActiveCN113033394B (en)2021-03-242021-03-24Image signature generation method and device, electronic equipment and storage medium

Country Status (1)

CountryLink
CN (1)CN113033394B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN114491112A (en)*2022-02-162022-05-13浙江网商银行股份有限公司 Information processing method and device

Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2002089105A2 (en)*2001-05-022002-11-07Bitstream, Inc.Methods, systems, and programming for producing and displaying subpixel-optimized images and digital content including such images
WO2010139007A1 (en)*2009-06-042010-12-09Peter BayleyApparatus and methods for storing image with embedded information
CN102292745A (en)*2009-01-232011-12-21日本电气株式会社image signature extraction device
CN102349092A (en)*2009-03-132012-02-08日本电气株式会社 Image signature extraction equipment
CN103116628A (en)*2013-01-312013-05-22新浪网技术(中国)有限公司Image file digital signature and judgment method and judgment device of repeated image file
CN103871044A (en)*2012-12-142014-06-18阿里巴巴集团控股有限公司Image signature generating method and image verifying method and device
CN109241470A (en)*2018-09-272019-01-18北京小米移动软件有限公司Page display method, apparatus and system
CN110675465A (en)*2019-09-232020-01-10京东数字科技控股有限公司Method and apparatus for generating image
CN111931756A (en)*2020-10-152020-11-13上海一嗨成山汽车租赁南京有限公司Method, computing device, and computer storage medium for generating electronic signatures
CN112070866A (en)*2019-06-112020-12-11腾讯科技(深圳)有限公司Animation data encoding method, animation data decoding method, animation data encoding apparatus, animation data decoding apparatus, storage medium, and computer device
CN112150394A (en)*2020-10-122020-12-29杭州睿琪软件有限公司Image processing method and device, electronic equipment and storage medium

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
WO2002089105A2 (en)*2001-05-022002-11-07Bitstream, Inc.Methods, systems, and programming for producing and displaying subpixel-optimized images and digital content including such images
CN102292745A (en)*2009-01-232011-12-21日本电气株式会社image signature extraction device
CN102349092A (en)*2009-03-132012-02-08日本电气株式会社 Image signature extraction equipment
WO2010139007A1 (en)*2009-06-042010-12-09Peter BayleyApparatus and methods for storing image with embedded information
CN103871044A (en)*2012-12-142014-06-18阿里巴巴集团控股有限公司Image signature generating method and image verifying method and device
CN103116628A (en)*2013-01-312013-05-22新浪网技术(中国)有限公司Image file digital signature and judgment method and judgment device of repeated image file
CN109241470A (en)*2018-09-272019-01-18北京小米移动软件有限公司Page display method, apparatus and system
CN112070866A (en)*2019-06-112020-12-11腾讯科技(深圳)有限公司Animation data encoding method, animation data decoding method, animation data encoding apparatus, animation data decoding apparatus, storage medium, and computer device
CN110675465A (en)*2019-09-232020-01-10京东数字科技控股有限公司Method and apparatus for generating image
CN112150394A (en)*2020-10-122020-12-29杭州睿琪软件有限公司Image processing method and device, electronic equipment and storage medium
CN111931756A (en)*2020-10-152020-11-13上海一嗨成山汽车租赁南京有限公司Method, computing device, and computer storage medium for generating electronic signatures

Also Published As

Publication numberPublication date
CN113033394A (en)2021-06-25

Similar Documents

PublicationPublication DateTitle
JP7564962B2 (en) IMAGE PROCESSING METHOD, IMAGE PROCESSING APPARATUS AND NON-TRANSITORY STORAGE MEDIUM
EP4207051A1 (en)Image super-resolution method and electronic device
CN109325532A (en)The image processing method of EDS extended data set under a kind of small sample
CN109635627A (en)Pictorial information extracting method, device, computer equipment and storage medium
US20210020139A1 (en)Picture obtaining method and apparatus and picture processing method and apparatus
CN105005980B (en)Image processing method and device
WO2014187223A1 (en)Method and apparatus for identifying facial features
CN110992243B (en)Intervertebral disc cross-section image construction method, device, computer equipment and storage medium
US20220358675A1 (en)Method for training model, method for processing video, device and storage medium
JP2015060012A (en) Image processing system, image processing apparatus, image processing method, image processing program, and display system
WO2019101005A1 (en)Pixel compensation method and apparatus, and terminal device
CN117372604B (en)3D face model generation method, device, equipment and readable storage medium
CN110443252A (en)A kind of character detecting method, device and equipment
CN110288521A (en)Image beautification method, device and electronic equipment
CN113516697A (en) Method, apparatus, electronic device, and computer-readable storage medium for image registration
CN113033394B (en)Image signature generation method and device, electronic equipment and storage medium
US11120269B2 (en)Method and apparatus for determining target rotation direction, computer readable medium and electronic device
CN114170068B (en) Method, device, electronic device and storage medium for generating image special effects
KR102550327B1 (en)Method and apparatus for upscaling video
CN113724141A (en)Image correction method and device and electronic equipment
WO2024055531A1 (en)Illuminometer value identification method, electronic device, and storage medium
US11954867B2 (en)Motion vector generation apparatus, projection image generation apparatus, motion vector generation method, and program
CN113420581A (en)Correction method and device for written document image, electronic equipment and readable medium
CN107392972B (en)A kind of image background weakening method, mobile terminal and computer readable storage medium
CN116684742B (en)Panoramic video conference system based on camera

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp