Image processing method, electronic device, and storage medium
Patent Information
- Application Number
- PCT/CN2026/089530
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-04-14
- Filing Date
- 2026-04-09
- Publication Date
- 2026-10-22
Smart Images

Figure CN2026089530_22102026_PF_FP_ABST
Abstract
Description
An image processing method, an electronic device, and a storage medium
[0001] This application claims priority to Chinese Patent Application No. 202510466395.2, filed on April 14, 2025, entitled "A Method for Image Processing, Electronic Device and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application belongs to the field of data processing technology, and in particular relates to an image processing method, electronic device and storage medium. Background Technology
[0003] Images, as one of the main carriers of existing multimedia data, are used in all aspects of daily life and work. For example, when users browse content that interests them, they can share or record the content by taking a screenshot. In order to improve the ability for users to retrieve the page corresponding to the screenshot later, existing image processing technology generally adds a QR code image corresponding to the page to the screenshot when the user takes a screenshot of a page. That is, the screenshot includes the content of the page and the added QR code content, so that users can jump to the page later by scanning the QR code.
[0004] However, the QR code occupies part of the display area, which affects the proportion of effective content in the screenshot, reduces the visibility of the page content in the screenshot, and in some scenarios, the QR code may even obscure part of the content in the screenshot, thus affecting the user experience. Summary of the Invention
[0005] This application provides an image processing method, electronic device, and storage medium that can solve the problem that existing image processing technologies require the use of QR codes that occupy visible controls when adding page access links to images, which reduces the visibility of page content and the proportion of effective content in the screenshot.
[0006] In a first aspect, embodiments of this application provide an image processing method, including:
[0007] Display the first page;
[0008] In response to a first operation for triggering a screenshot, a second screenshot is acquired; the second screenshot includes a first channel and a second channel; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page; the first channel and the second channel are different channels; the first identifier is used to indicate whether the second screenshot carries the access link.
[0009] The embodiments of this application have the following beneficial effects: When a first operation is received to take a screenshot of the first page currently displayed on the electronic device, a first screenshot corresponding to the first page and an access link corresponding to the first page can be obtained. By adjusting the first pixel value of the first screenshot in the first channel, a first identifier is carried in the third pixel value of the second screenshot in the first channel. By adjusting the second pixel value of the first screenshot in the second channel, a second bit sequence corresponding to the access link is carried in the fourth pixel value of the second screenshot in the second channel. Since the second screenshot carries the first identifier and the access link in the pixel values of the two channels, when the first page needs to be displayed through the second screenshot, the electronic device can first determine the first identifier based on the third pixel value of the second screenshot in the first channel. If it is determined that the second screenshot carries an access link based on the first identifier, the access link is then determined based on the fourth pixel value of the second screenshot in the second channel, and the first page is displayed according to the access link. Compared to existing link embedding techniques, this embodiment can embed the first identifier and the access link into the second screenshot by adjusting the pixel values of different channels. This implicitly carries the first identifier and the access link in the screenshot without occupying the visible area. In other words, the embedded access link is invisible to the user, thereby increasing the proportion of effective content in the screenshot and maintaining the visibility of the first page content. On the other hand, hierarchical encoding is achieved through pixel values of different channels. Subsequently, the first pixel value of the first channel can be parsed first. If the access link is identified in the screenshot based on the determined first identifier, subsequent parsing operations can be performed. This improves the efficiency of image parsing, thereby reducing unnecessary parsing operations and reducing the consumption of device computing resources.
[0010] In one possible implementation of the first aspect, the second screenshot includes a plurality of first image regions within the first channel; the third pixel value of each of the plurality of first image regions in the first channel is used to carry a first bit value of a bit in the first bit sequence;
[0011] The second screenshot includes multiple second image regions within the second channel; the fourth pixel value of each of the multiple second image regions in the second channel is used to carry the second bit value of one bit in the second bit sequence.
[0012] In one possible implementation of the first aspect, acquiring the second screenshot in response to the first operation for triggering the screenshot includes:
[0013] In response to the first operation, a first screenshot is obtained;
[0014] Based on the first bit value that the first image region needs to carry, adjust the first pixel value of each first image region in the first channel of the first screenshot, and based on the second bit value that the second image region needs to carry, adjust the second pixel value of each second image region in the second channel of the first screenshot to obtain the second screenshot.
[0015] In one possible implementation of the first aspect, the first image region includes a first partition and a second partition;
[0016] The step of adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first bit value that the first image region needs to carry includes:
[0017] For any of the first image regions, a first feature value corresponding to the first partition is calculated based on the first pixel value of the first partition in the first channel, and a second feature value corresponding to the second partition is calculated based on the first pixel value of the second partition in the first channel.
[0018] Based on the first feature value, the second feature value, and the first bit value that the first image region needs to carry, adjust the first pixel value of each of the first image regions in the first channel of the first screenshot.
[0019] In one possible implementation of the first aspect, the first feature value includes: a first total gray level and a first gray level extreme value; the second feature value includes: a second total gray level and a second gray level extreme value;
[0020] The step of adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first feature value, the second feature value, and the first bit value that the first image region needs to carry includes:
[0021] Based on the first gray level and the second gray level, calculate the average partition deviation of the first image region in the first channel;
[0022] Based on the first gray-level extreme value and the second gray-level extreme value, calculate the first depth parameter of the first image region in the first channel;
[0023] If the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, the first pixel value of each first pixel in the first channel in the first partition is increased and the first pixel value of each first pixel in the second partition in the first channel is decreased, and the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel is returned to be executed.
[0024] If the first bit value that the first image region needs to carry is the first value, and the sum of the partitioning deviation and the first depth parameter is less than 0, then the first pixel value of each first pixel in the first partition and the second partition in the first channel is maintained.
[0025] If the first bit value that the first image region needs to carry is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, then based on the first step length, reduce the first pixel value of each first pixel in the first channel of the first partition and increase the first pixel value of each first pixel in the first channel of the second partition, and return to execute the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel;
[0026] If the first bit value that the first image region needs to carry is the second value, and the difference between the partition deviation and the first depth parameter is greater than 0, then the first pixel value of each first pixel in the first partition and the second partition in the first channel is maintained.
[0027] In one possible implementation of the first aspect, the first step length is determined based on the difference between the mean of the partition deviation and the first depth parameter.
[0028] In one possible implementation of the first aspect, adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first bit value that the first image region needs to carry includes:
[0029] A first frequency domain matrix corresponding to the first image region is generated based on the first pixel value of each first pixel in the first channel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point.
[0030] Calculate the frequency domain difference between the first frequency point and the second frequency point;
[0031] If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is less than a preset second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix.
[0032] If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is greater than the second depth parameter, then based on the preset second step size, the first frequency domain value of the first frequency point is reduced and the second frequency domain value of the second frequency point is increased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned.
[0033] If the first bit value that the first image region needs to carry is the second value, and the frequency domain difference is greater than the second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix.
[0034] If the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, the first frequency domain value of the first frequency point is increased and the second frequency domain value of the second frequency point is decreased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned.
[0035] In one possible implementation of the first aspect, calculating the frequency domain difference between the first frequency point and the second frequency point includes:
[0036] Based on the frequency domain values corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix, a first frequency point is determined from the first frequency point group; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0037] Based on the first position of the first frequency point in the first frequency point group, the second frequency point is determined from the second frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0038] In one possible implementation of the first aspect, the second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
[0039] In one possible implementation of the first aspect, the plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
[0040] In one possible implementation of the first aspect, the first bit sequence is generated based on the first identifier and the region size.
[0041] In one possible implementation of the first aspect, the second bit sequence is obtained by redundantly encoding the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
[0042] In one possible implementation of the first aspect, acquiring the second screenshot in response to the first operation for triggering the screenshot includes:
[0043] In response to the first operation, the original screenshot is displayed;
[0044] In response to the editing operation, the original screenshot is edited to obtain the first screenshot.
[0045] In one possible implementation of the first aspect, the first channel is a blue channel; the second channel is a red channel.
[0046] In one possible implementation of the first aspect, the second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
[0047] In a second aspect, an image processing apparatus includes:
[0048] The page display unit is used to display the first page;
[0049] A screenshot acquisition unit is configured to acquire a second screenshot in response to a first operation that triggers a screenshot. The second screenshot includes a first channel and a second channel. The third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier. The fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page. The first channel and the second channel are different channels. The first identifier is used to indicate whether the second screenshot carries the access link.
[0050] In one possible implementation of the second aspect, the second screenshot includes a plurality of first image regions within the first channel; the third pixel value of each of the plurality of first image regions in the first channel is used to carry a first bit value of a bit in the first bit sequence;
[0051] The second screenshot includes multiple second image regions within the second channel; the fourth pixel value of each of the multiple second image regions in the second channel is used to carry the second bit value of one bit in the second bit sequence.
[0052] In one possible implementation of the second aspect, the screenshot acquisition unit includes:
[0053] The first screenshot acquisition unit is used to acquire a first screenshot in response to the first operation;
[0054] The pixel adjustment unit is configured to adjust the first pixel value of each first image region in the first channel of the first screenshot according to the first bit value that the first image region needs to carry, and to adjust the second pixel value of each second image region in the second channel of the first screenshot according to the second bit value that the second image region needs to carry, so as to obtain the second screenshot.
[0055] In one possible implementation of the second aspect, the first image region includes a first partition and a second partition;
[0056] The pixel adjustment unit includes:
[0057] The feature value calculation unit is configured to, for any first image region, calculate a first feature value corresponding to the first partition in the first channel based on the first pixel value of the first partition, and calculate a second feature value corresponding to the second partition in the first channel based on the first pixel value of the second partition.
[0058] The feature value adjustment unit is used to adjust the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first feature value, the second feature value and the first bit value that the first image region needs to carry.
[0059] In one possible implementation of the second aspect, the first feature value includes: a first total gray level and a first extreme gray level; the second feature value includes: a second total gray level and a second extreme gray level.
[0060] The feature value adjustment unit includes:
[0061] The mean calculation unit is used to calculate the mean partitioning deviation of the first image region in the first channel based on the first total gray level and the second total gray level.
[0062] The first depth parameter calculation unit is used to calculate the first depth parameter of the first image region in the first channel based on the first gray-level extreme value and the second gray-level extreme value.
[0063] The first determination unit is configured to, if the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, increase the first pixel value of each first pixel in the first channel of the first partition and decrease the first pixel value of each first pixel in the second partition in the first channel, and return to execute the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel;
[0064] The second determination unit is used to maintain the first pixel value of each first pixel in the first channel of the first partition and the second partition if the first bit value to be carried by the first image region is the first value and the sum of the partition deviation and the first depth parameter is less than 0.
[0065] The third determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, reduce the first pixel value of each first pixel in the first channel of the first partition and increase the first pixel value of each first pixel in the second partition in the first channel based on the first step length, and return to perform the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel;
[0066] The fourth determination unit is used to maintain the first pixel value of each first pixel in the first channel of the first partition and the second partition if the first bit value to be carried by the first image region is the second value and the difference between the partition deviation and the first depth parameter is greater than 0.
[0067] In one possible implementation of the second aspect, the first step length is determined based on the difference between the mean of the partition deviation and the first depth parameter.
[0068] In one possible implementation of the second aspect, the pixel adjustment unit includes:
[0069] The first frequency domain matrix generation unit is configured to generate a first frequency domain matrix corresponding to the first image region based on the first pixel value of each first pixel in the first channel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point.
[0070] A frequency domain difference calculation unit is used to calculate the frequency domain difference between the first frequency point and the second frequency point;
[0071] The fifth determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is a first value and the frequency domain difference is less than a preset second depth parameter.
[0072] The sixth determination unit is used to reduce the first frequency domain value of the first frequency point and increase the second frequency domain value of the second frequency point based on a preset second step size if the first bit value to be carried by the first image region is a first value and the frequency domain difference is greater than the second depth parameter, and then return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0073] The seventh determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is the second value and the frequency domain difference is greater than the second depth parameter.
[0074] The eighth determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, increase the first frequency domain value of the first frequency point and decrease the second frequency domain value of the second frequency point, and return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0075] In one possible implementation of the second aspect, the frequency domain difference calculation unit includes:
[0076] The first frequency point determination unit is used to determine a first frequency point from the first frequency point group based on the frequency domain value corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0077] The second frequency point determination unit is used to determine the second frequency point from the second frequency point group based on the first position of the first frequency point in the first frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0078] In one possible implementation of the second aspect, the second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
[0079] In one possible implementation of the second aspect, the plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
[0080] In one possible implementation of the second aspect, the first bit sequence is generated based on the first identifier and the region size.
[0081] In one possible implementation of the second aspect, the second bit sequence is obtained by redundantly encoding the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
[0082] In one possible implementation of the second aspect, the screenshot acquisition unit includes:
[0083] The original screenshot display unit is used to display the original screenshot in response to the first operation;
[0084] The screenshot editing unit is used to perform image editing on the original screenshot in response to the editing operation to obtain the first screenshot.
[0085] In one possible implementation of the second aspect, the first channel is a blue channel; the second channel is a red channel.
[0086] In one possible implementation of the second aspect, the second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
[0087] Thirdly, embodiments of this application provide an image processing method, including:
[0088] Display the first page;
[0089] In response to a first operation for triggering a screenshot, a second screenshot is acquired; the second screenshot includes a first encoded region and a second encoded region; the third pixel value of the second screenshot in the first encoded region is obtained by adjusting the first pixel value in the first encoded region of the first screenshot corresponding to the first page according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second encoded region is obtained by adjusting the second pixel value of the first screenshot in the second encoded region according to the second bit sequence corresponding to the access link corresponding to the first page; the first encoded region and the second encoded region are different regions in the second screenshot; the first identifier is used to indicate whether the second screenshot carries an access link.
[0090] The embodiments of this application have the following beneficial effects: When a first operation is received to take a screenshot of the first page currently displayed on the electronic device, a first screenshot corresponding to the first page and an access link corresponding to the first page can be obtained. By adjusting the first pixel value of the first screenshot in the first encoding area, a first identifier is carried in the third pixel value of the second screenshot in the first encoding area. By adjusting the second pixel value of the first screenshot in the second encoding area, a second bit sequence corresponding to the access link is carried in the fourth pixel value of the second screenshot in the second encoding area. Since the second screenshot carries the first identifier and the access link through the pixel values of two different encoding areas, when the first page needs to be displayed through the second screenshot, the electronic device can first determine the first identifier based on the third pixel value of the second screenshot in the first encoding area. If it is determined that the second screenshot carries an access link based on the first identifier, the access link is then determined based on the fourth pixel value of the second screenshot in the second encoding area, and the first page is displayed according to the access link. Compared to existing link embedding techniques, this embodiment can embed the first identifier and the access link into the second screenshot by adjusting the pixel values of different encoding regions. This implicitly carries the first identifier and the access link in the screenshot without occupying the visible area, meaning the embedded access link is invisible to the user. This increases the proportion of effective content in the screenshot while maintaining the visibility of the first page content. Furthermore, by implementing hierarchical encoding through pixel values of different encoding regions, subsequent analysis can be performed by first parsing the first pixel value of the first encoding region. If the access link is identified in the screenshot based on the determined first identifier, subsequent analysis operations can be performed, improving image analysis efficiency, reducing unnecessary analysis operations, and minimizing the use of device computing resources.
[0091] In one possible implementation of the third aspect, the second screenshot includes a plurality of first image regions within the first encoded region; the third pixel value of the third pixel in each of the plurality of first image regions is used to carry the first bit value of a bit in the first bit sequence;
[0092] The second screenshot includes multiple second image regions within the second encoding region; the fourth pixel value of the fourth pixel in each of the multiple second image regions is used to carry the second bit value of a bit in the second bit sequence.
[0093] In one possible implementation of the third aspect, the step of acquiring the second screenshot in response to the first operation for triggering the screenshot includes:
[0094] In response to the first operation, a first screenshot is obtained;
[0095] Based on the first bit value that the first image region needs to carry, adjust the first pixel value of each first image region in the first encoding region of the first screenshot, and based on the second bit value that the second image region needs to carry, adjust the second pixel value of each second image region in the second encoding region of the first screenshot, so as to obtain the second screenshot.
[0096] In one possible implementation of the third aspect, the first image region includes a first partition and a second partition;
[0097] The step of adjusting the first pixel value of each of the first image regions within the first encoding region of the first screenshot according to the first bit value that the first image region needs to carry includes:
[0098] For any of the first image regions, a first feature value corresponding to the first partition is calculated based on the first pixel value of the first pixel in the first partition, and a second feature value corresponding to the second partition is calculated based on the first pixel value of the first pixel in the second partition.
[0099] Based on the first feature value, the second feature value, and the first bit value that the first image region needs to carry, adjust the first pixel value of the first pixel in each of the first image regions within the first encoding region of the first screenshot.
[0100] In one possible implementation of the third aspect, the first feature value includes: a first total gray level and a first gray level extreme value; the second feature value includes: a second total gray level and a second gray level extreme value;
[0101] The step of adjusting the first pixel value of the first pixel in each of the first image regions within the first encoding region of the first screenshot, based on the first feature value, the second feature value, and the first bit value that the first image region needs to carry, includes:
[0102] Calculate the mean partition deviation of the first image region based on the first total gray level and the second total gray level;
[0103] Calculate the first depth parameter of the first image region based on the first gray-level extreme value and the second gray-level extreme value;
[0104] If the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, the first pixel value of each first pixel in the first partition is increased and the first pixel value of each first pixel in the second partition is decreased, and the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first pixel in the first partition, and calculating the second feature value corresponding to the second partition based on the first pixel value of the first pixel in the second partition is returned;
[0105] If the first bit value that the first image region needs to carry is the first value, and the sum of the partitioning deviation and the first depth parameter is less than 0, then the first pixel value of each first pixel in the first partition and the second partition is maintained.
[0106] If the first bit value that the first image region needs to carry is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, then based on the first step length, the first pixel value of each first pixel in the first partition is reduced and the first pixel value of each first pixel in the second partition is increased, and the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first pixel in the first partition, and calculating the second feature value corresponding to the second partition based on the first pixel value of the first pixel in the second partition is returned;
[0107] If the first bit value that the first image region needs to carry is the second value, and the difference between the partition deviation and the first depth parameter is greater than 0, then the first pixel value of each first pixel in the first partition and the second partition is maintained.
[0108] In one possible implementation of the third aspect, the first step length is determined based on the difference between the mean of the partition deviation and the first depth parameter.
[0109] In one possible implementation of the third aspect, adjusting the first pixel values of each of the first image regions within the first encoding region of the first screenshot according to the first bit value that the first image region needs to carry includes:
[0110] A first frequency domain matrix corresponding to the first image region is generated based on the first pixel value of each first pixel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point.
[0111] Calculate the frequency domain difference between the first frequency point and the second frequency point;
[0112] If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is less than a preset second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix.
[0113] If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is greater than the second depth parameter, then based on the preset second step size, the first frequency domain value of the first frequency point is reduced and the second frequency domain value of the second frequency point is increased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned.
[0114] If the first bit value that the first image region needs to carry is the second value, and the frequency domain difference is greater than the second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix.
[0115] If the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, the first frequency domain value of the first frequency point is increased and the second frequency domain value of the second frequency point is decreased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned.
[0116] In one possible implementation of the third aspect, calculating the frequency domain difference between the first frequency point and the second frequency point includes:
[0117] Based on the frequency domain values corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix, a first frequency point is determined from the first frequency point group; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0118] Based on the first position of the first frequency point in the first frequency point group, the second frequency point is determined from the second frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0119] In one possible implementation of the third aspect, the second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
[0120] In one possible implementation of the third aspect, the plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
[0121] In one possible implementation of the third aspect, the first bit sequence is generated based on the first identifier and the region size.
[0122] In one possible implementation of the third aspect, the second bit sequence is obtained by redundant encoding of the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
[0123] In one possible implementation of the third aspect, the step of acquiring the second screenshot in response to the first operation for triggering the screenshot includes:
[0124] In response to the first operation, the original screenshot is displayed;
[0125] In response to the editing operation, the original screenshot is edited to obtain the first screenshot.
[0126] In one possible implementation of the third aspect, the first encoding region is the top and / or bottom region of the second screenshot; the second encoding region is other regions in the second screenshot besides the first encoding region.
[0127] In one possible implementation of the third aspect, the second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
[0128] Fourthly, an image processing apparatus, comprising:
[0129] The page display unit is used to display the first page;
[0130] A screenshot acquisition unit is configured to acquire a second screenshot in response to a first operation that triggers a screenshot. The second screenshot includes a first encoded region and a second encoded region. The third pixel value of the second screenshot in the first encoded region is obtained by adjusting the first pixel value in the first encoded region of the first screenshot corresponding to the first page according to the first bit sequence corresponding to the first identifier. The fourth pixel value of the second screenshot in the second encoded region is obtained by adjusting the second pixel value in the second encoded region of the first screenshot according to the second bit sequence corresponding to the access link corresponding to the first page. The first encoded region and the second encoded region are different regions in the second screenshot. The first identifier is used to indicate whether the second screenshot carries an access link.
[0131] In one possible implementation of the fourth aspect, the second screenshot includes a plurality of first image regions within the first encoded region; the third pixel value of the third pixel in each of the plurality of first image regions is used to carry the first bit value of a bit in the first bit sequence;
[0132] The second screenshot includes multiple second image regions within the second encoding region; the fourth pixel value of the fourth pixel in each of the multiple second image regions is used to carry the second bit value of a bit in the second bit sequence.
[0133] In one possible implementation of the fourth aspect, the screenshot acquisition unit includes:
[0134] The first screenshot acquisition unit is used to acquire a first screenshot in response to the first operation;
[0135] A pixel adjustment unit is configured to adjust the first pixel value of each first image region in the first encoding area of the first screenshot according to the first bit value that the first image region needs to carry, and to adjust the second pixel value of each second image region in the second encoding area of the first screenshot according to the second bit value that the second image region needs to carry, so as to obtain the second screenshot.
[0136] In one possible implementation of the fourth aspect, the first image region includes a first partition and a second partition;
[0137] The pixel adjustment unit includes:
[0138] The feature value calculation unit is used to calculate a first feature value corresponding to the first partition based on the first pixel value of the first pixel in the first partition for any first image region, and to calculate a second feature value corresponding to the second partition based on the first pixel value of the first pixel in the second partition.
[0139] The feature value adjustment unit is used to adjust the first pixel value of the first pixel in each of the first image regions of the first screenshot within the first encoding region according to the first feature value, the second feature value, and the first bit value that the first image region needs to carry.
[0140] In one possible implementation of the fourth aspect, the first feature value includes: a first total gray level and a first gray level extreme value; the second feature value includes: a second total gray level and a second gray level extreme value;
[0141] The feature value adjustment unit includes:
[0142] The mean calculation unit is used to calculate the mean partitioning deviation of the first image region based on the first total gray level and the second total gray level.
[0143] The first depth parameter calculation unit is used to calculate the first depth parameter of the first image region based on the first gray-level extreme value and the second gray-level extreme value.
[0144] The first determination unit is configured to, if the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, increase the first pixel value of each first pixel in the first partition and decrease the first pixel value of each first pixel in the second partition, and return to execute the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first pixel in the first partition, and calculating the second feature value corresponding to the second partition based on the first pixel value of the first pixel in the second partition;
[0145] The second determination unit is used to maintain the first pixel value of each first pixel in the first partition and the second partition if the first bit value to be carried by the first image region is the first value and the sum of the partition deviation and the first depth parameter is less than 0.
[0146] The third determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, reduce the first pixel value of each first pixel in the first partition and increase the first pixel value of each first pixel in the second partition based on the first step length, and return to perform the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first pixel in the first partition, and calculating the second feature value corresponding to the second partition based on the first pixel value of the first pixel in the second partition;
[0147] The fourth determination unit is used to maintain the first pixel value of each first pixel in the first partition and the second partition if the first bit value to be carried by the first image region is the second value and the difference between the partition deviation and the first depth parameter is greater than 0.
[0148] In one possible implementation of the fourth aspect, the first step length is determined based on the difference between the mean of the partition deviation and the first depth parameter.
[0149] In one possible implementation of the fourth aspect, the pixel adjustment unit includes:
[0150] The first frequency domain matrix generation unit is configured to generate a first frequency domain matrix corresponding to the first image region based on the first pixel values of each first pixel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point.
[0151] A frequency domain difference calculation unit is used to calculate the frequency domain difference between the first frequency point and the second frequency point;
[0152] The fifth determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is a first value and the frequency domain difference is less than a preset second depth parameter.
[0153] The sixth determination unit is used to reduce the first frequency domain value of the first frequency point and increase the second frequency domain value of the second frequency point based on a preset second step size if the first bit value to be carried by the first image region is a first value and the frequency domain difference is greater than the second depth parameter, and then return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0154] The seventh determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is the second value and the frequency domain difference is greater than the second depth parameter.
[0155] The eighth determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, increase the first frequency domain value of the first frequency point and decrease the second frequency domain value of the second frequency point, and return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0156] In one possible implementation of the fourth aspect, the frequency domain difference calculation unit includes:
[0157] The first frequency point determination unit is used to determine a first frequency point from the first frequency point group based on the frequency domain value corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0158] The second frequency point determination unit is used to determine the second frequency point from the second frequency point group based on the first position of the first frequency point in the first frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0159] In one possible implementation of the fourth aspect, the second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
[0160] In one possible implementation of the fourth aspect, the plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
[0161] In one possible implementation of the fourth aspect, the first bit sequence is generated based on the first identifier and the region size.
[0162] In one possible implementation of the fourth aspect, the second bit sequence is obtained by redundant encoding of the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
[0163] In one possible implementation of the fourth aspect, the screenshot acquisition unit includes:
[0164] The original screenshot display unit is used to display the original screenshot in response to the first operation;
[0165] The screenshot editing unit is used to perform image editing on the original screenshot in response to the editing operation to obtain the first screenshot.
[0166] In one possible implementation of the fourth aspect, the first encoding region is the top and / or bottom region of the second screenshot; the second encoding region is other regions in the second screenshot besides the first encoding region.
[0167] In one possible implementation of the fourth aspect, the second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
[0168] Fifthly, embodiments of this application provide an image processing method, including:
[0169] In response to a second operation on a third screenshot, a first page corresponding to the access link carried by the third screenshot is displayed; the access link is obtained by converting a second bit sequence determined by the sixth pixel value of the third screenshot in the second channel when the first identifier is a third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first channel; the first channel and the second channel are different channels; when the first identifier is a third value, it indicates that the third screenshot carries an access link.
[0170] Implementing the embodiments of this application has the following beneficial effects: When receiving a user's second operation on a third screenshot, the first identifier carried by the third screenshot can be determined first based on the fifth pixel value of the first channel in the third screenshot. If the first identifier is a third value, the access link carried by the third screenshot can be determined based on the sixth pixel value of the second channel. Then, the first page can be displayed based on the access link, thereby achieving the purpose of displaying the first page through the third screenshot. Compared with existing screenshot technologies, the access link carried by the third screenshot is not in a visible state, but can be obtained by parsing the sixth pixel value of the third screenshot in the second channel. This ensures that the page content is not occupied by the QR code, while also carrying the access link to the first page, improving the visibility of the effective content within the first page in the third screenshot. On the other hand, by implementing hierarchical encoding through pixel values of different channels, and determining that the first identifier is a third value when the fifth pixel value of the first channel is determined, subsequent parsing operations can be performed, which can improve the efficiency of image parsing, thereby reducing unnecessary parsing operations and reducing the consumption of device computing resources.
[0171] In one possible implementation of the fifth aspect, before displaying the first page corresponding to the access link carried by the third screenshot, the method further includes:
[0172] The attribute information of the third screenshot is determined based on the fifth pixel value of each first image region in the first channel; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information;
[0173] If the first identifier is the third value, then the access link is determined according to the sixth pixel value of each second image region in the second channel of the third screenshot; each second image region carries the second bit value of one bit in the second bit sequence.
[0174] In one possible implementation of the fifth aspect, each of the first image regions includes a first partition and a second partition;
[0175] The step of determining the attribute information of the third screenshot based on the fifth pixel values of each first image region within the first channel includes:
[0176] Calculate the total third grayscale value corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel;
[0177] Calculate the total fourth grayscale value corresponding to the second partition based on the fifth pixel value of each third pixel in the first channel;
[0178] If the total amount of the third gray level is less than the total amount of the fourth gray level, then the first bit value carried by the first image region is determined to be a first value;
[0179] If the total third gray level is greater than the total fourth gray level, then the first bit value carried by the first image region is determined to be the second value.
[0180] In one possible implementation of the fifth aspect, calculating the total third grayscale value corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel includes:
[0181] The total third gray level corresponding to the first partition is calculated based on the fifth pixel value of each third pixel and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the center of the first image region.
[0182] In one possible implementation of the fifth aspect, determining the attribute information of the third screenshot based on the fifth pixel values of each first image region within the first channel includes:
[0183] Based on the fifth pixel value of each third pixel in the first channel within the first image region, a second frequency domain matrix corresponding to the first image region is generated; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band where the first frequency point group is located is lower than the frequency band where the second frequency point group is located.
[0184] If the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be a first value.
[0185] If the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be the second value.
[0186] In one possible implementation of the fifth aspect, the attribute information further includes region size;
[0187] Before determining the access link based on the sixth pixel value of each second image region within the second channel of the third screenshot, the method further includes:
[0188] If the first identifier is the third value, then the third screenshot is divided into regions according to the region size to obtain multiple second image regions.
[0189] In one possible implementation of the fifth aspect, the step of displaying a first page corresponding to the access link carried in the third screenshot in response to the second operation on the third screenshot includes:
[0190] In response to the second operation of the third screenshot in the first application, the first page is displayed in the second application; the first application and the second application are different applications.
[0191] In one possible implementation of the fifth aspect, the second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
[0192] In one possible implementation of the fifth aspect, the third screenshot is an image that is the same as or different from the second screenshot; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page.
[0193] In one possible implementation of the fifth aspect, the third screenshot is obtained by compressing the second screenshot.
[0194] Sixthly, this application provides an image processing apparatus, comprising:
[0195] A page redirection unit is used to respond to a second operation on a third screenshot and display a first page corresponding to the access link carried by the third screenshot; the access link is obtained by converting a second bit sequence determined by the sixth pixel value of the third screenshot in the second channel when the first identifier is a third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first channel; the first channel and the second channel are different channels; when the first identifier is a third value, it indicates that the third screenshot carries an access link.
[0196] In one possible implementation of the sixth aspect, the apparatus further includes:
[0197] The attribute information determination unit is used to determine the attribute information of the third screenshot based on the fifth pixel value of each first image region in the first channel; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information;
[0198] The access link determination unit is configured to determine the access link based on the sixth pixel value of each second image region in the second channel of the third screenshot if the first identifier is a third value; each second image region carries the second bit value of one bit in the second bit sequence.
[0199] In one possible implementation of the sixth aspect, each of the first image regions includes a first partition and a second partition; the attribute information determination unit includes:
[0200] The third grayscale total determination unit is used to calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel.
[0201] The fourth grayscale total determination unit is used to calculate the fourth grayscale total corresponding to the second partition based on the fifth pixel value of each third pixel in the first channel within the second partition.
[0202] The first value recognition unit is used to determine that the first bit value carried by the first image region is a first value if the third gray level is less than the fourth gray level.
[0203] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the third gray level is greater than the fourth gray level.
[0204] In one possible implementation of the sixth aspect, the third grayscale total determination unit is specifically used to: calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each of the third pixels and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the region center of the first image region.
[0205] In one possible implementation of the sixth aspect, the attribute information determining unit includes:
[0206] The second frequency domain matrix determination unit is used to generate a second frequency domain matrix corresponding to the first image region based on the fifth pixel value of each third pixel in the first channel within the first image region; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band in which the first frequency point group is located is lower than the frequency band in which the second frequency point group is located.
[0207] The first value recognition unit is configured to determine the first bit value carried by the first image region as a first value if the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group.
[0208] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group.
[0209] In one possible implementation of the sixth aspect, the attribute information further includes region size; the device further includes:
[0210] The size determination unit is used to divide the third screenshot into multiple second image regions based on the region size if the first identifier is a third value.
[0211] In one possible implementation of the sixth aspect, the page navigation unit includes:
[0212] An application redirection unit is configured to display the first page in a second application in response to the second operation of the third screenshot in the first application; the first application and the second application are different applications.
[0213] In one possible implementation of the sixth aspect, the second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
[0214] In one possible implementation of the sixth aspect, the third screenshot is an image that is the same as or different from the second screenshot; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page.
[0215] In one possible implementation of the sixth aspect, the third screenshot is obtained by compressing the second screenshot.
[0216] Seventhly, embodiments of this application provide an image processing method, characterized in that it includes:
[0217] In response to the second operation on the third screenshot, a first page corresponding to the access link carried in the third screenshot is displayed; the access link is obtained by converting the second bit sequence determined by the sixth pixel value of the third screenshot in the second encoding region when the first identifier is a third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first encoding region.
[0218] Implementing the embodiments of this application has the following beneficial effects: When receiving a user's second operation on a third screenshot, the first identifier carried by the third screenshot can be determined first based on the fifth pixel value in the first encoding region of the third screenshot. If the first identifier is a third value, the access link carried by the third screenshot can be determined based on the sixth pixel value in the second encoding region. Then, the first page can be displayed based on the access link, thereby achieving the purpose of displaying the first page through the third screenshot. Compared with existing screenshot technologies, the access link carried by the third screenshot is not in a visible state, but can be obtained by parsing the sixth pixel value in the second encoding region of the third screenshot. This ensures that the page content is not occupied by the QR code while also carrying the access link to the first page, improving the visibility of the effective content within the first page in the third screenshot. On the other hand, by implementing hierarchical encoding through pixel values in different encoding regions, and determining that the first identifier is a third value when the fifth pixel value in the first encoding region is determined, subsequent parsing operations can be performed, which can improve the efficiency of image parsing, thereby reducing unnecessary parsing operations and reducing the consumption of device computing resources.
[0219] In one possible implementation of the seventh aspect, before displaying the first page corresponding to the access link carried by the third screenshot, the method further includes:
[0220] The attribute information of the third screenshot is determined based on the fifth pixel value of each first image region within the first encoding region of the third screenshot; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information;
[0221] If the first identifier is the third value, then the access link is determined according to the sixth pixel value of each second image region in the second encoding region of the third screenshot; each second image region carries the second bit value of one bit in the second bit sequence.
[0222] In one possible implementation of the seventh aspect, each of the first image regions includes a first partition and a second partition;
[0223] The step of determining the attribute information of the third screenshot based on the fifth pixel value of each first image region within the first encoding region of the third screenshot includes:
[0224] Calculate the total third gray level corresponding to the first partition based on the fifth pixel value of each third pixel in the first partition;
[0225] Calculate the total fourth gray level corresponding to the second partition based on the fifth pixel value of each third pixel in the second partition;
[0226] If the total amount of the third gray level is less than the total amount of the fourth gray level, then the first bit value carried by the first image region is determined to be a first value;
[0227] If the total third gray level is greater than the total fourth gray level, then the first bit value carried by the first image region is determined to be the second value.
[0228] In one possible implementation of the seventh aspect, calculating the total third grayscale value corresponding to the first partition based on the fifth pixel value of each third pixel within the first partition includes:
[0229] The total third gray level corresponding to the first partition is calculated based on the fifth pixel value of each third pixel and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the center of the first image region.
[0230] In one possible implementation of the seventh aspect, determining the attribute information of the third screenshot based on the fifth pixel values of each first image region within the first encoding region includes:
[0231] Based on the fifth pixel value of each third pixel within the first image region, a second frequency domain matrix corresponding to the first image region is generated; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band where the first frequency point group is located is lower than the frequency band where the second frequency point group is located;
[0232] If the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be a first value.
[0233] If the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be the second value.
[0234] In one possible implementation of the seventh aspect, the attribute information further includes region size;
[0235] Before determining the access link based on the sixth pixel value of each second image region within the second encoding region of the third screenshot, the method further includes:
[0236] If the first identifier is the third value, then the third screenshot is divided into regions according to the region size to obtain multiple second image regions.
[0237] In one possible implementation of the seventh aspect, the step of displaying a first page corresponding to the access link carried in the third screenshot in response to the second operation on the third screenshot includes:
[0238] In response to the second operation of the third screenshot in the first application, the first page is displayed in the second application; the first application and the second application are different applications.
[0239] In one possible implementation of the seventh aspect, the second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
[0240] In one possible implementation of the seventh aspect, the third screenshot is an image that is the same as or different from the second screenshot; the third pixel value of the second screenshot in the first encoding region is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first encoding region according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second encoding region is obtained by adjusting the second pixel value of the first screenshot in the second encoding region according to the second bit sequence corresponding to the access link corresponding to the first page.
[0241] In one possible implementation of the seventh aspect, the third screenshot is obtained by compressing the second screenshot.
[0242] Eighthly, this application provides an image processing apparatus, comprising:
[0243] A page redirection unit is used to respond to a second operation on a third screenshot and display a first page corresponding to the access link carried in the third screenshot; the access link is obtained by converting a second bit sequence determined based on the sixth pixel value of the third screenshot in the second encoding region when the first identifier is a third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first encoding region; the first encoding region and the second encoding region are different encoding regions; when the first identifier is a third value, it indicates that the second screenshot carries an access link.
[0244] In one possible implementation of the eighth aspect, the apparatus further includes:
[0245] The attribute information determination unit is used to determine the attribute information of the third screenshot based on the fifth pixel value of each first image region within the first encoding region of the third screenshot; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information;
[0246] The access link determination unit is configured to determine the access link based on the sixth pixel value of each second image region within the second encoding region of the third screenshot if the first identifier is a third value; each second image region carries the second bit value of one bit in the second bit sequence.
[0247] In one possible implementation of the eighth aspect, each of the first image regions includes a first partition and a second partition; the attribute information determination unit includes:
[0248] The third grayscale total determination unit is used to calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each third pixel in the first partition.
[0249] The fourth grayscale total determination unit is used to calculate the fourth grayscale total corresponding to the second partition based on the fifth pixel value of each third pixel in the second partition;
[0250] The first value recognition unit is used to determine that the first bit value carried by the first image region is a first value if the third gray level is less than the fourth gray level.
[0251] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the third gray level is greater than the fourth gray level.
[0252] In one possible implementation of the eighth aspect, the third grayscale total determination unit is specifically used to: calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each of the third pixels and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the region center of the first image region.
[0253] In one possible implementation of the eighth aspect, the attribute information determining unit includes:
[0254] The second frequency domain matrix determination unit is used to generate a second frequency domain matrix corresponding to the first image region based on the fifth pixel value of each third pixel in the first image region; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band in which the first frequency point group is located is lower than the frequency band in which the second frequency point group is located.
[0255] The first value recognition unit is configured to determine the first bit value carried by the first image region as a first value if the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group.
[0256] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group.
[0257] In one possible implementation of the eighth aspect, the attribute information further includes region size; the device further includes:
[0258] The size determination unit is used to divide the third screenshot into multiple second image regions based on the region size if the first identifier is a third value.
[0259] In one possible implementation of the eighth aspect, the page navigation unit includes:
[0260] An application redirection unit is configured to display the first page in a second application in response to the second operation of the third screenshot in the first application; the first application and the second application are different applications.
[0261] In one possible implementation of the eighth aspect, the second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
[0262] In one possible implementation of the eighth aspect, the third screenshot is an image that is the same as or different from the second screenshot; the third pixel value of the second screenshot in the first encoding region is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first encoding region according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second encoding region is obtained by adjusting the second pixel value of the first screenshot in the second encoding region according to the second bit sequence corresponding to the access link corresponding to the first page.
[0263] In one possible implementation of the eighth aspect, the third screenshot is obtained by compressing the second screenshot.
[0264] Ninthly, embodiments of this application provide an electronic device, including: a memory, a processor, and a program stored in the memory, wherein the processor executes the program to implement the steps of the image processing method according to any one of the first aspects, the third aspect, the fifth aspect, and / or the seventh aspect.
[0265] In a tenth aspect, embodiments of this application provide a readable storage medium storing a program that, when executed by a processor, implements the steps of the image processing method described in any one of the first, third, fifth, and / or seventh aspects of the above-described image processing method.
[0266] Eleventhly, embodiments of this application provide a program product that, when run on a device, causes the device to perform the steps of the image processing method described in any one of the first aspects, the third aspect, the fifth aspect, and / or the seventh aspect.
[0267] Other implementations can refer to the aforementioned aspects and will not be elaborated further.
[0268] The beneficial effects of the above aspects can be referenced from each other, and will not be elaborated further here. Attached Figure Description
[0269] Figure 1 is a schematic diagram of existing content sharing methods using screenshots;
[0270] Figure 2 is a schematic diagram of the stages of an image processing method provided in an embodiment of this application;
[0271] Figure 3 is a schematic diagram of a scenario in which both stages are implemented on the same electronic device according to an embodiment of this application;
[0272] Figure 4 is a schematic diagram of a scenario where the two stages provided in an embodiment of this application are implemented on different electronic devices;
[0273] Figure 5 is a flowchart illustrating the implementation of an image processing method in the image encoding stage according to an embodiment of this application;
[0274] Figure 6 is a schematic diagram of the conversion of generating a second bit sequence based on an access link according to an embodiment of this application;
[0275] Figure 7 is a schematic diagram of a specific implementation of S502 provided in an embodiment of this application;
[0276] Figure 8 is a schematic diagram of screenshot acquisition provided in an embodiment of this application;
[0277] Figure 9 is a schematic diagram of the division of the coding region provided in an embodiment of this application;
[0278] Figure 10 is a schematic diagram of the division of a first image region provided in an embodiment of this application;
[0279] Figure 11 is a schematic diagram of the generation of a feature matrix provided in an embodiment of this application;
[0280] Figure 12 is a schematic diagram of calculating the eigenvalues of each partition based on a spatial matrix according to an embodiment of this application;
[0281] Figure 13 is a schematic diagram illustrating the classification of cases based on spatial domain adjustment according to an embodiment of this application;
[0282] Figure 14 is a schematic diagram of pixel value adjustment based on step size according to an embodiment of this application;
[0283] Figure 15 is a comparison diagram of the visual impact of pixel value adjustment under different textures provided in an embodiment of this application;
[0284] Figure 16 is a schematic diagram of frequency point group selection provided in an embodiment of this application;
[0285] Figure 17 is a flowchart illustrating the implementation of frequency selection according to an embodiment of this application;
[0286] Figure 18 is a schematic diagram of the correspondence between the first frequency point and the second frequency point provided in an embodiment of this application;
[0287] Figure 19 is a schematic diagram illustrating the classification of cases based on frequency domain adjustment according to an embodiment of this application;
[0288] Figure 20 is a flowchart illustrating the implementation of an image processing method in the image decoding stage according to an embodiment of this application;
[0289] Figure 21 is a schematic diagram of the first application scenario of the third screenshot provided in an embodiment of this application;
[0290] Figure 22 is a schematic diagram of a second scenario in the third screenshot provided in an embodiment of this application;
[0291] Figure 23 is a schematic diagram illustrating the implementation of determining the bit value of each image region according to an embodiment of this application;
[0292] Figure 24 is a schematic diagram showing the relationship between various pixel values and weight values provided in an embodiment of this application;
[0293] Figure 25 is a schematic diagram of the display of the first page provided in an embodiment of this application;
[0294] Figure 26 is a schematic diagram of the overall flow of the information embedding process and the information parsing process provided in an embodiment of this application;
[0295] Figure 27 is a structural block diagram of an image processing apparatus provided in an embodiment of this application;
[0296] Figure 28 is a structural block diagram of another image processing apparatus provided in an embodiment of this application;
[0297] Figure 29 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0298] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of this application. However, those skilled in the art will understand that this application may also be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted so as not to obscure the description of this application with unnecessary detail.
[0299] It should be understood that, when used in this application specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or a collection thereof.
[0300] It should also be understood that the term “and / or” as used in this application specification and the appended claims means any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.
[0301] As used in this application specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if detected [the described condition or event]" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once detected [the described condition or event]," or "in response to detection [the described condition or event]."
[0302] Furthermore, in the description of this application and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0303] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0304] Images, as one of the main carriers of existing multimedia data, are applied to all aspects of daily life and work. For example, when a user browses content of interest, they can share or record the content by taking a screenshot. Figure 1 illustrates an existing method of sharing content via screenshot. Referring to Figure 1, terminal 11 displays a purchase page for product A, i.e., page 12. The user of terminal 11 wants to share the purchase link for product A with the user of terminal 12, so they can initiate a screenshot operation. The shopping application responds to the user's screenshot operation by generating a QR code based on the purchase link on the purchase page and adding the QR code to the screenshot, resulting in screenshot 13. Screenshot 13 shows an area 131 for displaying the purchase page and an area 132 for displaying the QR code. Without obscuring the area 131 of the purchase page, a blank border area 133 is added. Therefore, the area of area 131 is severely compressed in screenshot 13, reducing the visibility of the effective content of the purchase page. Users often need to zoom in to see the relevant content.
[0305] After obtaining screenshot 13, terminal 11 can send screenshot 13 to terminal 12. After receiving screenshot 13, terminal 12 can save it locally and display the purchase page on terminal 12 by recognizing the QR code on screenshot 13, such as obtaining page 14, thereby enabling the sharing of product A between two users.
[0306] However, sharing content by adding a QR code to the screenshot reduces the area of effective content in the screenshot, meaning the visibility of the effective content is lower. It also reduces the uniformity and aesthetics of the overall screenshot, thus affecting the user experience.
[0307] Example 1:
[0308] To address the issue in image processing technology where adding page access links to images requires the use of QR codes that occupy visible controls, reducing the visibility of page content and the proportion of effective content in the screenshot, this application provides an image processing method. Based on a first bit sequence corresponding to a first identifier and a second bit sequence corresponding to the access link of the first page, the method adjusts the pixel values of different channels or different encoding regions within the screenshot to implicitly carry the first identifier and access link within the screenshot. This method does not rely on QR codes that occupy visible areas, meaning the aforementioned method of carrying access links is invisible to the user, thereby increasing the proportion of effective content within the screenshot while maintaining the visibility of the first page content.
[0309] The aforementioned image processing method can be specifically applied to electronic devices, including smartphones, tablets, laptops, desktop computers, and other interactive devices. These electronic devices may include interactive modules such as touchscreens, keyboards, and mice to respond to user-initiated interactive operations, enabling screenshotting or redirection of specific pages.
[0310] In this embodiment, the image processing method described above may specifically include two stages. For example, Figure 2 shows a schematic diagram of the stages of an image processing method provided in an embodiment of this application. Referring to Figure 2, the image processing method provided in this embodiment may include a stage 1 of image encoding for a screenshot of a specific page, and a stage 2 of image recognition for a screenshot with an access link added.
[0311] In Phase 1, the electronic device can obtain a screenshot (i.e., the first screenshot) of the page to be shared and an access link for the page to be shared. By adjusting the pixel values of the first pixel in different channels or different encoding regions of the first screenshot, the first identifier and the access link are embedded into the screenshot, resulting in a screenshot (i.e., the second screenshot) with the first identifier and the access link embedded. The electronic device can store the second screenshot or send it to other electronic devices.
[0312] In stage 2, the electronic device can acquire a third screenshot carrying a first identifier and an access link. This third screenshot can be the previously stored second screenshot or a screenshot obtained by compressing the second screenshot. The electronic device first determines the first identifier corresponding to the third screenshot by acquiring the fifth pixel value of the third pixel in a preset channel or encoding region of the third screenshot. If the first identifier is a preset third value, it determines that an access link is embedded in the third screenshot. Then, by acquiring the sixth pixel value of the third pixel in another channel or another encoding region, it determines the access link it carries. Thus, the page corresponding to the access link can be displayed locally to achieve the purpose of content sharing.
[0313] It should be noted that the above two stages are two independent stages. That is, the two stages can be implemented on the same electronic device or on two different electronic devices. The specific implementation can be determined according to the actual application scenario.
[0314] For example, Figure 3 illustrates a scenario where both stages of this application are implemented on the same electronic device according to an embodiment of the present application. Referring to Figure 3(a), the electronic device is specifically a smartphone. The user can browse online products through a shopping application installed on the smartphone, for example, opening a product page, i.e., page 31. At this time, the user has the intention to buy the product but is undecided. Therefore, the user can take a screenshot to record the page of the product to be purchased, as shown in Figure 3(b). After the smartphone completes the screenshot, it can generate a corresponding prompt box 32 to inform the user that the screenshot operation of the page has been completed, and prompt the user whether to save the screenshot 33. If the user agrees to save the screenshot, he / she can click the save control 34. In response to the user clicking the save control 34, the electronic device can save the screenshot to the local image library. Since the electronic device has already embedded the page access link into screenshot 33 when the user initiates the screenshot operation, if the user decides to purchase the above-mentioned product later, he / she can open the gallery, as shown in Figure 3(c), and drag the screenshot 33 stored in the gallery to the smartphone assistant to parse the embedded access link. After obtaining the access link from the screenshot, the product page will be displayed again locally, resulting in page 35 as shown in Figure 3(d).
[0315] For example, Figure 4 illustrates a scenario where two stages are implemented on different electronic devices according to an embodiment of this application. Referring to Figure 4(a), a user A can view a product page, such as page 41, on their local smartphone. The user can obtain a screenshot 42 corresponding to page 41 by taking a screenshot. The screenshot 42 is a screenshot with an access link embedded by the image processing method provided in this embodiment. During online communication with another user (such as user B), as shown in Figure 4(b), user A can send the screenshot 42 with the embedded access link to user B. User B can receive the screenshot 42 on their smartphone. As shown in Figure 4(c), user B can drag the screenshot 42 to a smart assistant. The smart assistant, by recognizing the access link embedded in the screenshot 42, can display the shared product page on user B's smartphone, resulting in page 43 as shown in Figure 4(d). It should be noted that, since the screenshot 42 may be compressed when transmitted between different electronic devices, the screenshot 42 stored on user A's smartphone and the screenshot 42 received on user B's smartphone may be the same image or different images.
[0316] To further illustrate the implementation of the image processing method provided in this application, the specific implementation flow of the above two stages (i.e., the image encoding stage and the image decoding stage) is described in detail below:
[0317] Phase 1: Encoding phase of embedding access links into screenshots
[0318] For example, Figure 5 shows a flowchart of the image encoding stage of an image processing method according to an embodiment of this application. Referring to Figure 5, the image processing method is specifically used to generate a screenshot that embeds an access link in an invisible and unobtrusive manner. Specifically, the image processing method includes the following steps:
[0319] In S501, the first page is displayed.
[0320] In this embodiment, the electronic device may have an application installed, within which a corresponding page, namely the first page mentioned above, can be opened. For example, a shopping application may open a product purchase page, a video application may open a video playback page, and a music application may open an audio playback page, etc. Different applications may correspond to different pages, and the type of page is not limited here.
[0321] In S502, in response to the first operation used to trigger the screenshot, a second screenshot is obtained.
[0322] In this embodiment, the second screenshot can carry the first bit sequence corresponding to the first identifier and the second bit sequence corresponding to the access link through different channels or different encoding regions.
[0323] In some implementations, the second screenshot includes a first channel and a second channel; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page; the first channel and the second channel are different channels; the first identifier is used to indicate whether the second screenshot carries the access link.
[0324] In some implementations, the second screenshot includes a first encoded region and a second encoded region; the third pixel value of the second screenshot in the first encoded region is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first encoded region according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second encoded region is obtained by adjusting the second pixel value of the first screenshot in the second encoded region according to the second bit sequence corresponding to the access link corresponding to the first page; the first encoded region and the second encoded region are different regions in the second screenshot; the first identifier is used to indicate whether the second screenshot carries an access link.
[0325] In some implementations, the above S502 can be further divided into two steps: obtaining the first screenshot and encoding the first screenshot to obtain the second screenshot. Specifically, the two detailed steps can be described as follows:
[0326] In S502.1, in response to the first operation used to trigger the screenshot, the first screenshot corresponding to the first page and the access link of the first page are obtained.
[0327] In this embodiment, when a user needs to share or save a page, they can initiate a first operation on the electronic device to trigger a screenshot. This first operation can be a screenshot of the first page. The first operation can be clicking a physical button on the electronic device, or clicking a combination of two or more physical buttons. If the electronic device is equipped with a touchscreen, the first operation can be a preset touch gesture, such as tapping the touchscreen with a knuckle.
[0328] In this embodiment, after receiving the first operation initiated by the user, the electronic device can determine the screenshot corresponding to the currently displayed page, i.e., the first screenshot. This first screenshot is a screenshot of the access link to be embedded.
[0329] In this embodiment, when the electronic device responds to the first operation, in addition to obtaining a screenshot of the current page, it can also obtain an access link for the current page. This access link can be a Uniform Resource Locator (URL) for the page currently displayed by the electronic device, or it can be a network address for that page. The specific representation of the access link can be set according to different applications and scenarios, and is not limited here.
[0330] In this embodiment, the electronic device can also determine the attribute information corresponding to the first screenshot. This attribute information can be used to determine image attributes related to the first screenshot. The attribute information includes a first identifier indicating whether the screenshot carries an access link. The electronic device can convert the first identifier into a corresponding first bit sequence. Optionally, if the first identifier is a third value, it indicates that the screenshot carries an access link; conversely, if the first identifier is a fourth value, it indicates that the screenshot does not carry an access link. The third value can be 1, and the fourth value can be 0. By adding the first identifier to the attribute information, the electronic device can quickly determine whether the screenshot carries an access identifier by reading the attribute information, avoiding the need to perform parsing operations on the second bit sequence during image parsing, thus improving the device's resource utilization.
[0331] In one possible implementation, the aforementioned attribute information can be the metadata of the screenshot. This attribute information may also include information such as the resolution of the first screenshot, the shooting location, and the shooting time, which can be determined according to the actual situation.
[0332] In some implementations, the aforementioned attribute information may also include a region size, which is the region size of the second image region used to carry the second bit sequence.
[0333] In this embodiment, after the electronic device obtains the access link corresponding to the currently displayed first page and the attribute information corresponding to the first screenshot, it can convert the access link and attribute information into binary format, that is, convert the first bit sequence obtained from the attribute information and the second bit sequence obtained from the access link.
[0334] In one possible implementation, the attribute information and access links can be converted into bit sequences by: obtaining the bit sequences based on the ASCII codes corresponding to each character in the attribute information and access links. For example, the first bit sequence can be obtained based on the ASCII codes corresponding to each character in the attribute information, and the second bit sequence can be obtained based on the ASCII codes corresponding to each character in the access links.
[0335] For example, Figure 6 illustrates a schematic diagram of the conversion of a second bit sequence based on an access link according to an embodiment of this application. Referring to Figure 6, the URL corresponding to a certain access link is www.vmall.com. The ASCII code for the character "w" has a decimal encoding of 119, which can be represented as "01110111" in binary. The ASCII code for the character "." has a decimal encoding of 46, which can be represented as "00101110" in binary. Similarly, the above URL can be converted into a second sequence consisting of 0s and 1s. It should be noted that the process of converting attribute information into a first sequence is the same as the conversion process of the access link, and will not be repeated here.
[0336] In one possible implementation, to improve the robustness of the access link while reducing the number of bits it occupies, the first and second bit sequences can be obtained through Huffman coding and redundancy coding. The bit conversion process can include the following steps:
[0337] Step 1: Obtain the original sequence based on the Huffman encoding of each character in the access link.
[0338] In this embodiment, attribute information and access links are generally represented by characters. However, the characters in these two types of information mainly include alphanumeric characters, common punctuation characters such as "." and " / ". These common characters appear frequently in the information, while other characters, such as "【" and "{", do not appear in access links or attribute information. If ASCII codes are used to encode each character in these two types of information, the encoding of most characters will not be used, thus introducing a lot of redundancy into 8-bit encoding. Based on the above reasons, the electronic device can collect a large number of page links of existing web pages and attribute information of existing screenshots, and determine the Huffman code corresponding to each character based on the probability of occurrence of each character in the collected page link and screenshot attribute information, and construct the corresponding Huffman code table.
[0339] In this embodiment, after obtaining the access link corresponding to the first page and the attribute information of the first screenshot, the electronic device can obtain the binary code corresponding to each character by querying the Huffman coding table based on the characters contained in the access link and attribute information. Then, it sorts the characters according to their binary codes. For example, it can convert each character in the access link to binary using the Huffman coding table to obtain the original sequence corresponding to the access link. Compared to encoding characters using ASCII code, where each ASCII character requires 8 bits, Huffman coding reduces the average number of bits used by all characters to 5.04, a bit compression ratio of 5 / 8. This increases the information that each first screenshot can hold by 8 / 5 = 160%, thus increasing the amount of information that can be embedded in the first screenshot.
[0340] Optionally, the protocol identifier used by the access link is generally "http" or "https". Therefore, in order to further compress the number of bits in the original sequence, the protocol identifier of "http: / / " can be represented by "0000" as its binary code; while the protocol identifier of "https: / / " can be represented by "0001" as its binary code; the remaining bits can be reserved for other protocol identifiers, such as "ftp: / / ", thereby reducing the number of bits occupied when the access link is converted into binary code, and thus carrying more information when embedding the bit sequence in the subsequent first screenshot.
[0341] Step 2: Import the original sequence into the preset redundancy coding algorithm to obtain the first bit sequence corresponding to the attribute information and the second bit sequence corresponding to the access link.
[0342] In this embodiment, after encoding each character in the access link and attribute information to obtain the corresponding original sequence, the electronic device can perform redundant encoding on the original sequence using a preset redundancy encoding algorithm to improve the robustness during transmission and thus improve the accuracy of subsequent restoration of the access link. For example, the sequence obtained by adding a check bit to the original sequence corresponding to the attribute information is identified as the first bit sequence corresponding to the attribute information, and the sequence obtained by adding a check bit to the original sequence corresponding to the access link is identified as the second bit sequence corresponding to the access link.
[0343] In one possible implementation, the aforementioned redundancy coding algorithm can be: a channel polarization-based coding algorithm, such as Polar coding; it can also be low-density parity-check (LDPC) coding and convolutional coding. The specific redundancy coding method used can be determined according to the actual situation and is not limited here. Since, in practical use, as the original bit error rate increases, the error correction capability of the bit sequence obtained by Polar coding is stronger than that obtained by LDPC coding and convolutional coding, this embodiment of the application can perform redundant coding on the original sequence using the Polar coding algorithm when generating the bit sequence.
[0344] In this embodiment, Huffman coding is used to convert each character in the access link and attribute information into its corresponding binary code. Since Huffman coding determines the encoding length of each character based on its frequency of occurrence, it can reduce the number of bits after the access link is converted into binary. Furthermore, by adding correction bits through a redundant coding algorithm, the robustness of the generated bit sequence can be improved, thereby improving the accuracy of subsequent decoding of the access link.
[0345] In one possible implementation, after initiating a screenshot operation on the current page, the electronic device can also edit the screenshot and recognize the edited image as the first screenshot. For example, Figure 7 shows a schematic diagram of a specific implementation of S502 provided in an embodiment of this application. Referring to Figure 7, in this embodiment, after responding to the first operation initiated by the user, the user can edit the screenshot, specifically including the following steps:
[0346] In S701, in response to the first operation, the original screenshot corresponding to the first page is displayed.
[0347] In this embodiment, after the user initiates the first operation (i.e., the screenshot operation), the electronic device can obtain the content within the current display screen of the electronic device, that is, obtain the original screenshot corresponding to the first page, and display the original screenshot. For example, Figure 8 shows a schematic diagram of screenshot acquisition provided in an embodiment of this application. Referring to Figure 8(a), after initiating a screenshot operation, the electronic device can obtain a screenshot of the current page and generate a screenshot success prompt box 81. The prompt box 81 can display a thumbnail of the screenshot, as well as a save control 82 and an edit control 83. If the electronic device detects that the user clicks the save control 82, the electronic device recognizes that the user does not need to edit the screenshot obtained by the above screenshot operation. That is, the original screenshot obtained by the above screenshot is the first screenshot. Therefore, attribute information and access links can be embedded into the first screenshot. Conversely, if the electronic device detects that the user clicks the edit control 83, the electronic device recognizes that the user needs to edit the screenshot. At this time, a corresponding screenshot editing interface can be generated, as shown in Figure 8(b). The user can initiate an editing operation on the original screenshot in the screenshot editing interface.
[0348] The method for obtaining the bit sequence corresponding to the access link can be found in the relevant description of the above embodiments, and will not be repeated here.
[0349] In S702, in response to an editing operation, the original screenshot is edited to obtain the first screenshot.
[0350] In this embodiment, the electronic device can display an editing interface for the original screenshot, allowing the user to edit it. This editing can include cropping, rotating, drawing, adding text, etc. The specific editing content can be set according to the user's actual usage and is not limited here. As shown in Figure 8(b), the user can click the cropping control 84 to adjust the content to be retained in the screenshot, resulting in the screenshot shown in Figure 8(c). After editing, the user can click the storage control 85 to indicate that the content editing operation is complete. In response to the user clicking the completed control 85, the electronic device determines the edited original screenshot as the first screenshot and embeds the page access link into the first screenshot.
[0351] In this embodiment of the application, when the user needs to edit the screenshot, the access link can be embedded after the user has finished editing. This avoids repeatedly performing the link embedding operation and also prevents the information of the embedded access link from being changed due to the user's editing operation, thereby improving the accuracy of the access link embedded in the screenshot.
[0352] In S502.2, the first pixel value and the second pixel value in the first screenshot are adjusted according to the first bit sequence and the second bit sequence to obtain the second screenshot. In this embodiment, after determining the first screenshot that needs to be embedded with information, the electronic device can perform image encoding on the first screenshot and adjust the first pixel value and the second pixel value in the first screenshot according to the first bit sequence corresponding to the aforementioned attribute information and the second bit sequence generated by the access link, thereby achieving the purpose of implicitly carrying information. The information embedding technology used in this embodiment is hierarchical embedding, that is, the first bit sequence corresponding to the attribute information is carried by the first pixel value in the first screenshot, and the second bit sequence corresponding to the access link is carried by the second pixel value in the first screenshot.
[0353] In some implementations, the first pixel value can be the pixel value of the first pixel in the first encoding region of the first screenshot, and correspondingly, the second pixel value can be the pixel value of the first pixel in the second encoding region of the first screenshot.
[0354] In one possible implementation, the electronic device can divide the first screenshot into at least two encoded regions, namely a first encoded region and a second encoded region. For example, Figure 9 shows a schematic diagram of the encoded region division provided in an embodiment of this application. Referring to Figure 9(a), the screenshot can be divided into two encoded regions, namely an upper region 91 and a lower region 92. The ratio between the two encoded regions can be 1:1 or other ratios, which can be set according to the actual situation. The electronic device can use the upper region 91 as the first encoded region for embedding attribute information and the lower region 92 as the second encoded region for embedding access links. Of course, the upper region 91 can also be used as the first encoded region; the specific region selection can be limited according to the actual situation.
[0355] Referring to Figure 9(b), the screenshot can be divided into three regions: the top region 93, the middle region 94, and the bottom region 95. The middle region 94 occupies 70% of the total screenshot area, while the top region 93 and the bottom region 95 occupy the remaining 30%. Since access links generally contain a large number of characters, the region with the larger area can be used as the second encoding region, i.e., the middle region 94. The middle region has stronger anti-interference capabilities and a lower probability of being truncated, thus improving the reliability and stability of the embedded access links. The top region 93 and the bottom region 95 are used as the first encoding region for embedding attribute information.
[0356] In this embodiment, the first pixel value can be the pixel value of the first pixel in the first screenshot in the first channel, and correspondingly, the second pixel value can be the pixel value of the first pixel in the first screenshot in the second channel. In one possible implementation, the electronic device can embed the first sequence and the second sequence into different channels of the first screenshot, respectively. Since the first screenshot is generally a color image, and a color image generally contains three or more channels, for example, the first screenshot is an RGB format image, that is, the first screenshot includes three different channels: red channel, blue channel, and green channel, and each pixel corresponds to a pixel value in different channels. In this case, the first bit sequence can be embedded in one of the three channels, and the second sequence can be embedded in the other three channels. The specific channel selection can be determined according to the actual situation. Optionally, the electronic device can convert the first screenshot into a YCbCr format image, wherein the YCbCr format image includes three channels, namely the luminance Y channel and two chrominance channels, namely the blue chrominance Cb channel and the red chrominance Cr channel. For example, the first sequence can be embedded in the Y channel, meaning the grayscale value in the Y channel is the first grayscale value, and the second sequence can be embedded in the blue chromaticity Cb channel, meaning the grayscale value in the Cb channel is the second grayscale value. The specific correspondence between the sequence and the channel can be determined according to the actual situation, and is not limited here.
[0357] Specifically, if the first screenshot is an RGB image, the following method can be used to convert each grayscale value when converting it to a YCbCr image:
[0358] The formula for converting the grayscale value of the Y channel is: Y = 0.299 × R + 0.587 × G + 0.114 × B
[0359] The formula for converting grayscale values in the Cb channel is: Cb = 128 - 0.168736 × R - 0.331264 × G + 0.5 × B
[0360] The formula for converting grayscale values in the Cr channel is: Cr = 128 + 0.5 × R - 0.418688 × G - 0.081312 × B
[0361] Where R is the grayscale value of the red channel in RGB format, B is the grayscale value of the blue channel in RGB format, and G is the grayscale value of the green channel in RGB format.
[0362] In some implementations, the first channel can be the blue channel. Since the blue channel has the best masking properties in an RGB image, the overall color deviation of the image is relatively small after carrying the bit values. The second channel can be the red channel. Because the red channel has a middle level of masking and robustness in an RGB image—lower masking than the blue channel but better robustness—the larger second bit sequence can be carried in the pixel values of the red channel. This reduces color deviation while also improving the robustness of the carried bit values.
[0363] It should be noted that the process of embedding the first bit sequence into the first pixel value of the first screenshot and the process of embedding the second bit sequence into the second pixel value of the first screenshot can be two independent processes, that is, they can be processed in parallel or serially, depending on the actual situation. Optionally, the embedding processes of the two bit sequences can adopt the same method or different methods, depending on the actual situation. For ease of description, the following describes the process of embedding the first bit sequence into the first pixel value of the first channel. The process of embedding the first bit sequence into the second pixel value of the second channel can be referred to the following description and will not be repeated here. The process of embedding the first bit sequence into the first pixel value of the first channel can specifically include the following steps: region division, feature matrix generation, and bit value adjustment. The implementation process of the above three steps is described in detail below:
[0364] Step 1: Regional Division
[0365] In this embodiment, the first pixel value can be the pixel value of the first pixel within the first encoding region of the first screenshot, or it can be the pixel value of each first pixel in the first channel. The first grayscale value determined by the above two methods corresponds to a relatively large image area. Since the first bit sequence contains multiple bits, the electronic device can divide the area corresponding to the first pixel value to obtain multiple image areas. It should be noted that if the first pixel value is the pixel value of the first screenshot within the first channel, then the area corresponding to the first pixel value is the entire screenshot, that is, the first screenshot can be divided to obtain a first image area for carrying each first bit value of the first bit sequence; if the first pixel value is the pixel value of each first pixel within the first encoding region of the first screenshot, then the area corresponding to the first pixel value is the first encoding region, that is, the first encoding region can be divided to obtain a first image area for carrying each first bit value of the first bit sequence.
[0366] Each of the aforementioned first image regions is used to carry the first bit value of a bit in the first bit sequence. It should be noted that the number of the aforementioned first image regions can be the same as or more than the number of bits in the first bit sequence, depending on the specific circumstances.
[0367] In some implementations, the number of bits in the first image region is the same as the number of bits in the first bit sequence. For example, if the first screenshot contains M*N first image regions in the first channel, then all M*N first image regions can be used to carry the first bit sequence.
[0368] In some implementations, if different bit sequences are carried by different coding regions, the number of first image regions obtained by dividing the first coding region can also be the same as the number of bits in the first bit sequence. For example, Figure 10 shows a schematic diagram of the division of a first image region according to an embodiment of this application. Referring to Figure 10(a), the first coding region in the first screenshot is the top region of the first screenshot, i.e., top region 101, and the number of first image regions contained in top region 101 is the same as the number of bits in the first bit sequence. For example, if the size of the first sequence is 80 bits, then top region 101 can be divided into 80 sub-regions.
[0369] In some implementations, the first image region can also be a partial region of the image region obtained by dividing the first pixel value. For example, if the number of bits in the first bit sequence is less than M*N, that is, the number of image regions obtained by the above division is greater than the number of bits in the first bit sequence, then a partial image region (i.e., the first image region) can be selected from M*N image regions to carry the first bit value of each bit of the first bit sequence. Continuing to refer to Figure 10(a), the top region 101 can be divided into 80 image regions. If the number of bits in the first bit sequence is 60 bits, then the first 60 image regions can be selected as the first image regions, that is, the 60 first image regions are used to carry the 60 bit value in the first bit sequence.
[0370] Optionally, referring to Figure 10(b), if the number of image regions is greater than the number of bits in the first bit sequence, a first image region for carrying the first bit value in the first bit sequence can be determined from the multiple image regions using a preset region distribution pattern. For example, if nine image regions are divided, and the first bit sequence includes four bits, then a first image region for carrying the four bits needs to be determined from the nine image regions. The electronic device can determine the second image region in the first row, i.e., region 102, as the first image region using the preset region distribution pattern. Similarly, the first image region in the second row, i.e., image region 103, is also the first image region, and so on. Four first image regions can be determined from the first screenshot. The region distribution patterns corresponding to different images can be the same or different, depending on the actual situation. Optionally, the above region distribution pattern can be stored in the metadata of the first screenshot.
[0371] The relationship between the number of first image regions and the number of bits in the first bit sequence can be determined based on the actual situation. For example, in scenarios where it is necessary to improve the reliability and robustness of access links or attribute information, the number of pixels contained in each sub-region needs to be increased, which can reduce the number of first image regions to improve the accuracy of subsequent bit value restoration; in scenarios where it is necessary to increase the amount of data carried by the screenshot, the number of pixels contained in each first image region can be reduced, thereby dividing more first image regions to carry more attribute information and access links.
[0372] In one possible implementation, if the number of bits in the first bit sequence or the second bit sequence is greater than the number of regions in the first image region, then two or more channels can be selected as the channels for embedding the bit sequence. For example, if the access link contains a large number of characters, the second bit sequence corresponding to the access link can be carried by the pixel values in the second and third channels of the first screenshot. For instance, the first screenshot includes three channels: a red channel, a blue channel, and a green channel, each corresponding to a pixel value. The first screenshot can be divided into regions using the second channel to obtain 100 second image regions. Since the number of bits in the second bit sequence corresponding to the access link is 150, each second image region needs to carry an average of 1.5 bits of information, exceeding the data capacity of the second channel. In this case, the electronic device can divide the third channel of the first screenshot into regions, also obtaining 100 third image regions, or it can divide the third channel into regions, obtaining 50 third image regions. The second and third channels can then jointly carry the bit values in the second bit sequence. By using the above method, when the number of bits in the first bit sequence or the second bit sequence is greater than the number of image regions, the remaining channels can be used to carry the excess bit value, thereby increasing the embeddable length of information and thus expanding the applicability of the scheme.
[0373] In one possible implementation, the electronic device can divide the image into regions based on a preset number of rows and columns. In some implementations, this region division based on the preset number of rows and columns can be applied to the region division of the first channel. Specifically, the first channel of the first screenshot is divided into regions based on the preset number of rows and columns to obtain multiple first image regions. For example, if the electronic device limits the number of rows and columns to M and N, where M and N are both positive integers, then the electronic device can divide the first channel into regions based on the aforementioned number of rows and columns to obtain M*N first image regions. Each of the M*N first image regions is used to carry the first bit value of one bit in the first bit sequence. By segmenting the image in this way, first screenshots of different sizes can be divided into the same number of image regions, improving the uniformity of the number of image regions between different screenshots.
[0374] In one possible implementation, the electronic device can set the region size of the image area, that is, define the number of pixels occupied by the length and the number of pixels occupied by the width of each image area. The electronic device can divide the area corresponding to the first pixel value according to the aforementioned region size, that is, divide the first channel into regions to obtain multiple first image regions. For example, if the region size of a certain area is a*b pixels, where a and b are both positive integers, and the image area corresponding to the first channel is L*H pixels, where L and H are both positive integers, then dividing the first screenshot according to the aforementioned region size can obtain (L*H) / (a*b) first image regions. By dividing the image regions in this way, the image regions obtained from multiple screenshots with different canvas sizes can be of the same size, thereby improving the uniformity of image regions between different screenshots. Specifically, when dividing the image region corresponding to the second pixel value (such as the region corresponding to the second channel), a fixed region size can be used for division. Since each image region contains the same number of pixels, it will not change due to different canvas sizes of the screenshot, thus ensuring the stability and accuracy of the bit information embedded in each image region.
[0375] It should be noted that the process of dividing the region for the second pixel value can also refer to the description above, and will not be repeated here. If the first bit sequence and the second bit sequence are carried through different channels, the first screenshot contains multiple second image regions in the second channel, and each second image region is used to carry the second bit value of one bit in the second bit sequence; if the first bit sequence and the second bit sequence are carried through different coding regions, the second coding region of the first screenshot contains multiple second image regions, and each second image region is used to carry the second bit value of one bit in the second bit sequence.
[0376] Step 2: Feature Matrix Generation
[0377] In this embodiment, the electronic device can divide the region corresponding to the first pixel value (such as the region corresponding to the first channel or the first encoding region) or the region corresponding to the second pixel value (such as the region corresponding to the second channel or the second encoding region) into multiple image regions. Each image region is used to carry the bit value of one bit in the bit sequence. To determine whether the pixel value of a pixel in the image region needs to be adjusted, a feature matrix corresponding to that image region needs to be determined. This feature matrix is determined based on the pixel values of each pixel within the image region. For the first image region, the feature matrix is determined based on the first pixel value of each pixel within the first image region, such as determining the feature matrix based on the pixel value of each pixel in the first channel; for the second image region, the feature matrix is determined based on the second pixel value of each pixel within the second image region, such as determining the feature matrix based on the pixel value of each pixel in the second channel.
[0378] For example, Figure 11 shows a schematic diagram of the generation of a feature matrix provided in an embodiment of this application. Referring to Figure 11, the process of embedding the first bit sequence into the first pixel value of the first screenshot in the first channel will be used as an example for explanation: The first screenshot is divided into an image region including region 111 in the first channel. The electronic device can determine that the region 111 contains 9 pixels, and each pixel can correspond to a pixel value in the first channel. The electronic device can construct the feature matrix corresponding to the region 111 based on the 9 pixel values.
[0379] Depending on the method of adjusting the pixel values, the generated feature matrix can include the following two types:
[0380] 1) Feature matrix generated based on spatial domain
[0381] In this embodiment, each pixel has a spatial relationship. Taking Figure 11 as an example, region 111 contains pixels 1 to 9. Pixel 1 is the pixel in the first row and first column, and its corresponding spatial coordinates are (1,1). Correspondingly, the spatial coordinates of each pixel in region 111 can be determined. Based on the spatial coordinates of each pixel, a feature matrix generated based on the spatial domain is generated, as shown in matrix 112 in Figure 11.
[0382] In this matrix 112, the value of each element is determined by the pixel value of the corresponding spatial coordinate.
[0383] 2) Feature matrix generated based on frequency domain
[0384] In this embodiment, each pixel has not only spatial relationships but also frequency domain relationships. Continuing with Figure 11 as an example, after constructing matrix 112, the electronic device can perform a Fourier transform on the spatially constructed matrix 112, thereby converting it into a frequency domain matrix 113 corresponding to multiple frequency points. It should be noted that the spatially constructed matrix 112 is generated based on the pixel values in the first channel of the first screenshot. For example, if the first screenshot is an RGB format image, then the matrix 112 can be generated based on the pixel values of one of the R, B, or G channels; similarly, if the first screenshot is a YCrCb format image, then the matrix 112 can be generated based on the pixel values in the Y channel, or it can be generated based on the pixel values of other channels, without limitation. Subsequently, when determining the quantization coefficients, they can also be determined based on the quantization matrix of the corresponding channel.
[0385] Wherein, matrix 112 is a 3x3 matrix, and the resulting frequency domain matrix 113 can also be a 3x3 matrix. Optionally, the electronic device can perform a Discrete Cosine Transform (DCT) on each pixel value in the spatial domain-based matrix 112 to determine the frequency domain value corresponding to each frequency point, thereby constructing the aforementioned frequency domain matrix 113. The transformation formula for the aforementioned DCT can be expressed as:
[0386] Where F(u, v) is the frequency domain value of the frequency point corresponding to the u-th row and v-th column in the frequency domain matrix, α(u) is the weighting coefficient of the frequency point in the u-th row, α(v) is the weighting coefficient of the frequency point in the v-th column, N is the total number of rows in the spatial matrix, M is the total number of columns in the spatial matrix, and f(x, y) is the pixel value corresponding to the pixel in the x-th row and y-th column in the spatial matrix.
[0387] In this embodiment, the electronic device can determine whether the frequency domain values of some frequency points in the frequency domain matrix need to be adjusted by judging the adjustment conditions corresponding to the bit values of the frequency domain matrix and the image region.
[0388] Step 3: Bit value adjustment
[0389] In this embodiment, each first image region can be used to carry the first bit value of a bit in a first bit sequence; correspondingly, each second image region can be used to carry the second bit value of a bit in a second bit sequence. Depending on the different first bit values that the first image region needs to carry, different pixel value adjustment conditions can be applied. The electronic device can match the feature matrix corresponding to the first image region with the adjustment conditions associated with the first bit value that the first image region needs to carry, and perform the corresponding pixel value adjustment operation based on the matching result.
[0390] In this embodiment, depending on the feature matrix used, the method of adjusting pixel values can also be divided into the following two methods:
[0391] Method 1: Adjustment process based on spatial matrix
[0392] In this embodiment, the electronic device can partition the spatial matrix to obtain a first partition and a second partition. Each partition contains half the number of pixel values as the total number of pixels in the first image region. After partitioning the spatial matrix, the electronic device can calculate the feature value corresponding to each partition. This feature value may include the total grayscale value and the grayscale extreme value corresponding to all grayscale values in that partition.
[0393] For example, Figure 12 shows a schematic diagram of calculating the feature values of each partition based on a spatial matrix according to an embodiment of this application. Referring to Figure 12, the spatial matrix 121 can be a 4*4 matrix, meaning the first image region contains 16 pixels, each pixel corresponding to a pixel value, thus constructing the aforementioned spatial matrix 121. The spatial matrix 121 can be divided into two partitions, partition 122 and partition 123. Partition 122 contains pixels 1 to 8, and its corresponding partition matrix is determined based on the pixel values of these 8 pixels. Partition 123 contains pixels 9 to 16, and its corresponding partition matrix is also determined based on the pixel values of these 8 pixels. Besides dividing the region vertically, it can also be divided horizontally or based on a preset distribution pattern; the method of partitioning is not limited here.
[0394] After determining the pixel values of the pixels contained in each partition, the feature values corresponding to each partition can be calculated, which are the total gray value of the partition and the gray extreme value of the partition.
[0395] The above total gray value is the sum of the pixel values of all pixels in the partition. For example, it is calculated based on the first pixel value of each first pixel in the first channel in the first screenshot. Taking Figure 12 as an example, the total gray value (i.e., the first total gray value) corresponding to the partition 122 is the sum of the pixel values of pixels 1 to 8 in the first channel, and the total gray value (i.e., the second total gray value) corresponding to the partition 123 is the sum of the pixel values of pixels 9 to 16 in the first channel.
[0396] The aforementioned grayscale extreme values are determined based on the pixel values of each pixel within the partition. It should be noted that the first grayscale extreme value corresponding to the first partition and the second grayscale extreme value corresponding to the second partition are two extreme values in opposite directions. For example, if the first grayscale extreme value of the first partition is the maximum value of all first pixel values in the first partition, then the second grayscale extreme value of the second partition is the minimum value of all first pixel values in the second partition; conversely, if the first grayscale extreme value of the first partition is the minimum value of all first pixel values in the first partition, then the second grayscale extreme value of the second partition is the maximum value of all first pixel values in the second partition. The extreme value type used for different partitions can be determined according to the partition encoding. Continuing with Figure 12 as an example, the grayscale extreme value corresponding to partition 122 can be a maximum value, i.e., the pixel value of pixel 3 in the first channel is 195. Correspondingly, the grayscale extreme value corresponding to partition 123 is a minimum value, i.e., the pixel value of pixel 12 in the first channel is 75.
[0397] In this embodiment, after the electronic device determines the feature values corresponding to each partition, it can determine the corresponding adjustment conditions based on the first bit value that the first image region needs to carry, and determine whether the first pixel value in the first image region needs to be adjusted based on the adjustment conditions. For example, Figure 13 shows a schematic diagram of spatial domain adjustment based on an embodiment of this application. Referring to Figure 13, based on the matching between the feature values corresponding to the two partitions and the adjustment conditions, the following four cases can be classified:
[0398] Case 1): The first bit value that the first image region needs to carry is the first value, and the grayscale value of the first image region that needs to be adjusted is determined based on the feature value.
[0399] In this embodiment, the electronic device can calculate the average partition deviation between the two partitions based on the first total grayscale value and the second total grayscale value. Specifically, the formula for calculating the average partition deviation can be expressed as: △=(S1-S2) / (m*n / 2)
[0400] Where △ represents the average partition deviation, S1 represents the first total gray value corresponding to the first partition, S2 represents the second total gray value corresponding to the second partition, m represents the number of rows in the first image region, and n represents the number of columns in the first image region. Since each of the two partitions occupies half the area of the first image region, the number of corresponding pixels is also half the total number of pixels in the first image region. Therefore, after calculating the difference between the two total gray values, dividing by the number of pixels corresponding to each partition yields the average partition deviation.
[0401] In this embodiment, the electronic device can calculate the first depth parameter corresponding to the first image region based on the first grayscale extreme value and the second grayscale extreme value. The first depth parameter can be the absolute value of the difference between the two extreme values, specifically expressed as: D = |max(Area1) - min(Area2)|
[0402] Where D is the first depth parameter mentioned above, max(Area1) is the maximum value corresponding to the first partition, i.e. the first grayscale extreme value, and min(Area2) is the minimum value corresponding to the second partition, i.e. the second grayscale extreme value.
[0403] If the bit value is the first value, and the sum of the average partition deviation and the depth parameter is greater than 0 (i.e. △>-D), it means that the gray values in the first image region need to be adjusted so that △>-D. That is, the total gray value in the first partition needs to be increased and the total gray value in the second partition needs to be decreased to increase the difference between the gray values.
[0404] In one possible implementation, the first value can be 0, and correspondingly, the second value can be 1.
[0405] In one possible implementation, the first value can be 1, and correspondingly, the second value can be 0.
[0406] In one possible implementation, the electronic device can adjust the first pixel value of each first pixel in the two partitions according to a preset first step length. That is, according to the preset first step length, the first pixel value of each first pixel in the first partition is decreased, and according to the preset first step length, the first pixel value of each first pixel in the second partition is increased. For example, FIG14 shows a schematic diagram of pixel value adjustment based on step length according to an embodiment of this application. Referring to FIG14, the first image region 141 needs to carry a first bit value of 0, and the above-mentioned Δ>-D can be determined through calculation. Therefore, the pixel value of each pixel in partition 142 of the first image region 141 can be increased, and the pixel value of each pixel in partition 143 can be decreased, according to the preset first step length.
[0407] It should be noted that after adjusting the grayscale values of the two partitions through the preset first step, the feature values can be recalculated based on the adjusted pixel values, that is, the first feature value and the second feature value can be recalculated, and their matching with the adjustment conditions can be judged.
[0408] In a possible implementation, the above-mentioned first step size may be a preset step size value, or may be determined based on the difference between the partition deviation mean and the first depth parameter, that is, the step size ε=Δ-D. If the first step size can be adjusted according to the gray level deviation mean and the first depth parameter, the iteration speed when adjusting the first pixel value of the first pixel can be improved while reducing the influence on the screenshot color, that is, the probability of occurrence of multiple iterations that still fail to meet the adjustment requirement is reduced.
[0409] Case 2): the first bit value to be carried by the first image region is a first value, and it is determined based on the feature value that there is no need to adjust the gray value in the first image region
[0410] If the first bit value to be carried by the first image region is the first value, and the sum of the above-mentioned partition deviation mean and the above-mentioned first depth parameter is less than 0 (that is, Δ < -D), it means that there is no need to adjust the first pixel value of the first pixel in the first image region, and at this time, the first pixel value of each first pixel in the first image region can be maintained.
[0411] Case 3): the first bit value to be carried by the first image region is a second value, and it is determined based on the feature value that the first pixel value in the first image region needs to be adjusted
[0412] If the first bit value to be carried by the first image region is the second value, and the difference between the above-mentioned partition deviation mean and the above-mentioned first depth parameter is less than 0 (that is, Δ < D), it means that the first pixel value of each first pixel in the first image region needs to be adjusted to make Δ < D, that is, it is necessary to reduce the total first gray value in the first partition and increase the total second gray value in the second partition, so as to improve the difference between the gray values of the two. For the specific adjustment manner, reference may be made to the related description of case 1), which will not be repeated herein.
[0413] In a possible implementation, the electronic device may adjust the first pixel value of each first pixel in the two partitions respectively according to a preset first step size, that is, according to the above-mentioned preset first step size, reduce the first pixel value of each first pixel in the first partition, and according to the above-mentioned preset first step size, increase the first pixel value of each first pixel in the second partition.
[0414] It should be noted that after the first pixel value of each first pixel in the two partitions is adjusted through the preset first step size, the feature value calculated based on the adjusted first pixel value may be re-obtained, that is, the first feature value and the second feature value are recalculated, and the matching situation between the feature values and the adjustment condition is judged.
[0415] Case 4): the first bit value to be carried by the first image region is a second value, and it is determined based on the feature value that there is no need to adjust the first pixel value of each first pixel in the first image region
[0416] If the first bit value that the first image region needs to carry is the second value, and the difference between the average partition deviation and the depth parameter is greater than 0 (i.e., △ < -D), then it means that there is no need to adjust the first pixel value of each first pixel in the first image region. At this time, the first pixel value of each first pixel in the first image region can be maintained.
[0417] In this embodiment, the basis for determining whether the first pixel value in the first image area needs to be adjusted is determined based on the first depth parameter and the average partition deviation, which enables the pixel value adjustment to achieve gradient adaptation based on the color of the first image area.
[0418] Since the above two feature values can be used to determine the texture between different partitions, Figure 15, for example, shows a comparison of the visual impact of grayscale value adjustment under different textures provided in an embodiment of this application. Referring to Figure 15, the image contains multiple regions, namely region 1 and region 2. Region 1 is a solid color block, and region 2 is a color block with a certain texture. For region 1, its corresponding D is smaller, while for region 2, D is larger. If the pixel value on the left side of region 1 is reduced by 1 and the pixel value on the right side is increased by 1 (as shown in region 151), it is difficult to detect the color deviation between the two partitions. If the pixel value on the left side of region 1 is reduced by 5 and the pixel value on the right side is increased by 5 (as shown in region 152), it is easier to detect the color deviation between the two partitions. This is because region 1 is a relatively simple texture map, and even small pixel value fluctuations will be noticed by the user. However, for region 2, which has a more complex texture, similarly reducing the pixel value on the left side by 5 and increasing the pixel value on the right side by 5 results in less difference between the adjusted region 153 and region 2 in the image, making it difficult to detect. Therefore, electronic devices can determine the first step length of adjustment and the corresponding adjustment method based on the above two parameters, which can reduce the impact of pixel value adjustment on the visual experience of the screenshot and increase the concealment of embedded information.
[0419] Method 2: Adjustment process based on the frequency domain matrix
[0420] In this embodiment, the electronic device can determine two frequency point groups from the frequency points in the low-frequency region of the frequency domain matrix, namely a first frequency point group and a second frequency point group. The two frequency point groups can be two adjacent frequency point groups in the low-frequency region of the frequency domain matrix. For example, the first frequency point group can be selected from the 1st to the 8th frequency points, and the second frequency point group can be selected from the 9th to the 16th frequency points.
[0421] For example, Figure 16 shows a schematic diagram of frequency point group selection provided in an embodiment of this application. Referring to Figure 16, the frequency domain matrix is a k*k frequency domain matrix, and the distribution order of the frequency points from largest to smallest can be shown by curve 161 in Figure 16. Therefore, the first frequency point group mentioned above can correspond to the frequency points in region 162, and the second frequency point group can correspond to the frequency points in region 163.
[0422] In this embodiment, the electronic device can select a frequency point from the first frequency point group as the first frequency point and a frequency point from the second frequency point group as the second frequency point, calculate the frequency domain difference between the two frequency points, match the adjustment conditions corresponding to the first bit value that the first image region needs to carry based on the frequency domain difference, and adopt the corresponding adjustment method based on the matching result.
[0423] In one possible implementation, fixed frequency points can be selected as the first frequency point and the second frequency point. Optionally, the last frequency point in the first frequency point group can be selected as the first frequency point, and the first frequency point in the second frequency point group can be selected as the first frequency point, for example, the 8th frequency point as the first frequency point, and the 9th frequency point as the second frequency point.
[0424] In one possible implementation, the electronic device can also dynamically select the corresponding first frequency point and second frequency point based on the frequency domain values of each frequency point in the frequency domain matrix. For example, Figure 17 shows a flowchart of the frequency point selection implementation provided in an embodiment of this application. The specific description is as follows:
[0425] In S1701, a first frequency point is determined from the first frequency point group based on the frequency domain values corresponding to each frequency point in the frequency domain matrix and the quantization matrix corresponding to the frequency domain matrix; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0426] In this embodiment, the electronic device can store the quantization coefficients corresponding to each frequency point, thereby forming a quantization matrix corresponding to the frequency domain matrix. After calculating the frequency domain matrix corresponding to the first image region, the electronic device can identify the relationship between the frequency domain value of each frequency point in the first frequency point group and its corresponding quantization coefficient, and select the frequency point in the first frequency point group whose frequency domain value is less than the corresponding quantization coefficient as the first frequency point.
[0427] Continuing with Figure 16 as an example, the frequency domain value corresponding to the 8th frequency point (i.e., frequency point 164) in the first frequency point group is 25, which is greater than the corresponding quantization coefficient (e.g., 14) in the quantization matrix. Therefore, other frequency points can be selected from the first frequency point group, such as the 7th frequency point (i.e., frequency point 165), which has a frequency domain value of 10, which is less than the corresponding quantization coefficient (e.g., 16) in the quantization matrix. Therefore, the 7th frequency point, i.e., frequency point 165, can be selected as the first frequency point.
[0428] In one possible implementation, the electronic device can identify the relationship between the frequency domain value and its quantization coefficient of each frequency point in the first frequency point group in descending order, thereby determining a first frequency point.
[0429] In S1702, the second frequency point is determined from the second frequency point group based on the first position of the first frequency point in the first frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0430] In this embodiment, after determining the first frequency point in the first frequency point group, the electronic device can select a corresponding second frequency point from the second frequency point group based on the position of the first frequency point in the first frequency point group or based on the order of the first frequency point in the first frequency point group. The positional relationship between the two frequency points is a mirror image of each other. Continuing with Figure 16 as an example, the selected first frequency point is the seventh frequency point in the first frequency point group, i.e., the second to last frequency point in the first frequency point group. Therefore, when selecting a second frequency point from the second frequency point group, the second frequency point in the second frequency point group can be selected as the second frequency point, i.e., the 10th frequency point (frequency point 166).
[0431] For example, Figure 18 shows a schematic diagram of the correspondence between a first frequency point and a second frequency point provided in an embodiment of this application. The first frequency point group consists of the 1st to 8th frequency points in the frequency domain matrix, and the second frequency point group consists of the 9th to 16th frequency points in the frequency domain matrix. If the electronic device determines that the 8th frequency point is the first frequency point, then the second frequency point is the 9th frequency point; if the electronic device determines that the 7th frequency point is the first frequency point, then the second frequency point is the 10th frequency point, and so on. The remaining frequency point combinations are (6,11), (5,12), (4,13), (3,14), (2,15), and (1,16).
[0432] In the embodiments of this application, by comparing the magnitude relationship between each frequency point and the quantization coefficient, a frequency point with strong anti-interference capability can be selected as the frequency point carrying the bit value. This improves the reliability of the bit value transmission process while reducing the need for grayscale value adjustment.
[0433] In this embodiment, the electronic device can calculate the frequency domain difference between two frequency points and determine whether the first pixel value of each first pixel in the first image region needs to be adjusted based on the adjustment conditions and the frequency domain difference. For example, Figure 19 shows a schematic diagram of frequency domain adjustment classification provided in an embodiment of this application. Referring to Figure 19, based on the matching between the frequency domain difference and the adjustment conditions, the following four cases can be distinguished:
[0434] Case 1) The first bit value that the first image region needs to carry is the first value, and the first pixel value of the first pixel in the first image region that needs to be adjusted is determined based on the frequency domain difference.
[0435] If the first bit value to be carried by the first image region is a first value, and the difference between the frequency domain difference and the preset second depth parameter is greater than 0 (i.e., Δ>D), then it means that the frequency domain values of the two selected frequency points need to be adjusted. In order to make the frequency domain difference greater than the preset second depth parameter, the frequency domain value of the first frequency point can be reduced and the frequency domain value of the second frequency point can be increased based on the preset second step size. For example, if the frequency domain value of the first frequency point is C1 and the frequency domain value of the second frequency point is C2, the adjusted frequency domain value of the first frequency point is C1'=C1-ε and the adjusted frequency domain value of the second frequency point is C2'=C2+ε.
[0436] In one possible implementation, the second depth parameter mentioned above can be determined based on the quantization coefficient corresponding to the first frequency point.
[0437] In one possible implementation, if the first value is 0, the second value can be 1; if the first value is 1, the second value can be 0. The specific settings can be adjusted according to the actual situation and are not limited here.
[0438] In one possible implementation, the second step size can be twice or more the quantization coefficient corresponding to the first frequency point, thereby enabling the adjusted frequency domain value to resist quantization and thus improving the accuracy of subsequent first bit value identification.
[0439] In this embodiment, after adjusting the frequency domain values corresponding to the two frequency points, the electronic device can recalculate the frequency domain difference based on the adjusted first and second frequency points and determine its matching with the adjustment conditions.
[0440] Wherein, if the adjusted frequency domain difference is smaller than the aforementioned second depth parameter, an inverse Fourier transform, that is, an inverse DCT operation, may be performed on the adjusted frequency domain matrix, so as to determine the first pixel value corresponding to each first pixel in the adjusted first image region, that is, the adjustment operation on the first pixel value is completed. It should be noted that the first pixel value corresponding to each first pixel in the adjusted first image region is the third pixel value of each second pixel in the corresponding first image region in the second screenshot.
[0441] Case 2) The first bit value to be carried by the first image region is a first value, and it is determined based on the frequency domain difference that there is no need to adjust the first pixel value of the first pixel in the first image region
[0442] If the first bit value to be carried by the first image region is a first value, and the difference between the aforementioned frequency domain difference and the preset second depth parameter is less than 0 (i.e., Δ<D), it means that there is no need to adjust the first pixel value of the first pixel in the first image region, and at this time, the first pixel value of each first pixel in the first image region may be maintained.
[0443] Case 3) The first bit value to be carried by the first image region is a second value, and it is determined based on the frequency domain difference that the first pixel value of the first pixel in the first image region needs to be adjusted
[0444] If the first bit value to be carried by the first image region is a second value, and the difference between the aforementioned frequency domain difference and the preset second depth parameter is less than 0 (i.e., Δ<D), it means that the frequency domain values of the two selected frequency points need to be adjusted. Wherein, in order to make the frequency domain difference smaller than the preset second depth parameter, the frequency domain value of the first frequency point may be increased, and the frequency domain value of the second frequency point may be decreased. For example, the frequency domain value of the aforementioned first frequency point is C1, the frequency domain value of the second frequency point is C2, the adjusted frequency domain value of the first frequency point C1'=C1+ε, and the adjusted frequency domain value of the second frequency point C2'=C2-ε.
[0445] In this embodiment, after adjusting the frequency domain values corresponding to the aforementioned two frequency points, the electronic device may recalculate the aforementioned frequency domain difference based on the adjusted first frequency point and the adjusted second frequency point, and determine its matching condition with the adjustment condition.
[0446] Wherein, if the adjusted frequency domain difference is greater than the aforementioned second depth parameter, an inverse Fourier transform, that is, an inverse DCT operation, may be performed on the adjusted frequency domain matrix, so as to determine the first pixel value of each first pixel in the first image region, that is, the adjustment operation on the first pixel value is completed.
[0447] Case 4) The first bit value that the first image region needs to carry is the second value, and the first pixel value of the first pixel in the first image region does not need to be adjusted based on the frequency domain difference.
[0448] If the first bit value that the first image region needs to carry is the second value, and the difference between the frequency domain difference and the preset second depth parameter is greater than 0 (i.e. △>D), then it means that there is no need to adjust the first pixel value of the first pixel in the first image region. At this time, the first pixel value of each first pixel in the first image region can be maintained.
[0449] In this embodiment, the electronic device can select one or a combination of two of the above two methods to adjust the first pixel value and the second pixel value in the first screenshot. For example, the first pixel value in the first channel or the first encoding region and the second pixel value in the second channel or the second encoding region can be adjusted using method 1; or the first pixel value in the first channel or the first encoding region and the second pixel value in the second channel or the second encoding region can be adjusted using method 2; or the first pixel value in the first channel or the first encoding region can be adjusted using method 1 and the second pixel value in the second channel or the second encoding region can be adjusted using method 2; or the first pixel value in the first channel or the first encoding region can be adjusted using method 2 and the second pixel value in the second channel or the second encoding region can be adjusted using method 1. The specific method used to adjust each pixel value can be selected according to the actual situation and is not limited here.
[0450] In this embodiment, after the electronic device completes the adjustment operation on the first pixel value and the second pixel value of the first screenshot, it obtains a second screenshot carrying the first bit sequence and the second bit sequence. The second screenshot carries the first bit sequence corresponding to the attribute information containing the first identifier through the third pixel value, and the second bit sequence corresponding to the access link through the fourth pixel. Subsequently, the attribute information and access link carried by the second screenshot can be determined by parsing the second screenshot. It should be noted that, unlike existing watermarking technologies, which generally embed access links through readable strings or machine-readable QR codes, this embodiment adjusts the pixel values of the pixels in the screenshot based on the bit values in the bit sequence, making the embedded attribute information and access link invisible and impossible to read directly by scanning a QR code, thereby improving the concealment of the embedded information.
[0451] As can be seen from the above, in this embodiment of the application, when a first operation to take a screenshot of the first page currently displayed by the electronic device is received, a first screenshot corresponding to the first page and an access link corresponding to the first page can be obtained. By adjusting the first pixel value of the first screenshot in the first channel, the first identifier is carried in the third pixel value of the second screenshot in the first channel. By adjusting the second pixel value of the first screenshot in the second channel, the second bit sequence corresponding to the access link is carried in the fourth pixel value of the second screenshot in the second channel. Since the second screenshot carries the first identifier and the access link in the pixel values of the two channels, when the first page needs to be displayed through the second screenshot, the electronic device can first determine the first identifier based on the third pixel value of the second screenshot in the first channel. If the access link is determined based on the first identifier, the access link is then determined based on the fourth pixel value of the second screenshot in the second channel, and the first page is displayed based on the access link. Compared to existing link embedding techniques, this embodiment can embed the first identifier and the access link into the second screenshot by adjusting the pixel values of different channels. This implicitly carries the first identifier and the access link in the screenshot without occupying the visible area. In other words, the embedded access link is invisible to the user, thereby increasing the proportion of effective content in the screenshot and maintaining the visibility of the first page content. On the other hand, hierarchical encoding is achieved through pixel values of different channels. Subsequently, the first pixel value of the first channel can be parsed first. If the access link is identified in the screenshot based on the determined first identifier, subsequent parsing operations can be performed. This improves the efficiency of image parsing, thereby reducing unnecessary parsing operations and reducing the consumption of device computing resources.
[0452] Phase 2: Decoding screenshots containing embedded attribute information and access links.
[0453] For example, Figure 20 shows a flowchart of an image processing method according to an embodiment of this application in the image decoding stage. Referring to Figure 20, the image processing method is specifically used for decoding a screenshot that embeds access links in an invisible and unobtrusive manner. Specifically, the image processing method includes the following steps:
[0454] In S2001, in response to the second operation on the third screenshot, the first page corresponding to the access link carried by the third screenshot is displayed.
[0455] In this embodiment, the third screenshot is a screenshot that embeds the first bit sequence corresponding to the attribute information and the second bit sequence corresponding to the access link.
[0456] In some implementations, the first bit sequence corresponding to the aforementioned attribute information can be carried in the fifth pixel value of the first channel of the third screenshot, and the second bit sequence corresponding to the aforementioned access link can be carried in the sixth pixel value of the second channel of the third screenshot.
[0457] In some implementations, the first bit sequence corresponding to the aforementioned attribute information can be carried in the fifth pixel value of the first encoding region of the third screenshot, and the second bit sequence corresponding to the aforementioned access link can be carried in the sixth pixel value of the second encoding region of the third screenshot.
[0458] The electronic device can display a third screenshot, and then the user can initiate an image decoding operation on the third screenshot in the interface of the first application, i.e. the second operation mentioned above. In response to the second operation, if the first identifier in the attribute information is determined to be a third value, the first page corresponding to the access link is displayed through the access link.
[0459] For example, Figure 21 illustrates a schematic diagram of a first application scenario of the third screenshot provided in an embodiment of this application. Referring to Figure 21(a), after a user initiates a screenshot operation on a web page, the corresponding screenshot can be stored in the local gallery. The user can open the gallery application on the electronic device and display thumbnails of the stored images in the image list interface (interface 211 in Figure 21). The interface 211 displays a screenshot 212 of a web page, which carries an access link to the web page. The user can click on screenshot 212 to preview it, resulting in the interface shown in Figure 21(b).
[0460] In some implementations, when a user clicks on screenshot 212, a decoding operation can be triggered on screenshot 212 to determine whether it carries attribute information and an access link. If the first identifier in the attribute information of screenshot 212 has a third value, it indicates that it carries an access link, and the corresponding page jump control can be displayed, such as control 213 shown in Figure 21(b). The user can click on the control 213 to jump to the interface corresponding to the access link, as shown in Figure 21(d). The third value can be 1 or 0, depending on the actual situation.
[0461] In some implementations, when a user clicks on screenshot 212, i.e. initiates a preview operation on screenshot 212, if the fifth pixel value of the screenshot 212 in the first channel or the first encoding area is parsed and it is determined that the first identifier it carries is the third value, it indicates that the screenshot 212 carries an access link. Then, the sixth pixel value in the second channel or the second encoding area can be parsed to determine the carried access link and display the network page corresponding to the access link, as shown in Figure 21(d). In this case, the above-mentioned second operation can be a preview operation on screenshot 212.
[0462] In some implementations, users can also long-press screenshot 212 to bring up the corresponding operation menu 214, as shown in Figure 21(c). If the screenshot 212 contains an access link, the operation menu 214 may include a page jump control 215. Users can directly jump to the corresponding page by clicking the page jump control 215.
[0463] For example, Figure 22 illustrates a schematic diagram of a second scenario of the third screenshot provided in an embodiment of this application. Referring to Figure 22(a), a user can communicate with other users through a chat application, such as interface 221. Other users send screenshots carrying access links through their terminals, such as screenshot 222 in interface 221. Since screenshot 222 carries an access link, a specified operation can be initiated on screenshot 222 to jump to the page corresponding to the carried access link. The specified operation can include the following three types:
[0464] Method 1: Drag and drop the screenshot to the smart assistant
[0465] In the chat interface, the user can select screenshot 222 as the drag-and-drop object and drag it to the key area that activates the smart assistant, as shown in area 223 (bottom area) of Figure 22(a). When the user drags screenshot 222 to area 223, the smart assistant will be activated, as shown in Figure 22(b). The smart assistant's interactive interface 224 will be displayed on the chat interface. If the first identifier carried in screenshot 222 is detected as a third value, it will be determined that the screenshot 222 carries an access link, and the corresponding jump control 225 can be displayed to prompt the user whether to jump to the interface corresponding to the access link.
[0466] Method 2: Long press to trigger
[0467] Users can also long-press to bring up the operation menu 226 for screenshot 222, as shown in Figure 22(c). When the user long-presses screenshot 222, a parsing operation is triggered, which determines whether the first identifier carried in screenshot 222 is a third value. If an access link is detected (i.e., the first identifier is a third value), a page jump control 227 can be displayed in the operation menu 226. The process of parsing the access link of screenshot 222 can be completed between the display of operation menu 226 and the user clicking the page jump control 227, without having to complete the access link parsing operation when operation menu 226 is displayed. This reduces the waiting time required for operation menu 226 to be displayed and improves the smoothness of user operation.
[0468] Method 3: Click to trigger
[0469] Similar to the preview method triggered in the photo album, users can preview screenshot 222 in the chat application by clicking on screenshot 222, which will result in the interface shown in Figure 22(d). During the user's preview of screenshot 222, the electronic device can parse the screenshot 222 to determine whether it carries an access link. If it carries an access link, the corresponding page jump control 228 can be displayed in the preview interface. The user can click on the control 228 to jump to the corresponding page.
[0470] It should be noted that in other applications that can receive or preview images, the image parsing operation can also be triggered through any of the above methods. For specific implementation details, please refer to the above description, which will not be repeated here. In some implementations, the third screenshot can be the second screenshot generated through stage 1. For example, in the application scenario shown in Figure 21, screenshot 212 is a screenshot stored in the gallery. This screenshot 212 can be a screenshot taken by the user while browsing other pages and stored in the gallery. In this case, the screenshot 212 is the screenshot generated through stage 1, meaning the third screenshot is the second screenshot.
[0471] In some implementations, the third screenshot can be an image obtained based on the second screenshot. Continuing with the application scenario in Figure 21, the screenshot 212 can be received from other terminals, such as being received via Bluetooth and shared by other terminals and stored in the gallery, or being received via a chat application and saved in the local gallery. Because image errors can occur during inter-device transmission, such as changes in pixel values before and after transmission, the third screenshot is not identical to the second screenshot; rather, it is an image obtained after the second screenshot has been transmitted between devices.
[0472] In some possible implementations, during the use of the second screenshot, such as when the second screenshot is sent to other devices or when other applications obtain the second screenshot from the local gallery, the image can be compressed. In this case, the third screenshot can be a screenshot obtained by compressing the second screenshot, for example, by compressing the resolution of the second screenshot to obtain the third screenshot.
[0473] In this embodiment, when the electronic device detects that the user has initiated a second operation, since this application uses hierarchical encoding to embed information, it can carry the first bit sequence corresponding to the attribute information and the second bit sequence corresponding to the access link through two different pixel values. Furthermore, the attribute information carries a first identifier indicating whether the screenshot carries an access link. If it is determined from the first identifier that the screenshot does not carry an access link, there is no need to parse the sixth pixel value in the second channel or the second encoding area; that is, there is no need to perform a parsing operation on all pixel values of the entire image, reducing the computational resources required for parsing and improving the utilization rate of computational resources. Based on this, the electronic device can first parse the fifth pixel value in the third screenshot to obtain the first identifier carried in the third screenshot.
[0474] In some implementations, S2001 above includes the following steps:
[0475] In S2001.1, in response to the second operation, the attribute information of the third screenshot is determined based on the fifth pixel value of each first image region in the first channel.
[0476] In this embodiment, the attribute information may carry a first identifier. If the first identifier is a third value, it means that the third screenshot carries an access link, and subsequent parsing operations on the sixth pixel value can be performed. Conversely, if the first identifier is not a third value, it means that the third screenshot does not carry an access link, and page redirection is not required.
[0477] In this embodiment, the electronic device parses attribute information based on the fifth pixel value within the first channel or the first encoding region. This parsing process corresponds one-to-one with the process of embedding the first bit sequence into the first pixel value of the screenshot, and specifically includes the following steps: region division, feature matrix generation, and bit value determination. The following describes in detail how these three steps are implemented during the decoding process:
[0478] Step 1: Regional Division
[0479] For example, Figure 23 illustrates a schematic diagram of the implementation of determining the first bit value carried by each first image region according to an embodiment of this application. Referring to Figure 23, similar to the process of embedding the first bit sequence, when the electronic device decodes the third screenshot, it can first determine the region corresponding to the fifth pixel value, such as determining the region corresponding to the first channel or determining the first encoding region, and divide the determined region to obtain multiple first image regions, such as dividing image 231, which includes region 232 and region 233. Each first image region in the region corresponding to the fifth pixel value carries the first bit value of one bit of the first bit sequence corresponding to the attribute information.
[0480] In this embodiment, the electronic device can divide the region corresponding to the fifth pixel value according to a preset division method. For example, the preset division method limits the number of rows and columns, such as limiting the region corresponding to the fifth pixel value to be divided into M*N first image regions. Then, according to the above division method, the region corresponding to the fifth pixel value can be divided into M*N first image regions. For example, the first channel can be divided into M*N first image regions, or the first encoding region can be divided into M*N first image regions.
[0481] In some implementations, the aforementioned preset division method can also define the region size of each first image region, such as the number of pixels per row and per column in each first image region. The electronic device can divide the region corresponding to the fifth pixel value into multiple first image regions with the same region size as specified above. The region sizes of the first image regions obtained from different screenshots are consistent, thereby improving the size consistency of the first image regions between different screenshots. For the specific method of dividing the image region of the first grayscale value, please refer to the relevant description in Stage 1, which will not be repeated here.
[0482] In some possible implementations, the aforementioned region dimensions can be recorded in the aforementioned attribute information.
[0483] Step 2: Feature Matrix Generation
[0484] In this embodiment, the electronic device can construct a feature matrix corresponding to the first image region based on the fifth pixel value corresponding to each third pixel in the first image region. Then, it matches this feature matrix with subsequent recognition conditions to determine the first bit value carried by the first image region. Corresponding to the method of embedding the bit value, the electronic device can construct a feature matrix based on the embedding method. For example, if stage 1 uses a spatial domain matrix to embed the first bit value, the feature matrix generated in this step is also a spatial domain matrix; conversely, if stage 1 uses a frequency domain matrix to embed the first bit value, the feature matrix generated in this step is a frequency domain matrix. For details on how to obtain the feature matrix based on the grayscale values in the first image region, please refer to the relevant description in step 2 of stage 1, which will not be repeated here.
[0485] Taking the use of spatial matrix embedding of the first bit value in stage 1 as an example, based on the fifth value corresponding to each third pixel in region 232, a spatial matrix corresponding to region 232, namely matrix 234, can be constructed. The first bit value corresponding to region 232 can be determined through matrix 234.
[0486] If stage 1 uses a frequency domain matrix to embed bit values, then DCT transformation can be performed on the above matrix 234 to obtain the frequency domain matrix corresponding to region 232, such as matrix 235. Based on the corresponding recognition conditions, the bit value corresponding to region 232 can be determined.
[0487] Step 3: Bit value determination
[0488] In this embodiment, the electronic device can match the feature matrix with the corresponding recognition conditions to reconstruct the bit value corresponding to the first image region. Depending on the type of feature matrix, the methods for determining the bit value can be specifically divided into the following two types:
[0489] Method 1: Recognition process based on spatial matrix
[0490] In this embodiment, the electronic device can further divide the spatial matrix corresponding to the first image region into two partitions: a first partition and a second partition. The method for determining the two partitions is consistent with the method used during bit value adjustment. Continuing with Figure 23 as an example, after obtaining matrix 234, it can be divided vertically to obtain partitions 2341 and 2342. The electronic device can then calculate the total grayscale value corresponding to each of these two partitions.
[0491] In some implementations, the total grayscale value can be determined by adding the fifth pixel values of all third pixels within a partition to the fifth pixel values of the first channel. Taking partition 2341 as an example, the electronic device can directly add the fifth pixel values of pixels 1 to 8 in the first channel to calculate the total grayscale value corresponding to partition 2341, such as 1273. Correspondingly, the fifth pixel values of pixels 9 to 16 can be directly added to calculate the total grayscale value corresponding to partition 2432, such as 866.
[0492] In some implementations, the total grayscale value can be obtained by weighted summing of the fifth pixel value of each third pixel within a partition and the corresponding weight value of that third pixel; whereby the weight value of the third pixel is determined based on the distance between the location of the third pixel and the center of the first image region. Specifically, the closer to the center of the region, the larger the corresponding weight value.
[0493] For example, Figure 24 illustrates a schematic diagram of the relationship between the various fifth pixel values and weight values provided in an embodiment of this application. The first image region can be divided into three concentric circles: concentric circle 1, concentric circle 2, and concentric circle 3. Concentric circle 1 is the concentric circle where the center of the first image region is located, and its corresponding weight value is the largest, which can be 1. The weight value of all third pixels in concentric circle 1 is 1. Concentric circle 2 is the second largest, and the weight value of all third pixels in concentric circle 2 can be set to 0.5. Concentric circle 3 is the furthest from the center of the region, and its corresponding weight value is the smallest. For example, the weight value of all third pixels in concentric circle 3 can be set to 0.25. Thus, the total gray value corresponding to each partition can be calculated by weighting and superimposing the weight values corresponding to each third pixel and the fifth pixel value. The total grayscale value can be expressed as: S = S1 + 0.5 * S2 + 0.25 * S3, where S is the total grayscale value, S1 is the sum of the fifth pixel values of all third pixels in layer 1, S2 is the sum of the fifth pixel values of all third pixels in layer 2, and S3 is the sum of the fifth pixel values of all third pixels in layer 3.
[0494] In this embodiment, by setting different weight values based on the distance from the center of the region, the accuracy of the total grayscale value calculation can be improved. Since images may be distorted during transmission, and the central region has stronger resistance to distortion, its pixel values are more reliable. By setting different weight values when calculating the corresponding total grayscale value, the accuracy of bit value recognition can be improved.
[0495] In this embodiment, the electronic device can compare the total gray values corresponding to the two partitions. If the total gray value corresponding to the first partition (i.e., the third total gray value) is less than the total gray value corresponding to the second partition (i.e., the fourth total gray value), then the first bit value carried by the first image region can be determined to be a first value, for example, 0. Conversely, if the third total gray value is greater than the fourth total gray value, then the first bit value carried by the first image region can be determined to be a second value, for example, 1.
[0496] Continuing with Figure 23 as an example, if the total gray value of partition 2341 is greater than the total gray value of partition 2342, then the first bit value carried by the first image region can be determined to be 1.
[0497] In this embodiment, the electronic device can determine the first bit value carried by each first image region in the above manner, thereby constructing a first bit sequence, and obtain attribute information based on the first bit sequence, and then determine whether the first identifier in the attribute information is a third value.
[0498] Method 2: Recognition process based on frequency domain matrix
[0499] In this embodiment, after obtaining the frequency domain matrix corresponding to the first image region in the first channel, the electronic device can determine the first frequency point group and the second frequency point group in the frequency domain matrix, and calculate the first frequency domain total corresponding to the first frequency point group and the second frequency domain total corresponding to the second frequency point group.
[0500] The first frequency domain total can be calculated by superimposing the frequency domain values of each frequency point in the first frequency point group; similarly, the second frequency domain total can be calculated by superimposing the frequency domain values of each frequency point in the second frequency point group.
[0501] Continuing with Figure 23 as an example, the frequency domain matrix 235 contains frequency domain values corresponding to multiple frequency points. From the frequency domain matrix, frequency point group 2351 and frequency point group 2352 can be determined. Each frequency point group contains multiple frequency points, and the total frequency domain value of each frequency point group is calculated. For example, the total frequency domain value of frequency point group 2351 is 1068, and the total frequency domain value of frequency point group 2352 is 496.
[0502] In this embodiment, the electronic device can determine the first bit value carried by the first image region by comparing the magnitudes of the two frequency domain totals.
[0503] In some implementations, if the total amount of the first frequency domain is less than the total amount of the second frequency domain, then the first bit value carried by the first image region is determined to be a first value, for example, 0; if the total amount of the first frequency domain is greater than the total amount of the second frequency domain, then the first bit value carried by the first image region is determined to be a second value, for example, 1.
[0504] Continuing with Figure 23 as an example, if the total frequency domain value of frequency point group 2351 is greater than the total frequency domain value of frequency point group 2352, then the first bit value carried by the first image region can be determined to be 1.
[0505] In this embodiment, the electronic device can determine the first bit value carried by each first image region in the above manner, thereby constructing a first bit sequence, and obtain attribute information based on the first bit sequence, and then determine whether the first identifier in the attribute information is a third value.
[0506] In one possible implementation, if the first bit sequence is the original sequence obtained by Huffman encoding each character of the attribute information, and then the original sequence is redundantly encoded, then after determining the first bit sequence, the electronic device can first restore the corresponding original sequence through the redundancy decoding algorithm, and then determine each character corresponding to the original sequence through the Huffman encoding table, thereby obtaining the aforementioned attribute information.
[0507] In S2001.2, if the first identifier is a third value, the access link is determined according to the sixth pixel value of each second image region in the second channel of the third screenshot; each second image region carries the second bit value of one bit in the second bit sequence.
[0508] In this embodiment, the first identifier is used to indicate whether the third screenshot carries an access link. When the first identifier is a third value, for example, the first identifier is 1, it means that the third screenshot carries an access link. The electronic device can parse the second bit sequence corresponding to the access link it carries based on the sixth pixel value in the second channel or the second encoding area, and then determine the corresponding access link based on the second bit sequence.
[0509] In this embodiment, the process of determining the second bit sequence based on the sixth pixel value is the same as the process of determining the first bit sequence based on the fifth pixel value, and may include the following steps:
[0510] The third screenshot includes multiple second image regions in the second channel or second encoding region;
[0511] For any second image region, the second bit value carried by the second image region is determined based on the sixth pixel value of each third pixel in the second image region.
[0512] The second bit sequence is determined based on the second bit value carried by all second image regions, and the access link is obtained based on the second bit sequence.
[0513] Optionally, the second image region includes a first partition and a second partition. For any second image region, determining the second bit value carried by the second image region based on the sixth pixel value of each three-pixel within the second image region includes:
[0514] Calculate the total third gray level corresponding to the first partition based on the sixth pixel value of each three-pixel in the first partition.
[0515] Calculate the total fourth gray level corresponding to the second partition based on the sixth pixel value of each three-pixel in the second partition;
[0516] If the total amount of the third grayscale is less than the total amount of the fourth grayscale, the second bit value carried by the second image region is determined to be the first value;
[0517] If the total third gray level is greater than the total fourth gray level, the second bit value carried by the second image region is determined to be a second value.
[0518] Optionally, calculating the total third grayscale value corresponding to the first partition based on the sixth pixel value of each three-pixel in the first partition includes:
[0519] The third gray level corresponding to the first partition is calculated based on the sixth pixel value of each three-pixel and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the pixel and the center of the second image region.
[0520] Optionally, determining the second bit value carried by the second image region based on the sixth pixel value of each three-pixel region within the second image region includes:
[0521] Based on the sixth pixel value of each three-pixel region in the second image region, a third frequency domain matrix corresponding to the second image region is generated; the third frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band of the first frequency point group is lower than the frequency band of the second frequency point group.
[0522] If the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group, then the second bit value carried by the second image region is determined to be the first value.
[0523] If the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group, the second bit value carried by the second image region is determined to be a third value.
[0524] The implementation process of each of the above steps can be found in the relevant description in S2001.1, and will not be repeated here.
[0525] In one possible implementation, if the second bit sequence is obtained by Huffman coding of each character of the access link and then by redundant coding of the original sequence, then after determining the second bit sequence, the electronic device can first use a redundant decoding algorithm to restore the corresponding original sequence, and then use the Huffman coding table to determine each character corresponding to the original sequence, thereby obtaining the aforementioned access link.
[0526] In S2001.3, the first page is displayed via the access link.
[0527] In this embodiment, the electronic device can access a link to display a first page corresponding to that link. This first page can be displayed in the first application currently running in the foreground of the electronic device, or in other applications besides the first application; the specific display location can be determined based on the actual situation.
[0528] In some implementations, after the access link of the third screenshot is determined, the jump control corresponding to the access link can be displayed in the first application, such as control 213 in Figure 21(b) and jump control 215 in Figure 21(c). If the user clicks the above jump control, the first page corresponding to the access link can be displayed in the second application.
[0529] For example, Figure 25 shows a schematic diagram of the display of a first page provided in an embodiment of this application. Referring to Figure 25(a), the electronic device receives a screenshot 251 sent by user A in a chat application. The holder of the electronic device, i.e., user B, can drag 251 into the smart assistant. The electronic device displays the corresponding jump control 252 in the interface of the smart assistant. After the user clicks the jump control 252, if the chat application can call the browser component, the network page corresponding to the access link can be displayed in the chat application through the browser component, as shown in the interface of Figure 25(b). The access link is a shopping page. The user can display the shopping page in the interface of the chat application and display the purchase page corresponding to the access link in the page.
[0530] In some implementations, when a user needs to navigate to the first page corresponding to an access link, the electronic device can run a second application in the foreground and display the first page corresponding to the access link in the second application. Here, the second application is the application associated with the first page. Continuing with Figure 25 as an example, if the electronic device detects that the user clicks the aforementioned jump control 252, it can launch the online shopping application corresponding to the product page and display the product page in the online shopping application, as shown in Figure 25(c).
[0531] As can be seen from the above, in this embodiment of the application, when receiving the user's second operation on the third screenshot, the first identifier carried by the third screenshot can be determined first based on the fifth pixel value of the first channel in the third screenshot. If the first identifier is a third value, the access link carried by the third screenshot can be determined based on the sixth pixel value of the second channel. Then, the first page can be displayed based on the access link, thereby achieving the purpose of displaying the first page through the third screenshot. Compared with existing screenshot technologies, the access link carried by the third screenshot is not in a visible state, but can be obtained by parsing the sixth pixel value of the third screenshot in the second channel. While ensuring that the page content is not occupied by the QR code, it can also carry the access link of the first page, improving the visibility of the effective content of the first page in the third screenshot. On the other hand, by implementing hierarchical encoding through pixel values of different channels, and performing subsequent parsing operations only when the first identifier is determined to be a third value for the fifth pixel value of the first channel, the efficiency of image parsing can be improved, thereby reducing unnecessary parsing operations and reducing the consumption of device computing resources.
[0532] For example, Figure 26 illustrates an overall flowchart of the information embedding and information parsing process provided in an embodiment of this application. Referring to Figure 26, the electronic device can respond to a user's first operation, obtain a screenshot, the screenshot's attribute information, and an access link to the first page corresponding to the screenshot, and perform the following steps:
[0533] Step 1.1: Source coding, which converts the attribute information and access links into binary, for example, by using a Huffman coding table to convert the two types of information into the original sequence.
[0534] Step 1.2: Channel coding. The initial sequence is redundantly encoded using a redundancy coding algorithm to obtain a bit sequence.
[0535] Step 1.3: Color gamut conversion, which can convert the screenshot to a preset image format, such as converting all images to YCrCb format or all images to RGB format.
[0536] Step 1.4: First-level encoding: Encode the first pixel value of the first channel or the first encoding region in the screenshot, including: image segmentation, for example, dividing the image region corresponding to the first pixel value into M*N first image regions, and embedding each first bit value of the first bit sequence, for example, implementing bit value embedding according to the spatial domain matrix to improve the anti-scaling capability of the first bit value.
[0537] Step 1.5: Second-level encoding: Encode the second pixel value of the second channel or second encoding region in the screenshot, including: image segmentation, for example, dividing the region corresponding to the second pixel value into multiple second image regions, each second image region including k*k pixels, and performing DCT transformation on the pixel value matrix composed of k*k pixels to obtain a frequency domain matrix, and adjusting the frequency domain value of the frequency points in the frequency domain matrix according to the second bit value carried by the second encoding region, and performing inverse DCT transformation to determine the second pixel value of each pixel after adjustment. By embedding the second bit value in the frequency domain, the compression resistance of the embedded second bit value in the second image region is improved.
[0538] Step 1.6: Obtain a screenshot of the embedded information.
[0539] Electronic devices can share screenshots to other devices or store them locally so that when viewing the screenshots locally later, they can quickly jump to the corresponding page.
[0540] Step 2.1: Color gamut conversion. Electronic devices can perform color gamut conversion on screenshots, converting them into images of preset formats, such as YCrCb format or RGB format, and determining the channels for embedding information.
[0541] Step 2.2: Level 1 Decoding: Based on the fifth pixel value of the first channel or the first encoding area in the screenshot, determine its corresponding attribute information and determine whether the first identifier in the attribute information is the third value.
[0542] Step 2.3: Resolution Restoration: When the first identifier is the third value, the electronic device can divide the second channel or the second coding region into multiple second image regions and restore the second image regions to k*k pixels so as to achieve frequency domain alignment when generating the frequency domain matrix later.
[0543] Step 2.4: DCT Transform: Determine the second bit value carried by each second image region based on the total frequency value of the two frequency groups in the frequency domain matrix.
[0544] Step 2.5: Second-level decoding: Determine the second bit sequence based on the second bit value carried by each second image region.
[0545] Step 2.6: Channel decoding: The second bit sequence is calibrated and error-corrected to obtain the error-corrected sequence.
[0546] Step 2.7: Source Decoding: Based on a preset decoding table, such as a Huffman coding table, restore the characters of the error-corrected sequence to obtain the corresponding access link, and implement page redirection based on the access link.
[0547] Example 2:
[0548] Corresponding to the implementation flow of stage 1 in the image processing method of Embodiment 1 above, Figure 27 shows a structural block diagram of an image processing apparatus provided by an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0549] Referring to Figure 27, the image processing apparatus described above includes:
[0550] Page display unit 271 is used to display the first page;
[0551] The screenshot acquisition unit 272 is configured to acquire a second screenshot in response to a first operation that triggers a screenshot. The second screenshot includes a first channel and a second channel. The third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier. The fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page. The first channel and the second channel are different channels. The first identifier is used to indicate whether the second screenshot carries the access link.
[0552] Optionally, the second screenshot includes a plurality of first image regions within the first channel; the third pixel value of each of the plurality of first image regions in the first channel is used to carry the first bit value of a bit in the first bit sequence;
[0553] The second screenshot includes multiple second image regions within the second channel; the fourth pixel value of each of the multiple second image regions in the second channel is used to carry the second bit value of one bit in the second bit sequence.
[0554] Optionally, the screenshot acquisition unit includes:
[0555] The first screenshot acquisition unit is used to acquire a first screenshot in response to the first operation;
[0556] The pixel adjustment unit is configured to adjust the first pixel value of each first image region in the first channel of the first screenshot according to the first bit value that the first image region needs to carry, and to adjust the second pixel value of each second image region in the second channel of the first screenshot according to the second bit value that the second image region needs to carry, so as to obtain the second screenshot.
[0557] Optionally, the first image region includes a first partition and a second partition;
[0558] The pixel adjustment unit includes:
[0559] The feature value calculation unit is configured to, for any first image region, calculate a first feature value corresponding to the first partition in the first channel based on the first pixel value of the first partition, and calculate a second feature value corresponding to the second partition in the first channel based on the first pixel value of the second partition.
[0560] The feature value adjustment unit is used to adjust the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first feature value, the second feature value and the first bit value that the first image region needs to carry.
[0561] Optionally, the first feature value includes: a first total gray level and a first gray level extreme value; the second feature value includes: a second total gray level and a second gray level extreme value;
[0562] The feature value adjustment unit includes:
[0563] The mean calculation unit is used to calculate the mean partitioning deviation of the first image region in the first channel based on the first total gray level and the second total gray level.
[0564] The first depth parameter calculation unit is used to calculate the first depth parameter of the first image region in the first channel based on the first gray-level extreme value and the second gray-level extreme value.
[0565] The first determination unit is configured to, if the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, increase the first pixel value of each first pixel in the first channel of the first partition and decrease the first pixel value of each first pixel in the second partition in the first channel, and return to execute the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel;
[0566] The second determination unit is used to maintain the first pixel value of each first pixel in the first channel of the first partition and the second partition if the first bit value to be carried by the first image region is the first value and the sum of the partition deviation and the first depth parameter is less than 0.
[0567] The third determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, reduce the first pixel value of each first pixel in the first channel of the first partition and increase the first pixel value of each first pixel in the second partition in the first channel based on the first step length, and return to perform the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel;
[0568] The fourth determination unit is used to maintain the first pixel value of each first pixel in the first channel of the first partition and the second partition if the first bit value to be carried by the first image region is the second value and the difference between the partition deviation and the first depth parameter is greater than 0.
[0569] Optionally, the first step length is determined based on the difference between the average partition deviation and the first depth parameter.
[0570] Optionally, the pixel adjustment unit includes:
[0571] The first frequency domain matrix generation unit is configured to generate a first frequency domain matrix corresponding to the first image region based on the first pixel value of each first pixel in the first channel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point.
[0572] A frequency domain difference calculation unit is used to calculate the frequency domain difference between the first frequency point and the second frequency point;
[0573] The fifth determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is a first value and the frequency domain difference is less than a preset second depth parameter.
[0574] The sixth determination unit is used to reduce the first frequency domain value of the first frequency point and increase the second frequency domain value of the second frequency point based on a preset second step size if the first bit value to be carried by the first image region is a first value and the frequency domain difference is greater than the second depth parameter, and then return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0575] The seventh determination unit is used to determine the third pixel value of the first image region in the second screenshot based on the first frequency domain matrix if the first bit value to be carried by the first image region is the second value and the frequency domain difference is greater than the second depth parameter.
[0576] The eighth determination unit is configured to, if the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, increase the first frequency domain value of the first frequency point and decrease the second frequency domain value of the second frequency point, and return to perform the operation of calculating the frequency domain difference between the first frequency point and the second frequency point.
[0577] Optionally, the frequency domain difference calculation unit includes:
[0578] The first frequency point determination unit is used to determine a first frequency point from the first frequency point group based on the frequency domain value corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix.
[0579] The second frequency point determination unit is used to determine the second frequency point from the second frequency point group based on the first position of the first frequency point in the first frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
[0580] Optionally, the second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
[0581] Optionally, the plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
[0582] Optionally, the first bit sequence is generated based on the first identifier and the region size.
[0583] Optionally, the second bit sequence is obtained by performing redundant encoding on the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
[0584] Optionally, the screenshot acquisition unit includes:
[0585] The original screenshot display unit is used to display the original screenshot in response to the first operation;
[0586] The screenshot editing unit is used to perform image editing on the original screenshot in response to the editing operation to obtain the first screenshot.
[0587] Optionally, the first channel is the blue channel; the second channel is the red channel.
[0588] Optionally, the second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
[0589] Example 3:
[0590] Corresponding to the implementation flow of stage 2 in the image processing method of Embodiment 1 above, Figure 28 shows a structural block diagram of an image processing apparatus provided in an embodiment of this application. For ease of explanation, only the parts related to the embodiment of this application are shown.
[0591] Referring to Figure 28, the image processing apparatus described above includes:
[0592] Page jump unit 281 is used to respond to a second operation on a third screenshot and display a first page corresponding to the access link carried by the third screenshot; the access link is obtained by converting a second bit sequence determined by the sixth pixel value of the third screenshot in the second channel when the first identifier is a third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first channel; the first channel and the second channel are different channels; when the first identifier is a third value, it indicates that the second screenshot carries an access link.
[0593] Optionally, the device further includes:
[0594] The attribute information determination unit is used to determine the attribute information of the third screenshot based on the fifth pixel value of each first image region in the first channel; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information;
[0595] The access link determination unit is configured to determine the access link based on the sixth pixel value of each second image region in the second channel of the third screenshot if the first identifier is a third value; each second image region carries the second bit value of one bit in the second bit sequence.
[0596] Optionally, each of the first image regions includes a first partition and a second partition; the attribute information determination unit includes:
[0597] The third grayscale total determination unit is used to calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel.
[0598] The fourth grayscale total determination unit is used to calculate the fourth grayscale total corresponding to the second partition based on the fifth pixel value of each third pixel in the first channel within the second partition.
[0599] The first value recognition unit is used to determine that the first bit value carried by the first image region is a first value if the third gray level is less than the fourth gray level.
[0600] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the third gray level is greater than the fourth gray level.
[0601] Optionally, the third grayscale total determination unit is specifically used to: calculate the third grayscale total corresponding to the first partition based on the fifth pixel value of each third pixel and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the region center of the first image region.
[0602] Optionally, the attribute information determination unit includes:
[0603] The second frequency domain matrix determination unit is used to generate a second frequency domain matrix corresponding to the first image region based on the fifth pixel value of each third pixel in the first channel within the first image region; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band in which the first frequency point group is located is lower than the frequency band in which the second frequency point group is located.
[0604] The first value recognition unit is configured to determine the first bit value carried by the first image region as a first value if the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group.
[0605] The second value recognition unit is used to determine that the first bit value carried by the first image region is a second value if the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group.
[0606] Optionally, the attribute information further includes region size; the device further includes:
[0607] The size determination unit is used to divide the third screenshot into multiple second image regions based on the region size if the first identifier is a third value.
[0608] Optionally, the page navigation unit includes:
[0609] An application redirection unit is configured to display the first page in a second application in response to the second operation of the third screenshot in the first application; the first application and the second application are different applications.
[0610] Optionally, the second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
[0611] Optionally, the third screenshot is an image that is the same as or different from the second screenshot; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page.
[0612] Optionally, the third screenshot is obtained by compressing the second screenshot.
[0613] Figure 29 is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. As shown in Figure 29, the electronic device 29 of this embodiment includes: at least one processor 290 (only one processor is shown in Figure 29, and the number of processors may match the actual number of chips included in the electronic device in the embodiment), a memory 291, and a program 292 stored in the memory 291 and executable on the at least one processor 290. When the processor 290 executes the program 292, it implements the steps in any of the above-described image processing method embodiments.
[0614] The electronic device 29 may be a smartphone, tablet computer, laptop computer, desktop computer, etc. This electronic device may include, but is not limited to, a processor 290 and a memory 291. Those skilled in the art will understand that FIG29 is merely an example of the electronic device 29 and does not constitute a limitation on the electronic device 29. It may include more or fewer components than illustrated, or combine certain components, or different components; for example, it may also include input / output electronic devices, network access electronic devices, etc.
[0615] The processor 290 may be a Central Processing Unit (CPU), but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0616] In some embodiments, the memory 291 may be an internal storage unit of the electronic device 29, such as a hard disk or memory of the electronic device 29. In other embodiments, the memory 291 may be an external storage device of the electronic device 29, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., equipped on the electronic device 29. Furthermore, the memory 291 may include both internal storage units and external storage devices of the electronic device 29. The memory 291 is used to store the operating system, applications, bootloader, data, and other programs, such as program code. The memory 291 can also be used to temporarily store data that has been output or will be output.
[0617] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0618] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0619] This application also provides an electronic device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, wherein the processor executes the computer program to implement the steps in any of the above method embodiments.
[0620] This application also provides a readable storage medium storing a program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0621] This application provides a program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0622] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographic device / electronic device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0623] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0624] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. An image processing method, characterized in that, include: Display the first page; In response to the first operation used to trigger the screenshot, obtain the second screenshot; The second screenshot includes the first channel and the second channel; The third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page; the first channel and the second channel are different channels; The first identifier is used to indicate whether the second screenshot carries the access link.
2. The method according to claim 1, characterized in that, The second screenshot includes multiple first image regions within the first channel; the third pixel value of each of the multiple first image regions in the first channel is used to carry the first bit value of a bit in the first bit sequence; The second screenshot includes multiple second image regions within the second channel; the fourth pixel value of each of the multiple second image regions in the second channel is used to carry the second bit value of one bit in the second bit sequence.
3. The method according to claim 2, characterized in that, The step of obtaining a second screenshot in response to a first operation for triggering a screenshot includes: In response to the first operation, a first screenshot is obtained; Based on the first bit value that the first image region needs to carry, adjust the first pixel value of each first image region in the first channel of the first screenshot, and based on the second bit value that the second image region needs to carry, adjust the second pixel value of each second image region in the second channel of the first screenshot to obtain the second screenshot.
4. The method according to claim 3, characterized in that, The first image region includes a first partition and a second partition; The step of adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first bit value that the first image region needs to carry includes: For any of the first image regions, a first feature value corresponding to the first partition is calculated based on the first pixel value of the first partition in the first channel, and a second feature value corresponding to the second partition is calculated based on the first pixel value of the second partition in the first channel. Based on the first feature value, the second feature value, and the first bit value that the first image region needs to carry, adjust the first pixel value of each of the first image regions in the first channel of the first screenshot.
5. The method according to claim 4, characterized in that, The first feature value includes: a first total gray level and a first gray level extreme value; the second feature value includes: a second total gray level and a second gray level extreme value; The step of adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first feature value, the second feature value, and the first bit value that the first image region needs to carry includes: Based on the first gray level and the second gray level, calculate the average partition deviation of the first image region in the first channel; Based on the first gray-level extreme value and the second gray-level extreme value, calculate the first depth parameter of the first image region in the first channel; If the first bit value to be carried by the first image region is a first value, and the sum of the partition deviation mean and the first depth parameter is greater than 0, then based on the first step length, the first pixel value of each first pixel in the first channel in the first partition is increased and the first pixel value of each first pixel in the second partition in the first channel is decreased, and the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel is returned to be executed. If the first bit value that the first image region needs to carry is the first value, and the sum of the partitioning deviation and the first depth parameter is less than 0, then the first pixel value of each first pixel in the first partition and the second partition in the first channel is maintained. If the first bit value that the first image region needs to carry is the second value, and the difference between the average partition deviation and the first depth parameter is less than 0, then based on the first step length, reduce the first pixel value of each first pixel in the first channel of the first partition and increase the first pixel value of each first pixel in the first channel of the second partition, and return to execute the operation of calculating the first feature value corresponding to the first partition based on the first pixel value of the first partition in the first channel, and calculating the second feature value corresponding to the second partition based on the first pixel value of the second partition in the first channel; If the first bit value that the first image region needs to carry is the second value, and the difference between the partition deviation and the first depth parameter is greater than 0, then the first pixel value of each first pixel in the first partition and the second partition in the first channel is maintained.
6. The method according to claim 5, characterized in that, The first step length is determined based on the difference between the average partition deviation and the first depth parameter.
7. The method according to claim 3, characterized in that, The step of adjusting the first pixel value of each of the first image regions in the first channel of the first screenshot according to the first bit value that the first image region needs to carry includes: A first frequency domain matrix corresponding to the first image region is generated based on the first pixel value of each first pixel in the first channel within the first image region; the first frequency domain matrix includes a first frequency point and a second frequency point. Calculate the frequency domain difference between the first frequency point and the second frequency point; If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is less than a preset second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix. If the first bit value to be carried by the first image region is a first value, and the frequency domain difference is greater than the second depth parameter, then based on the preset second step size, the first frequency domain value of the first frequency point is reduced and the second frequency domain value of the second frequency point is increased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned. If the first bit value that the first image region needs to carry is the second value, and the frequency domain difference is greater than the second depth parameter, then the third pixel value of the first image region in the second screenshot is determined based on the first frequency domain matrix. If the first bit value to be carried by the first image region is the second value, and the frequency domain difference is less than the second depth parameter, then based on the second step size, the first frequency domain value of the first frequency point is increased and the second frequency domain value of the second frequency point is decreased, and the operation of calculating the frequency domain difference between the first frequency point and the second frequency point is returned.
8. The method according to claim 7, characterized in that, The calculation of the frequency domain difference between the first frequency point and the second frequency point includes: Based on the frequency domain values corresponding to each frequency point in the first frequency domain matrix and the quantization matrix corresponding to the first frequency domain matrix, a first frequency point is determined from the first frequency point group; the frequency domain value corresponding to the first frequency point is less than the quantization coefficient of the first frequency point in the quantization matrix. Based on the first position of the first frequency point in the first frequency point group, the second frequency point is determined from the second frequency point group; the second position of the second frequency point in the second frequency point group is a mirror image of the first position.
9. The method according to claim 7 or 8, characterized in that, The second depth parameter is determined based on the quantization coefficient corresponding to the first frequency point.
10. The method according to any one of claims 2-9, characterized in that, The plurality of first image regions are obtained by dividing the first screenshot according to a preset number of rows and columns; the plurality of second image regions are obtained by dividing the first screenshot according to the resolution of the first screenshot and the region size determined by the number of bits in the second bit sequence.
11. The method according to claim 10, characterized in that, The first bit sequence is generated based on the first identifier and the region size.
12. The method according to any one of claims 1-11, characterized in that, The second bit sequence is obtained by redundancy encoding of the original sequence corresponding to the access link; the original sequence is determined based on the Huffman encoding of each character in the access link.
13. The method according to any one of claims 1-12, characterized in that, The step of obtaining a second screenshot in response to a first operation for triggering a screenshot includes: In response to the first operation, the original screenshot is displayed; In response to the editing operation, the original screenshot is edited to obtain the first screenshot.
14. The method according to any one of claims 1-13, characterized in that, The first channel is the blue channel; the second channel is the red channel.
15. The method according to any one of claims 1-14, characterized in that, The second screenshot is obtained by adjusting the first pixel value of the first pixel of the first screenshot according to the second bit sequence.
16. A method for image processing, characterized in that, include: Display the first page; In response to the first operation used to trigger the screenshot, obtain the second screenshot; The second screenshot includes a first encoded region and a second encoded region; The third pixel value of the second screenshot in the first encoding region is obtained by adjusting the first pixel value in the first screenshot corresponding to the first page in the first encoding region according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second encoding region is obtained by adjusting the second pixel value of the first screenshot in the second encoding region according to the second bit sequence corresponding to the access link corresponding to the first page; the first encoding region and the second encoding region are different regions in the second screenshot; the first identifier is used to indicate whether the second screenshot carries an access link.
17. The method according to claim 16, characterized in that, The first encoded region is the top and / or bottom region in the second screenshot; the second encoded region is the other region in the second screenshot besides the first encoded region.
18. An image processing method, characterized in that, include: In response to the second operation on the third screenshot, the first page corresponding to the access link carried in the third screenshot is displayed; The access link is obtained by converting the second bit sequence determined by the sixth pixel value of the second channel based on the third screenshot when the first identifier is the third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first channel; the first channel and the second channel are different channels; When the first identifier is a third value, it indicates that the third screenshot carries an access link.
19. The method according to claim 18, characterized in that, Before displaying the first page corresponding to the access link carried in the third screenshot, the method further includes: The attribute information of the third screenshot is determined based on the fifth pixel value of each first image region in the first channel; the attribute information includes the first identifier; each first image region carries the first bit value of one bit in the first bit sequence corresponding to the attribute information; If the first identifier is the third value, then the access link is determined according to the sixth pixel value of each second image region in the second channel of the third screenshot; each second image region carries the second bit value of one bit in the second bit sequence.
20. The method according to claim 19, characterized in that, Each of the first image regions includes a first partition and a second partition; The step of determining the attribute information of the third screenshot based on the fifth pixel values of each first image region within the first channel includes: Calculate the total third grayscale value corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel; Calculate the total fourth grayscale value corresponding to the second partition based on the fifth pixel value of each third pixel in the first channel; If the total amount of the third gray level is less than the total amount of the fourth gray level, then the first bit value carried by the first image region is determined to be a first value; If the total third gray level is greater than the total fourth gray level, then the first bit value carried by the first image region is determined to be the second value.
21. The method according to claim 20, characterized in that, The step of calculating the total third grayscale value corresponding to the first partition based on the fifth pixel value of each third pixel in the first channel includes: The total third gray level corresponding to the first partition is calculated based on the fifth pixel value of each third pixel and the weight value associated with the location of the third pixel; the weight value is determined based on the distance between the location of the third pixel and the center of the first image region.
22. The method according to claim 19, characterized in that, The step of determining the attribute information of the third screenshot based on the fifth pixel values of each first image region within the first channel includes: Based on the fifth pixel value of each third pixel in the first channel within the first image region, a second frequency domain matrix corresponding to the first image region is generated; the second frequency domain matrix includes a first frequency point group and a second frequency point group; the frequency band where the first frequency point group is located is lower than the frequency band where the second frequency point group is located; If the total amount of the first frequency domain corresponding to the first frequency point group is less than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be a first value. If the total amount of the first frequency domain corresponding to the first frequency point group is greater than the total amount of the second frequency domain corresponding to the second frequency point group, then the first bit value carried by the first image region is determined to be the second value.
23. The method according to any one of claims 18-22, characterized in that, The attribute information also includes the region size; Before determining the access link based on the sixth pixel value of each second image region within the second channel of the third screenshot, the method further includes: If the first identifier is the third value, then the third screenshot is divided into regions according to the region size to obtain multiple second image regions.
24. The method according to any one of claims 18-23, characterized in that, The second operation in response to the third screenshot, displaying the first page corresponding to the access link carried in the third screenshot, includes: In response to the second operation of the third screenshot in the first application, the first page is displayed in the second application; the first application and the second application are different applications.
25. The method according to any one of claims 18-24, characterized in that, The second operation includes one of the following: a click operation, a long press operation, and a drag operation to drag the third screenshot to the smart assistant.
26. The method according to any one of claims 18-25, characterized in that, The third screenshot is an image that may be the same as or different from the second screenshot; the third pixel value of the second screenshot in the first channel is obtained by adjusting the first pixel value of the first screenshot corresponding to the first page in the first channel according to the first bit sequence corresponding to the first identifier; the fourth pixel value of the second screenshot in the second channel is obtained by adjusting the second pixel value of the first screenshot in the second channel according to the second bit sequence corresponding to the access link corresponding to the first page.
27. The method according to claim 26, characterized in that, The third screenshot is obtained by compressing the second screenshot.
28. An image processing method, characterized in that, include: In response to the second operation on the third screenshot, the first page corresponding to the access link carried in the third screenshot is displayed; The access link is obtained by converting the second bit sequence determined by the sixth pixel value of the third screenshot in the second encoding region when the first identifier is the third value; the first bit sequence corresponding to the first identifier is carried in the fifth pixel value of the third screenshot in the first encoding region.
29. An electronic device, characterized in that, The electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the method as claimed in any one of claims 1 to 15, or the steps of the method as claimed in any one of claims 16 to 17, or the steps of the method as claimed in any one of claims 18 to 27, or the steps of the method as claimed in claim 27.
30. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as claimed in any one of claims 1 to 15, or implements the steps of the method as claimed in any one of claims 1 to 15, or implements the steps of the method as claimed in any one of claims 16 to 17, or implements the steps of the method as claimed in any one of claims 18 to 27, or implements the steps of the method as claimed in claim 27.