Method, apparatus, device and medium for manufacturing electrophysical homology electronic impression mold

By scanning or taking photos, obtaining seal images and converting them into ARGB data using RGB threshold sampling, and cropping and compressing electronic impressions, the problems of complex equipment and large storage space in the prior art are solved, and simplified physical and electrical homologous electronic impression production is achieved.

CN116030114BActive Publication Date: 2025-08-05CHONGQING AOXIONG INFORMATION TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211741704.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-31
Publication Date
2025-08-05
Estimated Expiration
2042-12-31

AI Technical Summary

Technical Problem

The production of electronic impressions in the prior art requires the production of special impression collection cards, which can achieve complex and large picture storage space, making it difficult to achieve electronic impression production with the same source of physical and electrical sources.

Method used

By scanning or taking pictures, the stamp image is obtained, the image data is converted into ARGB image data using RGB threshold sampling, the impression part is positioned and cropped, the electronic impression storage volume is compressed, and the PNG image file is generated.

Benefits of technology

It realizes the production of physical and electrical homologous electronic stamps without additional equipment, simplifies the processing process, reduces the storage space requirements, and is suitable for the application of electronic stamps.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116030114B_ABST
    Figure CN116030114B_ABST
Patent Text Reader

Abstract

The present application discloses a method for producing a physical-electronic homologous electronic seal. The method comprises the following steps: reading a seal image and decoding it into ARGB pixel data; setting the alpha component in the ARGB pixel value to a fixed value; setting an RGB color component threshold according to the seal color; traversing each pixel point, determining the RGB components of the pixel point respectively; setting the transparent component A of the pixel point whose RGB component is not within the threshold range to 0; obtaining an image with a transparent channel; locating the seal position according to the top, bottom, left, and right positions of the seal pattern in the seal image; cropping the seal; creating an indexed image data based on the image with the transparent channel; compressing the seal image; and encoding the image data obtained by marking the pixel points in the A channel at the corresponding positions of the index map into a PNG image file to obtain the electronic seal. This method greatly reduces the size of the seal image, which is beneficial for storage and network transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of electronic information technology and electronic seal technology, and specifically to a method for producing a physical-electronic homologous electronic stamp. Background Art

[0002] As paper documents became electronic, the evolution of physical seals into electronic ones was a natural and logical process. Currently, electronic seals are mostly produced by first printing the seal shape with a physical seal. The seal information is then uploaded to a computer by scanning or photographing it, and then processed using specialized software to create the electronic seal. This electronic simulation of the use of physical seals allows users to enjoy an experience consistent with traditional seal usage in e-government, e-commerce, and other activities. However, this approach has several drawbacks. First, it requires high standards for the images to be processed by the computer software. Second, whether it is a physical seal or an electronic seal, it can be difficult to verify whether it is the seal of the intended party during actual use, especially when duplicate names are encountered. Due to the unique characteristics of electronic documents, electronic seals are more susceptible to technical forgery.

[0003] Electronic impressions are used to make electronic seals and, combined with CA, are used to sign PDF and OFD documents, with equivalent legal effects.

[0004] The main methods currently used to create electronic seals include: 1. Generating a seal directly from the seal information, which is quite different from a physical seal and is not the same as the physical and electronic seals; 2. Using a physical seal, scanning it and then using Photoshop to cut out the image, which takes up a lot of storage space.

[0005] For example, publication number CN114782293A, entitled “A method, device and electronic device for producing a physical-electronic homologous electronic impression” discloses a method for producing a physical-electronic homologous electronic impression, wherein an image of an impression card is collected to obtain an impression card image, on which a seal image of a physical financial seal to be collected is stamped; the seal image is cut out from the impression card image to obtain a target electronic impression having the same size as the physical financial seal.

[0006] However, this method requires color space conversion when generating the seal, and needs to produce a special seal acquisition card, which is complex to implement. The seal surface data extracted from the converted rendered image lacks a lot of seal information, and the image storage space is large, so it is not suitable for making electronic seals. Summary of the Invention

[0007] The technical problem to be solved by this invention is that the existing technology for producing electronic impressions requires color space conversion, which is complex to implement and requires a dedicated impression acquisition card. This also requires a large amount of image storage space. This invention proposes a method for producing electronic impressions that is both physical and electronic. This method eliminates the need for a dedicated acquisition card. Instead of using a dedicated acquisition card, a blank piece of paper with a physical seal is stamped, and an image is generated by scanning or photographing it. This image is then directly processed to produce clear, compact impression image data. The impression processing program has simple logic and is easy to implement.

[0008] The technical solution of the present invention to solve the above technical problems is a method for making a physical-electrical homologous electronic impression, which collects seal image data on a carrier, converts the image data into ARGB (Alpha, Red, Green, Blue. Alpha-image channel) image data based on RGB threshold sampling, locates and crops the impression part to obtain an electronic impression, and compresses the storage volume of the electronic impression.

[0009] According to one aspect of the present application, a method for making a physical-electronic homologous electronic seal is proposed, comprising: reading a seal image and decoding it into ARGB pixel data; setting the alpha (transparency) component in the ARGB pixel value to a fixed value; setting an RGB color component threshold according to the seal color; traversing each pixel point; judging the RGB components of the pixel point respectively; setting the transparent component A of the pixel point whose RGB component (red, green, and blue channels) is not within the threshold range to 0; obtaining an image with a transparent channel; locating the seal position according to the upper, lower, left, and right positions of the seal pattern in the seal image and cropping the seal; creating an indexed image data according to the image with a transparent channel; compressing the seal image; encoding the image data obtained by marking the pixel points in the A channel at the corresponding positions of the index map into a PNG picture file; and obtaining an electronic seal.

[0010] Further preferably, the alpha component in the decoded ARGB pixel value is fixed to 255, each byte corresponds to a channel of ARGB, and each pixel point is traversed to determine the RGB components of the pixel point respectively; according to the seal color, the RGB component thresholds are pre-set to R1, G1 and B1 respectively.

[0011] Further preferably, for a red seal impression, the RGB component values are R greater than R1, G less than G1, and B less than B1, and the R component in the seal ARGB data is set to be greater than 200 and less than or equal to 255, and the B and G components are less than 50.

[0012] Further preferably, the print is distinguished according to the RGB value, the coordinates of the top, bottom, leftmost and rightmost pixels of the print part are taken, a rectangle is formed to obtain the print size, the image is cropped to obtain the print, an index table is constructed to store the specific ARGB data, and each pixel point uploads the corresponding index number in the index table.

[0013] Further preferably, locating the stamp position and cutting out the stamp includes: scanning from the four sides of the image to the middle row by row and column by column according to the width and height of the image, scanning the pixels from the top of the image row by row, and when the transparent component A of the pixel is all 0, discarding the row data until the row with not all A components is found, and locating it as the top of the stamp; scanning the pixels from the bottom of the image row by row, and when the transparent component A of the pixel is all 0, discarding the row data until the row with not all A components is found, and the row position is used as the bottom of the stamp; scanning the pixels from the left side of the image column by column to the right, and when the A component of the pixel is all 0, discarding the column data until the column with not all A components is found, and the column is used as the left side of the stamp; scanning the pixels from the right side of the image column by column to the left, and when the A component of the pixel is all 0, discarding the column data until the column with not all A components is found, and the column is used as the left side of the stamp.

[0014] Further preferably, compressing the image includes: traversing the print image data, obtaining the print pixels, setting the pixels whose A component in the print is 0 to 0 at the corresponding position in the new index map, setting the pixels whose A component is not 0 to 1 at the corresponding position in the new index map, encoding the data into a PNG image file, and obtaining the compressed print.

[0015] According to another aspect of the present application, a physical-electronic homologous electronic stamp production system is proposed, including: an image acquisition part, a channel setting part, a stamp cropping part, and an image compression part. The image acquisition part reads the seal image and decodes it into ARGB pixel data, and sets the alpha component in the ARGB pixel value to a fixed value; the channel setting part sets the RGB color component threshold according to the seal color, traverses each pixel point, judges the RGB components of the pixel point respectively, and sets the transparent component A of the pixel point whose RGB component is not within the threshold range to 0, thereby obtaining an image with a transparent channel; the stamp position is located according to the upper, lower, left, and right positions of the seal pattern in the seal image and the stamp is cropped out, and an indexed image data is created according to the image with a transparent channel; the image compression part compresses the seal image, and encodes the image data obtained by marking the pixel points in the A channel at the corresponding positions of the index map into a PNG picture file to obtain an electronic stamp.

[0016] Further preferably, locating the stamp position and cutting out the stamp includes: scanning from the four sides of the image to the middle row by row and column by column according to the width and height of the image, scanning the pixels from the top of the image row by row, and when the transparent component A of the pixel is all 0, discarding the row data until the row with not all A components is found, and locating it as the top of the stamp; scanning the pixels from the bottom of the image row by row, and when the transparent component A of the pixel is all 0, discarding the row data until the row with not all A components is found, and the row position is used as the bottom of the stamp; scanning the pixels from the left side of the image column by column to the right, and when the A component of the pixel is all 0, discarding the column data until the column with not all A components is found, and the column is used as the left side of the stamp; scanning the pixels from the right side of the image column by column to the left, and when the A component of the pixel is all 0, discarding the column data until the column with not all A components is found, and the column is used as the left side of the stamp.

[0017] According to another aspect of the present application, an electronic device is proposed, comprising: a processor; and a memory for storing a program, wherein the program comprises instructions, which, when executed by the processor, cause the processor to execute the above-described method for producing a physical-electrical homologous electronic impression.

[0018] According to another aspect of the present application, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable the computer to execute the method for making the physical-electrical homologous electronic impression described above.

[0019] This application uses the unique characteristics of the stamp and background colors to distinguish the stamp and background, making it simple to implement. The stamp data is extracted through the RGB channel component threshold, the PNG image volume is compressed by binary conversion, the stamp color is processed uniformly, and the image compression can greatly reduce the storage volume of the stamp image, thereby producing a smaller electronic seal, which is conducive to storage and network transmission, making the storage space of the signed file smaller and reducing storage costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 Shown is a schematic diagram of a method for making a physical-electrical homologous electronic stamp in an exemplary embodiment of the present application;

[0021] Figure 2 Shown is a schematic diagram of the positioning stamp position in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0022] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although certain embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be construed as limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present application. It should be understood that the drawings and embodiments of the present application are for illustrative purposes only and are not intended to limit the scope of protection of the present application.

[0023] It should be understood that the various steps described in the method embodiments of the present application can be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present application is not limited in this respect.

[0024] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the description below. It should be noted that the concepts of "first", "second", etc. mentioned in this application are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0025] It should be noted that the modifications of "one" and "multiple" mentioned in this application are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".

[0026] The names of the messages or information exchanged between multiple devices in the embodiments of the present application are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0027] The implementation of the present invention is further described in detail below with reference to the drawings and specific examples.

[0028] like Figure 1 The above is a flow chart of the electronic impression production method, which includes collecting seal image data on a carrier, preprocessing to obtain a seal image, converting the seal image data into ARGB image data based on RGB threshold sampling, locating and cropping the seal portion, obtaining an electronic impression, and compressing the electronic impression storage volume. Specifically:

[0029] Obtain the seal image and decode it into ARGB pixel data. Set the alpha component in the ARGB pixel data to a fixed value. Set the RGB color component threshold according to the seal color. Traverse each pixel in the ARGB pixel data and determine the RGB components of the pixel respectively. Set the transparent component A of the pixel whose RGB component is not within the threshold range to 0 to obtain an image with a transparent channel. Locate the stamp position according to the top, bottom, left, and right positions of the seal pattern in the seal image and crop out the stamp. Create an indexed image data based on the image with a transparent channel. Traverse the seal pattern pixels, mark the pixels in the A channel according to the corresponding positions of the index map, and encode the obtained image data into a PNG picture file to obtain an electronic stamp.

[0030] For example, the physical seal to be used for electronic stamping can be placed on a blank sheet of paper, and the stamp image on the sheet can be obtained by scanning or photographing. This image can then be preprocessed to produce a preprocessed image. This preprocessing involves cropping the image and removing any extraneous background to ensure that no other images besides the stamp are present. This preprocessing results in an image containing the stamp.

[0031] In this embodiment, the seal image is processed into ARGB image data with a transparent channel. The processing method includes:

[0032] Read the image and decode it into ARGB pixel data, parse it to obtain image attribute information, and call the corresponding image parsing library to load and decode the image into pixel data. For example, use libjpeg for jpg images and libpng for png images to load and decode them into ARGB pixel data.

[0033] Because the original image lacks a transparent channel, the alpha component of the decoded ARGB pixel values is fixed to 255. An alpha component of 255 indicates an opaque channel, while others are semi-transparent. Each byte corresponds to each channel in the ARGB data. A pixel occupies 4 bytes, or 1 byte represents 8 bits. The value range is 0-255, with 0 being fully transparent. Each pixel is iterated over, and its RGB components are determined. Thresholds are set based on the stamp color. For example, if a red stamp is required, the red component (R) of the stamped portion is set to a higher ratio, while the green component (G) and blue component (B) are set to lower ratios, ideally close to 0. The red, green, and blue component thresholds are pre-set to R1, G1, and B1, respectively. A possible color range is set based on the stamp color. For a red stamp, the red, green, and blue color components are set such that R is greater than R1, G is less than G1, and B is less than B1. Similarly, for a blue stamp, the red, green, and blue color components are set such that B is greater than B1, G is less than G1, and R is less than R1.

[0034] If the print is red, in the print ARGB data, set the R component to be greater than 200 and less than or equal to 255, and the B and G components to be less than 50 to confirm that the print color is red.

[0035] The transparent component (A component) of pixels outside the threshold range is set to 0, making them fully transparent, thus obtaining image data with a transparent channel. Within the threshold range, the A component can default to 255.

[0036] like Figure 2 The figure shows a schematic diagram of the positioning die in an exemplary embodiment of the present application. Generally, image data is composed of individual pixel tiles, each of which is divided into four ARGB channels, representing transparency, red, green, and blue. Adjusting the ratio of the three primary colors (red, green, and blue) yields 224 color configurations. The RGB values can be used to distinguish between a print and background. The coordinates of the top, bottom, left, and rightmost pixels of the print are then taken to form a rectangle. The local pixel data is used to determine the print size. The image is then cropped to obtain the print, and an index table is constructed to store the specific ARGB data. Each pixel then uploads its corresponding index number from the index table.

[0037] Process the image. Specifically, the image can be cropped so that the image size is consistent with the print size.

[0038] Locate the stamp and cut out the stamp. Locate the top edge of the stamp and scan pixels from the top of the pre-processed image downwards row by row. When the transparent component A of the pixel is all 0, discard the row data until a row with non-zero A components is found, indicating the stamp data has been found.

[0039] Locate the bottom part of the print, scan the image row by row and column by column from the four sides to the middle according to the width and height of the image, and scan the pixels from the bottom of the image row by row upwards. When the transparent component A of the pixel is all 0, discard the data of this row until a row with not all 0 A components is found. The position of this row is the bottom of the print.

[0040] Locate the left part of the print, scan the pixels column by column from the left side of the image to the right, and when the A component of the pixel is all 0, discard the data in that column until a column with not all A components is found. This column is used as the left side of the print.

[0041] Locate the right part of the print, scan the pixels column by column from the right side of the image to the left, and when the A component of the pixel is all 0, discard the data in that column until a column with not all A components is found.

[0042] By locating the top, bottom, left and right positions of the print, the image size is recalculated so that the remaining data is the print data.

[0043] Further, a compressed electronic impression image is generated based on the impression data, an indexed image data is created, which is a binary index map with a palette, and a blank map is created to prepare for subsequent data writing.

[0044] Compress the image. Generally, one pixel is 4 bytes, and one byte represents one pixel, directly compressing the image data size to 1 / 4 of the original size. The indexed image data is 8-bit image data, and one pixel only occupies 1 byte of storage space. Generally, pixels with transparent channels occupy 4 bytes. The image also sets the palette size to 2, sets the transparent color index to 0, and the print color index to 1. The image size is the size of the print after cropping.

[0045] Traverse the uncompressed print image data to obtain the print pixels. Pixels with an A component of 0 are set to 0 in the corresponding positions in the new index map. Pixels with a non-zero A component are set to 1 in the corresponding positions in the new index map. After processing, encode the data into a PNG image file to obtain the final result. This is the compressed print. Unifying the print color not only helps compress the image but also enhances the print.

[0046] The exemplary embodiments of the present application further provide an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor. The memory stores a computer program executable by the at least one processor, wherein the computer program, when executed by the at least one processor, causes the electronic device to perform a method according to an embodiment of the present application.

[0047] An exemplary embodiment of the present application further provides a non-transitory computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor of a computer, is used to cause the computer to perform a method according to an embodiment of the present application.

[0048] An exemplary embodiment of the present application further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor of a computer, it is used to cause the computer to perform the method according to the embodiment of the present application.

[0049] refer to Figure 2, a block diagram of an electronic device 300 that can serve as a server or client of the present application will now be described, which is an example of a hardware device that can be applied to various aspects of the present application. The electronic device is intended to represent various forms of digital electronic computer equipment, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0050] like Figure 2 As shown, electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. RAM 303 may also store various programs and data required for the operation of device 300. Computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to bus 304.

[0051] Multiple components within electronic device 300 are connected to I / O interface 305, including an input unit 306, an output unit 307, a storage unit 308, and a communication unit 309. Input unit 306 can be any type of device capable of inputting information into electronic device 300. Input unit 306 can receive input numeric or character information and generate key signal inputs related to user settings and / or function control of the electronic device. Output unit 307 can be any type of device capable of presenting information and may include, but is not limited to, a display, a speaker, a video / audio output terminal, a vibrator, and / or a printer. Storage unit 308 may include, but is not limited to, a magnetic disk or an optical disk. Communication unit 309 allows electronic device 300 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as a Bluetooth device, a WiFi device, a WiMax device, a cellular communication device, and / or the like.

[0052] The computing unit 301 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above. For example, in some embodiments, the reconstruction and decomposition of muscle movement trajectories based on the original trajectory of a signature stroke, as well as the decomposition of its logarithmic velocity curve, can be implemented as a computer software program tangibly embodied in a machine-readable medium, such as the storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 300 via the ROM 302 and / or the communication unit 309. In some embodiments, the computing unit 301 can be configured to perform the signature handwriting dynamic acquisition implementation method through any other suitable means (e.g., via firmware).

[0053] The program code for implementing the methods of the present application can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flow charts and / or block diagrams are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0054] In the context of this application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or apparatus. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fibers, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0055] As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, apparatus, and / or device (e.g., a magnetic disk, an optical disk, a memory, a programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as a machine-readable signal. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0056] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0057] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0058] Computer systems may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The client and server relationship arises through computer programs running on the respective computers and having a client-server relationship to each other.

[0059] The applicant of the present invention has made a detailed explanation and description of the implementation examples of the present invention in conjunction with the drawings in the specification. However, those skilled in the art should understand that the above implementation examples are only preferred implementation plans of the present invention, and the detailed description is only to help readers better understand the spirit of the present invention, and is not a limitation on the scope of protection of the present invention. On the contrary, any improvements or modifications based on the inventive spirit of the present invention should fall within the scope of protection of the present invention.

Claims

1. A method for making a physical-electrical homologous electronic impression, characterized in that: Read the seal image and decode it into ARGB pixel data. Set the alpha component in the ARGB pixel value to a fixed value. Set the RGB color component threshold according to the seal color. Iterate over each pixel and determine the RGB components of the pixel respectively. According to the seal color, pre-set the RGB component thresholds as R1, G1, and B1 respectively. The transparent component A of pixels whose RGB components are not within the threshold range is set to 0 to obtain an image with a transparent channel. The stamp position is located according to the top, bottom, left, and right positions of the stamp pattern in the stamp image and the stamp is cropped. An indexed image data is created based on the image with a transparent channel. The stamp image is compressed, and the image data obtained by marking the pixels in the A channel according to the corresponding positions of the index map is encoded into a PNG image file to obtain an electronic stamp. The method of reading the seal image and decoding it into ARGB pixel data and setting the alpha component in the ARGB pixel value to a fixed value is as follows: collecting the seal image data on the carrier, performing preprocessing to obtain the seal image, converting the seal image data into ARGB image data based on RGB threshold sampling; and fixing the alpha component in the decoded ARGB pixel value to 255; The method for compressing the seal image is to traverse the seal image data, obtain the seal pixel points, set the pixel points whose A component is 0 in the seal to 0 in the corresponding position of the new index map, set the pixel points whose A component is not 0 to 1 in the corresponding position of the new index map, encode the data into a PNG image file, and obtain the compressed seal.

2. The method according to claim 1, characterized in that Each byte corresponds to a channel of ARGB. We traverse each pixel and determine the RGB components of the pixel respectively.

3. The method according to claim 2, characterized in that For a red stamp, the RGB component values are R greater than R1, G less than G1, and B less than B1. The R component in the stamp ARGB data is set to be greater than 200 and less than or equal to 255, and the B and G components are less than 50.

4. The method according to any one of claims 1 to 3, characterized in that: Distinguish the print based on the RGB value, take the coordinates of the top, bottom, leftmost, and rightmost pixels of the print part, enclose them in a rectangle to get the print size, crop the image to get the print, build an index table to store the specific ARGB data, and upload the corresponding index number of each pixel in the index table.

5. The method according to claim 4, characterized in that Positioning the stamp position and cutting out the stamp includes: scanning from the four sides of the image to the middle row by row and column by column according to the width and height of the image, scanning the pixels from the top of the image row by row, and when the transparent component A of the pixel is all 0, discarding the data in this row until a row with not all A components is found, which is positioned as the top of the stamp; scanning the pixels from the bottom of the image row by row, and when the transparent component A of the pixel is all 0, discarding the data in this row until a row with not all A components is found, which is positioned as the bottom of the stamp; scanning the pixels from the left side of the image column by column to the right, and when the A component of the pixel is all 0, discarding the data in this column until a column with not all A components is found, which is used as the left side of the stamp; scanning the pixels from the right side of the image column by column to the left, and when the A component of the pixel is all 0, discarding the data in this column until a column with not all A components is found, which is used as the left side of the stamp.

6. The method according to claim 4, characterized in that Compressing the image includes: traversing the print image data, obtaining the print pixels, setting the pixels whose A component is 0 in the print to 0 in the corresponding position of the new index map, setting the pixels whose A component is not 0 to 1 in the corresponding position of the new index map, encoding the data into a PNG image file, and obtaining the compressed print.

7. A physical and electrical homologous electronic impression production system, characterized in that: include: Image acquisition part, channel setting part, stamp cropping part, image compression part. The image acquisition part reads the stamp image and decodes it into ARGB pixel data, and sets the alpha component in the ARGB pixel value to a fixed value. The channel setting part sets the RGB color component threshold according to the stamp color, traverses each pixel, judges the RGB components of the pixel respectively, and sets the transparent component A of the pixel whose RGB component is not within the threshold range to 0, thus obtaining an image with a transparent channel; The stamp position is located according to the top, bottom, left and right positions of the stamp pattern in the stamp image and the stamp is cut out. An indexed image data is created based on the image with a transparent channel. The image compression part compresses the stamp image and encodes the image data obtained by marking the pixel points in the A channel according to the corresponding positions of the index map into a PNG image file to obtain an electronic stamp. The method of reading the seal image and decoding it into ARGB pixel data and setting the alpha component in the ARGB pixel value to a fixed value is as follows: collecting the seal image data on the carrier, performing preprocessing to obtain the seal image, converting the seal image data into ARGB image data based on RGB threshold sampling; and fixing the alpha component in the decoded ARGB pixel value to 255; The method for compressing the seal image is to traverse the seal image data, obtain the seal pixel points, set the pixel points whose A component is 0 in the seal to 0 in the corresponding position of the new index map, set the pixel points whose A component is not 0 to 1 in the corresponding position of the new index map, encode the data into a PNG image file, and obtain the compressed seal.

8. The system according to claim 7, characterized in that Positioning the stamp position and cutting out the stamp includes: scanning from the four sides of the image to the middle row by row and column by column according to the width and height of the image, scanning the pixels from the top of the image row by row, and when the transparent component A of the pixel is all 0, discarding the data in this row until a row with not all A components is found, which is positioned as the top of the stamp; scanning the pixels from the bottom of the image row by row, and when the transparent component A of the pixel is all 0, discarding the data in this row until a row with not all A components is found, which is positioned as the bottom of the stamp; scanning the pixels from the left side of the image column by column to the right, and when the A component of the pixel is all 0, discarding the data in this column until a column with not all A components is found, which is used as the left side of the stamp; scanning the pixels from the right side of the image column by column to the left, and when the A component of the pixel is all 0, discarding the data in this column until a column with not all A components is found, which is used as the left side of the stamp.

9. An electronic device comprising: processor; And a memory for storing a program, characterized in that, wherein the program includes instructions, which, when executed by the processor, enable the processor to execute the method for making a physical-electrical homologous electronic impression according to any one of claims 1-6.

10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to enable the computer to execute the method for making a physical-electrical homologous electronic impression according to any one of claims 1-6.

Citation Information

Patent Citations

  • Manufacturing method and device of physical and electric homologous electronic impression and electronic equipment

    CN114782293A

  • Method for manufacturing electronic seal pattern model

    CN103021006A

  • Digital watermark embedding environment determination method, device and equipment and readable storage medium

    CN110992236A