Image processing method and system based on digital watermark

The image processing method addresses vulnerabilities in existing watermarking technologies by splitting images into color gamut maps and using CRC-32 and LSB algorithms to ensure data integrity and security, preventing tampering while maintaining image quality.

CN119205476AActive Publication Date: 2024-12-27CHONGQING SELIS PHOENIX INTELLIGENT INNOVATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411279522.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2024-12-27
Estimated Expiration
2044-09-12

AI Technical Summary

Technical Problem

Existing image digital watermarking technologies in the vehicle field are vulnerable to attacks, have high computational complexity, and may cause image distortion, making them unsuitable for robust data protection and integrity verification.

Method used

An image processing method using digital watermarking that splits images into color gamut maps, embeds watermark data in preset positions, and verifies consistency using CRC-32 and LSB algorithms to ensure data integrity and security while maintaining visual quality.

Benefits of technology

The method effectively prevents data tampering and damage, ensures data protection, and maintains image quality by embedding CRC-32 check codes in the least significant bits, reducing resource requirements and improving verification efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119205476A_ABST
    Figure CN119205476A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of digital watermarking, and discloses an image processing method and system based on digital watermarking, and the method is applied to a vehicle terminal, and comprises the steps: generating first verification data according to raw watermark data, generating first watermark data according to the raw watermark data and the first verification data, splitting a to-be-processed image into a plurality of first color gamut graphs, and obtaining the first color gamut graphs; and replacing the first watermark data to a preset data position in any first color gamut image according to the color gamut channel, performing channel combination on the first color gamut images to obtain a target watermark image, and sending at least one part of the first watermark data and the target watermark image to a server side, the server side is used for extracting second watermark data from the target watermark image and verifying the watermark data according to a comparison result between at least one part of the first watermark data and the second watermark data; according to the method, the watermark data is embedded into the image, the visual quality of the image is kept, hidden data protection is achieved, and the risk of data tampering and damage is effectively prevented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of digital watermarking, and in particular to an image processing method and system based on digital watermarking. Background Art

[0002] Image digital watermarking technology has been widely used in copyright protection, information security and anti-counterfeiting, advertising marketing and tracking, content verification and integrity protection and other fields. In terms of copyright protection, digital watermarking technology effectively prevents illegal copying and piracy of digital works by embedding copyright information; in the field of information security and anti-counterfeiting, digital watermarking technology is used to protect the authenticity and integrity of important information or products and prevent information from being tampered with or forged; at the same time, this technology is also used in advertising marketing and tracking to help advertisers accurately evaluate advertising effects; in terms of content verification and integrity protection, digital watermarking technology ensures the authenticity and integrity of digital media content.

[0003] In the vehicle field, the collected images are usually sent directly to the image receiver. Some related technologies mainly use the least significant bit algorithm (LSB), transform domain method and zero watermark technology to digitally watermark the images. It has the following disadvantages: 1. LSB is not robust and is vulnerable to attacks. The receiver cannot tell whether the image has been tampered with or the data has been lost; 2. The transform domain method has high computational complexity, high requirements for processing equipment, and may also cause image distortion; 3. The implementation complexity of zero watermark technology is high, and in some cases it may be difficult to find sufficiently stable features in the original image to construct a watermark. Obviously, there is an urgent need for a new image processing method based on digital watermarking to solve at least one of the above problems.

[0004] It should be noted that the above content only provides background technical information related to the present application and does not necessarily constitute prior art. Summary of the invention

[0005] In view of the above-mentioned shortcomings of the prior art, the present application provides an image processing method and system based on digital watermarking, so as to achieve data protection and effectively prevent the risk of data tampering and damage on the basis of ensuring the visual quality of the image.

[0006] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.

[0007] According to one aspect of an embodiment of the present application, a digital watermark-based image processing method is provided, which is applied to a vehicle terminal, and the method includes: obtaining original watermark data and an image to be processed; generating first verification data according to the original watermark data, and generating first watermark data according to the original watermark data and the first verification data; splitting the image to be processed into multiple first color gamut maps according to color gamut channels, replacing the first watermark data to a preset data position in any first color gamut map, and merging the channels of each first color gamut map to obtain a target watermark map; sending at least a part of the first watermark data and the target watermark map to a server side, wherein the server side is used to extract second watermark data from the target watermark map, and verify the consistency of the watermark data based on a comparison result between at least a part of the first watermark data and the second watermark data.

[0008] In one embodiment of the present application, based on the aforementioned scheme, before obtaining the original watermark data, the method also includes: obtaining the timestamp of acquiring the image to be processed, the vehicle information and user information corresponding to the vehicle terminal; and determining the original watermark data based on at least one of the timestamp, the vehicle information and the user information.

[0009] In one embodiment of the present application, based on the aforementioned scheme, after generating the first watermark data according to the original watermark data and the first verification data, the method further includes: obtaining a first total pixel of the image to be processed, and calculating a first data length required for the first total pixel to be occupied; comparing the first data length with a second data length corresponding to the first watermark data; if the first data length is greater than or equal to the second data length, splitting the image to be processed into multiple first color gamut images according to the color gamut channel; if the first data length is less than the second data length, ending the image processing of the image to be processed.

[0010] In one embodiment of the present application, based on the aforementioned scheme, the image to be processed is split into multiple first color gamut maps according to the color gamut channel, and the first watermark data is replaced to a preset data position in any first color gamut map, including: obtaining the first image dimension number of the image to be processed; if the image to be processed is determined to be a grayscale image according to the first image dimension number, the first watermark data is replaced to a preset data position in any first color gamut map; if the image to be processed is determined not to be a grayscale image according to the first image dimension number, the image to be processed is split into multiple first color gamut maps according to the color gamut channel, a remainder is calculated according to the length of the original watermark data and a preset number, a target first color gamut map is determined according to the correspondence between the remainder and the first color gamut map, and the first watermark data is replaced to a preset data position in the target first color gamut map.

[0011] In one embodiment of the present application, based on the aforementioned scheme, the method also includes: extracting a first area image from the image to be processed according to a preset extraction rule, performing image recognition on the first area image, and obtaining first image information; sending the first image information to the server side, wherein the server side is used to extract a second area image from the target watermark image according to the preset extraction rule, performing image recognition on the second area image, and obtaining second image information, comparing the first image information with the second image information, and verifying the consistency of the image to be processed and the target watermark image according to the comparison result.

[0012] According to one aspect of an embodiment of the present application, a digital watermark-based image processing method is provided, which is applied to a server side, and the method includes: receiving at least a part of the first watermark data and a target watermark map sent by a vehicle-mounted terminal, wherein the vehicle terminal is used to obtain original watermark data and an image to be processed, generating first verification data according to the original watermark data, and generating the first watermark data according to the original watermark data and the first verification data, splitting the image to be processed into multiple first color gamut maps according to color gamut channels, replacing the first watermark data to a preset data position in any first color gamut map, and merging the channels of each of the first color gamut maps to obtain the target watermark map, sending at least a part of the first watermark data and the target watermark map to the server side; extracting second watermark data from the target watermark map, and verifying the consistency of the watermark data based on a comparison result between at least a part of the first watermark data and the second watermark data.

[0013] In one embodiment of the present application, based on the aforementioned scheme, second watermark data is extracted from the target watermark image, including: obtaining the second image dimension of the target watermark image; if the target watermark image is determined to be a grayscale image according to the second image dimension, the second watermark data is extracted from the target watermark image; if the target watermark image is determined not to be a grayscale image according to the second image dimension, the target watermark image is split into multiple second color gamut images according to the color gamut channel, and the second watermark data is extracted in a preset data position of the target second color gamut image, wherein the target second color gamut image is determined based on the correspondence between the length of the original watermark data and the remainder of a preset number and the second color gamut image.

[0014] In one embodiment of the present application, based on the aforementioned scheme, after extracting the second watermark data from the target watermark image, the method also includes: calculating the first watermark length of the first watermark data according to the length of the original watermark data and the length of the first verification data; comparing the first watermark length with the second watermark length of the second watermark data, if the second watermark length is less than the first watermark length, generating an inspection abnormality prompt message to prompt the user; if the second watermark length is greater than or equal to the first watermark length, verifying the consistency of the watermark data based on the comparison result between at least a part of the first watermark data and the second watermark data.

[0015] In one embodiment of the present application, based on the aforementioned scheme, the consistency of the watermark data is verified according to the comparison result between at least a part of the first watermark data and the second watermark data, including: comparing at least a part of the first watermark data with the second watermark data to obtain a comparison result; if the comparison result is that at least a part of the first watermark data and the corresponding part of the second watermark data are the same, then the watermark data are determined to be consistent; if the comparison result is that at least a part of the first watermark data and the corresponding part of the second watermark data are not the same, then the watermark data are determined to be inconsistent.

[0016] According to one aspect of an embodiment of the present application, there is provided an image processing system based on a digital watermark, comprising: a vehicle terminal, for acquiring original watermark data and an image to be processed, generating first verification data according to the original watermark data, and generating first watermark data according to the original watermark data and the first verification data, splitting the image to be processed into multiple first color gamut maps according to color gamut channels, replacing the first watermark data to a preset data position in any first color gamut map, merging the channels of each of the first color gamut maps to obtain a target watermark map, and sending at least a part of the first watermark data and the target watermark map to a server side; a server side, for extracting second watermark data from the target watermark map, and verifying the consistency of the watermark data according to a comparison result between at least a part of the first watermark data and the second watermark data.

[0017] Beneficial effects of the present application: The present application obtains the original watermark data and the image to be processed, generates the first verification data according to the original watermark data, and generates the first watermark data according to the original watermark data and the first verification data, splits the image to be processed into multiple first color gamut images according to the color gamut channel, replaces the first watermark data to the preset data position in any first color gamut image, and merges the channels of each first color gamut image to obtain the target watermark image, and sends at least a part of the first watermark data and the target watermark image to the server side, wherein the server side is used to extract the second watermark data from the target watermark image, and verify the consistency of the watermark data according to the comparison result between at least a part of the first watermark data and the second watermark data. The visual quality of the image is maintained, hidden data protection is achieved, and the verifiability of the image during transmission or storage is ensured, while minimizing the interference with the original data and effectively preventing the risk of data tampering and damage.

[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work. In the drawings:

[0020] Figure 1 is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application;

[0021] Figure 2 is a flowchart of an image processing method based on digital watermarking shown in an exemplary embodiment of the present application;

[0022] Figure 3 is a schematic diagram of a digital watermark embedding process of an image processing method based on a digital watermark, shown in an exemplary embodiment of the present application;

[0023] Figure 4 is a schematic diagram of a digital watermark extraction and verification process of an image processing method based on a digital watermark, shown in an exemplary embodiment of the present application;

[0024] Figure 5 is a block diagram of an image processing system based on digital watermarking shown in an exemplary embodiment of the present application;

[0025] Figure 6A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION

[0026] The following will describe the implementation methods of the present application with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present application from the contents disclosed in this specification. The present application can also be implemented or applied through other different specific implementation methods, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present application. It should be understood that the preferred embodiments are only for illustrating the present application, not for limiting the scope of protection of the present application.

[0027] It should be noted that the illustrations provided in the following embodiments are only used to illustrate the basic concept of the present application in a schematic manner, and therefore the illustrations only show components related to the present application rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0028] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present application. However, it is obvious to those skilled in the art that the embodiments of the present application can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present application difficult to understand.

[0029] First of all, it should be noted that the least significant bit algorithm (LSB) is an algorithm commonly used in image steganography. It hides information by embedding the secret information into the least significant bit (also called the least significant bit) of the pixel value of the carrier image. Since the least significant bit has the least impact on the overall quality of the image, changing the data at this position usually does not cause a significant decrease in image quality, thereby achieving information invisibility.

[0030] CRC-32 (Cyclic Redundancy Check 32-bit) algorithm is a widely used cyclic redundancy check (CRC) algorithm. The algorithm generates a 32-bit check code to detect whether errors occur during data transmission or storage, thereby ensuring the integrity and reliability of the data. The CRC-32 algorithm is based on treating the data as a large binary number, which is divided by another predefined "generator polynomial" and then returning the remainder as the CRC value. This process is similar to long division, but is performed in the binary world, using an XOR operation instead of subtraction. The generator polynomial is usually represented as a 32-bit binary number in the context of CRC-32, representing the coefficients of a polynomial.

[0031] Figure 1 It is a schematic diagram of an exemplary system architecture shown in an exemplary embodiment of the present application.

[0032] Reference Figure 1 As shown, the system architecture may include a data acquisition device 101 and a computer device 102. The computer device 102 may be at least one of a desktop graphics processing unit (GPU) computer, a GPU computing cluster, a neural network computer, etc. The data acquisition device 101 is used to acquire the original watermark data and the image to be processed. In this embodiment, the data acquisition device 101 obtains the above data and provides it to the computer device 102 for processing. Relevant technicians can use the computer device 102 to generate first verification data according to the original watermark data, and generate first watermark data according to the original watermark data and the first verification data, split the image to be processed into multiple first color gamut images according to the color gamut channel, replace the first watermark data to the preset data position in any first color gamut image, and merge the channels of each first color gamut image to obtain a target watermark image, and send at least a part of the first watermark data and the target watermark image to the server end, wherein the server end is used to extract the second watermark data from the target watermark image, and verify the consistency of the watermark data according to the comparison result between at least a part of the first watermark data and the second watermark data. It should be noted that the data acquisition device 101 and the computer device 102 provided in this embodiment are merely examples and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0033] It should be noted that the digital watermark-based image processing method provided in the embodiment of the present application is generally executed by the computer device 102 , and accordingly, the digital watermark-based image processing system is generally disposed in the computer device 102 .

[0034] Figure 2is a flowchart of an image processing method based on digital watermarks according to an exemplary embodiment of the present invention. The image processing method based on digital watermarks can be executed by a computing and processing device, which can be Figure 1 The computer device 102 shown in FIG. Figure 2 As shown, the image processing method based on digital watermark is applied to a vehicle terminal, and at least includes steps S210 to S240, which are described in detail as follows:

[0035] In step S210, original watermark data and the image to be processed are obtained.

[0036] In one embodiment of the present application, before obtaining the original watermark data, the timestamp of capturing the image to be processed, the vehicle information and user information corresponding to the vehicle terminal are obtained; and the original watermark data is determined based on at least one of the timestamp, the vehicle information and the user information.

[0037] In this embodiment, the vehicle information includes but is not limited to at least one of the basic information of the vehicle, the ownership and registration information of the vehicle, the basic information includes but is not limited to one or more of the vehicle identification code (VIN code), license plate number, vehicle type, brand and model, and production date, the ownership and registration information includes but is not limited to one or more of the owner information, registration date, vehicle status, and driving license information, preferably, the vehicle information includes the vehicle identification code; the user information includes but is not limited to one or more of the user name, contact information, etc. It should be noted that the user data such as vehicle information and user information obtained in the embodiment of the present application are all obtained when the user is obtained, or are actively submitted after the user's relevant instructions, or are necessarily uploaded when the user uses the corresponding application through the client, web page, etc. In the technical solution of the present disclosure, the collection, storage, use, processing, transmission, provision, disclosure and application of the user's personal information involved are in compliance with the provisions of relevant laws and regulations, necessary confidentiality measures are taken, and do not violate public order and good customs.

[0038] In this embodiment, the image to be processed may be acquired by the image acquisition device of the vehicle terminal corresponding to the vehicle, or may be sent after being processed by the vehicle terminal. There is a corresponding relationship between the original watermark data and the image to be processed, for example, the original watermark data contains relevant information of the vehicle terminal that acquires or processes the image to be processed.

[0039] In step S220, first verification data is generated according to the original watermark data, and first watermark data is generated according to the original watermark data and the first verification data.

[0040] In this embodiment, the method of generating the first watermark data according to the original watermark data and the first verification data includes: splicing the original watermark data and the first verification data to obtain the first watermark data, or calculating the original watermark data and the first verification data according to a preset algorithm to obtain the first watermark data.

[0041] In this embodiment, the original watermark data is converted into binary data to obtain binary data, a cyclic redundancy check algorithm is used to generate first verification data according to the original watermark data, and the binary data and the first verification data are combined to generate first watermark data.

[0042] In this embodiment, taking the example of obtaining the first watermark data by concatenating binary data and first verification data, the original watermark data T is converted into binary data B, and the binary data B is concatenated with the first verification code data crcData to obtain the first watermark data M to be embedded.

[0043] In this embodiment, the original watermark data T is processed by a cyclic redundancy check algorithm (such as a CRC-32 algorithm) to obtain a first check code crcData, i.e., first check data. The steps of the CRC-32 algorithm processing process are as follows:

[0044] ① Initialize a 32-bit register to all 1s (i.e. 0xFFFFFFFF). This register is used to store the intermediate results of the CRC check process.

[0045] ② Data processing: Process the original watermark data T byte by byte (8 bits). For each byte, perform an XOR operation with the lowest 8 bits of the current CRC register. Then, perform a bitwise modulo 2 operation on the result and the generating polynomial (i.e., perform polynomial division through an XOR operation). Shift the CRC register one bit to the right and fill the highest bit with 0. Repeat the above process until all 8 bits of the byte are processed.

[0046] ③ Repeat step ② until all bytes are processed.

[0047] ④ After processing the last byte, perform an XOR operation on the CRC register and 0xFFFFFFFF, and the final result is the first check code.

[0048] In one embodiment of the present application, a first total pixel of an image to be processed is obtained, and a first data length required to be occupied by the first total pixel is calculated; the first data length is compared with a second data length corresponding to the first watermark data; if the first data length is greater than or equal to the second data length, the image to be processed is split into multiple first color gamut images according to the color gamut channel; if the first data length is less than the second data length, image processing of the image to be processed is terminated.

[0049] In this embodiment, since the total number of pixels of the image before and after the image to be processed is split into multiple first color gamut images according to the color gamut channel remains unchanged, determining whether the image to be processed has enough space to embed the first watermark data is equivalent to determining whether the first grayscale image P has enough space to embed the first watermark data M. The basis for the determination is that by calculating the first total pixel of the first grayscale image P or the image to be processed, the first data length (assuming that 1 pixel size is equal to 1 byte) that the first total pixel needs to occupy can be calculated according to the correspondence between the pixel size and the byte size, and the first data length is compared with the second data length of the first watermark data M. If the first data length is greater than or equal to the second data length, the next step of processing is performed, that is, the image to be processed is split into multiple first color gamut images according to the color gamut channel; if the first data length is less than the second data length, an exception is thrown to terminate the entire processing flow.

[0050] In step S230, the image to be processed is split into multiple first color gamut maps according to the color gamut channels, the first watermark data is replaced to a preset data position in any first color gamut map, and the channels of each first color gamut map are merged to obtain a target watermark map.

[0051] In one embodiment of the present application, the first image dimension number of the image to be processed is obtained; if the image to be processed is determined to be a grayscale image according to the first image dimension number, the first watermark data is replaced to a preset data position in any first color gamut image; if the image to be processed is determined not to be a grayscale image according to the first image dimension number, the image to be processed is split into multiple first color gamut images according to the color gamut channel, the remainder is calculated according to the length of the original watermark data and the preset number, the target first color gamut image is determined according to the correspondence between the remainder and the first color gamut image, and the first watermark data is replaced to the preset data position in the target first color gamut image.

[0052] In this embodiment, to determine whether the original image data, i.e., the image to be processed, is a grayscale image, the cv2 library of Python can be used for processing. The specific steps are to reference the image processing framework cv2 of Python, call cv2.imread(path) to read the image data to obtain the image image, if the image dimension image.shape is 2, it is a grayscale image; if the image dimension image.shape is 3 and the number of color channels is 1 (i.e., image.shape[2] is 1), it is a grayscale image; otherwise, it is not a grayscale image. If it is a grayscale image, the original image data, i.e., the image to be processed, is used. If it is not a grayscale image, the first grayscale image is extracted according to the original image. For example, if the original image is an RGB image, the grayscale image of the RGB channel is extracted, and the cv2 library of Python is used for processing. The specific steps are as follows: use the cv2.imread() function to read the original image data; use the cv2.split() function to separate the R, G, and B channel data of the original image; return the R channel data, i.e., the R channel grayscale image (the G channel or B channel grayscale image may also be returned).

[0053] In this embodiment, which channel grayscale image is returned, i.e., the target first color gamut image, is determined by the correspondence between the length of the original watermark data and the remainder calculated by the preset number and the first color gamut image. For example, assuming the preset number is 3, the remainder of the length of the original watermark data and 3 is 0, and the R channel grayscale image is returned; the remainder of the length of the original watermark data and 3 is 1, and the G channel grayscale image is returned; the remainder of the length of the original watermark data and 3 is 2, and the B channel grayscale image is returned. Assuming the preset number is 7, the remainder of the length of the original watermark data and 7 is 0, and the grayscale image of the R channel is returned; the remainder of the length of the original watermark data and 7 is 1, and the grayscale image of the G channel is returned; the remainder of the length of the original watermark data and 7 is 2, and the grayscale image of the B channel is returned; the remainder of the length of the original watermark data and 7 is 3, and the grayscale image of the R channel and the grayscale image of the G channel are returned; the remainder of the length of the original watermark data and 7 is 4, and the grayscale image of the R channel and the grayscale image of the B channel are returned; the remainder of the length of the original watermark data and 7 is 5, and the grayscale image of the G channel and the grayscale image of the B channel are returned; the remainder of the length of the original watermark data and 7 is 6, and the grayscale image of the R channel, the grayscale image of the G channel and the grayscale image of the B channel are returned. It should be noted that the above preset numbers are preferred examples. In actual application, the preset numbers and the correspondence between the remainder calculated by the length of the original watermark data and the preset numbers and the first color gamut map can be set according to actual needs. The present application does not limit this, nor should it bring any limitation to the functions and scope of use of the embodiments of the present application.

[0054] In this embodiment, the first watermark data is replaced to a preset data position in any first color gamut image. Specifically, the first grayscale image P is traversed, and the first watermark data M is bit-embedded into the preset data position of the first grayscale image P, such as the least significant bit, that is, the lowest bit. The first grayscale image P is read and converted into a binary array Data; the first watermark data M storage array is converted from a byte array to a bit array; Data is traversed, and the Data value corresponding to the current loop index is read as byte data D, and the value of M corresponding to the current loop index is read as bit data Q. If the index value is greater than the length of M, the reading starts again from the first bit of M; the value of the lowest bit of the byte data D is modified to Q.

[0055] In this embodiment, the returned channel grayscale image, i.e., the target first color gamut image, is embedded with the first watermark data, and the first color gamut images are subsequently merged to obtain the target watermark image. If the original image, i.e., the image to be processed, is a grayscale image, the grayscale image embedded with the watermark is directly saved; if the original image is not a grayscale image, the first grayscale image P is merged to obtain the corresponding original image. For example, if the original image is an RGB image, and the current grayscale image P is derived from the R channel grayscale image, the merging steps are as follows: call the cv2.merge([B,G,R]) function to merge the separated B and G channels of the original image with the modified R channel grayscale image P to obtain the RGB image embedded with the watermark, i.e., the target watermark image.

[0056] In step S240, at least a portion of the first watermark data and the target watermark image are sent to the server, wherein the server is used to extract the second watermark data from the target watermark image and verify the consistency of the watermark data based on the comparison result between at least a portion of the first watermark data and the second watermark data.

[0057] In this embodiment, at least a part of the first watermark data (the first verification data and / or the original watermark data) and the target watermark image are sent to the server side, so that the server side compares the first verification data with the second verification data and / or the original watermark data with the initial watermark data. If the first verification data is the same as the second verification data and / or the original watermark data is the same as the initial watermark data, it is determined that the watermark data is consistent, that is, the first watermark data is consistent with the second watermark data, indicating that the target watermark image has no risk of tampering and damage. It can be understood that the first verification data and the original watermark data are the first watermark data.

[0058] In one embodiment of the present application, a first area image is extracted from an image to be processed according to a preset extraction rule, and image recognition is performed on the first area image to obtain first image information; the first image information is sent to a server, wherein the server is used to extract a second area image from a target watermark image according to a preset extraction rule, and image recognition is performed on the second area image to obtain second image information, and the first image information is compared with the second image information, and the consistency of the image to be processed and the target watermark image is verified based on the comparison result.

[0059] In this embodiment, image recognition is performed on a partial image in the image to be processed and a partial image of the same part in the target watermark image, respectively, to obtain first image information and second image information, and the consistency of the target watermark image is verified secondary based on the comparison result of the first image information and the second image information, and the risk of tampering and damage of the target watermark image is determined secondary.

[0060] In one embodiment of the present application, the digital watermark-based image processing method is applied to the server side, and at least includes steps S310 to S320, which are described in detail as follows:

[0061] In step S310, at least a portion of the first watermark data and a target watermark image sent by the vehicle terminal are received, wherein the vehicle terminal is used to obtain the original watermark data and the image to be processed, generate the first verification data according to the original watermark data, and generate the first watermark data according to the original watermark data and the first verification data, split the image to be processed into multiple first color gamut images according to the color gamut channels, replace the first watermark data to the preset data position in any first color gamut image, and merge the channels of each first color gamut image to obtain the target watermark image, and send at least a portion of the first watermark data and the target watermark image to the server.

[0062] In this embodiment, the specific manner in which the vehicle-mounted terminal determines the first watermark data and the target watermark image has been described in detail in the above embodiments, and will not be repeated here.

[0063] In step S320, the second watermark data is extracted from the target watermark image, and the consistency of the watermark data is verified based on a comparison result between at least a portion of the first watermark data and the second watermark data.

[0064] In one embodiment of the present application, the second image dimension number of the target watermark image is obtained; if the target watermark image is determined to be a grayscale image based on the second image dimension number, the second watermark data is extracted from the target watermark image; if the target watermark image is determined not to be a grayscale image based on the second image dimension number, the target watermark image is split into multiple second color gamut images according to the color gamut channel, and the second watermark data is extracted from the preset data position of the target second color gamut image, wherein the target second color gamut image is determined based on the correspondence between the length of the original watermark data and the remainder of a preset number and the second color gamut image.

[0065] In this embodiment, it is determined whether the target watermark image is a grayscale image. If it is a grayscale image, the target watermark image is directly used to extract the second watermark data; if the target watermark image is not a grayscale image, the second grayscale image is extracted according to the target watermark image. For example, if the original image is an RGB image, the grayscale image of the RGB channel is extracted, and the cv2 library of Python is used for processing. The steps are as follows: the original image data is read using the cv2.imread() function; the R, G, and B channel data of the original image are separated using the cv2.split() function; the target watermark image is split into multiple second color gamut images according to the color gamut channel, and the second watermark data is extracted from the preset data position of the target second color gamut image, wherein the target second color gamut image is determined according to the length of the original watermark data and the correspondence between the remainder of the preset number and the second color gamut image. For example, the R channel data, i.e., the R channel grayscale image (consistent with the channel extracted during the embedding process) is returned.

[0066] In one embodiment of the present application, a first watermark length of the first watermark data is calculated based on the length of the original watermark data and the length of the first verification data; the first watermark length is compared with the second watermark length of the second watermark data, and if the second watermark length is less than the first watermark length, a verification abnormality prompt message is generated to prompt the user; if the second watermark length is greater than or equal to the first watermark length, the consistency of the watermark data is verified based on the comparison result between at least a part of the first watermark data and the second watermark data.

[0067] In this embodiment, the second grayscale image P2, i.e., the second color gamut image information, pixel width width, pixel height height are read, and it is assumed that each pixel corresponds to one byte to obtain the total byte length totalPixels of P2; all byte data of the second grayscale image P2 are traversed once according to totalPixels, and the lowest bit data of each byte is extracted and saved in bitList; bitList is traversed in sequence, with each 8 bits as a group, and each group of data is converted into a byte data and saved in byteList, and the second watermark length is obtained according to the length of bitList; the expected byte length L, i.e., the first watermark length, is calculated: ORIGINAL_LENGTH (the length of the original watermark data T) + 4 (the length of the check code generated by the CRC-32 algorithm); if the length of bitList is less than L, it means that the original watermark data T and the second check code U, i.e., the second check data, are not obtained, and an abnormal test result is thrown; if the length of bitList is greater than L, the next step is performed, i.e., the consistency of the watermark data is verified according to the comparison result between at least a part of the first watermark data and the second watermark data.

[0068] In this embodiment, the second watermark data T' and the second check code crcData' are separated, and data of corresponding lengths are sequentially intercepted from bitList according to the length of the original watermark data T and the length of the first check code crcData to obtain the second watermark data T' and its corresponding CRC check code calculatedCRC, i.e., the second check code.

[0069] In one embodiment of the present application, at least a portion of the first watermark data is compared with the second watermark data to obtain a comparison result; if the comparison result is that at least a portion of the first watermark data and the corresponding portion of the second watermark data are the same, the watermark data are determined to be consistent; if the comparison result is that at least a portion of the first watermark data and the corresponding portion of the second watermark data are different, the watermark data are determined to be inconsistent.

[0070] In this embodiment, the calculated check code calculatedCRC, i.e., the second check code, is compared with the received check code crcData, i.e., the first check code, to verify the integrity of the data. Verification is performed by CRC (cyclic redundancy check). If crcValid is True, i.e., if the second check code is equal to the first check code, the verification is successful, indicating that the image transmission is correct and complete and has not been tampered with; if crcValid is false, i.e., if the second check code is not equal to the first check code, it indicates that the image has been tampered with during transmission or that image data is missing, and the image receiver, i.e., the server, will perform corresponding business processing according to the verification result.

[0071] Figure 3FIG. 1 is a schematic diagram of a digital watermark embedding process of an image processing method based on a digital watermark, shown in an exemplary embodiment of the present application. Figure 3 As shown, in an exemplary embodiment, a cyclic redundancy check (CRC) algorithm is used to generate first verification data according to the original watermark data, and the first watermark data is generated according to the original watermark data and the first verification data; the original image data, i.e., the image data to be processed, is read to determine whether the image to be processed is a grayscale image. If the image to be processed is a grayscale image, the grayscale image is directly read; if the image to be processed is not a grayscale image, the grayscale image is extracted according to the image to be processed, and then the grayscale image is read; according to the total pixels of the grayscale image and the length of the first watermark data, it is determined whether the space size of the grayscale image is sufficient. If the space is not enough, an exception is thrown, i.e., an exception message is generated to prompt the user. If the space is sufficient, the first watermark data is embedded in the grayscale image to obtain the target watermark image, and the target watermark image is saved. If the image to be processed is a grayscale image, the target watermark image is directly saved; if the image to be processed is not a grayscale image, the grayscale image is restored and the image is saved. The specific implementation method has been specifically described in the above embodiments and will not be repeated here.

[0072] Figure 4 FIG. 1 is a schematic diagram of a digital watermark extraction and verification process of an image processing method based on a digital watermark, which is shown in an exemplary embodiment of the present application. Figure 4 As shown, in an exemplary embodiment, the watermark image data, i.e., the target watermark image data, is read to determine whether the target watermark image is a grayscale image. If the target watermark image is a grayscale image, the grayscale image is directly read; if the target watermark image is not a grayscale image, the grayscale image is extracted according to the target watermark image and then read; the lowest bit data in the grayscale image is extracted, and the second verification data is obtained by separating the extracted lowest bit data, the first verification data is compared with the second verification data, and the consistency of the watermark data is verified according to the comparison result. The specific implementation method has been specifically described in the above embodiments and will not be repeated here.

[0073] This application combines the CRC algorithm with the LSB algorithm to improve the verification efficiency and verification speed, and ensure the integrity and reliability of the data. This application obtains the original watermark data and the image to be processed, generates the first verification data according to the original watermark data, and generates the first watermark data according to the original watermark data and the first verification data, splits the image to be processed into multiple first color gamut images according to the color gamut channel, replaces the first watermark data to the preset data position in any first color gamut image, and merges the channels of each first color gamut image to obtain the target watermark image, and sends at least a part of the first watermark data and the target watermark image to the server side, wherein the server side is used to extract the second watermark data from the target watermark image, and verify the consistency of the watermark data according to the comparison result between at least a part of the first watermark data and the second watermark data. It has the following advantages: 1. Improve data security: By embedding the CRC-32 check code in the least significant bit of the image data, implicit verification of the image data is realized, which effectively prevents tampering and damage of the data during transmission or storage. 2. Reduce resource requirements: Compared with the transform domain method and zero watermark technology, the method of the present invention saves storage space and reduces the requirements for equipment. 3. Improve verification efficiency: The CRC-32 algorithm has a fast calculation speed and can achieve fast verification without affecting the image quality.

[0074] Figure 5 is a block diagram of an image processing system based on digital watermarking shown in an exemplary embodiment of the present application. The device can be applied to Figure 1 The implementation environment shown in the figure is specifically configured in the computer device 102. The device can also be applied to other exemplary implementation environments and specifically configured in other devices. This embodiment does not limit the implementation environment to which the device is applied.

[0075] like Figure 5 As shown, the exemplary digital watermark-based image processing system includes: a vehicle terminal 510 and a server 520 .

[0076] Among them, the vehicle terminal 510 is used to obtain the original watermark data and the image to be processed, generate the first verification data according to the original watermark data, and generate the first watermark data according to the original watermark data and the first verification data, split the image to be processed into multiple first color gamut maps according to the color gamut channel, replace the first watermark data to the preset data position in any first color gamut map, and merge the channels of each first color gamut map to obtain a target watermark map, and send at least a part of the first watermark data and the target watermark map to the server side; the server side 520 is used to extract the second watermark data from the target watermark map, and verify the consistency of the watermark data based on the comparison result between at least a part of the first watermark data and the second watermark data.

[0077] It should be noted that the digital watermark-based image processing system provided in the above embodiment and the digital watermark-based image processing method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs operations has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the digital watermark-based image processing system provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0078] The embodiment of the present application also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the electronic device implements the image processing method based on digital watermark provided in the above embodiments. The above electronic device includes a vehicle terminal.

[0079] Figure 6 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0080] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the methods provided in the above-mentioned various embodiments. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, the ROM 602 and the RAM 603 are connected to each other through the bus 604. The input / output (I / O) interface 605 is also connected to the bus 604.

[0081] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.

[0082] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 609, and / or installed from a removable medium 611. When the computer program is executed by a central processing unit (CPU) 601, various functions defined in the system of the present application are executed.

[0083] It should be noted that the computer-readable medium shown in the embodiment of the present application can be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media can include, but are not limited to: an electrical connection with 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), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. This propagated data signal can take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. A computer program contained on a computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0084] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not constitute limitations on the units themselves in some cases.

[0086] Another aspect of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor of a computer, the computer executes the image processing method based on digital watermarking provided in the above embodiments. The computer-readable storage medium may be included in the electronic device described in the above embodiments, or may exist independently without being assembled into the electronic device.

[0087] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.

[0088] Another aspect of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. A processor of a computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the image processing method based on digital watermark provided in each of the above embodiments.

[0089] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.

[0090] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.

[0091] The above embodiments are merely illustrative of the principles and effects of the present application, and are not intended to limit the present application. Anyone familiar with the technology may modify or change the above embodiments without violating the spirit and scope of the present application. Therefore, all equivalent modifications or changes made by a person of ordinary skill in the art without departing from the spirit and technical ideas disclosed in the present application shall still be covered by the claims of the present application.

Claims

1. An image processing method based on digital watermark, characterized in that: Applied to a vehicle terminal, the method comprises: Obtain original watermark data and the image to be processed; Generate first verification data according to the original watermark data, and generate first watermark data according to the original watermark data and the first verification data; Splitting the image to be processed into a plurality of first color gamut images according to color gamut channels, replacing the first watermark data to a preset data position in any first color gamut image, and merging the channels of the first color gamut images to obtain a target watermark image; At least a portion of the first watermark data and the target watermark image are sent to a server, wherein the server is used to extract second watermark data from the target watermark image and verify the consistency of the watermark data based on a comparison result between at least a portion of the first watermark data and the second watermark data.

2. The image processing method based on digital watermark according to claim 1 is characterized in that: Before obtaining the original watermark data, the method further includes: Acquire the timestamp of acquiring the image to be processed, the vehicle information and the user information corresponding to the vehicle terminal; The original watermark data is determined according to at least one of the timestamp, the vehicle information and the user information.

3. The image processing method based on digital watermark according to claim 1, characterized in that: After generating the first watermark data according to the original watermark data and the first verification data, the method further includes: Acquire a first total pixel of the image to be processed, and calculate a first data length that the first total pixel needs to occupy; comparing the first data length with a second data length corresponding to the first watermark data; If the first data length is greater than or equal to the second data length, splitting the image to be processed into a plurality of first color gamut images according to color gamut channels; If the first data length is smaller than the second data length, the image processing of the image to be processed is terminated.

4. The image processing method based on digital watermark according to any one of claims 1 to 3, characterized in that: Splitting the image to be processed into a plurality of first color gamut images according to the color gamut channels, and replacing the first watermark data to a preset data position in any first color gamut image, comprises: Obtaining a first image dimension of the image to be processed; If the image to be processed is determined to be a grayscale image according to the first image dimension number, the first watermark data is replaced to a preset data position in any first color gamut image; If it is determined that the image to be processed is not a grayscale image according to the first image dimension number, the image to be processed is split into multiple first color gamut images according to the color gamut channel, the remainder is calculated according to the length of the original watermark data and a preset number, the target first color gamut image is determined according to the correspondence between the remainder and the first color gamut image, and the first watermark data is replaced to the preset data position in the target first color gamut image.

5. The image processing method based on digital watermark according to any one of claims 1 to 3, characterized in that: The method further comprises: Extracting a first region image from the image to be processed according to a preset extraction rule, performing image recognition on the first region image, and obtaining first image information; The first image information is sent to the server side, wherein the server side is used to extract the second area image from the target watermark image according to the preset extraction rule, perform image recognition on the second area image to obtain second image information, compare the first image information with the second image information, and verify the consistency between the image to be processed and the target watermark image based on the comparison result.

6. An image processing method based on digital watermark, characterized in that: Applied to the server side, the method includes: Receiving at least a portion of the first watermark data and a target watermark image sent by a vehicle terminal, wherein the vehicle terminal is used to obtain original watermark data and an image to be processed, generating first verification data according to the original watermark data, and generating the first watermark data according to the original watermark data and the first verification data, splitting the image to be processed into multiple first color gamut images according to color gamut channels, replacing the first watermark data to a preset data position in any first color gamut image, and merging the channels of each of the first color gamut images to obtain the target watermark image, and sending at least a portion of the first watermark data and the target watermark image to a server; The second watermark data is extracted from the target watermark image, and the consistency of the watermark data is verified based on a comparison result between at least a portion of the first watermark data and the second watermark data.

7. The image processing method based on digital watermark according to claim 6 is characterized in that: Extracting second watermark data from the target watermark image includes: Obtaining the second image dimension of the target watermark image; If the target watermark image is determined to be a grayscale image according to the second image dimension, extracting the second watermark data from the target watermark image; If it is determined that the target watermark image is not a grayscale image according to the second image dimension number, the target watermark image is split into multiple second color gamut images according to the color gamut channel, and the second watermark data is extracted from the preset data position of the target second color gamut image, wherein the target second color gamut image is determined based on the correspondence between the length of the original watermark data and the remainder of a preset number and the second color gamut image.

8. The image processing method based on digital watermark according to claim 6, characterized in that: After extracting the second watermark data from the target watermark image, the method further comprises: Calculate the first watermark length of the first watermark data according to the length of the original watermark data and the length of the first verification data; Compare the first watermark length with the second watermark length of the second watermark data, and if the second watermark length is smaller than the first watermark length, generate a verification abnormality prompt message to prompt the user; If the second watermark length is greater than or equal to the first watermark length, the consistency of the watermark data is verified based on a comparison result between at least a portion of the first watermark data and the second watermark data.

9. The image processing method based on digital watermark according to any one of claims 6 to 8, characterized in that: Verifying the consistency of the watermark data according to a comparison result between at least a portion of the first watermark data and the second watermark data includes: comparing at least a portion of the first watermark data with the second watermark data to obtain a comparison result; If the comparison result is that at least a portion of the first watermark data is identical to a corresponding portion of the second watermark data, then it is determined that the watermark data are consistent; If the comparison result is that at least a portion of the first watermark data is different from a corresponding portion of the second watermark data, it is determined that the watermark data are inconsistent.

10. An image processing system based on digital watermark, characterized in that: include: A vehicle terminal is used to obtain original watermark data and an image to be processed, generate first verification data according to the original watermark data, and generate first watermark data according to the original watermark data and the first verification data, split the image to be processed into multiple first color gamut images according to color gamut channels, replace the first watermark data to a preset data position in any first color gamut image, and merge the channels of each of the first color gamut images to obtain a target watermark image, and send at least a part of the first watermark data and the target watermark image to a server; The server side is used to extract the second watermark data from the target watermark image, and verify the consistency of the watermark data according to the comparison result between at least a part of the first watermark data and the second watermark data.

Citation Information

Patent Citations

  • Digital watermark embedding method, extraction method, device and digital watermark system

    CN108665403A

  • Image watermark processing method and device, equipment and storage medium

    CN115481374A