Image processing method and apparatus

By performing edge segmentation and filter bank filtering on the image, the optimal region is determined and information is embedded, which solves the problem of low image security and achieves efficient and secure information embedding.

CN116433567BActive Publication Date: 2025-11-07CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210001641.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2025-11-07
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

Current technologies have low image security, and watermarks are easily tampered with and imitated, making it impossible to effectively guarantee the authenticity of images.

Method used

By segmenting the edge image of the target image into blocks, edge blocks that meet specific conditions are selected to determine the optimal region. The target filter bank and cost function are used to determine the information embedding region, and spatiotemporal coding is used to embed the information into the image.

Benefits of technology

It improves image security and information embedding efficiency, reduces the amount and dimensionality of image processing data, and ensures the reliability and security of information embedding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116433567B_ABST
    Figure CN116433567B_ABST
Patent Text Reader

Abstract

The application provides an image processing method and device, the method comprising: performing block processing on an edge image corresponding to a target image to obtain an edge block; determining an optimal region based on a first edge block satisfying a target condition; and embedding target embedding information into the target image based on the optimal region; wherein the target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information. The image processing method and device provided in the embodiments of the application can filter out an optimal region for information embedding, thereby improving image security, reducing information embedding cost and improving information embedding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of image processing, and in particular to an image processing method and device. BACKGROUND

[0002] With the continuous development of the Internet and information technology, more and more people use image processing tools or image editing software, and the authenticity of images becomes very important. Unauthorized copying or tampered images can affect the interests of the author or have a negative impact. At present, images can be protected by adding watermarks. However, due to the visibility of the watermark, even if a watermark is added to the image, there is still a risk of tampering and imitation, and the security is low. Tamperers can add similar watermarks to the fake images, making it impossible to identify the authenticity of the images, and thus the security of the images cannot be guaranteed. SUMMARY

[0003] Embodiments of the present application provide an image processing method and device to solve the technical problem of low image security in the prior art.

[0004] In a first aspect, an embodiment of the present application provides an image processing method, comprising:

[0005] performing block processing on an edge image corresponding to a target image to obtain an edge block;

[0006] determining an optimal region based on a first edge block satisfying a target condition;

[0007] embedding target embedding information into the target image based on the optimal region;

[0008] The target condition is determined according to the size of the edge block, the size of the edge image, and the length of the target embedding information.

[0009] In one embodiment, the embedding of the target embedding information into the target image based on the optimal region comprises:

[0010] determining a cost function corresponding to the optimal region based on a target filter set and image residuals in different directions corresponding to the optimal region;

[0011] determining a target embedding region of the target image in the optimal region based on the cost function;

[0012] embedding the target embedding information into the target embedding region.

[0013] In one embodiment, the determination of the cost function corresponding to the optimal region based on the target filter set and the image residuals in different directions corresponding to the optimal region comprises:

[0014] determine the image residual of different directions based on the optimal region and the filter of different directions;

[0015] determine the cost function based on the image residual and the target mean filter;

[0016] The target filter set includes the filter of different directions and the target mean filter.

[0017] In one embodiment, the determination of the optimal region based on the first edge block satisfying the target condition comprises:

[0018] determine a second edge block from the first edge block based on the width of the line spread function corresponding to the first edge block and the gray variance of the first edge block;

[0019] determine the optimal region based on the second edge block.

[0020] In one embodiment, the image residual of different directions is specifically:

[0021]

[0022] wherein R (k) represents the image residual of different directions, K (k) represents the filter of different directions, X represents a matrix corresponding to the optimal region, represents convolution operation;

[0023] The cost function is specifically:

[0024]

[0025] wherein ρ' represents the cost function, and L represents the target low-pass filter.

[0026] In one embodiment, the target condition is specifically:

[0027] and / or

[0028] wherein η represents the proportion of the number of rows containing target number of non-zero value pixels in the edge block to the total number of rows of the edge block, ρ represents the proportion of the number of columns containing target number of non-zero value pixels in the edge block to the total number of columns of the edge block, M represents the length of the target embedded information, W represents the side length of the edge block, and x·y represents the size of the edge image.

[0029] In a second aspect, the embodiments of the present application provide an image processing device, comprising:

[0030] An acquisition module is configured to acquire an edge block by performing block processing on an edge image corresponding to a target image.

[0031] A determination module is configured to determine an optimal region based on a first edge block satisfying a target condition.

[0032] An embedding module is configured to embed the target embedding information into the target image based on the optimal region.

[0033] The target condition is determined according to a size of the edge block, a size of the edge image, and a length of the target embedding information.

[0034] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, and the processor implements the steps of the image processing method in the first aspect when executing the program.

[0035] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, and the computer program implements the steps of the image processing method in the first aspect when executed by a processor.

[0036] The image processing method and device provided by the embodiment of the present application can filter out edge regions that do not satisfy the target condition, retain more representative first edge blocks, reduce image processing data volume and image dimension, facilitate information embedding, and thus improve image security. Meanwhile, the information embedding cost can be reduced, and the information embedding efficiency is greatly improved. BRIEF DESCRIPTION OF DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the present application or the prior art, the following will briefly introduce the drawings needed in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0038] Figure 1 is a flowchart of the image processing method provided by the embodiment of the present application;

[0039] Figure 2 is an edge block schematic diagram of applying the image processing method provided by the embodiment of the present application;

[0040] Figure 3 is a target edge block acquisition flowchart of applying the image processing method provided by the embodiment of the present application;

[0041] Figure 4is a cost function construction schematic diagram of an image processing method provided by an embodiment of the application;

[0042] Figure 5 is a flowchart of an image processing method provided by an embodiment of the application;

[0043] Figure 6 is a structural schematic diagram of an image processing device provided by an embodiment of the application;

[0044] Figure 7 is a physical structural schematic diagram of an electronic device provided by an embodiment of the application. DETAILED DESCRIPTION

[0045] To make the objectives, technical solutions and advantages of the present application clearer, the technical solutions of the present application will be described in detail below with reference to the drawings in the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.

[0046] In the related art, there is an image encryption method as follows:

[0047] I. Directly encrypting an image through a watermark, and then performing multiple information conversion on the watermark, and at least once of the information conversion is encrypted information conversion, so as to obtain an encrypted watermark. However, all image data needs to be processed, and the calculation amount is large; the encryption position is vulnerable to attack, thereby resulting in weak security of the whole image.

[0048] II. Using a neural network or the like to encrypt an image. For example, an LCNN neural network can be established to encrypt an image, but the design scale of the LCNN neural network is relatively large, and there are problems of complex model, low efficiency and slow speed, and it is difficult to achieve real-time effect in actual application, and has certain limitations.

[0049] The image processing method and device provided by the embodiments of the present application will be described in detail below with reference to the drawings and specific embodiments and application scenarios.

[0050] Figure 1 is a flowchart of an image processing method provided by an embodiment of the application. Referring to Figure 1 , the present application provides an image processing method, which can include steps 110, 120 and 130.

[0051] Step 110, performing block processing on an edge image corresponding to a target image to obtain an edge block;

[0052] Step 120, determining an optimal region based on the first edge block satisfying the target condition;

[0053] Step 130, embedding the target embedding information into the target image based on the optimal region;

[0054] The target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information.

[0055] The execution subject of the image processing method provided by the embodiments of the present application can be an electronic device, a component in the electronic device, an integrated circuit or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook or a personal digital assistant (PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), etc., which are not limited in the embodiments of the present application.

[0056] The technical solutions of the present application will be described in detail below with the computer executing the image processing method provided by the embodiments of the present application as an example.

[0057] It can be understood that the target image will be subjected to edge detection processing to obtain an edge image before step 110.

[0058] Optionally, the target image can be any image, which is not limited herein. In the case of the target image being an RGB image, the RGB image is first converted into a gray-scale image. The edge information features described by the gray-scale image are consistent with those described by the color image, and the gray-scale image can greatly reduce the original data amount of the image, so the gray-scale image needs to be obtained first. The edge features of the gray-scale image are extracted by using a Canny edge detection algorithm to obtain an edge image. The edge image includes the edge information of the image.

[0059] Optionally, the edge image is subjected to block processing in step 110, and then the edge image is divided into a plurality of non-overlapping edge blocks.

[0060] For example, an edge image with a size of x x y is selected from the target image, and the edge image is divided into a plurality of non-overlapping rectangular edge blocks. The edge image can be a partial image or the whole image obtained from the target image. Specifically, there is an edge image with a size of 512 x 512 pixels, and each edge block with a size of 32 x 32 pixels in the edge image is divided. The edge image can be divided into 256 edge blocks with a size of 32 x 32 pixels. The position number of the edge blocks in the edge image can also be represented by m and n, where m represents the position number in the vertical direction of the edge image, and n represents the position number in the horizontal direction of the edge image. The edge block in the edge image can be represented by B(m, n).

[0061] Optionally, in step 120, for each edge block, it is first detected whether it contains a horizontal or nearly horizontal edge; and for the block not containing a horizontal edge, it is further detected whether it contains a vertical or nearly vertical edge. The edge image is a binary image, that is, the pixel value in the binary image is 0 or 1. Therefore, the first edge block satisfying the target condition can be determined by detecting the non-zero value pixels contained in all rows and columns of each edge block.

[0062] For example, the edge block with a size of 32 x 32 pixels contains 1024 pixels, and the value of each pixel can be 0 or 1. The pixel with a value of 1 is a non-zero value pixel contained in the edge block.

[0063] Optionally, according to the size of the edge block, the size of the edge image, and the length of the target embedded information, it can be determined whether the target proportion of the non-zero value pixels contained in the edge block satisfies the target condition. The target proportion can be the proportion of the number of rows containing a target number of non-zero value pixels in each edge block to the total number of rows of the edge block, or the proportion of the number of columns containing a target number of non-zero value pixels in each edge block to the total number of columns of the edge block. Based on the first edge block satisfying the target condition, the optimal region can be determined. Compared with the original image, the optimal region not only filters out most of the smooth regions and clean edge regions, but also retains more representative information, greatly improving the efficiency of the algorithm.

[0064] Optionally, in step 130, based on the optimal region, the target embedded information can be embedded into the target image by using space-time coding (STC), and the image information embedding is completed. The target embedded information can be text information, which is not limited in the embodiments of the present application.

[0065] The image processing method provided by the embodiment of the present application can filter out the edge regions that do not meet the target condition, retain more representative first edge blocks, reduce the image processing data volume and image dimension, facilitate information embedding, and thus improve the image security. Meanwhile, the information embedding cost can be reduced, and the information embedding efficiency is greatly improved.

[0066] In one embodiment, the target condition is specifically:

[0067] And / or

[0068] wherein η represents the proportion of the number of rows containing target number of non-zero value pixel points in the edge block to the total number of rows of the edge block, ρ represents the proportion of the number of columns containing target number of non-zero value pixel points in the edge block to the total number of columns of the edge block, M represents the length of the target embedded information, W represents the edge length of the edge block, and x·y represents the size of the edge image.

[0069] Optionally, the target number can be in a preset range or a fixed value. For example, the target number can be greater than or equal to 2. Therefore, the target condition that the first edge block needs to meet is that the proportion of the number of rows containing 2 or more than 2 non-zero value pixel points in the edge block to the total number of rows of the edge block, or the proportion of the number of columns containing 2 or more than 2 non-zero value pixel points in the edge block to the total number of columns of the edge block, needs to be greater than the target value.

[0070] Optionally, when the target value is η, the edge length of the edge block is the edge length in the vertical direction of the edge block; and when the target value is ρ, the edge length of the edge block is the edge length in the horizontal direction of the edge block.

[0071] wherein the target value is and the target value is greater than zero.

[0072] Suppose ρ is 0.6, the proportion of the number of columns containing 2 or more than 2 non-zero value pixel points in the first edge block to the total number of columns of the edge block needs to be greater than or equal to 0.6. For example, Figure 2 , the proportion of the number of columns containing 2 or more than 2 non-zero value pixel points in the first edge block to the total number of columns of the edge block needs to be greater than or equal to 0.6. Figure 2 In FIG. (a) of FIG. (b), most of the columns contain only one edge, and the proportion of the number of columns containing 2 or more than 2 non-zero value pixel points in the edge block does not reach the target condition, so it does not meet the standard. In FIG. (c), most of the columns are blank images, and the proportion of the number of columns containing 2 or more than 2 non-zero value pixel points in the edge block also does not reach the target condition, so it also does not meet the standard.

[0073] The image processing method provided in the embodiments of the present application can filter out the first edge block with rich edge features by setting a target condition, so as to ensure that the first edge block has representative information, filter out the edge block that does not meet the target condition, reduce the image dimension, and improve the image processing efficiency.

[0074] In one embodiment, the first edge block meeting the target condition is used to determine the optimal region, including:

[0075] The second edge block is determined from the first edge block based on the width of the line spread function corresponding to the first edge block and the gray variance of the first edge block.

[0076] The optimal region is determined based on the second edge block.

[0077] Optionally, after the first edge block meeting the target condition is determined, the first edge block is sorted according to the definition and contrast of the first edge block, so as to further filter out the second edge block with more representative information. The definition of the edge block is measured by the average width of the line spread function, and the contrast of the edge block is measured by the variance σ. m,n The gradient change of the image edge can form a line spread function curve, and the maximum point of the line spread function is the place with the largest gradient change, that is, the edge boundary point of the image. The more serious the image blur is, the larger the width of the line spread function is, and the lower the definition is. The average value of the image gray can represent the overall brightness of the image, and the more intense the pixel gray change in the image region is, the larger the gray variance corresponding to the image is, and the larger the contrast is.

[0078] Optionally, the average width of the line spread function of each first edge block is determined and the variance σ m,n is sorted. If the average width is sorted from small to large, the embodiments of the present application can select the edge block with the average width of the line spread function being the first 30% of the average width of the line spread function of the first edge block and the variance being greater than 1.2 times the minimum value of the variance of the first edge block, that is, the second edge block.

[0079] Optionally, the gray value of the corresponding position information in the gray image is determined according to the position information of the selected second edge block, to form a gray matrix. The plurality of gray matrices are transversely spliced to generate a new matrix, that is, the optimal region is obtained.

[0080] As shown in Figure 3 , Figure 3 ​is a target edge block acquisition flow diagram of an image processing method provided by the embodiment of the present application. The target edge block acquisition flow is as follows: performing Canny edge detection on a gray-scale image to obtain an edge image. Then performing block processing on the edge image to obtain a basic block. According to a detection standard (target condition), a target detection block is obtained. Based on the definition and contrast of the detection block, a target edge block is determined, and a region corresponding to the target edge block is determined as an optimal region.

[0081] The image processing method provided by the embodiment of the present application further screens out a second edge block with more representative information in the first edge block, reduces the matrix dimension, greatly improves the screening efficiency, facilitates analysis, and improves the image performance.

[0082] In one embodiment, the embedding the target embedding information into the target image based on the optimal region comprises:

[0083] Determining a cost function corresponding to the optimal region based on a target filter set and image residuals in different directions corresponding to the optimal region;

[0084] Determining a target embedding region of the target image in the optimal region based on the cost function;

[0085] Embedding the target embedding information into the target embedding region.

[0086] Optionally, through the preprocessing of the image, although the region with complex texture is preliminarily screened out, for the pixels in the texture region, even if it is predictable in a certain direction, it also needs to be assigned a higher cost value, and therefore further screening of the pixels suitable for carrying data is needed. The embodiment of the present application acquires the residuals of the image in different directions through the manner of constructing a filter set, and then constructs a cost function, so as to ensure that all the pixels carrying data have relatively low distortion cost. Through the cost function, the region with unobvious feature vector change, i.e., the target embedding region, can be determined, and the higher cost is assigned to the place with higher image content predictability.

[0087] The image processing method provided by the embodiment of the present application determines a new cost function through the design of the filter set, so that the position with the minimum embedding cost can be more accurately determined, the target embedding region of the target embedding information is more reliable, and the security of the entire information embedding process is improved.

[0088] In one embodiment, the determining the cost function corresponding to the optimal region based on the target filter set and the image residuals in different directions corresponding to the optimal region comprises:

[0089] Determining the image residuals in different directions based on the filters in different directions and the optimal region.

[0090] determine the cost function based on the image residual and the target mean filter;

[0091] The target filter set comprises the filters in different directions and the target mean filter.

[0092] Optionally, the target filter set comprises a one-dimensional horizontal direction low-pass filter and a one-dimensional horizontal direction high-pass filter, and a target low-pass filter. The one-dimensional horizontal direction low-pass filter and the one-dimensional horizontal direction high-pass filter can construct the filters in three directions. The target low-pass filter can extend the low-cost values in the texture region to their adjacent pixels, and the distortion values of a single pixel and its adjacent pixels are weighted to consider the mutual dependence between the distortion values, so that better security performance can be obtained. The target mean filter can not only be quickly implemented and easily obtained, but also make the generality of the cost function stronger, so the target mean filter is selected to implement the low-pass filter.

[0093] In actual implementation, in image processing, wavelet transform is another breakthrough after Fourier transform. Among a large number of wavelet bases, Daubechies wavelet has good regularity, can introduce smooth errors that are not easy to be detected when reconstructing an image, and can capture subtle features. Moreover, Daubechies wavelet has strong localization ability in the frequency domain, so it can be used to extract the texture features of an image. Through experimental analysis, the 8th-order Daubechies wavelet has better performance. Therefore, the DB-8 wavelet is used to construct the filters in three different directions, including the filter in the horizontal direction, the filter in the vertical direction and the filter in the diagonal direction. Specifically, the filters can be represented by the following formulas:

[0094] K (1) =h·g T ,K (2) =g·h T ,K (3) =g·g T

[0095] wherein K (k) is the filter in different directions, and different values of k represent different directions. When k = 1, K (1) is the filter in the horizontal direction; when k = 2, K (2) is the filter in the vertical direction; and when k = 3, K (3) is the filter in the diagonal direction. h is a one-dimensional horizontal direction DB-8 low-pass filter, g is a one-dimensional horizontal direction DB-8 high-pass filter, g T is the transpose of g, and h T is the transpose of h.

[0096] Optionally, according to the filters of three different directions, the image residual of different directions corresponding to the optimal region can be determined. After the image residual of different directions is determined, the target low-pass filter is used to smooth the image residual of three directions respectively. The low-pass filter selects the mean filter with low-pass characteristics and simple and fast, and the best filter size of 3*3 mean filter is determined through experiment.

[0097] The image processing method provided by the embodiment of the application constructs the cost function through the filters of different directions and the target mean filter, so that the screening of the target embedding region is more accurate.

[0098] In one embodiment, the image residual of different directions is specifically:

[0099]

[0100] wherein, R (k) represents the image residual of different directions, K (k) represents the filter of different directions, X represents the matrix corresponding to the optimal region, represents the convolution operation;

[0101] The cost function is specifically:

[0102]

[0103] wherein, ρ' represents the cost function, and L represents the target low-pass filter.

[0104] Optionally, after the cost function values of different directions corresponding to the optimal region are determined, the cost function values can be sorted. The region which is relatively safe in horizontal, vertical and diagonal directions can be determined as the target embedding region.

[0105] As shown in the following formula: Figure 4 After the optimal region is determined, the filter set is constructed, and the filter set includes the direction filters K (1) , K (2) , K (3) and the mean filter L of 3*3. According to the direction filters, the image residual of three directions can be determined, and then according to the image residual and the mean filter, the cost function can be determined. Based on the calculation result of the cost function, the safe embedding region is selected. Finally, the information is embedded in the safe embedding region by using the STC coding, and the information embedding is completed.

[0106] The image processing method provided by the embodiment of the application can measure the information embedding appropriateness by constructing the specific cost function, so that the target embedding region can be determined quickly.

[0107] In an embodiment, the image processing method provided by the embodiment of the present application can be applied to a scenario of watermark encryption. Figure 5 is a flowchart of an application of the image processing method provided by the embodiment of the present application. Referring to Figure 5 , the image processing method provided by the embodiment of the present application can include:

[0108] Step 510, input an RGB watermark image.

[0109] Step 520, convert the RGB watermark image into a grayscale image.

[0110] Step 530, pre-process the grayscale image to extract an edge image of the grayscale image.

[0111] Step 540, reduce the dimension of the edge image to obtain an optimal encryption region.

[0112] Step 550, construct a cost function using a filter bank.

[0113] Step 560, calculate the embedding cost of different positions in the optimal encryption region using the cost function, and determine the position with the minimum embedding cost as a target embedding position.

[0114] Step 570, encode and embed information using STC.

[0115] Step 580, complete watermark encryption to obtain an encrypted watermark image, so that the authenticity of the watermark can be determined by identifying whether the watermark contains encrypted information.

[0116] The image processing method provided by the embodiment of the present application has higher encryption efficiency, and the encryption position is more reliable, the encryption method is more secure, and the encryption method is more suitable for actual application scenarios. By extracting the complex texture of the image, the more suitable encryption region is screened out, the dimension of the image is reduced, the encryption efficiency and security are improved. By constructing a new cost function using a filter bank, the position with the minimum embedding cost can be more accurately determined, the target embedding position is more reliable, and the security of the entire encryption process is improved.

[0117] The image processing device provided by the embodiment of the present application is described below. The image processing device described below can be correspondingly referred to the image processing method described above.

[0118] Figure 6 The structure diagram of the image processing device provided by the embodiment of the present application is shown in Figure 6 The device includes an acquisition module 610, a determination module 620, and an embedding module 630.

[0119] The acquisition module 610 is configured to perform block processing on an edge image corresponding to a target image to obtain an edge block.

[0120] The determining module 620 is configured to determine an optimal region based on the first edge block satisfying a target condition.

[0121] The embedding module 630 is configured to embed the target embedding information into the target image based on the optimal region.

[0122] The target condition is determined according to the size of the edge block, the size of the edge image, and the length of the target embedding information.

[0123] The image processing apparatus provided by the embodiments of the present application can filter out edge regions that do not satisfy the target condition, retain more representative first edge blocks, reduce image processing data volume and image dimension, facilitate information embedding, and thus improve image security. Meanwhile, the information embedding cost can be reduced, and the information embedding efficiency is greatly improved.

[0124] In one embodiment, the embedding module 630 is specifically configured to:

[0125] determine a cost function corresponding to the optimal region based on a target filter set and image residuals in different directions corresponding to the optimal region;

[0126] determine a target embedding region of the target image in the optimal region based on the cost function;

[0127] embed the target embedding information into the target embedding region.

[0128] In one embodiment, the embedding module 630 is specifically configured to:

[0129] determine the image residuals in different directions based on filters in different directions and the optimal region;

[0130] determine the cost function based on the image residuals and a target mean filter;

[0131] The target filter set includes the filters in different directions and the target mean filter.

[0132] In one embodiment, the determining module 620 is specifically configured to:

[0133] determine a second edge block from the first edge block based on the width of a line spread function corresponding to the first edge block and the gray variance of the first edge block;

[0134] determine the optimal region based on the second edge block.

[0135] In one embodiment, the image residuals in different directions are specifically:

[0136]

[0137] Among them, R (k) K represents the image residuals in the different directions. (k) Let X represent the filters in different directions, and let X represent the matrix corresponding to the optimal region. This represents the convolution operation;

[0138] The cost function is specifically:

[0139]

[0140] Where ρ′ represents the cost function and L represents the target low-pass filter.

[0141] In one embodiment, the target condition is specifically:

[0142] and / or

[0143] Where η represents the proportion of the number of rows containing the target number of non-zero value pixels in the edge block to the total number of rows in the edge block, ρ represents the proportion of the number of columns containing the target number of non-zero value pixels in the edge block to the total number of columns in the edge block, M represents the length of the target embedded information, W represents the side length of the edge block, and x·y represents the size of the edge image.

[0144] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7 As shown, the electronic device may include a processor 710, a communication interface 720, a memory 730, and a communication bus 740, wherein the processor 710, the communication interface 720, and the memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute image processing methods, such as:

[0145] The edge image corresponding to the target image is segmented into blocks to obtain edge blocks;

[0146] Determine the optimal region based on the first edge block that meets the target conditions;

[0147] Based on the optimal region, the target embedding information is embedded into the target image;

[0148] The target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information.

[0149] In addition, the logic instructions in the memory 730 described above can be implemented in the form of a software function unit and sold or used as an independent product, and can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM, Read-Only Memory), a random access memory (RAM, Random Access Memory), a magnetic disk or an optical disk, and various media that can store program codes.

[0150] On the other hand, the embodiments of the present application also provide a computer program product, which includes a computer program, the computer program can be stored on a non-transitory computer readable storage medium, and the computer program is executed by a processor, so that the computer can execute the image processing method provided by the above-mentioned embodiments, for example, including:

[0151] performing block processing on the edge image corresponding to the target image to obtain an edge block;

[0152] determining an optimal region based on the first edge block satisfying a target condition;

[0153] embedding the target embedding information into the target image based on the optimal region;

[0154] The target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information.

[0155] On the other hand, the embodiments of the present application also provide a processor readable storage medium, which stores a computer program, and the computer program is used to make the processor execute the steps of the method provided by the above-mentioned embodiments, for example, including:

[0156] performing block processing on the edge image corresponding to the target image to obtain an edge block;

[0157] determining an optimal region based on the first edge block satisfying a target condition;

[0158] embedding the target embedding information into the target image based on the optimal region;

[0159] The target condition is determined according to the size of the edge block, the size of the edge image, and the length of the target embedding information.

[0160] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to a magnetic storage (e.g., floppy disk, hard disk, tape, MO, etc.), an optical storage (e.g., CD, DVD, BD, HVD, etc.), and a semiconductor storage (e.g., ROM, EPROM, EEPROM, NAND FLASH, SSD, etc.), etc.

[0161] The apparatus embodiments described above are merely illustrative, wherein the units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, i.e., can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected to achieve the purpose of the embodiments according to actual needs. Those skilled in the art can understand and implement without creative labor.

[0162] From the above description of the embodiments, those skilled in the art can clearly understand that the embodiments can be implemented by means of software plus necessary universal hardware platforms, and of course can also be implemented by hardware. Based on such understanding, the above technical solutions can be embodied in the form of software products, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and include a number of instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute the methods described in each embodiment or some parts of the embodiments.

[0163] Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacements for some technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. An image processing method, characterized by, The method comprises the following steps: performing block processing on an edge image corresponding to a target image to obtain an edge block; determining an optimal region based on a first edge block satisfying a target condition; embedding target embedding information into the target image based on the optimal region; wherein the target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information; the target condition is specifically: and / or wherein η represents the proportion of the number of rows containing target quantity of non-zero value pixel points in the edge block to the total number of rows of the edge block, ρ represents the proportion of the number of columns containing target quantity of non-zero value pixel points in the edge block to the total number of columns of the edge block, M represents the length of the target embedding information, W represents the side length of the edge block, and x·y represents the size of the edge image.

2. The image processing method of claim 1, wherein, The step of embedding the target embedding information into the target image based on the optimal region comprises the following steps: determining a cost function corresponding to the optimal region based on a target filter set and image residuals in different directions corresponding to the optimal region; determining a target embedding region of the target image in the optimal region based on the cost function; embedding the target embedding information into the target embedding region.

3. The image processing method of claim 2, wherein, The step of determining the cost function corresponding to the optimal region based on the target filter set and the image residuals in different directions corresponding to the optimal region comprises the following steps: determining the image residuals in different directions based on filters in different directions and the optimal region; determining the cost function based on the image residuals and a target mean filter; wherein the target filter set comprises the filters in different directions and the target mean filter.

4. The image processing method of claim 1, wherein, The step of determining the optimal region based on the first edge block satisfying the target condition comprises the following steps: determining a second edge block from the first edge block based on the width of a line spread function corresponding to the first edge block and the gray scale variance of the first edge block; determining the optimal region based on the second edge block.

5. The image processing method of claim 3, wherein, The image residuals in different directions are specifically: wherein k represents different directions, R (k) represents image residuals of the different directions, K (k) represents filters of the different directions, X represents a matrix corresponding to the optimal region, represents a convolution operation; the cost function is specifically: wherein ρ' represents the cost function, and L represents the target mean filter.

6. An image processing apparatus characterized by comprising: The method comprises the following steps: an acquisition module is configured to perform block processing on an edge image corresponding to a target image to obtain an edge block; a determination module is configured to determine an optimal region based on a first edge block satisfying a target condition; an embedding module is configured to embed target embedding information into the target image based on the optimal region; wherein the target condition is determined according to the size of the edge block, the size of the edge image and the length of the target embedding information; the target condition is specifically: and / or wherein η represents the proportion of the number of rows containing target quantity of non-zero value pixel points in the edge block to the total number of rows of the edge block, ρ represents the proportion of the number of columns containing target quantity of non-zero value pixel points in the edge block to the total number of columns of the edge block, M represents the length of the target embedding information, W represents the side length of the edge block, and x·y represents the size of the edge image.

7. The image processing apparatus according to claim 6, characterized by The embedding module is specifically configured to: determine a cost function corresponding to the optimal region based on a target filter set and image residuals in different directions corresponding to the optimal region; determining a target embedding region of the target image in the optimal region based on the cost function; embedding the target embedding information into the target embedding region.

8. An electronic device comprising a processor and a memory having a computer program stored therein, characterized in that, The processor, when executing the computer program, implements the steps of the image processing method in any one of claims 1 to 5.

9. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the image processing method in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Image adaptive steganography method and device, electronic equipment and medium

    CN112118365A

  • Digital watermark embedding method, digital watermark extracting method, digital watermark embedding device, digital watermark extracting device, digital watermark equipment and medium

    CN112907433A