A method and system for converting bit depth of signature image
Through the bit depth conversion method, the problem of incompatibility of the signature image being displayed in the template or mirror system is solved, and the color conversion of the grayscale signature image is realized to ensure that it can be displayed normally on report templates and other media.
Patent Information
- Application Number
- CN202410458831.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-17
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2044-04-17
AI Technical Summary
The signature images stored in the prior art cannot be displayed normally in some templates or mirror systems, resulting in display incompatibility issues.
By obtaining the signature image that needs to be displayed, determine whether bit depth conversion is required, calculate the actual bitmap capacity, lock the memory area of the target bit depth image, obtain and set image parameters, and convert the display size of the signature image into a byte array Is the target byte array copied to the signature image to implement bit depth conversion to adapt it to color display.
It solves the problem that the signature image cannot be displayed normally in the template or mirror system, and realizes the color conversion of the grayscale signature image to ensure that it can be displayed normally on report templates and other media.
Smart Images

Figure CN118096925B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and system for converting the bit depth of a signature image. Background Art
[0002] CA signature image refers to the handwritten signature stamp image printed by medical staff on prescriptions or certain reports issued to them. Therefore, the hospital will store the signature image information of medical staff in the database. Considering that the database pressure increases due to the large number of people and the large image memory, the CA signature will be grayed or even binarized when stored to compress the image size and reduce the database pressure.
[0003] However, grayscale or binary signature images cannot be displayed normally in some templates or mirror systems. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a method and system for bit depth conversion of a signature image, aiming to solve the problem in the prior art that the signature image stored cannot be displayed normally in certain templates or mirror systems.
[0005] The embodiment of the present invention is implemented as follows:
[0006] A method for converting the bit depth of a signature image, the method comprising:
[0007] Obtaining a signature image to be displayed, and determining whether the signature image needs to be converted to a bit depth;
[0008] When it is determined that the signature image needs to be converted into a bit depth, calculating the actual bitmap capacity of the signature image;
[0009] Apply for the variable of the target bit depth map to be converted, lock its memory area, obtain the image parameters of the target bit depth map and set the target bit depth map information,
[0010] Obtain the display size byte array of the signature image, convert the display size byte array of the signature image into a target byte array actually stored in the memory area, and copy the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image.
[0011] Furthermore, in the above-mentioned bit depth conversion method, the step of determining whether the signature image needs to be converted in bit depth comprises:
[0012] Obtaining a pixel format enumeration sequence of the signature image, and intercepting digital elements in the pixel format enumeration sequence;
[0013] Determining the bit depth of the signature image according to the digital element, and judging whether the bit depth is not less than a preset bit depth threshold;
[0014] When it is determined that the bit depth is not lower than the preset bit depth threshold, it is determined that the signature image needs to be converted into a bit depth.
[0015] Furthermore, in the above-mentioned bit depth conversion method, the steps of obtaining the image parameters of the target bit depth map and setting the target bit depth map information include:
[0016] Acquire a scan line width and a display width of the target bit depth map, and determine a gap between the display width and the scan line width according to the scan line width and the display width;
[0017] The memory start position of the target bit depth map and the size of the memory area are obtained.
[0018] Furthermore, the above bit depth conversion method further comprises:
[0019] Obtaining a pixel format enumeration sequence of the signature image, and determining a storage type to which the signature image belongs according to the pixel format enumeration sequence;
[0020] The storage database of the signature image is determined according to the storage type, and when the signature image needs to be stored, the signature image is stored in the corresponding storage database.
[0021] Furthermore, in the above-mentioned bit depth conversion method, after the step of obtaining the pixel format enumeration sequence of the signature image and determining the storage type to which the signature image belongs according to the pixel format enumeration sequence, the step further includes:
[0022] Obtaining a pixel format enumeration sequence of the signature image that each storage database needs to store, and extracting a unique feature part and a basic feature part from the pixel format enumeration sequence;
[0023] Extracting a target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion;
[0024] Performing a hash calculation on the basic feature portion to obtain a first hash value, and determining the number of added elements according to the length of the target specific feature portion;
[0025] The corresponding encryption element is randomly extracted from the first Hash value according to the number of the added elements, and the encryption element is randomly added to the target-specific feature part to obtain the security key of the database.
[0026] Furthermore, in the above-mentioned bit depth conversion method, after the step of extracting the target unique feature part from the unique feature parts in the plurality of pixel format enumeration sequences according to the length of the unique feature part, the step further includes:
[0027] Eliminating collisions of identical elements of the target-specific feature portion, and performing hash calculation on the target-specific feature portion after collision elimination to obtain a feature hash value;
[0028] The elements in the characteristic hash value that are identical to the collision elimination elements are removed, and the encryption element is randomly added to the characteristic hash value from which the identical elements are removed to obtain the security key of the database.
[0029] Furthermore, in the above-mentioned bit depth conversion method, after the step of copying the target byte array to the signature image to obtain the target signature image and performing bit depth conversion on the signature image, the step further includes:
[0030] When the signature image needs to be displayed, the target signature image is sent to the printed data source;
[0031] After receiving the data source, the data source containing the target seal image is assigned to the template to display the seal image.
[0032] Another object of the present invention is to provide a bit depth conversion system for a signature image, the system comprising:
[0033] A determination module, used for obtaining a signature image to be displayed, and determining whether the signature image needs to be converted in bit depth;
[0034] A calculation module, for calculating the actual bitmap capacity of the signature image when it is determined that the signature image needs to be converted into a bit depth;
[0035] The locking module is used to apply for the variable of the target bit depth map to be converted, lock its memory area, obtain the image parameters of the target bit depth map and set the target bit depth map information.
[0036] A conversion module is used to obtain the display size byte array of the signature image, convert the display size byte array of the signature image into a target byte array actually stored in the memory area, and copy the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image.
[0037] Another object of the present invention is to provide a readable storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of any one of the methods described above.
[0038] Another object of the present invention is to provide an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.
[0039] The present invention obtains a signature image that needs to be displayed and determines whether the signature image needs to be converted in bit depth; when it is determined that the signature image needs to be converted in bit depth, calculates the actual bitmap capacity of the signature image; applies for a variable of a target bit depth map that needs to be converted, locks its memory area, obtains image parameters of the target bit depth map and sets target bit depth map information, obtains a display size byte array of the signature image, converts the display size byte array of the signature image into a target byte array actually stored in the memory area, and copies the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image, and perform color conversion on the grayscaled signature image, so as to be compatible with media that need to be displayed, such as report templates, thereby solving the problem that the signature image stored in the prior art cannot be displayed normally in some templates or mirror systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] Figure 1 It is a flow chart of the method for converting the bit depth of a signature image in the first embodiment of the present invention;
[0041] Figure 2 4 is a structural block diagram of a bit depth conversion system for a signature image in a third embodiment of the present invention.
[0042] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION
[0043] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
[0044] It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0046] The following will describe in detail how to convert the bit depth of the signature image in combination with specific embodiments and drawings to convert the grayscale image into a color image.
[0047] First embodiment
[0048] See also Figure 1 , shown is a method for bit depth conversion of a signature image in a first embodiment of the present invention, the method comprising steps S10 to S13.
[0049] Step S10, obtaining a signature image to be displayed, and determining whether the signature image needs to be converted in bit depth.
[0050] Among them, the signature image refers to the CA signature draft image that medical staff prints on their own prescriptions or certain reports. The hospital will store the medical staff's signature image information in the database in advance. When in use, the corresponding signature image is extracted from the database and displayed on the prescription or certain reports to realize the signature. Considering that the database pressure is increased due to the large number of people and the large image memory, the signature image will be grayed out or even binarized when stored to achieve the effect of compressing the image size and reducing the database pressure.
[0051] However, grayscale or binary signature images cannot be displayed normally in some templates or mirror systems and must be converted into color (bit depth 24 or above) images to meet display requirements. Therefore, when displaying the signature image, determine in advance whether bit depth conversion is required.
[0052] In addition, in some optional embodiments of the present invention, the step of determining whether the signature image needs to be converted in bit depth includes:
[0053] Obtaining a pixel format enumeration sequence of the signature image, and intercepting digital elements in the pixel format enumeration sequence;
[0054] Determining the bit depth of the signature image according to the digital element, and judging whether the bit depth is not less than a preset bit depth threshold;
[0055] When it is determined that the bit depth is not lower than the preset bit depth threshold, it is determined that the signature image needs to be converted into a bit depth.
[0056] Among them, the pixel format enumeration sequence of the signature image can be used to intercept the digital elements in the pixel format enumeration sequence to obtain the bit depth of the image, and determine whether the bit depth conversion is required based on the size of the obtained bit depth.
[0057] Specifically, the pixel format enumeration sequence is the PixelFormat enumeration of the image. For example, Format16bppRgb555=135173 indicates that the specified format is 16 bits per pixel; 5 bits are used for each of the red, green, and blue components, and the remaining 1 bit is unused.
[0058] Format16bppRgb565 = 135174 means that the specified format is 16 bits per pixel; 5 bits are used for the red component, 6 bits for the green component, and 5 bits for the blue component.
[0059] Format16bppGrayScale indicates that the pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray.
[0060] Intercept the number between Format and bpp in PixelFormat, and use the number to determine the image bit depth. If it is greater than or equal to 24, no processing is done, and if it is less than 24, it is converted to 24 bits.
[0061] Step S11, when it is determined that the signature image needs to be converted into a bit depth, the actual bitmap capacity of the signature image is calculated.
[0062] When performing the bit depth conversion of the signature image, the actual bitmap capacity of the signature image is calculated. Specifically, the actual bitmap capacity is determined by obtaining the width and height of the signature image.
[0063] Step S12, applying for a variable of the target bit depth map to be converted, locking its memory area, obtaining image parameters of the target bit depth map and setting target bit depth map information.
[0064] Among them, the variables of the target bit depth map that needs to be converted are applied. For example, in the embodiment of the present invention, it is necessary to convert a picture with a depth lower than 24 bits into a picture with a depth of 24 bits. Specifically, the variables of the target bit map applied for are the width and height of the image and the specified PixelFormat is Format24bppRgb. Further, the image parameters that need to be determined when converting the bit depth are obtained and the target bit map information is set, wherein the image parameters include the width of the scan line, the gap between the display width and the scan line width, and the size of the memory area.
[0065] Step S13, obtaining the display size byte array of the signature image, converting the display size byte array of the signature image into a target byte array actually stored in the memory area, and copying the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image.
[0066] Among them, the original display size byte array is converted into a byte array actually stored in the memory, so as to complete the bit depth conversion by converting the byte array, and the target byte array is copied to the signature image to obtain the target signature image, so as to perform bit depth conversion on the signature image. Specifically, after obtaining the target byte array, the target byte array can be copied to the signature image of the BitmapData class through the Copy method of Marshal to obtain the converted target signature image.
[0067] In addition, in some optional embodiments of the present invention, when the signature image needs to be displayed, the target signature image is sent to the data source for printing;
[0068] After receiving the data source, the data source containing the target seal image is assigned to the template to display the seal image.
[0069] Specifically, after the bit depth conversion is performed, the data source containing the target signature image is assigned to the template, so that the target signature image is displayed.
[0070] In summary, the method for bit depth conversion of a seal image in the above embodiment of the present invention obtains a seal image to be displayed and determines whether the seal image needs to be converted in bit depth; when it is determined that the seal image needs to be converted in bit depth, the actual bitmap capacity of the seal image is calculated; a variable of the target bit depth map to be converted is applied for, and its memory area is locked, the image parameters of the target bit depth map are obtained and the target bit depth map information is set, the display size byte array of the seal image is obtained, and the display size byte array of the seal image is converted into the target byte array actually stored in the memory area, and the target byte array is copied to the seal image to obtain the target seal image, so as to perform bit depth conversion on the seal image and perform color conversion on the grayscale seal image, so as to be compatible with report templates and other media that need to be displayed, thereby solving the problem that the seal image stored in the prior art cannot be displayed normally in some templates or mirror systems.
[0071] Second embodiment
[0072] The bit depth conversion method of the signature image in this embodiment is different from the bit depth conversion method of the signature image in the first embodiment in that:
[0073] The method also includes.
[0074] Obtaining a pixel format enumeration sequence of the signature image, and determining a storage type to which the signature image belongs according to the pixel format enumeration sequence;
[0075] The storage database of the signature image is determined according to the storage type, and when the signature image needs to be stored, the signature image is stored in the corresponding storage database.
[0076] Among them, before storing the signature image, the signature image can be classified according to the pixel format enumeration sequence of the signature image. For example, the signature image contains images with 8-bit depth, 16-bit depth or 24-bit depth, and the bit depth of the signature image can be clearly determined according to the information contained in the pixel format enumeration sequence. Therefore, the storage type of the signature image can be determined according to the pixel format enumeration sequence, and different databases can be established according to different types of signature image bit depths. When storing, the signature image will be stored in the database of the corresponding bit depth.
[0077] In addition, in some optional embodiments of the present invention, after the step of obtaining the pixel format enumeration sequence of the signature image and determining the storage type to which the signature image belongs according to the pixel format enumeration sequence, the step further includes:
[0078] Obtaining a pixel format enumeration sequence of the signature image that each storage database needs to store, and extracting a unique feature part and a basic feature part from the pixel format enumeration sequence;
[0079] Extracting a target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion;
[0080] Performing a hash calculation on the basic feature portion to obtain a first hash value, and determining the number of added elements according to the length of the target specific feature portion;
[0081] According to the number of the added elements, the corresponding encryption elements are randomly extracted from the first hash value, and the encryption elements are randomly added to the target-specific feature part to obtain the security key of the database.
[0082] Among them, the format of the pixel format enumeration sequence is generally Format*bpp& format, wherein "Format" and "bpp" are necessary parts of each pixel format enumeration sequence, that is, basic feature parts, and "*" generally represents the bit depth of the picture, mainly composed of numbers, and "&" is the type and component of the color, mainly composed of numbers and letters. In the embodiment of the present invention, the "*" and "&" of the pixel format enumeration sequence are used as unique feature parts of the picture, that is, different pictures will have different parts.
[0083] When storing images, for the security of data storage, a security key is configured for the database. Since different databases are established, different security keys are set for different databases. Specifically, an encryption algorithm is performed on the basic feature part, such as a hash calculation to obtain a first hash value. Since the length of the unique feature part in the pixel format enumeration sequence of images with the same bit depth may be different, the longest target pixel format enumeration sequence of the unique feature part is found from the pixel format enumeration sequence of the same storage type, and the target unique feature part is determined. The number of added elements of the security key is determined according to the length of the target feature part, and the corresponding encryption element is randomly extracted from the first hash value according to the number of added elements and randomly added to the unique feature part to obtain the security key of the database.
[0084] Specifically, the length of the unique feature part refers to the number of elements in the unique feature part. When the embodiment of the present invention is implemented, the number of added elements can be set to the same as the number of elements in the unique feature part, and a mapping table between the number of added elements and the number of elements in the unique feature part is obtained. When the number of elements in the unique feature part is small, the number of added elements is increased to ensure the length of the security key.
[0085] In addition, in some optional embodiments of the present invention, after the step of extracting the target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion, the step further includes:
[0086] Eliminating collisions of identical elements of the target-specific feature portion, and performing hash calculation on the target-specific feature portion after collision elimination to obtain a feature hash value;
[0087] The elements in the characteristic hash value that are identical to the collision elimination elements are removed, and the encryption element is randomly added to the characteristic hash value from which the identical elements are removed to obtain the security key of the database.
[0088] Specifically, in order to further improve the security of the security key, after obtaining the target-specific feature part, the same elements therein are collided and eliminated, that is, the same elements in the target-specific feature part are eliminated to avoid too many intersections between the encrypted elements and the target-specific feature part itself, and the target-specific feature part after collision elimination is hashed to obtain a feature hash value, and the elements in the feature hash value that are the same as the collision-eliminated elements are removed to improve the security of the target-specific feature part itself, and then the encrypted elements are added to the feature hash value after removing the same elements to obtain the security key of the database to improve the security of the database.
[0089] In summary, the method for bit depth conversion of a seal image in the above embodiment of the present invention obtains a seal image to be displayed and determines whether the seal image needs to be converted in bit depth; when it is determined that the seal image needs to be converted in bit depth, the actual bitmap capacity of the seal image is calculated; a variable of the target bit depth map to be converted is applied for, and its memory area is locked, the image parameters of the target bit depth map are obtained and the target bit depth map information is set, the display size byte array of the seal image is obtained, and the display size byte array of the seal image is converted into the target byte array actually stored in the memory area, and the target byte array is copied to the seal image to obtain the target seal image, so as to perform bit depth conversion on the seal image and perform color conversion on the grayscale seal image, so as to be compatible with report templates and other media that need to be displayed, thereby solving the problem that the seal image stored in the prior art cannot be displayed normally in some templates or mirror systems.
[0090] Third embodiment
[0091] See also Figure 2 , shown is a bit depth conversion system for a signature image proposed in a third embodiment of the present invention, the system comprising:
[0092] The judging module 100 is used to obtain a signature image to be displayed and to judge whether the signature image needs to be converted in bit depth;
[0093] A calculation module 200, for calculating the actual bitmap capacity of the signature image when it is determined that the signature image needs to be converted into a bit depth;
[0094] The locking module 300 is used to apply for the variable of the target bit depth map to be converted, lock its memory area, obtain the image parameters of the target bit depth map and set the target bit depth map information.
[0095] The conversion module 400 is used to obtain the display size byte array of the signature image, convert the display size byte array of the signature image into a target byte array actually stored in the memory area, and copy the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image.
[0096] Furthermore, in some optional embodiments of the present invention, the judgment module is specifically used for:
[0097] Obtaining a pixel format enumeration sequence of the signature image, and intercepting digital elements in the pixel format enumeration sequence;
[0098] Determining the bit depth of the signature image according to the digital element, and judging whether the bit depth is not less than a preset bit depth threshold;
[0099] When it is determined that the bit depth is not lower than the preset bit depth threshold, it is determined that the signature image needs to be converted into a bit depth.
[0100] Furthermore, in some optional embodiments of the present invention, the locking module is specifically used for:
[0101] Acquire a scan line width and a display width of the target bit depth map, and determine a gap between the display width and the scan line width according to the scan line width and the display width;
[0102] The memory start position of the target bit depth map and the size of the memory area are obtained.
[0103] Furthermore, in some optional embodiments of the present invention, the system further includes:
[0104] A determination module, used for obtaining a pixel format enumeration sequence of the signature image, and determining a storage type to which the signature image belongs according to the pixel format enumeration sequence;
[0105] A storage module is used to determine the storage database of the signature image according to the storage type, and store the signature image into the corresponding storage database when the signature image needs to be stored.
[0106] Furthermore, in some optional embodiments of the present invention, the system further includes:
[0107] A first encryption module, used for obtaining a pixel format enumeration sequence of the signature image to be stored in each storage database, and extracting a unique feature part and a basic feature part from the pixel format enumeration sequence;
[0108] Extracting a target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion;
[0109] Performing a hash calculation on the basic feature portion to obtain a first hash value, and determining the number of added elements according to the length of the target specific feature portion;
[0110] The corresponding encryption element is randomly extracted from the first Hash value according to the number of the added elements, and the encryption element is randomly added to the target-specific feature part to obtain the security key of the database.
[0111] Furthermore, in some optional embodiments of the present invention, the system further includes:
[0112] A second encryption module is used to perform collision elimination on identical elements of the target specific feature part, and perform hash calculation on the target specific feature part after collision elimination to obtain a feature hash value;
[0113] The elements in the characteristic hash value that are identical to the collision elimination elements are removed, and the encryption element is randomly added to the characteristic hash value from which the identical elements are removed to obtain the security key of the database.
[0114] Furthermore, in some optional embodiments of the present invention, the system further includes:
[0115] A display module, used for sending the target signature image to the printed data source when the signature image needs to be displayed;
[0116] After receiving the data source, the data source containing the target seal image is assigned to the template to display the seal image.
[0117] The functions or operation steps implemented when the above modules are executed are substantially the same as those in the above method embodiments, and will not be repeated here.
[0118] Fourth embodiment
[0119] Another aspect of the present invention further provides a readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the steps of the method described in any one of the first to second embodiments above are implemented.
[0120] Fifth embodiment
[0121] Another aspect of the present invention provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method described in any one of the first to second embodiments when executing the program.
[0122] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0123] Those skilled in the art will appreciate that the logic and / or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be specifically implemented in any computer-readable storage medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable storage medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0124] More specific examples (a non-exhaustive list) of computer-readable storage media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable storage medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
[0125] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0126] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0127] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
Claims
1. A method for converting the bit depth of a signature image, characterized in that: The method comprises: Obtaining a signature image to be displayed, and determining whether the signature image needs to be converted to a bit depth; When it is determined that the signature image needs to be converted into a bit depth, calculating the actual bitmap capacity of the signature image; Apply for the variable of the target bit depth map to be converted, lock its memory area, obtain the image parameters of the target bit depth map and set the target bit depth map information, Obtaining a display size byte array of the signature image, converting the display size byte array of the signature image into a target byte array actually stored in the memory area, and copying the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image; The method further comprises: Obtaining a pixel format enumeration sequence of the signature image, and determining a storage type to which the signature image belongs according to the pixel format enumeration sequence; Determine the storage database of the signature image according to the storage type, and store the signature image into the corresponding storage database when the signature image needs to be stored; After the step of obtaining the pixel format enumeration sequence of the signature image and determining the storage type to which the signature image belongs according to the pixel format enumeration sequence, the method further comprises: Obtaining a pixel format enumeration sequence of the signature image that each storage database needs to store, and extracting a unique feature part and a basic feature part from the pixel format enumeration sequence; Extracting a target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion; Performing a hash calculation on the basic feature portion to obtain a first hash value, and determining the number of added elements according to the length of the target specific feature portion; randomly extracting corresponding encryption elements from the first hash value according to the number of the added elements, and randomly adding the encryption elements to the target-specific feature portion to obtain a security key for the database; After the step of extracting a target unique feature portion from the unique feature portions in the plurality of pixel format enumeration sequences according to the length of the unique feature portion, the method further comprises: Eliminating collisions of identical elements of the target-specific feature portion, and performing hash calculation on the target-specific feature portion after collision elimination to obtain a feature hash value; The elements in the characteristic hash value that are identical to the collision elimination elements are removed, and the encryption element is randomly added to the characteristic hash value from which the identical elements are removed to obtain the security key of the database.
2. The method for bit depth conversion of a signature image according to claim 1, characterized in that: The step of determining whether the signature image needs to be converted to a bit depth comprises: Obtaining a pixel format enumeration sequence of the signature image, and intercepting digital elements in the pixel format enumeration sequence; Determining the bit depth of the signature image according to the digital element, and judging whether the bit depth is not less than a preset bit depth threshold; When it is determined that the bit depth is not lower than the preset bit depth threshold, it is determined that the signature image needs to be converted into a bit depth.
3. The method for bit depth conversion of a signature image according to claim 1, characterized in that: The steps of obtaining the image parameters of the target bit depth map and setting the target bit depth map information include: Acquire a scan line width and a display width of the target bit depth map, and determine a gap between the display width and the scan line width according to the scan line width and the display width; The memory start position of the target bit depth map and the size of the memory area are obtained.
4. The method for converting the bit depth of a signature image according to any one of claims 1 to 3, characterized in that: After the step of copying the target byte array to the signature image to obtain the target signature image and performing bit depth conversion on the signature image, the step further includes: When the signature image needs to be displayed, the target signature image is sent to the printed data source; After receiving the data source, the data source including the target seal image is assigned to the template to display the seal image.
5. A bit depth conversion system for a signature image, characterized in that: A method for implementing the bit depth conversion of a signature image according to any one of claims 1 to 4, the system comprising: A determination module, used for obtaining a signature image to be displayed, and determining whether the signature image needs to be converted in bit depth; A calculation module, for calculating the actual bitmap capacity of the signature image when it is determined that the signature image needs to be converted into a bit depth; The locking module is used to apply for the variable of the target bit depth map to be converted, lock its memory area, obtain the image parameters of the target bit depth map and set the target bit depth map information. A conversion module is used to obtain the display size byte array of the signature image, convert the display size byte array of the signature image into a target byte array actually stored in the memory area, and copy the target byte array to the signature image to obtain a target signature image, so as to perform bit depth conversion on the signature image.
6. A readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
7. An electronic device, characterized in that: The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods of claims 1 to 4 when executing the program.
Citation Information
Patent Citations
Image-text annotation method for DICOM image film printing
CN102103653A
Database-based data field enumeration unified access method and system, terminal equipment and storage medium
CN114443653A
Feature data conversion method and device, electronic equipment and readable storage medium
CN117874118A
Scheme of applying the modified polynomial-based hash function in the digital signature algorithm based on the division algorithm
US20100318804A1
Method of Depth Coding Compatible with Arbitrary Bit-Depth
US20150358643A1
