Data embedding and extraction from images
By changing the image unit value in the flat or textured area of the image, data is embedded and extracted in the image with high robustness, solving the problem that the robustness and perceived quality of data embedding and extraction in the prior art is difficult to take into account, and is suitable for various image processing operations.
Patent Information
- Application Number
- CN201910582121.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-06-30
- Publication Date
- 2025-08-08
- Estimated Expiration
- 2039-06-30
AI Technical Summary
The prior art is difficult to effectively extract data from images, especially data in graphical images, and it is difficult to take into account both the robustness and perceived quality of data embedding and extraction during image processing.
By converting the target data into a sequence of logical values and changing the value of the image unit within the flat or textured area of the image, ensuring that the visual perception distortion is within the allowable threshold, while achieving accurate embedding and extraction of data.
It realizes the high robustness of the data embedded and extracted in the image without significantly affecting the perceived quality of the image, and is suitable for various image processing operations.
Smart Images

Figure CN112233004B_ABST
Abstract
Description
Background Art
[0001] Once created, images are primarily used to convey information visually. While humans can effectively visually perceive the information presented by an image, machines may struggle to understand or recover the implicit information. For example, charts, as graphical representations of data, can be edited using specialized editing tools and created as image files for insertion into other types of documents, web pages, and other files to visually present relevant data to viewers. However, once presented in the form of an image, the data is effectively locked into the image's pixel values, making it difficult for machines to accurately extract it for subsequent operations such as re-editing, enhancing, and redefining the data. Summary of the Invention
[0002] According to an implementation of the present disclosure, a scheme for embedding and extracting data in an image is proposed. When embedding data, a target area for data embedding is determined from a source image, such as a chart image. The target data to be embedded is converted into a sequence of logical values represented in a predetermined format. Based on the sequence of logical values, the image values of one or more image cells in the target area are changed so that the image values in the target area can be used to transmit the sequence of logical values corresponding to the target data. The change in image value is within a predetermined range, so that no significant visual perception distortion is caused while embedding the data. In subsequent processes, the embedded data can also be easily extracted from the image for use.
[0003] The invention summary is provided to introduce the relevant concepts in a simplified form, which will be further described in the detailed description below. The invention summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to limit the scope of the claimed subject matter. BRIEF DESCRIPTION OF THE DRAWINGS
[0004] Figure 1 A block diagram illustrating an environment in which various implementations of the present disclosure can be implemented;
[0005] Figure 2 A flowchart illustrating a process for embedding data in an image according to one implementation of the present disclosure is shown;
[0006] Figure 3 An example of determining a target area in which data can be embedded from a source image according to one implementation of the present disclosure is shown;
[0007] Figure 4 shows an example grouping of a sequence of logic values according to one implementation of the present disclosure;
[0008] Figure 5 shows an example correspondence from logical values of a data block to image units according to one implementation of the present disclosure;
[0009] Figure 6A and Figure 6B shows an example arrangement of a start marker block, a data block, and an end marker block in a target area according to one implementation of the present disclosure;
[0010] Figure 7A shows an example of a pattern of a first synchronization alignment block according to one implementation of the present disclosure;
[0011] Figure 7B shows an example of a pattern of a second synchronization alignment block according to one implementation of the present disclosure;
[0012] Figure 8 A flowchart illustrating a process for extracting data from an image according to one implementation of the present disclosure is shown;
[0013] Figure 9 A flowchart illustrating a process for embedding data in an image according to one implementation of the present disclosure; and
[0014] Figure 10 A block diagram of a computing device capable of implementing various implementations of the present disclosure is shown.
[0015] In these drawings, the same or similar reference symbols are used to designate the same or similar elements. DETAILED DESCRIPTION
[0016] The present disclosure will now be discussed with reference to several example implementations. It should be understood that these implementations are discussed only to enable those skilled in the art to better understand and implement the present disclosure, rather than to imply any limitation on the scope of the present disclosure.
[0017] As used herein, the term "including" and its variations are to be interpreted as open-ended terms meaning "including but not limited to." The term "based on" is to be interpreted as "based, at least in part, on." The terms "an implementation" and "an implementation" are to be interpreted as "at least one implementation." The term "another implementation" is to be interpreted as "at least one other implementation." The terms "first," "second," and so on may refer to different or the same objects. Other explicit and implicit definitions may also be included below.
[0018] As mentioned above, the data presented by the image is difficult for machines to understand, and it is also difficult to accurately extract for further editing and processing. In some images that present data such as numerical values and text, the data presented by the image is expected to be able to be processed later. For example, quantitative data is often effectively presented to users in a visual way such as charts. Editing tools such as electronic spreadsheets can be used to conveniently organize quantitative data into charts that are easy for people to understand in a variety of ways. Charts may be made into chart images so that they can be published in communication media such as electronic documents, web pages, and written documents. However, the data presented in the chart image is difficult for machines to accurately understand or identify the accurate numerical information therein.
[0019] Furthermore, images, as separate files, may be disseminated through various means, including transmission, copying, scaling, screenshotting, printing, format conversion, and photographing via image acquisition devices. Besides the information visually presented in the image, other additional information is difficult to transmit along with the image without loss during these processes, unless this additional information is presented as part of the image element.
[0020] To extract data from images, conventional approaches utilize optical character recognition (OCR) and image recognition technologies to identify the types of charts and visual codes presented in the image, or to obtain data visually presented in the image. Despite extensive research on OCR and image recognition technologies, the results of data extraction remain incomplete and inaccurate, with high error rates. Furthermore, these technologies typically rely on the visual presentation of the image to extract data, so the data that can be obtained must be visually and prominently presented in the image. Without visually presented data in the image, the aforementioned methods are unavailable.
[0021] Example environment and basic working principles
[0022] Figure 1 A block diagram of an environment 100 in which multiple implementations of the present disclosure can be implemented is shown. In the environment 100, a data embedder 110 is configured to embed target data 104 into an image 102 to obtain an image 112 with data embedding. The image 102 can be referred to as a source image for data embedding, and the image 112 can be referred to as a target image for data embedding. The target image 112 can be provided for various purposes, such as being inserted into an electronic document, a web page, copied to other storage locations, transmitted to other devices, printed, photographed, or re-edited. Figure 1 In the example of FIG. 1 , it is schematically shown that the target image 112 is inserted into the electronic document 130 as an illustration.
[0023] In the environment 100, a data extractor 120 is configured to extract the embedded target data 104 from an available image 122. The target data 104 extracted by the data extractor 120 may be provided for any subsequent processing. The image 122 may be referred to as a target image for data extraction. The image 122 may have undergone some candidate operations and may not be identical to the image 112 output by the data embedder 110. For example, the image 122 may be obtained by taking a screenshot from the electronic document 130 and scaled relative to the image 112. Of course, in some implementations, the image 122 processed by the data extractor 120 is identical to the image 112 output by the data embedder 110.
[0024] Data embedder 110 and data extractor 120 can be integrated into a single computing device or system, or distributed across different computing devices or systems. The functionality of one or more of data embedder 110 and data extractor 120 can serve as a library of functions for embedding and extracting data from an image, allowing for easy access as needed. In some implementations, the data embedding functionality of data embedder 110 can be invoked by or integrated into an editing tool for image 102 to integrate data into the edited image. For example, an editing tool for editing charts and creating chart data, such as a spreadsheet application (e.g., Excel) or a business intelligence (Power BI) tool, can invoke data embedder 110 to embed any desired data into the generated image. In some implementations, images obtained from various data sources can be provided to data extractor 120 in an attempt to extract embedded data therefrom. The data extraction functionality of data extractor 120 can be invoked by or integrated into an application that obtains image 122, or the target data extracted by data extractor 120 can be provided to such an application. Examples of such an application tool may be an application for editing or creating an electronic document into which an image may be inserted, such as a word processing application, a presentation application, an image processing application, an electronic form application, and any other application.
[0025] It should be understood that Figure 1 The various images and applications of the images shown in FIG are merely examples. Any other types of images can also be applied to data embedding and extraction, and images with data embedding can be used for many other purposes.
[0026] According to implementations of the present disclosure, it is desirable to embed data into images without degrading the perceived quality of the image, while also ensuring that the embedded data can be accurately extracted. To better understand the data embedding and extraction schemes proposed in various implementations of the present disclosure, we first briefly analyze some of the challenges or key requirements identified by the inventors for embedding data in images. These challenges or requirements primarily relate to robustness, data capacity, and perceived quality.
[0027] Typically, after embedding data, images may undergo various processing operations, such as compression, scaling, rotation, printing, and recapture by imaging devices. These subsequent operations may cause further distortion of the image. Therefore, it is desirable that data embedding solutions be more robust to the general processing and operational distortions that images may face during use, so that the embedded data can always be correctly extracted.
[0028] On the other hand, for a given image, the amount of data that can be embedded in it is limited. It is expected that the amount of data embedded in the image (also called data capacity) is sufficient to embed all the required data. The data capacity depends on the embedding scheme and specific parameters used. In general, robustness and data capacity are two conflicting requirements. For a given embedding scheme, if the data capacity is increased, the robustness will decrease. In other words, it is difficult to maximize both data capacity and robustness when embedding data. In practical applications, these two requirements can be balanced. One alternative is to determine the conventional distortion in the target application scenario where the image in which the embedded data is to be used, and then set the robustness to a level that can withstand such distortion while maximizing the capacity. Another approach is to first determine the amount of data to be embedded, that is, set the required data capacity level, and then maximize the robustness on this basis.
[0029] When embedding data into an image, particularly one used for visual presentation of graphical data such as a chart, it is desirable that the embedded data does not interfere with the normal use of the image. This means that the data embedding must ensure high perceptual quality, effectively controlling the visual distortion of the original image caused by the embedded data. Therefore, while ensuring that the embedded data can be correctly extracted, it is also desirable that the visual distortion is acceptable.
[0030] The data embedding and extraction scheme according to the implementation of the present disclosure takes into account the requirements of one or more of the above aspects. The implementation of the present disclosure proposes a scheme for data embedding and extraction in an image. When performing data embedding, target data is embedded into a target area in an image. To achieve the embedding, the target data is converted into a sequence of logical values. Depending on the logical value corresponding to the target data to be embedded, the image value of the image unit in the target area is changed, and the degree of change in the image value depends on the degree of impact on visual perception. As a result, the difference in visual perception presented by the target area before and after embedding the target data is within an allowable threshold.
[0031] Data embedded in an image can be accurately extracted. Specifically, when performing data extraction, a target area in the image where data may be embedded is determined. Based on the image values of the image cells in the target area, a logical value sequence represented in a predetermined format is determined, and then the logical value sequence is converted into the target data.
[0032] According to this scheme, any desired data can be conveniently embedded in an image without significantly affecting the perceived quality of the image. Furthermore, the data in the image can be conveniently extracted for subsequent use. In some implementations, this data embedding and extraction scheme is particularly suitable for chart images that present graphical representations of data. A target region is identified in the chart image, and target data is embedded in the target region.
[0033] The following will refer to Figures 2 to 8 To describe the data embedding and extraction in images in detail. In this paper, for the purpose of explanation, the graph image (e.g. Figure 1 The source image 102 is shown as an example to describe the embedding of data and the subsequent extraction of data. Such a chart image can be a bar chart, a line chart, a dot chart, any combination of the foregoing, or other types of charts. However, it should be understood that the implementation of the present disclosure can be applied to any other images, such as computer-generated graphics, line drawings, sketches, etc.
[0034] Data Embedding
[0035] Figure 2 FIG. 1 is a flow chart illustrating a process 200 for embedding data in an image according to one implementation of the present disclosure. The process 200 may be performed by, for example, Figure 1 For ease of discussion, reference will be made to the data embedder 110. Figure 1 2. Process 200 will be described.
[0036] At block 210, the data embedder 110 extracts the image data from a source image (e.g. Figure 1The source image 102 of the image processing unit 102 is used to determine the target area in which the data can be embedded. Typically, the source image 102 includes multiple picture elements, which are arranged in rows and columns. In this article, "picture element" refers to a pixel, a group of pixels, superpixels, voxels or other higher-level image components of an image. Each picture element has an associated value, which is called an "image value", "pixel value" or "physical bit". Through the different image values of the picture elements, the corresponding areas of the source image 102 can have different colors or tones, thereby presenting corresponding visual information.
[0037] In the implementation of the present disclosure, in order to avoid a negative impact on the perceived quality of the image after embedding the data, the target area in which the data can be embedded is determined in the source image 102 and is composed of one or more relatively flat areas or textured areas. In the image, a flat area refers to an image area with smaller fluctuations in image values, for example, the degree of change in the image values of a group of image units in the flat area is within a predetermined threshold. The predetermined threshold for determining the flat area can be set to any appropriate finite value and is usually not set to too large. The setting of the predetermined threshold can be specifically set according to the actual use case and also depends on the user's tolerance for visual perception distortion of the image. A textured area refers to an area in which the image values have a certain periodicity. The values of the image values in the flat area and the textured area are usually predictable to a certain extent, which is helpful for the data embedding and subsequent data extraction of the present disclosure.
[0038] The target region in which data can be embedded may include one or more continuous subregions in the source image 102. Each continuous subregion may be a flat region or a textured region. In some cases, the image values of different subregions may differ significantly. Spectrally, the spectral distribution of the image values in each subregion of the target region is relatively narrow, such as near DC. Visually, the colors presented by each continuous subregion in the target region are not complex and varied, but rather appear smooth or exhibit a periodically varying texture in overall visual perception.
[0039] In some implementations, source images suitable for embedding data without causing noticeable perceptual distortion include graphic images, such as bar graphs, line graphs, and dot graphs. Source images may also include computer-generated graphics or images, line or sketch images, and the like. Such images typically include at least one region where the variation in image values is small, and such target regions may be difficult to locate in natural images captured by an imaging device.
[0040] In some implementations, the target region for embedding data can be the background region of the source image 102 rather than the foreground region. This is because when viewing an image, people may pay more attention to the information presented in the foreground region, so the possible visual perceptual distortion caused by embedding an image in the background region is easily ignored by the human eye. In addition, the background region of most images typically includes relatively large monotonous areas, such areas can be used to embed data. Embedding data into the background of the source image 102 can also improve robustness because the foreground regions of different images typically vary greatly. In a background region-based implementation, the data embedder 110 can first separate the foreground and background regions of the source image 102 and select the target region from the background region.
[0041] Various foreground and background segmentation techniques currently in use or to be developed in the future can be utilized to separate the foreground and background regions of the source image 102. In some implementations, the foreground and background regions are separated by analyzing the distribution of image values in the source image 102, taking advantage of the fact that the foreground region is more easily visible. More specifically, the pixel values in the source image 102 are clustered into a plurality of clusters. Based on the number of clusters, the distribution of image values, the location of each pixel value in each cluster, and the distance between clusters, it is possible to determine which clusters belong to the background cluster. By utilizing the image values in the determined background clusters, the source image 102 can be separated into the foreground and background regions. In other implementations, the data embedder 110 is connected to or integrated into an editing and generation tool for the source image 102. The editing and generation tool knows the foreground and background regions of the source image 102 and can transmit the foreground and background information to the data embedder 110.
[0042] In one implementation, the entire background area of the source image 102 can be used to embed data, because the background area generally does not have much color variation and is relatively single in color. Figure 1 The source image 102 depicted as a bar graph has, in addition to foreground elements such as the histogram area, coordinate axes, annotations on the coordinate axes, and numerical label lines, a relatively large substantially white background area. Such background area can be used as a target area for embedding data.
[0043] In optional circumstances, such as when source image 102 is editable, to better achieve data embedding, source image 102 can be created so that the foreground and background areas are more distinct. For example, when the user designs source image 102, a set of candidate background areas can be provided for selection. These background areas have a significantly different visual appearance from the foreground areas and can have simpler colors or a certain texture. This not only improves the perceived quality of the generated source image 102 itself, but also enhances the perceived quality of the target image obtained after data embedding.
[0044] In another implementation, the target region may also be selected from the foreground region of the source image 102, as long as the foreground region contains a continuous region with a small range of image value variation. For example, in a source image with a limited background area, the target region may be selected to include a portion of the foreground region and a portion of the background region, or may be entirely from the foreground region, as long as the distortion of the foreground region caused by data embedding is controlled within the range of the user's visual perception distortion tolerance. For example, for chart images, pie chart-type images generally do not include a background region or only include a limited background region, so the data may be embedded in the foreground region.
[0045] In addition to the color requirement, the target area in which the data can be embedded has a certain size so as to be able to carry the data to be embedded. A predetermined size threshold can be set. The data embedder 110 can determine whether there is an area in the source image 102 that is larger than the predetermined size threshold and has a small degree of change in image value. The data embedder 110 can determine one or more discrete sub-embedding areas from the source image 102. Each sub-embedding area is composed of multiple continuous image units, that is, it belongs to a continuous area part, and the size of each sub-area is larger than the predetermined size threshold. Then, the data embedder 110 determines whether the total size of the multiple sub-areas can embed the data to be embedded. For example, Figure 3 As shown, the data embedder 110 determines a plurality of sub-regions 302-1 to 302-7 (sometimes collectively or individually referred to as sub-regions 302 of the target region) from the background region of the source image 102 as data embedding regions. Furthermore, the data embedder 110 determines that the total size of the plurality of sub-regions exceeds a predetermined size threshold. If the size of all data-embeddable regions is sufficient to embed the target data 104 to be embedded, subsequent data embedding operations may be performed.
[0046] The predetermined size threshold for the target area can be determined based on the amount of target data to be embedded, or can be set to a baseline value to ensure that a meaningful amount of data can be embedded into the source image 102. It should be understood that the predetermined size threshold can be set to any other size value, and the scope of the present disclosure is not limited in this respect.
[0047] Continue to refer Figure 2 At block 220, the data embedder 110 converts target data (e.g., target data 104) into a sequence of logical values represented in a predetermined format. The target data refers to data to be embedded in the source image 102. The target data can be any data, such as data related to the visual representation presented on the image, other auxiliary or enhancement data, or any other data that the user desires to embed, as long as the embeddable data capacity in the source image 102 allows. For example, for a chart image used to present a graphical representation of data, it may be desirable to embed the chart data so that the chart data can be subsequently recovered from the image for viewing, re-editing, or performing other processing.
[0048] In order to achieve data embedding, the target data 104 is converted into a logical value representation in a predetermined format. The format of the logical value representation can be a binary format, with two logical values 0 and 1. Other logical value representation methods are also feasible, such as quaternary, octal, hexadecimal, etc. Such a format can enable the target data 104 to be represented by a limited number of logical values. The selected logical value representation format will affect how the image value of the image unit is changed during data embedding. In the following implementation, for the purpose of explanation, the binary representation of the target data 104 is used as an example. Logical values in other formats can also be similarly applied in such an implementation. In binary representation, a logical value can also be called a bit or a logical bit, and a sequence of eight bits can be called a byte. The binary logical value sequence of the target data 104 can also be called a bit sequence, a bit stream, or a byte sequence.
[0049] In some implementations, to reduce the number of logical values used to represent the target data 104, data simplification can be performed on the target data 104. Data simplification can be considered a type of data compression, but with greater robustness to error propagation. Therefore, errors or loss of certain data will not significantly affect subsequent data. This differs from typical data compression techniques, which can result in long dependencies between compressed bitstream values, rendering subsequent data undecodable in the event of data errors or data loss. In implementations utilizing data simplification, a simple local transformation is performed on the originally non-binary data to account for error propagation in data compression and the unknowable nature of the data itself.
[0050] For example, if the target data 104 includes ASCII text, the highest bit in the binary representation corresponding to each ASCII character can be removed, and the remaining bits can be aligned to form a byte. If necessary, after byte alignment, if the last remaining bits are insufficient to form a byte, padding bits can be added to form the last byte, thereby forming a logical value sequence corresponding to the target data 104. In some examples, if the target data 104 includes textual representations of numerical values, these numerical values can be directly converted to binary representation.
[0051] In some implementations, to alleviate the problem of limited embeddable data capacity in the source image 102, the target data 104 to be embedded may include a link to additional data, such as a uniform resource locator (URL) or other access link, so that more relevant data can be accessed later after the link is extracted. Alternatively or additionally, the data embedding and extraction schemes proposed in some implementations of the present disclosure can be used in combination with conventional schemes, such as OCR and / or image recognition technology. In one example, the target data 104 to be embedded in the source image 102 may not include data that can be extracted from the visual presentation of the image using OCR and / or image recognition technology. For example, for a chart image, if the source image 102 visually presents some numerical or related data, this data may not need to be embedded in the source image as target data 104. In another example, the target data 104 to be embedded may include auxiliary information required by conventional OCR and / or image recognition technology, which helps to better accurately identify data from the visual presentation of the image. For example, if a certain image recognition technology requires the type of the source image, the type of the source image can be embedded as target data 104 to improve the accuracy of subsequent image recognition. Of course, in such an example, when utilizing OCR and / or image recognition technology, it should be known that the image to be processed has data embedded in it, so as to avoid the impact of the data embedding on the recognition results. The data embedding scheme proposed in the implementation of the present disclosure is feasible because the data embedding of the present disclosure has a relatively small negative impact on the visual perception quality of the image.
[0052] At block 230, the data embedder 110 generates a target image (eg, a target image having the target data 104 embedded therein) by changing an image value of at least one of the image cells of the target area within a predetermined range based on a sequence of logical values. Figure 1Target image 112 is obtained. According to an implementation of the present disclosure, target data 104 is transmitted by changing the image values (e.g., pixel values) of image cells, with different image values being used to indicate different logical values. Each logical value in the logical value sequence can be mapped to one or more image cells in the target area, and the logical value can be indicated by the image values of these image cells. The mapping of the logical value sequence to the image values of the image cells can be performed sequentially to facilitate extraction.
[0053] Specifically, for binary logical values, two different image values of an image cell can be used to represent two different logical values. In some implementations, the data embedder 110 can use the original image value of the image cell to indicate one logical value (e.g., a logical value of "0"), and by slightly changing the original image value of the image cell, the changed image value can be used as another logical value (e.g., a logical value of "1"). In an alternative embodiment, the correspondence between image values and logical values can also be configured in the opposite manner, that is, the original image value can be used to indicate a logical value of "1", while the changed image value can be used to indicate a logical value of "0". The change to the original image value can be to increase or decrease the original image value by a certain amount, and the difference between the changed image value and the original image value is within a predetermined range, which can ensure that the data embedding does not cause excessive visual perception distortion. In other implementations, the data embedder 110 can make some changes to the original image value of the image cell to form two types of image values, one type of image value is used to indicate one logical value (e.g., a logical value of "0"), and the other type of image value is used to indicate another logical value (e.g., a logical value of "1"). For logical values in other formats, such as quaternary and octal, more different image values can be used to indicate the corresponding logical values. In order for the image values of corresponding image cells to indicate the corresponding logical values, the image values of some image cells will be changed. Such changes must also be limited to a predetermined range to avoid causing significant visual distortion.
[0054] The setting of the predetermined range can be determined based on the degree of impact on visual perception. For example, it can be set so that the perceived difference presented by the target area in the source image 102 before and after data embedding is within an allowable threshold. The predetermined range can be changed according to actual needs, because different users and different application scenarios of images may have different tolerances for visual perception distortion. Therefore, different degrees of image value change during data embedding are determined based on different degrees of visual perception. As an example, if the image value of the image unit of the source image 102 ranges from 0 to 255, and the original image value of the image unit in the target area is approximately 255, then the predetermined range can be set to 10, so that the image unit can be modified from the original image value to 245 to represent another logical value.
[0055] Processing of target data during embedding
[0056] In order to further improve the robustness of data embedding, in some implementations, the data embedder 110 divides the logic value sequence of the target data 104 into multiple groups or segments. In some implementations, the data embedder 110 can also add a prefix portion to the logic value sequence of the target data 104, and the prefix portion includes one or more logic values represented in a predetermined format (e.g., binary format) to indicate the length of the logic value sequence of the target data 104. The logic value sequence of the target data 104 is the data actually desired to be embedded, and therefore can also be referred to as payload data, user data, or input data. The prefix portion can include a predetermined number of logic values (e.g., two bytes). The prefix portion can indicate the length of the logic value sequence of the target data 104 in bytes. For example, a two-byte prefix portion can indicate a logic value sequence length of up to 65535 bytes. In other examples, the prefix portion can include other numbers of logic values. In implementations that include the prefix portion, the prefix portion and the logic value sequence are divided into multiple groups together.
[0057] Each divided packet or segment includes a header portion and a payload portion. Figure 4 An example of a packet 400 divided by a sequence of logical values is shown, which is shown as including a header portion and a payload portion. The sizes of the packet, header portion, and payload portion can be preconfigured, and any number of logical values is feasible. The payload portion includes a predetermined number of logical values (this number is sometimes referred to as the "third predetermined number" in this article). In some cases, if the last packet divided does not have a sufficient number of logical values, padding bits can be used to fill the remaining space.
[0058] The header portion includes one or more fields, each field including one or more logic values that are not a sequence of logic values from the target data 104. The logic values in the header portion may be configured to indicate a header tag (in the first field), an identifier (ID) of the packet (in the second field), and / or a checksum of the payload portion, such as a cyclic redundancy check (CRC) code (in the third field). Figure 4 As shown. The header tag in the header part is used to identify the header from a series of logical values. The ID of the packet is used to identify which of the entire packets the current packet is. Multiple packets divided from the logical value sequence of the target data 104 or the logical value sequence with the prefix portion added can be numbered in sequence, and the corresponding number is indicated in the ID field of each packet. The CRC code can be determined based on the logical value of the payload part of the current packet and / or the ID of the packet. The CRC code can be used to detect whether there is an error in the payload part of the packet and / or the ID of the packet.
[0059] In some implementations, the data embedder 110 may perform error correction encoding on the logical values in the payload portion to correct subsequent extraction errors. For example, the error correction encoding of the payload may be performed using a Reed-Solomon error correction algorithm, wherein a first portion of data in the payload portion includes a logical value from the logical value sequence, and a second portion of data includes a parity check code for error correction of data of various fields in the packet (such as a packet ID, a CRC code, and / or a combination of logical values of the logical value sequence).
[0060] By segmenting and adding parity information and / or error correction information, possible errors can be confined to a single packet, avoiding error propagation on a longer logic value sequence, and error correction and data verification can also be implemented within the packet.
[0061] In some implementations, the sequence of logical values of the target data 104 or the sequence of logical values with a prefix portion can be encapsulated into multiple data blocks in a predetermined order, each data block including a certain number of logical values arranged in rows and columns. In implementations where the sequence of logical values of the target data 104 or the sequence of logical values with a prefix portion is divided into groups, the data embedder 110 can encapsulate the divided groups into multiple data blocks in sequence, and these groups carry other information in addition to the payload data. For example, in each data block, the sequence of logical values (with the prefix portion) is organized into the data blocks in a top-to-bottom and left-to-right order. Of course, other orders within the data blocks are also feasible, as long as such order follows a certain pattern. The encapsulated multiple data blocks are also embedded into the target area in a certain order to facilitate the subsequent connection of the logical values in different data blocks.
[0062] The number of logical values in a data block is sometimes referred to herein as a "first predetermined number," which can be preconfigured. As will be understood below, each data block is embedded in or mapped to an image block in the target area of the source image 102. In one aspect, the size of the data block (i.e., the number of logical values included) should not be configured to be too large, so as to avoid leaving too many small image blocks in the target area where data cannot be embedded. On the other hand, the size of the data block should also be avoided from being configured to be too small. As will be mentioned below, in addition to the payload data, the data block also includes one or more management logical values. If the size of the data block is too small, the ratio of payload to configuration information in each data block is too small, and the carrying efficiency of the payload data is too low.
[0063] In one example, the size of the data block may be a 3×3 bit data block, so each data block carries 9 bits (ie, 9 logical values), and these 9 logical bits are arranged into a data block in 3 rows and 3 columns. Figure 5An example data block 510 of 3×3 bits is shown, which includes 9 logical values arranged in rows and columns. However, it should be understood that Figure 5 Just one specific example is given, and each data block may be configured to have other sizes, such as a 4×4 bit data block, a 5×5 bit data block, a 3×4 bit data block, etc.
[0064] The multiple groups obtained from the logical value sequence can be sequentially encapsulated into multiple data blocks. Because these groups have their own identifiers, depending on the size of the group and the size of the data block, a group may be distributed across multiple data blocks, or a data block may include multiple groups. By sequentially placing the data blocks and using the identifiers of each group, the logical value sequence of the target data 104 can be recovered during data extraction, as will be seen in the detailed description of data extraction below.
[0065] The encapsulated multiple data blocks can be embedded in the target area of the source image 102. Each logical value arranged in rows and columns in the data block corresponds to a predetermined number of image cells in the target area (sometimes referred to as the "second predetermined number" in this article), so that the logical value can be indicated by the image values of these image cells, for example, by changing the image value within the predetermined range as described above to indicate the corresponding logical value. In some implementations, the second predetermined number is greater than 1, that is, each logical value can correspond to multiple image cells of the source image 102, which can enable the image embedded in the target data 104 to still correctly transmit data after being reduced. By using more image cells to indicate a single logical value, higher robustness in image scaling can be achieved. However, it will be understood that by increasing the ratio between logical values and image values, the capacity of data that can be embedded will be reduced accordingly.
[0066] Figure 5 FIG. 5 shows an image block 520 in which a data block 510 is embedded in a target area of a source image 102 during data embedding. The image block 520 includes a plurality of image units 522. Figure 5 In the example shown in FIG5 , a logic value 512 of a data block 510 is mapped to four image units 522 of an image block 520. Such a ratio ensures that the image can still be correctly decoded in theory even if it is reduced to half of its original size in both directions after embedding the data. Figure 5 This is just an example, and other ratios are also feasible. Each image unit 522 in the image block can maintain the original image value or be modified to another image value so as to transmit a corresponding logical value.
[0067] In some implementations, the data embedder 110 may construct one or more data blocks to include one or more managed logical values in addition to the logical values from the target data 104. One managed logical value (referred to as a first managed logical value) is used to indicate a correspondence between the logical values included in the data block and the image values of the image cells. For example, if the original image value of the image cell is used to indicate a logical value of "1" and the changed image value is used to indicate a logical value of "0," then the first managed logical value is a particular logical value (e.g., a logical value of "0"). If the correspondence between the logical values and the image values is reversed, then the first managed logical value is another logical value (e.g., a logical value of "1"). The correspondence between the logical values and the image values in a data block may need to be reversed in some circumstances, for example, if the logical values of a data block cause the corresponding image block to present a pattern that is difficult to distinguish between the data block and other types of information blocks (described below). In this case, the correspondence between the logical values and the image values of the data block may need to be reversed.
[0068] In addition to or as an alternative to the first management logic value, one or more data blocks may further include another management logic value (referred to as a "second management logic value") for indicating the type of at least one data block to facilitate distinguishing it from other types of information blocks (described below). When the second management logic value has two values (for example, in binary representation), one value of the second management logic value may indicate that the current block is a data block, and the other value may indicate that the current block is not a data block.
[0069] In the implementation described above, the target data 104 to be embedded is organized into multiple data blocks in various ways and embedded into the source image 102 in units of data blocks. In addition to data blocks, other information blocks can also be designed to facilitate more convenient and accurate data extraction later. In some implementations, the data embedder 110 can embed a start marker block and / or an end marker block in the target area to indicate the start and / or end of data embedding, respectively. For example, the target area in the source image 102 where data can be embedded may be composed of multiple continuous sub-areas, such as Figure 3 Multiple sub-regions 302 are shown. In some implementations, the start marker block and the end marker block can be the same size as the data block and also include multiple logical values arranged in rows and columns. These logical values can be set to specific combinations to indicate the start and end of data. The logical values of the start marker block and the end marker block can be indicated by the image values of the corresponding image cells in a similar manner, and the correspondence between logical values and image cells is the same as that of logical values in the data block.
[0070] To facilitate subsequent data extraction, the data embedder 110 may embed a start marker block, at least one data block, and an end marker block in each consecutive sub-region. The start marker block is placed before the at least one data block, and the end marker block is placed after the at least one data block. In some implementations, the data embedder 110 may place the combination of the start marker block, the data block, and the end marker block row by row or column by column in the sub-region of the target region. Figure 6A An example of arranging a start marker block, a data block, and an end marker block in a continuous sub-region 302 of a target region is shown. Figure 6A As shown, in the first row of the continuous sub-region 302, the start marker block 601-1 (indicated by "S") is first arranged, followed by a plurality of data blocks 510-1, 510-2 (indicated by "D"), and finally the end marker block 602-1 (indicated by "E") is placed. In the second row of the continuous sub-region 302, the start marker block 601-2 is placed in a similar manner, followed by a plurality of data blocks 510-3, 510-4, and finally the end marker block 602-2 is placed.
[0071] In some implementations, the start marker block and the end marker block can be set to be the same, that is, have the same size, and the values of the multiple logical values are also the same, so that the same pattern can be presented in the target area of the source image 102. In such an implementation, when extracting data, if multiple corresponding logical values are extracted from a certain image block, it can be determined by the context whether the extracted logical values indicate the beginning or the end of the data. More specifically, if the left side of the image block from which these logical values are extracted is close to the non-target area (such as the foreground area) and the right side belongs to the target area (such as the background area), then these logical values indicate the beginning of the data, and the subsequently extracted logical values correspond to the target image. If the relative positioning relationship between the image block from which these logical values are extracted and the target area is opposite, then it can be determined that these logical values indicate the end of the data.
[0072] In some implementations, in addition to placing the start marker block, data block, and end marker block row by row or column by column, the data embedder 110 may also place the start marker block, data block, and end marker block in multiple rows or columns, so that the start marker block and the end marker block mark the data blocks placed in the image area within a matrix range. Figure 6BAs shown, in the two rows of continuous sub-region 302, a start marker block 601-1 is placed at the beginning of the first row, and data blocks 510-1, 510-2, 510-3, and so on are placed in order in the first row until the end of the first row. Subsequent data blocks 510-4, 510-5, 510-6, and so on are placed in the second row. An end marker block 602-1 is placed at the end of the second row to indicate the end of the data. This placement method requires that the start marker block and the end marker block have sufficient image space in the extended area in the row and column directions for embedding the data blocks, that is, the continuous sub-region 302 is a rectangular area.
[0073] In some implementations, if the start and end of data embedding are marked by embedding a start marker block and an end marker block, the data block may not need to include the aforementioned second management logic value to indicate the data block type. This can increase the amount of data that can be embedded while ensuring data extraction accuracy.
[0074] In some implementations, if the logic value sequence of the target data 104 or the logic value sequence with the prefix portion is all embedded in the target area of the source image 102 (and the start marker block, the end marker block, or the synchronization alignment block to be described below is also embedded in the target area), and there is still an embeddable area in the target area, then data embedding can be performed again starting from the beginning of the logic value sequence. This process can continue until all available target areas have been embedded with data. In some implementations, other data may have been previously embedded in the source image 102. When determining the target area, it is possible to avoid selecting the area with embedded data as the target area (if it is not desired to overwrite the previously embedded data). In some implementations, if there are some small areas in the target area where a data block or other preset information block cannot be embedded, logical values can be randomly embedded in these areas, as long as the randomly embedded logical values are not the same as the pattern of the start marker block, the end marker block, or the synchronization alignment block to be described below.
[0075] Embedding of synchronization alignment blocks
[0076] Considering that a target image with data embedded therein, such as target image 112, may be further processed during subsequent use, such as being scaled, printed, rephotographed, or otherwise distorted or deformed, the size and viewing angle of the image may differ from the image 112 generated by the data embedder 110 during data extraction, thereby causing errors in data extraction. In some implementations, to improve robustness, when performing data embedding, the data embedder 110 further embeds one or more synchronization alignment blocks in the target area to implement image scaling and / or alignment during image extraction, thereby improving the accuracy of the data extraction results.
[0077] In one implementation, at least one coarse synchronization alignment block (sometimes also referred to as a "first synchronization alignment block") may be embedded in the target area of the source image 102. The first synchronization alignment block has a first predetermined pattern. By embedding the predetermined pattern in the source image 102, the image to be extracted data may be roughly aligned to the source image 102 (or the target image 112 with data embedded therein) during data extraction. The first predetermined pattern may be designed to have a special structure and may be defined by changing the image values of the image cells in the target area. The definition of the first predetermined pattern in the target area may be defined in a manner similar to a sequence of logical values by changing the image values of the image cells covered by the first synchronization alignment block within a predetermined range. Different logical values correspond to different image values, so a specific pattern may be presented by a combination of logical values.
[0078] Figure 7A An example of the first synchronization alignment block 710 is shown. In this example, the first synchronization alignment block 710 has a 9×9 bit structure, represented by 81 bits (logical values) arranged in rows and columns. Figure 7A In order to more clearly present the pattern and structure of the first synchronization alignment block, the image values corresponding to the logic value "0" and the logic value "1" are depicted in two distinct colors, but this does not mean that the first synchronization alignment block has such a distinct and visible visual presentation after being embedded in the source image 102. Figure 7A In the example shown in FIG, the first synchronization alignment block 710 includes a 3×3 bit structure at the center, with a logic value of "1", which can correspond to the image value in the source image 102 indicating a logic value of "1" (e.g., the changed image value in the background area). The 3×3 bit structure is surrounded by a square strip (with a width of 1 bit) corresponding to another logic value of "0", followed by a square strip (with a width of 1 bit) corresponding to the inverted logic value of "1", and finally a square strip (with a width of 1 bit) corresponding to the inverted logic value of "0". Because different logic values correspond to different image values, the first synchronization alignment block presents a corresponding pattern.
[0079] The mapping ratio and correspondence between each logic value in the first synchronization alignment block and the image block in the target area can be the same as the embedding method of the logic value of the target data 104. Of course, it is also feasible to indicate the pattern of the first synchronization alignment block in a different manner from the logic value of the target data 104. It should be understood that Figure 7A The illustrated embodiment is merely a specific example of the first synchronization alignment block. In other implementations, the first synchronization alignment block may be configured to have any other pattern, shape, size, etc., and the scope of the present disclosure is not limited in this respect.
[0080] The first synchronization alignment block can be placed in any appropriate position in the target area of the source image 102, and multiple first synchronization alignment blocks can be placed in the target area. In some implementations, multiple first synchronization alignment blocks can be placed at the edge of the target area to define the bounding box of the target area, which requires the target area to have a continuous and regular shape. In a specific implementation, multiple first synchronization alignment blocks can be placed in one or more continuous sub-areas of the target area to define the bounding box of the sub-area. Thus, during the data extraction process, if multiple first synchronization alignment blocks are determined from the image, the target area from which data can be extracted can be quickly located. In some implementations described above, the embedding position of the data block carrying the target data 104 can be located by the start marker block and the end marker block, and at this time, it is also not necessary to determine the target area for data embedding by the first synchronization alignment block. In this case, the first synchronization alignment block can be placed in any appropriate position in the target area.
[0081] The first synchronization alignment block is only used for rough image alignment. Since the area where data can be embedded varies greatly in different images, it is difficult to use multiple first synchronization alignment blocks to determine the accurate alignment and scaling of the image. In some implementations, the data embedder 110 can also embed additional fine synchronization alignment blocks in the target area of the source image 102 to perform more accurate image alignment and scaling during data extraction. Such synchronization alignment blocks are referred to as second synchronization alignment blocks in this article. Each second synchronization alignment block has a second predetermined pattern, which can also be designed to have a special structure and can be defined by changing the image value of the image unit covered by the second synchronization alignment block within a predetermined range. To avoid confusion, the predetermined pattern of the second synchronization alignment block is different from the predetermined pattern of the first synchronization alignment block. Different logical values correspond to different image values, so a specific pattern can be presented by a combination of logical values.
[0082] Figure 7B An example of the second synchronization alignment block 720 is shown. In this example, the second synchronization alignment block 720 has a 5×5 bit structure, represented by 25 bits (logical values) arranged in rows and columns. Figure 7B In order to more clearly present the pattern and structure of the second synchronization alignment block, the image values corresponding to the logic value "0" and the logic value "1" are depicted in two distinct colors, but this does not mean that the first synchronization alignment block has such a distinct and visible visual presentation after being embedded in the source image 102. Figure 7BIn the example shown in FIG. 1 , the second synchronization alignment block 720 includes a central one-bit structure having a logic value of "1," which corresponds to an image value in the source image 102 indicating a logic value of "1" (e.g., the altered image value in the background region). The central one-bit structure is surrounded by a square strip (one bit wide) corresponding to another logic value of "0," and then surrounded by a square strip (one bit wide) corresponding to the inverted logic value of "1." Because different logic values correspond to different image values, the second synchronization alignment block presents a corresponding pattern.
[0083] Multiple second synchronization alignment blocks can be embedded in any position in the target area of the source image 102. In some implementations, at least three second synchronization alignment blocks are embedded in the target area. They can be located anywhere in the target area as a whole, but their relative positions satisfy given conditions so that the data extractor 120 can accurately determine their relative distances after aligning and scaling the image 122 using the first synchronization alignment blocks. If it is desired to improve robustness, more second synchronization alignment blocks can be embedded. In some implementations, the second synchronization alignment blocks are embedded in the target area in pairs, and the distance between each two second synchronization alignment blocks in the row direction or column direction among the multiple embedded second synchronization alignment blocks is selected from a set of predetermined distances. In other words, the relative positions of each pair of synchronization alignment blocks are constrained to each other, and the distance after being embedded in the source image 102 is not determined arbitrarily, but is selected from a limited set of candidate predetermined distances.
[0084] These predetermined distances are designed so that, after the image is corrected (scaled and / or aligned) using the first synchronization alignment block, the maximum error in the distance between two second synchronization alignment blocks is less than half the difference between two relevant distances among these predetermined distances. Thus, after the image is corrected using the first synchronization alignment block, the true distance between each pair of detected synchronization alignment blocks can be determined, thereby accurately determining the scaling and / or alignment parameters for scaling and / or aligning the image from which data is to be extracted to the source image 102 (and the target image 112). By setting the distances between the second synchronization alignment blocks, the problem of being unable to accurately determine the scaling and / or alignment parameters due to various subsequent operations on the image can be resolved.
[0085] In the implementation described above, in addition to performing corresponding processing on the logical value sequence of the target data 104, some additional information blocks are embedded in the source image 102, including a start marker block, an end marker block, and coarse and / or fine synchronization alignment blocks. These information blocks (also called management blocks) can be used to improve the robustness of data embedding and extraction, and avoid data extraction errors introduced by various distortions and scaling operations that may occur during the image transmission process.
[0086] In some implementations, because these management blocks are designed to have fixed logical values or present fixed patterns, when carrying different target data 104, the logical values in some data blocks may result in the same or similar logical values or patterns as those in these management blocks, making it difficult to correctly identify the management blocks. In this case, the correspondence between the logical values and image values in the data blocks can be reversed to distinguish them from these management blocks. As discussed above, the first management logical value in the data block can be used to indicate whether the correspondence between the logical values and image values in the data block is reversed.
[0087] During the data embedding process, after determining the target region of the source image 102, the data embedder 110 may first embed the first and / or second synchronization alignment blocks into the target region, and then may sequentially embed the start marker and end marker blocks (if necessary) into the rest of the target region, and embed multiple data blocks corresponding to the target data 104 before the start marker and end marker blocks. In this way, the data embedder 110 determines the target image 112.
[0088] Further processing of the source image
[0089] In addition to embedding the target data 104 and necessary management blocks, the data embedder 110 may also perform further processing on the source image 102 to further improve the perceived quality of the obtained target image 112 and ensure the accuracy of subsequent data extraction.
[0090] In some implementations, if a target region is to be selected from the background region of the source image 102, the data embedder 110 may select the target region such that a transition region exists between the edge of the target region and the edge of the foreground region. The transition region may be configured to have a predetermined size, such as a predetermined width in the row and / or column directions. The data embedder 110 may perform a smoothing process on the transition region to transition the target region (i.e., the background region) to the foreground region. This is because, after embedding the target data 104, while significantly changing the image values of the background region is minimized, a certain degree of perceptible pattern may still be present. Visual elements (lines, shapes, objects, etc.) in the foreground region typically have a regular structure or pattern, such as the vertical edges of each bar in a bar graph. If embedding the target data 104 in the background region results in a visual pattern in the background region that connects to the foreground region, this may cause people to visually notice the background region more easily (because the background and foreground regions are not significantly different).
[0091] In order to improve the perceived quality of the target image 112 after embedding data, it may be desirable to reduce the visibility of the background area relative to the foreground area. The provision of a transition area can achieve this effect. The transition area is not used to carry data, and the image values of the image cells therein can be adjusted to present a smooth transition from the edge of the background area to the edge of the foreground area. In some implementations, such a smooth transition should also avoid being mistaken for carrying meaningful information. This can be achieved by adjusting the image values of the transition area based on the target data 104 and the logical values of each management block.
[0092] In some implementations, after embedding the target data 104 in the background area, in order to further improve the perceived quality, the data embedder 110 may also process one or more visual elements present in the foreground area of the source image 110, thereby enhancing the visibility of these foreground visual elements in the target image 112. By improving the visibility of the foreground area, the difference between the foreground area and the background area can be enhanced, which not only improves the perceived quality but also facilitates accurate distinction between the foreground and background areas during data extraction. The visibility enhancement of the foreground visual elements can be achieved by adjusting the image values of the image units corresponding to the foreground visual elements to have a greater difference from the image values of the image units in the background area. For example, after the visibility enhancement processing of the foreground area of the source image 102, the visibility of the numerical annotation lines in the obtained target image 112 is enhanced.
[0093] Data extraction
[0094] The image 112 embedded with the target data can be used as a normal image and may be further processed during subsequent use, such as being scaled, printed, rephotographed, or otherwise distorted or deformed. Regardless of any subsequent processing, the image 112 embedded with the target data or a processed version thereof can be used to extract data. The process of extracting data from an image is the inverse of the process of embedding data into an image. Figure 8 FIG. 8 is a flow chart illustrating a process 800 for extracting data from an image according to one implementation of the present disclosure. The process 800 may be performed by, for example, Figure 1 For ease of discussion, reference will be made to the data extractor 120. Figure 1 800 is described below.
[0095] At block 810, the data extractor 120 extracts the data from the target image (e.g. Figure 1The target region for data extraction is determined from a target image 122 (e.g., a target image 122 output by the data embedder 110). Target image 122 is a version of target image 112 output by the data embedder 110 and may be identical to target image 112 or may have undergone any subsequent processing. The target region determined from target image 122 is the region identified as a potential location for data embedding. Therefore, such a target region is typically a flat region in target image 122 with minimal variation in image values or may be a textured region.
[0096] In some implementations, if the background area in the image is selected as the target area for data embedding during the data embedding phase, then during the data extraction phase, the data extractor 120 can use various foreground and background segmentation techniques currently in use or to be developed in the future to divide the foreground area and background area of the target image 122, and determine the target area from the background area. More specifically, the pixel values in the target image 122 are clustered into multiple clusters. Based on the number of clusters, the image value distribution, the location of each pixel value in each cluster, and the distance between each cluster, it can be determined which clusters belong to the background cluster. By utilizing the image values in the determined background clusters, the target image 122 can be separated into the foreground area and the background area. It should be understood that various foreground and background segmentation techniques currently in use or to be developed in the future can be used to divide the foreground and background areas of the image. In some implementations, the background area is considered as a candidate area for carrying target data.
[0097] At block 820 , the data extractor 120 determines an original logic value sequence represented in a predetermined format based on the image values of the image cells in the target area. Different image values of the image cells in the target area respectively indicate different logic values in the predetermined format.
[0098] Without considering that the target image 122 may have undergone image deformation after the data is embedded (such as scaling or being recaptured at a different angle, etc.), the target area (such as the background area) can be scanned row by row and column by column to determine the logical value corresponding to the image value in the target area of the target image 122. The logical value can be determined based on a predetermined ratio of logical values to image units and a correspondence between logical values and image values when the data is embedded. This predetermined ratio and correspondence are known or negotiated by the data extractor 120 and the data embedder 110. For example, if the predetermined ratio of logical values to image units is 1:4, then the image values of four image units are used to represent one logical value. In some implementations, in order to make the data extraction more accurate, the target image 122 can be enlarged by a certain multiple (for example, two or three times), and then the original logical value sequence is determined based on the enlarged target area.
[0099] In some cases, considering that the target image 122 may have undergone image deformation after the data is embedded, it is necessary to utilize some management blocks embedded in the target area to deform the target image 122 to align with the source image 102 or the target image 112. In some implementations, the data extractor 120 attempts to find one or more first synchronization alignment blocks that may be embedded in the target area. Specifically, based on the first predetermined pattern of the first synchronization alignment block, the data extractor 120 scans the target area row by row and column by column for a first candidate pattern that has a structural feature that matches the first predetermined pattern. For example, by scanning row by row and column by column, it is found whether there is a distance ratio of 1:1:1:3:1:1:1 in the row direction and the column direction in the target area (corresponding to Figure 7A The first predetermined pattern shown in FIG. A candidate image block is formed by combining corresponding regions in the row direction and the column direction. For each candidate image block, the data extractor 120 checks structural continuity to determine whether the candidate image block matches the first predetermined pattern, thereby determining a first candidate synchronization alignment block. In some examples, there may be multiple first candidate synchronization alignment blocks.
[0100] After determining the first candidate synchronization alignment block, the data extractor 120 determines deformation parameters for deforming the first candidate pattern of the first candidate synchronization alignment block to the first predetermined pattern, that is, how to deform the first candidate pattern so that the first candidate pattern becomes similar to the first predetermined pattern (note that due to the lack of distance reference in the row and column directions, the scaling ratio from the first candidate pattern to the first predetermined pattern may not be accurately determined in terms of size). In some implementations, if there are multiple first candidate synchronization alignment blocks, multiple deformation parameters may be determined. Then, based on the mean and standard deviation of the multiple deformation parameters, candidate synchronization alignment blocks with a large difference from the mean of a probability distribution model composed of the mean and standard deviation (such as a Gaussian distribution) are excluded from the multiple first candidate synchronization alignment blocks. The mean or median of the deformation parameters corresponding to the candidate synchronization alignment blocks that are not excluded can be determined as the deformation parameters used to deform the target image 122. The deformation parameters can be used to perform a rough deformation on the target image 122, and in particular, the alignment of the target image 122 can be corrected.
[0101] In some implementations, a similar process can be used to determine multiple second candidate synchronization alignment blocks from the target area of the target image 122 corrected by the first candidate synchronization alignment blocks, wherein the second candidate synchronization alignment blocks have a second candidate pattern that matches the structural features of the second predetermined pattern. A more accurate scaling parameter for the target image 122 (i.e., the deformed target image) is determined based on a candidate distance in the row or column direction between two adjacent second candidate synchronization alignment blocks in the multiple candidate synchronization alignment blocks and a previously known allowable distance between the second synchronization alignment blocks.
[0102] By finding the first and second synchronization alignment blocks, and based on the predetermined pattern and predetermined distance of these synchronization alignment blocks, the parameters of the alignment and scaling operations to be performed on the target image 122 can be determined. As a result, the target image 122, after deformation and scaling calibration, is substantially equivalent to the target image 112 in size and viewing angle. Based on the target image 122 after deformation and scaling calibration, data extraction can be performed more accurately. In some implementations, the target image 122 can be further magnified (e.g., by a factor of two or three). As mentioned above, this can further improve the precision of the deformation and scaling calibration and the accuracy of the data extraction.
[0103] After deformation and scaling calibration, or when it is determined that deformation and scaling calibration are not required, the target area determined from the corresponding image can be used to extract the original logical value sequence. Considering the logical value embedding method of the target data during data embedding, the logical value sequence can be similarly extracted in sequence from the target area. In some implementations, the data extractor 110 first detects a start marker block from the target area, and in particular, detects the start marker block from a continuous sub-area composed of multiple image units. The combination of multiple logical values used to form the start marker block is predetermined, so the best matching image block portion can also be found from the target area using a matching method. After locating the start marker block, one or more data blocks for transmitting the target data are detected starting from after the start marker block.
[0104] Alternatively or additionally, the data extractor 110 may further detect an end marker block in the target area, in particular in a continuous sub-area. The combination of multiple logical values used to constitute the end marker block is predetermined and, as mentioned above, in some examples may be the same as the combination of multiple logical values constituting the start marker block. After detecting the end marker block, the data extractor 110 may determine one or more data blocks between the start marker block and the end marker block. In some implementations, in addition to the synchronization alignment block, the mapping between the detected start marker block and the true start marker block, and / or the detected end marker block and the true end marker block may also be used to fine-tune the position of the current block in the target image 122 after deformation and scaling calibration to correct the accumulated errors introduced during the data extraction process.
[0105] When determining each logic value in the original logic value sequence, the specific value can be determined based on the degree of change between the image value of the corresponding one or more image units relative to the original image value of the target area of the target image 122. In some implementations, the logic values included in multiple data blocks determined in sequence (for example, in the order from top to bottom and from left to right in the target area or each continuous sub-area) are sequentially connected in series to form the original logic value sequence. In some implementations, the data block may also include management logic values, such as a first management logic value for indicating the correspondence between the logic value included in the data block and the image value of the image unit, and a second management logic value for indicating the type of the data block. When performing data extraction, the data extractor 120 can also determine the value of each bit based on the first management logic value, and / or can determine whether other logic values of the data block are used to carry data based on the second management logic value.
[0106] In box 830, the data extractor 120 determines the target data to be embedded in the target image based on the original logical value sequence. In some implementations, the data extractor 120 divides the original logical value sequence into multiple groups. Each group can have a predetermined number of original logical values, and the division method is the same as the group division method when data is embedded. Each group includes a header part and a payload part. The payload part carries a certain number (a third predetermined number) of logical values, which correspond to the expected target data. As described above, the header part includes one or more logical values for indicating a header tag, an identifier of the group and / or a verification code of the payload part. The header tag of the header part can help determine how to divide the group.
[0107] The packet identifier in the header of each packet can be used to determine the concatenation order of the logical values in the payload. In some implementations, due to repeated embedding during the data embedding phase, some packets may be embedded multiple times. In this case, the data extractor 120 determines whether there are duplicate packets based on the packet identifier. If there are duplicate packets, the data extractor 120 can also determine a more accurate logical value by combining the logical values of the payload portions of the duplicate packets. Of course, if the reliability of a packet in the duplicate packets is low, it can be directly discarded.
[0108] After sequentially concatenating the logical values in the payload portion of each packet, a target logical value sequence corresponding to the target data can be determined, which can be converted into the desired target data. In some implementations, the concatenated data can be further corrected or corrected using error correction or erasure correction coding. In some implementations, depending on the data extraction situation and the subsequent processing of the target image 122, the target data extracted by the data extractor 120 may be part or all of the target data embedded by the data embedder 110. In some implementations, the prefix portion of the original logical value sequence is used to indicate the length of the target logical value sequence corresponding to the target data. This prefix portion can be used to determine whether the determined target logical value sequence is complete. In some implementations, to ensure the accuracy of the extracted data, the data extractor 120 can also perform a checksum on the logical values in the payload portion based on the checksum in the header portion of each packet, and then concatenate the checked logical values to form the target logical value sequence of the target data. The method for performing the checksum check depends on how the checksum is generated. Any suitable checksum method can be used.
[0109] Example implementation of chart images
[0110] Figure 9 FIG. 9 is a flow chart illustrating a process 900 for embedding data in an image according to one implementation of the present disclosure. The process 900 relates to a specific example of data embedding in a chart image. The process 900 may be performed by, for example, Figure 1 For ease of discussion, reference will be made to the data embedder 110. Figure 1 900 is described below.
[0111] In box 910, the data embedder 110 obtains a chart image presenting a graphical representation of data. In box 920, the data embedder 110 determines a target area in which data can be embedded from the background area of the chart image. The method of selecting the target area in the background area of the chart image can refer to one or more implementations discussed above. In box 930, the data embedder 110 embeds the target data into the determined target area, and the degree of change of the image value in the target area after the target data is embedded is determined based on the degree of impact on visual perception. The embedding of the target data can be determined, for example, by changing the image value of the image unit in the target area. The specific degree of change of the image value is expected to be controlled within a predetermined range, and can be specifically determined based on the degree of impact on the visual perception of the chart image. The specific data embedding method can also refer to one or more implementations discussed above.
[0112] Example device implementation
[0113] Figure 10 FIG1 shows a block diagram of a computing device 1000 capable of implementing various implementations of the present disclosure. Figure 1 The computing device 1000 shown is merely exemplary and should not be construed as limiting the functionality and scope of the implementations described in this disclosure. The computing device 1000 may be used to implement Figure 1 The data embedder 110 and / or data extractor 120 in FIG.
[0114] like Figure 10 As shown, computing device 1000 comprises a computing device in the form of a general-purpose computing device 1000. Components of computing device 1000 may include, but are not limited to, one or more processors or processing units 1010, memory 1020, storage device 1030, one or more communication units 1040, one or more input devices 1050, and one or more output devices 1060.
[0115] In some implementations, the computing device 1000 can be implemented as various user terminals or service terminals. The service terminal can be a server, a large computing device, etc. provided by various service providers. The user terminal is such as any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a site, a unit, a device, a multimedia computer, a multimedia tablet, an Internet node, a communicator, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a gaming device, or any combination thereof, including accessories and peripherals of these devices, or any combination thereof. It is also foreseeable that the computing device 1000 can support any type of interface for the user (such as a "wearable" circuit, etc.).
[0116] Processing unit 1010 may be a real or virtual processor and is capable of performing various processes according to a program stored in memory 1020. In a multi-processor system, multiple processing units execute computer-executable instructions in parallel to increase the parallel processing capabilities of computing device 1000. Processing unit 1010 may also be referred to as a central processing unit (CPU), a microprocessor, a controller, or a microcontroller.
[0117] The computing device 1000 typically includes a plurality of computer storage media. Such media can be any available media accessible to the computing device 1000, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 1020 can be a volatile memory (e.g., registers, cache, random access memory (RAM)), a non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 1030 can be a removable or non-removable medium and can include a machine-readable medium such as a memory, a flash drive, a disk, or any other medium that can be used to store information and / or data and can be accessed within the computing device 1000.
[0118] The computing device 1000 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 10 As shown in FIG, a magnetic disk drive for reading or writing from a removable, nonvolatile magnetic disk and an optical disk drive for reading or writing from a removable, nonvolatile optical disk can be provided. In these cases, each drive can be connected to a bus (not shown) by one or more data media interfaces.
[0119] The communication unit 1040 enables communication with other computing devices via a communication medium. Additionally, the functionality of the components of the computing device 1000 can be implemented as a single computing cluster or multiple computing machines that can communicate via a communication connection. Thus, the computing device 1000 can operate in a networked environment using logical connections to one or more other servers, personal computers (PCs), or other general network nodes.
[0120] Input device 1050 may be one or more of various input devices, such as a mouse, keyboard, trackball, voice input device, etc. Output device 1060 may be one or more output devices, such as a display, speaker, printer, etc. Computing device 1000 may also communicate with one or more external devices (not shown) via communication unit 1040 as needed, such as storage devices, display devices, etc., with one or more devices that allow a user to interact with computing device 1000, or with any device that allows computing device 1000 to communicate with one or more other computing devices (e.g., a network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0121] In some implementations, in addition to being integrated on a single device, some or all of the various components of computing device 1000 may also be configured in the form of a cloud computing architecture. In a cloud computing architecture, these components may be remotely located and may work together to implement the functionality described herein. In some implementations, cloud computing provides computing, software, data access, and storage services that do not require the end user to be aware of the physical location or configuration of the systems or hardware providing these services. In various implementations, cloud computing provides services over a wide area network (such as the Internet) using appropriate protocols. For example, a cloud computing provider provides applications over a wide area network, and these applications can be accessed through a web browser or any other computing component. The software or components of the cloud computing architecture and the corresponding data may be stored on servers at a remote location. Computing resources in a cloud computing environment may be consolidated at a remote data center location or they may be dispersed. Cloud computing infrastructure may provide services through a shared data center, even though they appear to be a single access point for users. Therefore, the components and functionality described herein may be provided by a service provider at a remote location using a cloud computing architecture. Alternatively, they may be provided from a conventional server, or they may be installed directly or otherwise on a client device.
[0122] The computing device 1000 can be used to implement automatic formatting of data tables in various implementations of the present disclosure. The memory 1020 can include one or more modules having one or more program instructions, which can be accessed and executed by the processing unit 1010 to implement the functions of various implementations described herein. For example, the memory 1020 can include a data embedding / extraction module 1022. The data embedding / extraction module 1022 can be configured to implement the data embedding and / or data extraction functions described in one or more implementations herein.
[0123] Example Implementation
[0124] Some example implementations of the present disclosure are listed below.
[0125] In a first aspect, the present disclosure provides a computer-implemented method. The method includes: determining a target region in which data can be embedded from a source image, the source image including a plurality of image cells arranged in rows and columns, and the target region including one or more flat regions or textured regions in the source image; converting the target data into a sequence of logical values represented in a predetermined format; and generating a target image having the target data embedded therein by changing an image value of at least one of the image cells in the target region within a predetermined range based on the sequence of logical values, wherein different image values of the image cells in the target region respectively indicate different logical values in the predetermined format.
[0126] In some implementations, generating a target image with target data embedded includes: packing a sequence of logic values into a plurality of data blocks in a predetermined order, each data block including a first predetermined number of logic values arranged in rows and columns; and embedding the plurality of data blocks into a target area, the logic values in each data block being indicated by image values of a second predetermined number of image units in the target area.
[0127] In some implementations, encapsulating a sequence of logical values into multiple data blocks includes: adding a prefix portion to the sequence of logical values, the prefix portion including at least one logical value represented in a predetermined format to indicate the length of the sequence of logical values; and encapsulating the prefix portion and the sequence of logical values into multiple data blocks.
[0128] In some implementations, encapsulating a sequence of logical values into multiple data blocks includes: dividing at least the sequence of logical values into multiple groups, each group including a header portion and a payload portion, the payload portion including a third predetermined number of logical values in the sequence of logical values, and the header portion including at least one logical value represented in a predetermined format to indicate at least one of the following information: a header tag, an identifier of the group, and a check code of the payload portion; and encapsulating the logical values included in the multiple groups into multiple data blocks.
[0129] In some implementations, at least one data block among the multiple data blocks also includes at least one of the following logical values: a first management logical value indicating a correspondence between the logical values included in the at least one data block and the image values of the image units, and a second management logical value indicating a type of the at least one data block.
[0130] In some implementations, the target area includes sub-areas each consisting of a plurality of consecutive image units, and embedding the plurality of data blocks into the target area includes: embedding a start marker block in the sub-area, the start marker block including a plurality of logic values arranged in rows and columns for indicating the start of data embedding in the sub-area; and embedding at least one data block of the plurality of data blocks after the start marker block.
[0131] In some implementations, embedding the plurality of data blocks into the target region further comprises: in the sub-region, embedding an end marker block after at least one of the data blocks, the end marker block comprising a plurality of logic values arranged in rows and columns to indicate the end of data embedding in the sub-region.
[0132] In some implementations, the start marker block is the same as the end marker block.
[0133] In some implementations, the method further includes embedding at least one first synchronization alignment block in the target area, each first synchronization alignment block having a first predetermined pattern, the first predetermined pattern being defined by varying image values of image cells covered by the first synchronization alignment block within a predetermined range.
[0134] In some implementations, the method further includes: embedding a plurality of second synchronization alignment blocks in the target area, each second synchronization alignment block having a second predetermined pattern, the second predetermined pattern being defined by changing the image value of the image unit covered by the second synchronization alignment block within a predetermined range, and the distance between every two adjacent second synchronization alignment blocks in the embedded plurality of second synchronization alignment blocks in the row direction or the column direction is selected from a set of predetermined distances.
[0135] In some implementations, determining the target region includes: dividing the source image into a foreground region and a background region; and selecting the target region from the background region.
[0136] In some implementations, selecting the target region from the background region includes selecting the target region from the background region such that a transition region exists between an edge of the selected target region and an edge of the foreground region. The method further includes performing a smoothing process on the transition region from the target region to the foreground region.
[0137] In some implementations, the method further includes processing the at least one visual element presented in the foreground area to enhance visibility of the at least one visual element in the target image.
[0138] In some implementations, the source image includes an image presenting a graphical representation of the data.
[0139] In a second aspect, the present disclosure provides a computer-implemented method. The method includes: determining a target region for data extraction from a target image, the target image including a plurality of image cells arranged in rows and columns, and the target region including one or more flat regions or textured regions in the target image; determining a sequence of raw logical values represented in a predetermined format based on image values of the image cells in the target region, wherein different image values of the image cells in the target region respectively indicate different logical values in the predetermined format; and determining target data to be embedded in the target image based on the sequence of raw logical values.
[0140] In some implementations, determining the original logic value sequence includes: determining a plurality of data blocks embedded in the target area by analyzing image values of image cells in the target area row by row or column by column, each data block including a first predetermined number of logic values arranged in rows and columns; and concatenating the logic values included in the plurality of data blocks in a predetermined order to determine the original logic value sequence.
[0141] In some implementations, determining target data based on an original logic value sequence includes: dividing the original logic value sequence into a plurality of groups; determining a header portion and a payload portion of corresponding groups in the plurality of groups, the payload portion of each group including a third predetermined number of logic values in the original logic value sequence, and the header portion of each group including at least one logic value represented in a predetermined format for at least indicating an identification of the group; based on the identifications of the plurality of groups, concatenating the logic values in the payload portions of the plurality of groups to obtain a target logic value sequence corresponding to the target data; and converting the target logic value sequence into target data.
[0142] In some implementations, the header portion of each packet also includes at least one logic value represented in a predetermined format, which is used to indicate a check code of the payload portion of the packet, and concatenating the logic values in the payload portions of multiple packets also includes: performing verification on the logic values in the payload portions of the multiple packets based on the check codes included in the header portions of the multiple packets; and concatenating the verified logic values into a target logic value sequence.
[0143] In some implementations, at least one data block among the multiple data blocks also includes at least one of the following logical values: a first management logical value indicating a correspondence between the logical values included in the at least one data block and the image values of the image units, and a second management logical value indicating a type of the at least one data block.
[0144] In some implementations, the target area includes sub-areas each consisting of a plurality of consecutive image units, and determining a plurality of data blocks to be embedded in the target area includes: detecting a start marker block from the sub-area based on a predetermined combination of a plurality of logic values for indicating the start of data embedding in the sub-area; and determining at least one data block among the plurality of data blocks in the sub-area following the start marker block in response to detecting the start marker block.
[0145] In some implementations, determining the multiple data blocks to be embedded in the target area further includes: detecting an end marker block from the sub-area based on a predetermined combination of multiple logical values for indicating the end of data embedding in the sub-area; and in response to detecting the end marker block, determining at least one data block from the multiple data blocks before the end marker block in the sub-area.
[0146] In some implementations, the start marker block is the same as the end marker block.
[0147] In some implementations, determining the target area includes: determining a first candidate synchronization alignment block from the target image based on a first predetermined pattern, the first candidate synchronization alignment block having a first candidate pattern that matches structural features of the first predetermined pattern; determining deformation parameters for deforming the first candidate pattern into the first predetermined pattern; performing a deformation operation on the target image based on the deformation parameters to obtain a deformed target image; and determining the target area from the deformed target image.
[0148] In some implementations, determining a target area from a deformed target image includes: determining a plurality of second candidate synchronization alignment blocks from the target image based on a second predetermined pattern, the plurality of second candidate synchronization alignment blocks having a second candidate pattern that matches structural features of the second predetermined pattern; determining a scaling parameter for the deformed target image based on a candidate distance in a row direction or a column direction between every two adjacent second candidate synchronization alignment blocks in the plurality of candidate synchronization alignment blocks and a set of predetermined distances; scaling the deformed target image based on the scaling parameter; and determining the target area from the deformed scaled target image.
[0149] In some implementations, determining the target region includes: dividing the target image into a foreground region and a background region; and determining the target region from the background region.
[0150] In some implementations, determining the target region from the background region includes determining the target region from the background region such that a transition region with a predetermined size exists between an edge of the selected target region and an edge of the foreground region.
[0151] In a third aspect, the present disclosure provides a computer-implemented method comprising: acquiring a chart image presenting a graphical representation of data; determining a target region in which data can be embedded from a background region of the chart image; and embedding the target data into the determined target region, wherein a degree of change in image values in the target region after embedding the target data is determined based on a degree of impact on visual perception.
[0152] In a fourth aspect, the present disclosure provides an electronic device. The electronic device includes: a processing unit; and a memory coupled to the processing unit and containing instructions stored thereon, which, when executed by the processing unit, cause the device to perform the following actions: determining a target area in which data can be embedded from a source image, the source image including a plurality of image cells arranged in rows and columns, and the target area including one or more flat areas or textured areas in the source image; converting the target data into a sequence of logical values represented in a predetermined format; and generating a target image with the target data embedded by changing an image value of at least one of the image cells in the target area within a predetermined range based on the sequence of logical values, wherein different image values of the image cells in the target area respectively indicate different logical values in the predetermined format.
[0153] In some implementations, generating a target image with target data embedded includes: packing a sequence of logic values into a plurality of data blocks in a predetermined order, each data block including a first predetermined number of logic values arranged in rows and columns; and embedding the plurality of data blocks into a target area, the logic values in each data block being indicated by image values of a second predetermined number of image units in the target area.
[0154] In some implementations, encapsulating a sequence of logical values into multiple data blocks includes: adding a prefix portion to the sequence of logical values, the prefix portion including at least one logical value represented in a predetermined format to indicate the length of the sequence of logical values; and encapsulating the prefix portion and the sequence of logical values into multiple data blocks.
[0155] In some implementations, encapsulating a sequence of logical values into multiple data blocks includes: dividing at least the sequence of logical values into multiple groups, each group including a header portion and a payload portion, the payload portion including a third predetermined number of logical values in the sequence of logical values, and the header portion including at least one logical value represented in a predetermined format to indicate at least one of the following information: a header tag, an identifier of the group, and a check code of the payload portion; and encapsulating the logical values included in the multiple groups into multiple data blocks.
[0156] In some implementations, at least one data block among the multiple data blocks also includes at least one of the following logical values: a first management logical value indicating a correspondence between the logical values included in the at least one data block and the image values of the image units, and a second management logical value indicating a type of the at least one data block.
[0157] In some implementations, the target area includes sub-areas each consisting of a plurality of consecutive image units, and embedding the plurality of data blocks into the target area includes: embedding a start marker block in the sub-area, the start marker block including a plurality of logic values arranged in rows and columns for indicating the start of data embedding in the sub-area; and embedding at least one data block of the plurality of data blocks after the start marker block.
[0158] In some implementations, embedding the plurality of data blocks into the target region further comprises: in the sub-region, embedding an end marker block after at least one of the data blocks, the end marker block comprising a plurality of logic values arranged in rows and columns to indicate the end of data embedding in the sub-region.
[0159] In some implementations, the start marker block is the same as the end marker block.
[0160] In some implementations, the actions further include embedding at least one first synchronization alignment block in the target area, each first synchronization alignment block having a first predetermined pattern, the first predetermined pattern being defined by varying image values of image cells covered by the first synchronization alignment block within a predetermined range.
[0161] In some implementations, the action further includes: embedding a plurality of second synchronization alignment blocks in the target area, each second synchronization alignment block having a second predetermined pattern, the second predetermined pattern being defined by changing an image value of an image unit covered by the second synchronization alignment block within a predetermined range, and a distance between every two adjacent second synchronization alignment blocks in the embedded plurality of second synchronization alignment blocks in a row direction or a column direction being selected from a set of predetermined distances.
[0162] In some implementations, determining the target region includes: dividing the source image into a foreground region and a background region; and selecting the target region from the background region.
[0163] In some implementations, selecting the target region from the background region includes selecting the target region from the background region such that a transition region exists between an edge of the selected target region and an edge of the foreground region. The method further includes performing a smoothing process on the transition region from the target region to the foreground region.
[0164] In some implementations, the actions further include processing the at least one visual element presented in the foreground area to enhance visibility of the at least one visual element in the target image.
[0165] In some implementations, the source image includes an image presenting a graphical representation of the data.
[0166] In a fifth aspect, the present disclosure provides an electronic device. The electronic device includes: a processing unit; and a memory coupled to the processing unit and containing instructions stored thereon, which, when executed by the processing unit, cause the device to perform the following actions: determining a target area for data extraction from a target image, the target image including a plurality of image cells arranged in rows and columns, and the target area including one or more flat areas or textured areas in the target image; determining a sequence of raw logical values represented in a predetermined format based on image values of the image cells in the target area, different image values of the image cells in the target area respectively indicating different logical values in the predetermined format; and determining target data to be embedded in the target image based on the sequence of raw logical values.
[0167] In some implementations, determining the original logic value sequence includes: determining a plurality of data blocks embedded in the target area by analyzing image values of image cells in the target area row by row or column by column, each data block including a first predetermined number of logic values arranged in rows and columns; and concatenating the logic values included in the plurality of data blocks in a predetermined order to determine the original logic value sequence.
[0168] In some implementations, determining target data based on an original logic value sequence includes: dividing the original logic value sequence into a plurality of groups; determining a header portion and a payload portion of corresponding groups in the plurality of groups, the payload portion of each group including a third predetermined number of logic values in the original logic value sequence, and the header portion of each group including at least one logic value represented in a predetermined format for at least indicating an identification of the group; based on the identifications of the plurality of groups, concatenating the logic values in the payload portions of the plurality of groups to obtain a target logic value sequence corresponding to the target data; and converting the target logic value sequence into target data.
[0169] In some implementations, the header portion of each packet also includes at least one logic value represented in a predetermined format, which is used to indicate a check code of the payload portion of the packet, and concatenating the logic values in the payload portions of multiple packets also includes: performing verification on the logic values in the payload portions of the multiple packets based on the check codes included in the header portions of the multiple packets; and concatenating the verified logic values into a target logic value sequence.
[0170] In some implementations, at least one data block among the multiple data blocks also includes at least one of the following logical values: a first management logical value indicating a correspondence between the logical values included in the at least one data block and the image values of the image units, and a second management logical value indicating a type of the at least one data block.
[0171] In some implementations, the target area includes sub-areas each consisting of a plurality of consecutive image units, and determining a plurality of data blocks to be embedded in the target area includes: detecting a start marker block from the sub-area based on a predetermined combination of a plurality of logic values for indicating the start of data embedding in the sub-area; and determining at least one data block among the plurality of data blocks in the sub-area following the start marker block in response to detecting the start marker block.
[0172] In some implementations, determining the multiple data blocks to be embedded in the target area further includes: detecting an end marker block from the sub-area based on a predetermined combination of multiple logical values for indicating the end of data embedding in the sub-area; and in response to detecting the end marker block, determining at least one data block from the multiple data blocks before the end marker block in the sub-area.
[0173] In some implementations, the start marker block is the same as the end marker block.
[0174] In some implementations, determining the target area includes: determining a first candidate synchronization alignment block from the target image based on a first predetermined pattern, the first candidate synchronization alignment block having a first candidate pattern that matches structural features of the first predetermined pattern; determining deformation parameters for deforming the first candidate pattern into the first predetermined pattern; performing a deformation operation on the target image based on the deformation parameters to obtain a deformed target image; and determining the target area from the deformed target image.
[0175] In some implementations, determining a target area from a deformed target image includes: determining a plurality of second candidate synchronization alignment blocks from the target image based on a second predetermined pattern, the plurality of second candidate synchronization alignment blocks having a second candidate pattern that matches structural features of the second predetermined pattern; determining a scaling parameter for the deformed target image based on a candidate distance in a row direction or a column direction between every two adjacent second candidate synchronization alignment blocks in the plurality of candidate synchronization alignment blocks and a set of predetermined distances; scaling the deformed target image based on the scaling parameter; and determining the target area from the deformed scaled target image.
[0176] In some implementations, determining the target region includes: dividing the target image into a foreground region and a background region; and determining the target region from the background region.
[0177] In some implementations, determining the target region from the background region includes determining the target region from the background region such that a transition region with a predetermined size exists between an edge of the selected target region and an edge of the foreground region.
[0178] In a sixth aspect, the present disclosure provides an electronic device. The electronic device includes: a processing unit; and a memory coupled to the processing unit and containing instructions stored therein, which, when executed by the processing unit, cause the device to perform the following actions: acquire a chart image presenting a graphical representation of data; determine a target region in which data can be embedded from a background region of the chart image; and embed target data in the determined target region, wherein a degree of change in an image value in the target region after the embedding of the target data is determined based on a degree of impact on visual perception.
[0179] In a seventh aspect, the present disclosure provides a computer program product tangibly stored in a non-transitory computer storage medium and comprising machine-executable instructions that, when executed by a device, cause the device to perform the method of the first, second or third aspect.
[0180] In an eighth aspect, the present disclosure provides a computer-readable medium having machine-executable instructions stored thereon, which, when executed by a device, causes the device to perform the method of the above aspects.
[0181] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), and the like.
[0182] The program code for implementing the method of the present disclosure can be written in any combination of one or more programming languages. These program codes 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 chart and / or block diagram 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.
[0183] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, 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), 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 foregoing.
[0184] In addition, although each operation is described in a specific order, this should be understood as requiring such operation to be performed in the specific order shown or in a sequential order, or requiring that all illustrated operations should be performed to obtain the desired result. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate implementation can also be implemented in a single implementation in combination. On the contrary, the various features described in the context of a single implementation can also be implemented in multiple implementations individually or in any suitable sub-combination mode.
[0185] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A computer-implemented method comprising: A target area in which data may be embedded is determined from a source image, the source image comprising a plurality of image cells arranged in rows and columns, and the target area comprising: One or more flat or textured regions in the source image; and A sub-region having a plurality of consecutive image units; Converting target data into a sequence of logical values represented in a predetermined format; Packing the sequence of logic values into a plurality of data blocks in a predetermined order, each data block including a first predetermined number of logic values arranged in rows and columns; embedding a start marker block in the sub-region, wherein the start marker block includes a plurality of logic values arranged in rows and columns and is used to indicate the start of data embedding in the sub-region; embedding at least one data block among the plurality of data blocks after the start marker block; embedding an end marker block after the at least one data block in the sub-region, the end marker block including a plurality of logic values arranged in rows and columns to indicate an end of embedding of data in the sub-region; and A target image having the sub-area embedded therein is generated by changing the image value of at least one of the image cells of the target area within a predetermined range based on the logic value sequence, wherein different image values of the image cells in the target area respectively indicate different logic values in the predetermined format. 2 . The method according to claim 1 , wherein the logic value in each embedded data block is indicated by image values of a second predetermined number of image cells in the target area.
3. The method of claim 1 , wherein packaging the sequence of logic values into the plurality of data blocks comprises: adding a prefix portion to the logic value sequence, the prefix portion including at least one logic value represented in the predetermined format to indicate a length of the logic value sequence; as well as The prefix portion and the logic value sequence are encapsulated into the plurality of data blocks.
4. The method of claim 1 , wherein packing the sequence of logic values into the plurality of data blocks comprises: dividing at least the sequence of logic values into a plurality of packets, each packet comprising a header portion and a payload portion, the payload portion comprising a third predetermined number of logic values in the sequence of logic values, and the header portion comprising at least one logic value represented in the predetermined format to indicate at least one of the following information: a header tag, an identification of the packet, and a check code of the payload portion; as well as The logic values included in the plurality of packets are encapsulated into the plurality of data blocks.
5. The method of claim 1 , wherein at least one of the plurality of data blocks further comprises at least one of the following logical values: a first management logic value indicating a correspondence between a logic value included in the at least one data block and an image value of an image unit, and A second management logic value indicates a type of the at least one data block.
6. The method according to claim 1, further comprising: At least one first synchronization alignment block is embedded in the target area, each first synchronization alignment block has a first predetermined pattern, and the first predetermined pattern is defined by changing the image value of the image unit covered by the first synchronization alignment block within the predetermined range.
7. The method according to claim 1, further comprising: A plurality of second synchronization alignment blocks are embedded in the target area, each second synchronization alignment block having a second predetermined pattern, the second predetermined pattern being defined by changing the image value of the image unit covered by the second synchronization alignment block within the predetermined range, and the distance between each two adjacent second synchronization alignment blocks in the row direction or column direction among the plurality of embedded second synchronization alignment blocks is selected from a set of predetermined distances.
8. The method of claim 1 , wherein determining the target area comprises: Dividing the source image into a foreground area and a background area; as well as The target area is selected from the background area.
9. The method of claim 8, wherein selecting the target area from the background area comprises: selecting the target area from the background area so that there is a transition area between an edge of the selected target area and an edge of the foreground area, The method further comprises: performing a smoothing process on the transition area from the target area to the foreground area.
10. The method according to claim 8, further comprising: At least one visual element presented in the foreground area is processed to enhance visibility of the at least one visual element in the target image. The method according to claim 1 , wherein the source image is a chart image.
12. A computer-implemented method comprising: A target region for data extraction is determined from a target image, the target image including a plurality of image cells arranged in rows and columns, and the target region including: One or more flat regions or textured regions in the target image; and A sub-region having a plurality of consecutive image units; determining an original logic value sequence represented in a predetermined format based on image values of image cells in the target area, wherein different image values of the image cells in the target area respectively indicate different logic values in the predetermined format; Packing the sequence of logic values into a plurality of data blocks in a predetermined order, each data block including a first predetermined number of logic values arranged in rows and columns; embedding a start marker block in the sub-region, wherein the start marker block includes a plurality of logic values arranged in rows and columns and is used to indicate the start of data embedding in the sub-region; embedding at least one data block among the plurality of data blocks after the start marker block; embedding an end marker block after the at least one data block in the sub-region, the end marker block including a plurality of logic values arranged in rows and columns to indicate an end of embedding of data in the sub-region; and Target data embedded in the target image is determined based on the original logic value sequence.
13. The method according to claim 12, further comprising: The logic values included in the plurality of data blocks are concatenated in a predetermined order to determine the original logic value sequence.
14. The method of claim 13, wherein determining a plurality of data blocks embedded in the target area comprises: Detecting the start marker block; as well as In response to detecting the start marker block, at least one data block among the plurality of data blocks is determined in the sub-region after the start marker block.
15. The method of claim 12, wherein determining the target area comprises: determining a first candidate synchronization alignment block from the target image based on a first predetermined pattern, wherein the first candidate synchronization alignment block has a first candidate pattern that matches a structural feature of the first predetermined pattern; determining deformation parameters for deforming the first candidate pattern into the first predetermined pattern; performing a deformation operation on the target image based on the deformation parameters to obtain a deformed target image; as well as The target area is determined from the deformed target image.
16. The method according to claim 15, wherein determining the target area from the deformed target image comprises: determining a plurality of second candidate synchronization alignment blocks from the target image based on a second predetermined pattern, wherein the plurality of second candidate synchronization alignment blocks have a second candidate pattern that matches a structural feature of the second predetermined pattern; determining a scaling parameter for the deformed target image based on a candidate distance in a row direction or a column direction between every two adjacent second candidate synchronization alignment blocks in the plurality of second candidate synchronization alignment blocks and a set of predetermined distances; scaling the deformed target image based on the scaling parameter; as well as The target region is determined from the deformed scaled target image.
17. An electronic device comprising: processing unit; as well as A memory is coupled to the processing unit and contains instructions stored thereon, which, when executed by the processing unit, cause the apparatus to perform the method of claim 1.
Citation Information
Patent Citations
Electronic watermark embedding apparatus and electronic watermark detection apparatus
CN101155249A
Common buffer for multiple streams and control registers in an MPEG-2 compliant transport register
US6181706B1