Image-based information hiding method, device and computer readable storage medium
By dividing images into sub-regions and performing hierarchical scrambling, the problems of resource waste and privacy leakage in image recognition are solved, achieving adaptability of information hiding and privacy protection effects.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHEJIANG DAHUA TECH CO LTD
- Filing Date
- 2026-03-10
- Publication Date
- 2026-06-26
AI Technical Summary
Existing technologies in image recognition suffer from wasted resources and risks of privacy leaks, and cannot effectively adapt to the information hiding needs of different privacy areas.
By dividing the target object in the image into sub-regions, determining the attribute regions of each sub-region to be hidden, and determining the scrambling level according to its importance, a hierarchical scrambling process is performed to generate the target image.
It improves the adaptability of information hiding, ensures the effectiveness of privacy protection in different regions, and avoids waste of resources and privacy leaks.
Smart Images

Figure CN122293797A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to an image-based information hiding method, electronic device, and computer-readable storage medium. Background Technology
[0002] With the rapid development of image processing technology, many fields utilize image recognition to obtain relevant information, such as unmanned retail. However, the use of image recognition to acquire information also requires consideration of privacy protection within the images to prevent privacy leaks.
[0003] To protect privacy, sensitive areas in images can be masked. A common approach is to use a uniform masking standard. However, using a uniformly high masking standard may lead to wasted resources; conversely, using a single standard may leave sensitive areas at risk of privacy breaches. Summary of the Invention
[0004] The main technical problem addressed by this application is to provide an image-based information hiding method, electronic device, and computer-readable storage medium that can improve the adaptability of information hiding.
[0005] To address the aforementioned technical problems, this application provides an image-based information hiding method, comprising: dividing the target region containing the target object in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, each sub-region representing an attribute region of the target object; determining the scrambling level of each sub-region to be hidden based on the attribute region of the target object represented by each sub-region to be hidden; and scrambling the corresponding sub-region to be hidden based on the scrambling level of each sub-region to obtain the target image.
[0006] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an electronic device, including a memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to execute the above-mentioned image-based information hiding method.
[0007] To solve the above-mentioned technical problems, another technical solution adopted in this application is to provide a computer-readable storage medium including program data, which, when executed by a processor, is used to implement the above-mentioned image-based information hiding method.
[0008] The image-based information hiding method of this application divides the target region containing the target object in the acquired image to be processed into sub-regions, obtaining at least one sub-region to be hidden. Each sub-region to be hidden represents an attribute region of the target object. The scrambling level of each sub-region to be hidden is determined based on the attribute region of the target object represented by each sub-region. The corresponding sub-region to be hidden is then scrambled according to its scrambling level to obtain the target image. Thus, by classifying the scrambling of each sub-region to be hidden through its corresponding attribute region, hierarchical scrambling of different sub-regions is achieved, improving the adaptability of the scrambling level of each sub-region to be hidden and ensuring that information is hidden. Attached Figure Description
[0009] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly described below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort, wherein: Figure 1 This is a flowchart illustrating an exemplary embodiment of the information hiding method shown in this application; Figure 2 This is a schematic diagram showing the locker door in the open state as illustrated in this application; Figure 3 This is a flowchart illustrating another exemplary embodiment of the information hiding method shown in this application; Figure 4 This is a schematic diagram of an exemplary embodiment of the information hiding device shown in this application; Figure 5 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application; Figure 6 This is a schematic diagram of an embodiment of the computer-readable storage medium provided in this application. Detailed Implementation
[0010] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It is understood that the specific embodiments described herein are only for explaining this application and not for limiting it. Furthermore, it should be noted that, for ease of description, only the parts related to this application are shown in the accompanying drawings, not all structures. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0011] First, it's important to note that with the development of intelligent technologies, automated image detection is becoming a trend. However, this also brings with it the issue of privacy protection; how to protect the privacy contained within images has become a crucial question.
[0012] Based on this, embodiments of this application propose an image-based information hiding method, an electronic device, and a computer-readable storage medium. By determining the scrambling level through the attribute information of the sub-region to be hidden, the scrambling accuracy can be improved. The image-based information hiding method is hereinafter referred to as the information hiding method; for details, please refer to [reference needed]. Figure 1 , Figure 1 This is a flowchart illustrating an exemplary embodiment of the information hiding method shown in this application.
[0013] The entity executing the information hiding method can be a terminal device, a server, or other processing device. The terminal device can be a user equipment (UE), computer, mobile device, user terminal, terminal, cellular phone, cordless phone, personal digital assistant (PDA), handheld device, computing device, in-vehicle device, wearable device, etc. The entity executing the information hiding method can also be an information hiding device, which can be an image acquisition device or a video acquisition device. In some possible implementations, the information hiding method can be implemented by a processor calling computer-readable instructions stored in memory.
[0014] Specifically, the information hiding method in this embodiment includes the following steps: S110: Divide the target region where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden. Each sub-region to be hidden represents an attribute region of the target object.
[0015] The image to be processed refers to the image for which information hiding is required. It can be an image selected from an image set, an image captured by an image acquisition device, or a video frame extracted from a video stream captured by a video acquisition device. It can also be an image submitted by the user. Exemplarily, it can be any image in the image set, or the image with the highest quality in the image set; this application does not limit this. In some embodiments, the acquired original image can be directly used as the image to be processed. In other embodiments, the acquired original image can be preprocessed to obtain the image to be processed. Preprocessing includes, but is not limited to, brightness adjustment, alignment, cropping, scaling, downsampling, and grayscale conversion.
[0016] The target object in the image to be processed refers to an instance of an object or a region of interest in the target image. For example, the target object could be an animal, vehicle, or person. The target object can be obtained by detecting the image to be processed using an object detection algorithm. This object detection algorithm may include, but is not limited to, YOLO-V5, YOLO-V4, YOLO-V7, PP-YOLOv2, etc., to accurately identify and locate target objects from images or videos.
[0017] The target region can refer to the image area where the target object is located in the image to be processed. For example, the target bounding box obtained by the target object detected in the image to be processed by the object detection algorithm can be used as the target region, or the detected target bounding box can be optimized to obtain the target region. For example, the information hiding device can use a part of the target object as the target region, such as the facial region.
[0018] The sub-regions to be hidden are the areas within the target area that need to be concealed. For example, keypoint detection can be performed on the target area to obtain the sub-regions to be hidden. If the target area belongs to the facial region of the target object, it can be divided into sub-regions according to facial features to obtain the sub-regions to be hidden. For example, each sub-region to be hidden may include the eye region, the nose region, and the lip region.
[0019] An attribute region refers to a region divided according to the attributes of a target object. For example, the target object can be divided according to its facial features to obtain attribute regions. Each attribute region corresponds to a part of the target object. For instance, keypoint detection is performed on the target object region to obtain a set of K keypoint coordinates P = {(x_k, y_k) |k=1,2,...,K}. Based on these K keypoint coordinates, several attribute regions are obtained. In other embodiments, for each attribute region, instead of using a fixed network, a set of blocks adapted to its shape can be generated. Specifically, firstly, four coordinates (x_min, y_min, x_max, y_max) of each region are obtained using keypoint coordinates, and these four coordinates are connected to generate the region boundary. The image to be processed is then initially segmented to obtain initial image blocks. Boundary image blocks intersecting with the region boundaries are obtained from each initial image block. If the proportion of pixels within a boundary image block that are within the region is greater than a preset pixel proportion threshold, the boundary image block is retained. If the proportion of pixels within a boundary image block that are within the region is less than or equal to the preset pixel proportion threshold, the boundary image block is discarded or merged into an adjacent image block outside that region. This process yields the attribute regions in the image to be processed.
[0020] S120: Determine the scrambling level of each sub-region to be hidden based on the attribute region of the target object represented by each sub-region to be hidden.
[0021] The scrambling level is used to limit the degree of hiding of each sub-region to be hidden. The scrambling level can be set to be positively correlated with the degree of hiding, with a higher scrambling level resulting in a higher degree of hiding; alternatively, the scrambling level can be set to be inversely correlated, with a higher scrambling level resulting in a lower degree of hiding. For example, the scrambling level of each sub-region to be hidden can be determined by the attribute regions of the target object corresponding to each sub-region to be hidden. Specifically, the higher the importance of the attribute regions of the target object represented by the sub-region to the identification of target object information, the higher the required degree of hiding for that sub-region, and the corresponding scrambling level is determined; conversely, the lower the importance of the attribute regions of the target object represented by the sub-region to the identification of target object information, the lower the required degree of hiding for that sub-region, and the corresponding scrambling level is determined.
[0022] In some embodiments, a mapping relationship between a preset attribute region and a preset scrambling level can be pre-defined, and then the scrambling level of each sub-region to be hidden can be obtained from the mapping relationship. In other embodiments, the area of each sub-region to be hidden can also be obtained; the scrambling level of each sub-region to be hidden can be determined based on the area of each sub-region to be hidden and the corresponding attribute region. For example, the initial scrambling level determined based on the attribute region can be adjusted by adjusting the area of the sub-region to be hidden to obtain the scrambling level of the sub-region to be hidden. For example, if the area is smaller than the preset area, the initial scrambling level is reduced accordingly.
[0023] S130: Scramble the corresponding sub-regions to be hidden according to the scrambling level of each sub-region to obtain the target image.
[0024] The target image is the image after information hiding. For example, the information hiding device scrambles the corresponding sub-regions to be hidden according to their scrambling levels to obtain the target image. It should be noted that the attribute regions of the target object represented by each hidden sub-region are different, and the corresponding scrambling levels may be the same or different, depending on the actual application scenario. In other embodiments, after obtaining the target image, it can be input into a target detection model for target detection processing to obtain the target detection result; if the target detection result indicates successful detection, the information hiding processing is repeated on the target image; if the target detection result indicates detection failure, the process ends.
[0025] As can be seen, the information hiding method in this embodiment divides the target region where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, each sub-region representing an attribute region of the target object; the scrambling level of each sub-region to be hidden is determined according to the attribute region of the target object represented by each sub-region to be hidden; and the corresponding sub-region to be hidden is scrambled according to the scrambling level of each sub-region to be hidden to obtain the target image. Thus, by classifying the scrambling of each sub-region to be hidden through the attribute region corresponding to each sub-region to be hidden, hierarchical scrambling of different sub-regions to be hidden is achieved, thereby improving the adaptability of the scrambling level of each sub-region to be hidden and ensuring that information is hidden.
[0026] In some application scenarios, the acquired image to be processed may be affected by the acquisition environment, resulting in overexposure or underexposure of the target object, leading to the loss of regional information in the target area and affecting subsequent processing. For example, vending machines are installed in various scenarios, and in some scenarios, there is a large difference in brightness between the inside and outside of the vending machine. This can cause the image acquired when the vending machine door is open to easily show overexposure or underexposure of the target object. Based on this, before dividing the target area where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, this embodiment can first adjust the brightness of the original image to obtain a uniformly bright image to be processed. In some embodiments, the brightness value of each image block of the acquired original image is compared with an overexposure threshold and an underexposure threshold, respectively. If the brightness value of an image block is greater than the overexposure threshold or less than the underexposure threshold, the brightness of the original image needs to be adjusted to obtain the image to be processed. In other embodiments, the acquired original image is first subjected to brightness analysis to obtain the brightness uniformity parameter of the original image; in response to the original image's brightness uniformity parameter being greater than or equal to a preset parameter threshold, the brightness of the original image is adjusted to obtain the image to be processed. This method performs adaptive brightness adjustment on the original image, ensuring the clarity of the image to be processed.
[0027] The original image refers to an image that has not yet undergone brightness adjustment. For example, an image captured by an image acquisition device or a video acquisition device can be used as the original image; alternatively, the image with the best quality can be selected from the acquired images; or the acquired image can be preprocessed to obtain the original image. This embodiment does not limit the method of acquiring the original image.
[0028] The brightness uniformity parameter is used to measure the brightness distribution characteristics of different regions in the original image. Generally, a larger brightness uniformity parameter indicates a lower degree of brightness distribution uniformity in the original image, potentially indicating the presence of overly bright or dark areas; a smaller brightness uniformity parameter indicates a more uniform brightness distribution in the original image. For example, the brightness uniformity parameter of the original image can be determined using the brightness values of each pixel in the original image. In some embodiments, the brightness uniformity parameter of the original image can be determined based on the brightness histogram of the original image. In other embodiments, the original image can be divided into blocks to obtain several image blocks; brightness calculations can be performed on each image block to obtain a block brightness value; and the differences between the block brightness values of each image block can be compared to determine the brightness uniformity parameter of the original image. In other embodiments, the original image can be divided into blocks to obtain several image blocks; brightness calculations can be performed on each image block to obtain a block brightness value, and a brightness averaging calculation can be performed on each image block to obtain an average brightness value; the brightness uniformity parameter of the original image can be calculated based on the block brightness values and the average brightness value of each image block.
[0029] After obtaining several image blocks from the original image, the RGB information of the image block located in the i-th row and j-th column of the original image is statistically analyzed as R[i][j], G[i][j], B[i][j]. The formula for calculating the block brightness value of this image block is as follows: Y[i][j] = 0.2989 R[i][j]+ 0.5866 G[i][j]+ 0.1145 B[i] [j] Then, the total brightness value of each image block is determined based on the block brightness value of each image block. The calculation formula is as follows:
[0030] in, This represents the total brightness value of each image block. This indicates the row number of the image patch in the original image. This indicates the number of columns in the image patch of the original image, that is, dividing the original image into M×N image patches. This represents the block brightness value of the image block located in the i-th row and j-th column.
[0031] After obtaining the total brightness value of each image block, the average brightness value of each image block is determined using the total brightness value of each image block and the total number of image blocks. The calculation formula is as follows: = / ( ) in, This represents the average brightness value of each image block. This represents the total brightness value of each image block. , These represent the number of rows and columns of the image patch, respectively.
[0032] The brightness uniformity parameter of the original image is determined by the relationship between the block brightness values and the average brightness value of each image block. As an example, the formula for calculating the brightness uniformity parameter is as follows:
[0033] in, This represents the brightness uniformity parameter. This represents the block brightness value of the image block located in the i-th row and j-th column. Indicates the average brightness value. , These represent the number of rows and columns of the image patch, respectively.
[0034] The preset parameter threshold can be set based on experience or determined experimentally. This threshold is used to measure the brightness uniformity parameter and determine if there is uneven brightness in the original image. When the brightness uniformity parameter is less than the preset threshold, it indicates that the original image has relatively uniform brightness; when the brightness uniformity parameter is greater than or equal to the preset threshold, it indicates that the original image has significant differences in brightness between light and dark areas.
[0035] After the brightness uniformity parameter of the original image is greater than or equal to a preset threshold, the proportion of dark areas and the proportion of bright areas in the original image can be further determined to decide whether brightness adjustment processing is needed to obtain the image to be processed. Specifically, if the proportion of dark areas in the original image is greater than or equal to a dark area ratio threshold and the proportion of bright areas is less than a bright area ratio threshold, then the dark areas of the original image are brightened to obtain the image to be processed; if the proportion of dark areas in the original image is greater than or equal to a dark area ratio threshold and the proportion of bright areas is greater than or equal to a bright area ratio threshold, then the dark areas of the original image are brightened and the bright areas of the original image are suppressed to obtain the image to be processed. This method of suppressing bright areas and brightening dark areas makes the edges of the target object clear. Furthermore, the brightness statistical weight of the target area can be increased during AE (Automatic Exposure) to ensure that the target object is clearly visible.
[0036] Dark areas refer to regions with low brightness in the original image. For example, a region consisting of pixels with brightness values below a dark threshold can be defined as a dark area. Alternatively, the original image can be divided into blocks to obtain several image blocks; whether an image block belongs to a dark area can be determined based on the relationship between the block brightness value and the dark threshold. After identifying the dark areas in the original image, their areas are statistically analyzed to obtain the proportion of dark areas.
[0037] The dark area ratio threshold is used to measure the proportion of dark areas in the original image. For example, the dark area ratio threshold can be set empirically. When the proportion of dark areas in the original image is greater than or equal to the dark area ratio threshold, it indicates that there are dark areas in the original image that need to be adjusted; when the proportion of dark areas in the original image is less than the dark area ratio threshold, it indicates that there are no dark areas in the original image that need to be adjusted.
[0038] Bright areas refer to regions with high brightness in the original image. For example, a bright area can be defined as a region comprised of pixels whose brightness values exceed an overbrightness threshold. Alternatively, the original image can be divided into blocks to obtain several image blocks; whether an image block belongs to a bright area can be determined based on the relationship between the block brightness value and the overbrightness threshold. After identifying the dark areas in the original image, the area of the bright areas is statistically analyzed to obtain the proportion of bright areas.
[0039] The brightness ratio threshold is used to measure the proportion of bright areas in the original image. For example, the brightness ratio threshold can be set empirically. When the proportion of bright areas in the original image is greater than or equal to the brightness ratio threshold, it indicates that there are bright areas in the original image that need adjustment; when the proportion of bright areas in the original image is less than the brightness ratio threshold, it indicates that there are no bright areas in the original image that need adjustment.
[0040] When the proportion of dark areas in the original image is greater than or equal to the dark area proportion threshold and the proportion of bright areas is less than the bright area proportion threshold, it indicates that there are dark areas in the original image that need adjustment, but no bright areas that need adjustment. The dark areas in the original image are then brightened to obtain the image to be processed. This brightening of dark areas can be achieved by adjusting the gamma or DRC (Dynamic Range Compression) of the ISP (Image Signal Processor).
[0041] When the proportion of dark areas in the original image is greater than or equal to the proportion of bright areas, and the proportion of bright areas is greater than or equal to the bright area ratio threshold, it indicates that both dark and bright areas in the original image need adjustment. Therefore, the dark areas of the original image are brightened, and the bright areas are suppressed, resulting in the image to be processed. Specifically, the shutter speed and gain of the afterimage (AE) can be adjusted to reduce the brightness of bright areas, while the gamma or DRC of the ISP can be adjusted to suppress bright areas and brighten dark areas.
[0042] If the proportion of dark areas in the original image is less than the dark area proportion threshold and the proportion of bright areas is greater than or equal to the bright area proportion threshold, it means that there are bright areas in the original image that need to be adjusted, but no dark areas that need to be adjusted. The bright areas in the original image are then suppressed to obtain the image to be processed.
[0043] When the information hiding method of this embodiment is applied to a locker (e.g., a vending machine), it is necessary to determine whether the locker door is open before acquiring the image to be processed. If the locker door is open, the image to be processed is acquired. The steps for determining the locker door status include: performing edge extraction processing on the region of interest in the acquired current locker image to obtain at least one initial edge segment; filtering each initial edge segment to obtain a target edge segment; calculating the angle between the locker door and the locker body based on the target edge segment and a preset edge segment; and acquiring the image to be processed if the angle between the locker door and the locker body is greater than a preset angle threshold.
[0044] A locker is a cabinet used to store several goods, and it includes a cabinet body and a door. The current locker image includes the locker to be detected. For example, the current locker image can be acquired using an image acquisition device located on the locker door, such as the door handle. When the locker door state changes, the current locker image acquired by the image acquisition device also changes accordingly. The current locker door state can be determined by the change information in the current locker image.
[0045] The region of interest (ROI) refers to the area enclosed by the edge of the locker. For example, the ROI can be determined by pre-marking to eliminate interference from irrelevant backgrounds.
[0046] The initial edge segments refer to those obtained by detecting straight lines in the region of interest (ROI) of the current locker image. Specifically, the current locker image can be binarized to obtain a binarized image; the edge gradient of the ROI in the binarized image can be calculated to obtain the gradient of the ROI; gradient consistency screening can be performed to obtain several edge points; and these edge points can be fitted to obtain the initial edge segments. The edge gradient calculation includes horizontal gradient, vertical gradient, gradient magnitude, and gradient direction. The formula for calculating the horizontal gradient of pixel I(x,y) is as follows: Gx=(I′(x+1,y) I′(x 1,y)) / 2 Where Gx represents the horizontal gradient, and I(x+1,y) represents the pixel value of the pixel at coordinates (x+1,y). 1,y) represents coordinates (x,y) The pixel value of the pixel (1, y).
[0047] The formula for calculating the vertical gradient of pixel I(x,y) is as follows: Gy=(I′(x,y+1) I′(x,y 1)) / 2 Where Gy represents the vertical gradient, and I(x,y+1) represents the pixel value of the pixel at coordinates (x,y+1). 1) indicates coordinates (x, y) 1) The pixel value of the pixel.
[0048] The formula for calculating the gradient magnitude of pixel I(x,y) is as follows: G=∣Gx∣+∣Gy∣ Where Gx represents the horizontal gradient and Gy represents the vertical gradient. Calculating the gradient magnitude using absolute values can reduce computation.
[0049] The formula for calculating the gradient direction of pixel I(x,y) is as follows: θ=arctan2(Gy,Gx) Where Gx represents the horizontal gradient and Gy represents the vertical gradient.
[0050] Gradient consistency filtering methods can include: retaining at least N consecutive pixels as edge points, where the gradient direction difference among the N pixels is less than an adaptive threshold. This removes discrete noise.
[0051] After obtaining several edge points, these edge points can be directly fitted to obtain at least one initial edge segment. In other embodiments, the binarized region of interest can be divided into blocks to obtain several sub-blocks; for each sub-block, histogram statistics are performed on the gradient directions of the edge points within the sub-block, and the peak direction is taken as the candidate line direction corresponding to that sub-block; for those with the same candidate line direction... The initial edge segments are obtained by fitting straight lines to the edge points. The straight line fitting method can be least squares, with a slope of... .
[0052] To improve the accuracy of the included angle calculation, the initial edge segments can be filtered to obtain the target edge segments. In some embodiments, the initial edge segments are fitted from several edge points. Therefore, the error of each edge point in each initial edge segment can be calculated to obtain the sum of edge pixel errors of each initial edge segment. If the sum of edge pixel errors of the initial edge segments is less than a preset error threshold and the length of the initial edge segments is greater than a preset length threshold, then the initial edge segments are determined as the target edge segments.
[0053] The sum of edge pixel errors refers to the sum of the absolute values of the perpendicular distances from all edge points involved in the fitting to the initial edge segment. A smaller sum of edge pixel errors indicates that each edge point is closer to the fitted initial edge segment, resulting in a higher quality fit; conversely, a larger sum of edge pixel errors indicates that each edge point is farther from the fitted initial edge segment, resulting in a lower quality fit. For example, the perpendicular distance between each edge point and the initial edge segment can be calculated; then, the perpendicular distances of each edge point can be statistically analyzed to obtain the sum of edge pixel errors for the initial edge segment. As an example, the formula for calculating the sum of edge pixel errors is as follows:
[0054] Where e represents the edge pixel error and sum. This represents the ordinate of the j-th edge point in the image coordinate system. represents the x-coordinate of the j-th edge point in the image coordinate system; 'a' represents the slope of the initial edge segment. 'a' is not calculated freely using the standard least squares method, but is determined by the direction of candidate lines obtained through histogram statistics. Specifically: This makes the fitting process "direction-first", finding a representative straight line with a fixed direction; b represents the intercept of the initial edge segment, which is calculated by the least squares method given a; represents the predicted ordinate or the corresponding ordinate on the initial edge segment by substituting the x-coordinate of the j-th edge point into the fitted line equation y = ax + b; represents the absolute value of the vertical distance from the edge point to the initial edge segment, measuring the degree of deviation of the edge point from the initial edge segment.
[0055] The preset error threshold can be set empirically. If the sum of the edge pixel errors of the initial edge segment is less than the preset error threshold and the segment length of the initial edge segment is greater than the preset length threshold, then the initial edge segment is selected as the target edge segment. Otherwise, the initial edge segment is discarded.
[0056] The preset edge segment is a baseline segment pre-set in the current locker image. For example, when the locker door is closed, the edge of the locker door can be acquired to obtain the preset edge segment, and the direction angle of the preset edge segment can be pre-calibrated. In some embodiments, the locker door state can be determined by the angle between the initial edge segment and the preset edge segment. In other embodiments, the initial edge segment can be filtered to obtain a target edge segment, thereby determining the locker door state by the angle between the target edge segment and the preset edge segment. For example, see [reference needed]. Figure 2 , Figure 2This is a schematic diagram showing the locker door in the open state as illustrated in this application. The locker is 200, the door is 210, the body is 220, L0 is a preset edge segment, and L1 is a target edge segment. The angle between L0 and L1 is determined by detection.
[0057] The preset angle threshold is set based on experience. For example, any value between 5° and 10° can be selected as the preset angle threshold. When the angle between the locker door and the locker body is greater than the preset angle threshold, the locker door is determined to be open. The system triggers a high-level event response, starts full-resolution video acquisition, and performs target object detection and information hiding processing. The processed video stream and encrypted metadata are then uploaded to the management platform. When the angle between the locker door and the locker body is less than or equal to the preset angle threshold, the locker door is determined to be closed or slightly moved. The system remains in low-power mode, does not store or upload video, and only periodically performs locker door angle detection.
[0058] If the cabinet door is detected to be open, the corresponding image to be processed is acquired for subsequent operations. After obtaining the image to be processed, an information hiding strategy can be determined based on the image quality. For example, when the target region in the image to be processed can accurately locate all attribute regions of the target object, each sub-region to be hidden is divided according to the attributes of the target object and scrambled according to the corresponding scrambling level; when the target region in the image to be processed can only locate part of the attribute regions of the target object, then that part of the attribute regions is scrambled; when the target region in the image to be processed cannot locate any attribute regions, then the target region is scrambled according to a uniform scrambling level.
[0059] If multiple sub-regions to be hidden exist with different scrambling levels, in response to a sub-region's scrambling level being a first preset scrambling level, the first and second scrambling methods are used sequentially to scramble the sub-regions to be hidden, resulting in the sub-region to be hidden after the first scrambling. In response to a sub-region's scrambling level being a second preset scrambling level, either the first or second scrambling method is used to scramble the sub-region to be hidden, resulting in the sub-region to be hidden after the second scrambling. The first preset scrambling level is higher than the second preset scrambling level. The target image is determined based on the sub-regions to be hidden after the first and / or second scrambling. Thus, different numbers of scrambling methods are used for sub-regions to be hidden with different scrambling levels; the higher the level, the greater the scrambling intensity.
[0060] In other application scenarios, if the scrambling level of the sub-region to be hidden is the first preset scrambling level, then the first scrambling method and the second scrambling method are used sequentially to scramble the sub-region to be hidden, resulting in the sub-region to be hidden after the first scrambling. If the scrambling level of the sub-region to be hidden is the second preset scrambling level, then the first scrambling method or the second scrambling method is used to scramble the sub-region to be hidden, resulting in the sub-region to be hidden after the second scrambling. If the scrambling level of the sub-region to be hidden is the third preset scrambling level, then the third scrambling method is used to scramble the sub-region to be hidden, resulting in the sub-region to be hidden after the third scrambling. The first preset scrambling level, the second preset scrambling level, and the third preset scrambling level decrease sequentially. The target image is determined based on the sub-region to be hidden after the first scrambling, the sub-region to be hidden after the second scrambling, and / or the sub-region to be hidden after the third scrambling.
[0061] The scrambling methods include, but are not limited to, block scrambling, frequency domain coefficient scrambling, and slight blurring. The first and second scrambling methods can be arbitrarily selected from the above methods. As an example, the first scrambling method can be frequency domain coefficient scrambling, and the second scrambling method can be block scrambling. When the sub-region to be hidden needs to be scrambled using the first and second scrambling methods sequentially, the information hiding device performs frequency domain coefficient scrambling on the sub-region to be hidden, obtaining an initially scrambled sub-region to be hidden; based on the semantic information of each sub-region to be hidden, it performs block scrambling on the image blocks in each initially scrambled sub-region to be hidden, obtaining the sub-region to be hidden after the first scrambling. Thus, through the combined operation of frequency domain coefficient scrambling and block scrambling, the semantic information of the sub-region to be hidden can be completely scrambled.
[0062] The frequency domain coefficient scrambling method can include the following steps: Performing a two-dimensional discrete cosine transform on the sub-region to be hidden, obtaining the frequency domain coefficient matrix D = DCT2D(d) corresponding to the sub-region to be hidden, where D(0,0) is the DC component (DC coefficient), representing the average brightness of the sub-region to be hidden, and the rest are AC components (AC coefficients), representing detail information at different frequencies; constructing a perceptual importance binary matrix M_imp based on the size of the frequency domain coefficient matrix D, used to mark the low-to-mid-frequency coefficients crucial to visual perception. The marking rule can be to use a zig-zag scanning order, setting a coefficient energy percentage threshold P, and setting the corresponding positions in the perceptual importance binary matrix M_imp to 1 from low to high frequencies until the cumulative energy of the covered coefficients reaches P of the total energy, with the remaining positions set to 0. Alternatively, the marking rule can be to select the first K coefficients of the zig-zag order as key coefficients, setting the corresponding positions in the perceptual importance binary matrix M_imp to 1; extracting the key coefficients from the frequency domain coefficient matrix D based on the perceptual importance binary matrix M_imp, obtaining a one-dimensional vector D_selected = { D(u, v)} |M_imp(u, v) == 1}, while extracting key coefficients, records the position (u,v) of each key coefficient in the frequency domain coefficient matrix D for restoration during inverse transformation; the key coefficients in the one-dimensional vector D_selected are encrypted and scrambled. The randomness of scrambling is driven by the unique key K_enc of the image acquisition device and the frame sequence number frame_id of the image to be processed. A deterministic and unpredictable scrambling sequence D_scrambled = Permute(D_selected, PRNG(K_enc, frame_id)) is generated by a pseudo-random number generator.
[0063] Block scrambling can include the following steps: generating a pseudo-random sequence for block position scrambling based on a key; and performing position replacement processing on image blocks in the initially scrambled sub-region to be hidden based on the pseudo-random sequence to obtain the sub-region to be hidden after the first scrambling process. For example, the block scrambling process can be described as: j = π_intra(i), where π_intra is the block index permutation function generated by the key.
[0064] To ensure the correct restoration of the scrambled image, this embodiment can also generate geometric constraint relationships based on the semantic information of each initial scrambled sub-region to be hidden, and generate a scrambling sequence for each initial scrambled sub-region to be hidden through these geometric constraint relationships. Specifically, each initial scrambled sub-region to be hidden is grouped according to its semantic information to obtain at least one group of initial scrambled sub-regions to be hidden; a scrambling sequence for each initial scrambled sub-region to be hidden is generated based on the geometric constraint relationships of each initial scrambled sub-region in each group; and image blocks in the corresponding initial scrambled hidden regions are scrambled according to the scrambling sequences of each initial scrambled sub-region to be hidden to obtain the first scrambled sub-region to be hidden.
[0065] Semantic information is used to characterize the properties of the initial scrambled sub-regions to be hidden. Initial scrambled sub-regions with the same semantic characteristics can be grouped together, for example, the left-eye and right-eye regions can be grouped together. For the same group of initial scrambled sub-regions, their scrambling sequences are not generated completely independently and randomly, but must satisfy corresponding geometric constraints.
[0066] As an example, consider the left and right eye regions, which have symmetrical geometric constraints. Using the vertical midline of the face as a reference, a mirror symmetry mapping function is defined, mapping the left eye region to the symmetrical coordinates of the right eye region. The left and right eye regions are divided into blocks, and feature matching is performed on the image blocks of both regions to obtain matching blocks. Specifically, the centroid coordinates and local texture features of each image block are calculated, and a correspondence between each image block in the left and right eye regions is established based on the feature similarity between the image blocks. Then, the master scrambling sequence π_intra_left for the left eye region is generated, entirely controlled by the key K_pos. The scrambling sequence π_intra_right for the right eye region is derived through constraint derivation: for block index j of the right eye region, the corresponding left eye block index i is found through the mapping relationship, and the new position of the left eye block in π_intra_left is obtained. The symmetrical position is then calculated using the mirror mapping function F_mirror. Finally, a small-range random perturbation Δ controlled by the key is added to determine π_intra_right(j). This process ensures that the block positions in the left and right eye regions remain mirror-symmetrical.
[0067] In other embodiments, when generating the scrambling sequence of each initial scrambling sub-region to be hidden using geometric constraints, the constraint strength α (0 ≤ α ≤ 1) can be determined based on the semantic information of the initial scrambling sub-region to be hidden. An adjustable constraint strength coefficient is introduced to determine the degree to which the scrambling sequence is affected by the geometric relationship. When α = 1, it represents a strictly symmetric constraint; when α = 0, it represents no constraint and complete randomness. Different constraint strengths are used for the initial scrambling sub-regions to be hidden corresponding to different semantic information: high-strength constraints (α = 0.8-1.0) are used for the eye region, medium-strength constraints (α = 0.5-0.7) are used for the nose region, and weak constraints or no constraints are used for other regions.
[0068] Furthermore, to ensure the image's reproducibility, all parameters required during the scrambling process, including symmetry axis information, mapping relationships, and constraint strength coefficients, are stored as part of the metadata using a device key for encryption. During restoration, decrypting the parameters restores the constraint relationships of each initial scrambled sub-region to be hidden, thus ensuring the naturalness and correctness of the restored structure.
[0069] Furthermore, all the above scrambling transformations are reversible processes. All key parameters generated or used during the scrambling process are recorded and stored as metadata, including frame sequence number, region attributes, scrambling level, number of image blocks in the sub-region to be hidden, inter-block scrambling sequence seed (encryption), and frequency domain coefficient scrambling mapping (encryption). To ensure the security of the metadata itself and prevent the stolen or tampered with during transmission or storage, the system uses a combination of the device's unique key K_device (burned into the device's security chip and not exportable) and the frame sequence number frame_id as the initialization vector IV. An AEAD (Authenticated Encryption with Associated Data) algorithm (such as AES-GCM) is used to encrypt and protect the integrity of the metadata. This process can be represented as: C_M = Encrypt_AEAD(K_device, IV, M), where C_M is the output ciphertext and M is the metadata. The AEAD algorithm simultaneously ensures the confidentiality (unauthorized decryption is impossible) and integrity (any tampering can be detected) of the metadata, forming a second security barrier in the restoration process.
[0070] During authorized restoration, the authorized user initiates a request by connecting to the image acquisition device and enters the preset management password and the authorized operator password in the software interface, selects the video recording time period to be restored and the scrambling level of the restoration area; the management software sends the request initiated by the authorized user to the image acquisition device through the USB HID interface or dedicated control channel of the image acquisition device. Before sending, the password can also be hashed to obtain a hash value, which is then sent to the image acquisition device.
[0071] After receiving a request, the image acquisition device compares the received hash value P_hash with the pre-stored authorization credential P_stored, which has undergone salted hashing (Salt+Hash), in the device's secure storage area. The verification condition is: P_stored = SALTED_HASH(P_hash). Upon successful verification, the image acquisition device dynamically derives a session-specific level restoration key K_decrypt_level based on P_hash and the current session random number Nonce using a Key Derivation Function (KDF): K_decrypt_level = KDF(P_hash, Nonce, L_a), where L_a represents the authorization level. This key exists only in the memory of this session and is bound to the scrambling level. Based on the authorized time range, the image acquisition device reads the corresponding encrypted metadata C_M and performs overall decryption and integrity verification using the device root key K_device, recovering the metadata M = Decrypt_AEAD(K_device, IV=frame_id, C_M). It then iterates through all sub-regions recorded in the metadata M. A sub-region will only enter the restoration process if its scrambling level is not higher than the current authorization level. For each region to be restored, the inverse transformation function T^{-1}_Lr corresponding to the scrambling level is called. This inverse transformation function uses the scrambling mapping, color information recorded in the metadata M, and K_decrypt_level derived from the current session to perform an inverse operation on the scrambled sub-region b_scrambled to be hidden, restoring the approximate original image region b_original. b_original = T^{-1}_Lr(b_scrambled, K_decrypt_level, M) Sub-regions with a scrambling level higher than the current authorization level (such as attempting to restore an L3-level eye using an L2-level password) will be automatically skipped, maintaining their highly obscured state and strictly adhering to access control.
[0072] To elaborate on the application of this application to information hiding methods, Figure 3 The flowchart shown below provides further explanation, as detailed below: Locker door status detection: Acquire the current locker image; Mark the region of interest from the current locker image and perform line detection on the region of interest to obtain the initial edge segments in the region of interest; Evaluate the fitting quality of the initial edge segments using the vertical distance between the edge points in the initial edge segments and the initial edge segments, and obtain the edge pixel error of the initial edge segments; When the edge pixel error of the initial edge segments is less than a preset error threshold and the length of the initial edge segments is greater than a preset length threshold, the initial edge segments are taken as target edge segments; If the angle between the target edge segments and the preset edge segments is greater than a preset angle threshold, it indicates that the locker door is in the open state, triggering video recording and image detection to acquire the original image. The acquisition devices for the original image and the current locker image may be different. For example, the acquisition device for the current locker image may be located on the locker door, while the acquisition device for the original image may be located on the locker body.
[0073] Image Adaptive Dynamic Adjustment: Since there may be significant differences in brightness between the inside and outside of the locker, brightness can be adaptively adjusted based on the image information of the original image. Specifically, the brightness uniformity parameter of the original image is obtained. If the brightness uniformity parameter is less than a preset threshold, no brightness adjustment is needed. If the brightness uniformity parameter is greater than or equal to the preset threshold, the proportions of dark and bright areas in the original image are statistically analyzed. Based on the relationship between the proportion of dark areas and the dark area ratio threshold, it is determined whether to brighten the dark areas and whether to suppress the bright areas, thus obtaining the image to be processed with the information hidden.
[0074] Information hiding and restoration: Face detection and key point localization are performed on the image to be processed, resulting in several sub-regions to be hidden. The scrambling method for each sub-region is determined based on its scrambling level; higher scrambling levels correspond to more sophisticated scrambling methods. For example, the eye region uses a combination of the first and second scrambling methods, the mouth and nose region uses either the first or second scrambling method, and other regions use the third scrambling method. Furthermore, during block scrambling, the scrambling sequence of each sub-region needs to be determined based on its geometric constraints.
[0075] The parameters generated during the scrambling process are recorded and stored as metadata, and the metadata is encrypted. When sub-region restoration is required, the authorization level determines whether the corresponding sub-region can be restored. If so, the metadata is decrypted to obtain the corresponding metadata, and restoration processing is performed based on the parameters in the metadata to obtain the restored image.
[0076] Please see Figure 4 , Figure 4 This is a schematic diagram of an exemplary embodiment of the information hiding device shown in this application. The information hiding device 400 includes a segmentation module 410, a determination module 420, and a scrambling module 430. The segmentation module 410 is used to segment the target region where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, and each sub-region to be hidden represents an attribute region of the target object. The determination module 420 is used to determine the scrambling level of each sub-region to be hidden based on the attribute region of the target object represented by each sub-region to be hidden. The scrambling module 430 is used to scramble the corresponding sub-region to be hidden according to the scrambling level of each sub-region to be hidden to obtain the target image.
[0077] The above scheme involves the information hiding device dividing the target region containing the target object in the acquired image into sub-regions, obtaining at least one sub-region to be hidden. Each sub-region represents an attribute region of the target object. The scrambling level of each sub-region is determined based on its attribute region. The corresponding sub-region is then scrambled according to its scrambling level to obtain the target image. This hierarchical scrambling of different sub-regions through their corresponding attribute regions improves the adaptability of the scrambling levels and ensures information is hidden.
[0078] The functions of each module can be found in the information hiding method implementation examples, and will not be repeated here.
[0079] To implement the information hiding method of the above embodiments, this application proposes another electronic device, please refer to [link / reference needed]. Figure 5 , Figure 5 This is a schematic diagram of the structure of an embodiment of the electronic device provided in this application.
[0080] Electronic device 500 includes memory 510 and processor 520, wherein memory 510 and processor 520 are coupled together.
[0081] The memory 510 is used to store program data, and the processor 520 is used to execute the program data to implement the information hiding method of the above embodiment.
[0082] In this embodiment, processor 520 can also be referred to as CPU (Central Processing Unit). Processor 520 may be an integrated circuit chip with signal processing capabilities. Processor 520 can also be a general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component. The general-purpose processor can be a microprocessor, or processor 520 can be any conventional processor.
[0083] This application also provides a computer-readable storage medium, such as Figure 6 As shown, the computer-readable storage medium 600 is used to store program data 610, which, when executed by a processor, is used to implement the information hiding method as described in the method embodiments of this application.
[0084] The methods involved in the information hiding method embodiments of this application, when implemented as software functional units and sold or used as independent products, can be stored in a device, such as a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0085] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
[0086] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus. The term "and / or" is merely a description of the association of related objects, indicating that three relationships can exist; for example, A and / or B can represent: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this document generally indicates that the preceding and following related objects are in an "or" relationship. Furthermore, "many" in this document means two or more. In addition, the term "at least one" in this document means any combination of at least two of any one or more of a plurality of elements, such as including at least one of A, B, and C, and may mean including any one or more elements selected from the set consisting of A, B, and C.
Claims
1. An image-based information hiding method, characterized in that, The method includes: The target region where the target object is located in the acquired image to be processed is divided into sub-regions to obtain at least one sub-region to be hidden, and each sub-region to be hidden represents an attribute region of the target object. The scrambling level of each sub-region to be hidden is determined based on the attribute region of the target object represented by each sub-region to be hidden; The target image is obtained by scrambling the corresponding sub-regions to be hidden according to their scrambling levels.
2. The image-based information hiding method according to claim 1, characterized in that, The step of scrambling the corresponding sub-regions to be hidden according to their scrambling levels to obtain the target image includes: In response to the scrambling level of the sub-region to be hidden being the first preset scrambling level, the sub-region to be hidden is scrambled sequentially using the first scrambling method and the second scrambling method to obtain the sub-region to be hidden after the first scrambling process. In response to the scrambling level of the sub-region to be hidden being the second preset scrambling level, the sub-region to be hidden is scrambled using either the first scrambling method or the second scrambling method to obtain the sub-region to be hidden after the second scrambling process, wherein the first preset scrambling level is higher than the second preset scrambling level. The target image is determined based on the first scrambled sub-region to be hidden and / or the second scrambled sub-region to be hidden.
3. The image-based information hiding method according to claim 2, characterized in that, The step of sequentially scrambling the sub-region to be hidden using a first scrambling method and a second scrambling method to obtain the sub-region to be hidden after the first scrambling includes: The frequency domain coefficients of the sub-region to be hidden are scrambled to obtain an initial scrambled sub-region to be hidden; Based on the semantic information of each sub-region to be hidden, the image blocks in each initially scrambled sub-region to be hidden are scrambled to obtain the first scrambled sub-region to be hidden.
4. The image-based information hiding method according to claim 3, characterized in that, The step of performing block scrambling on image blocks in each initially scrambled sub-region to be hidden based on the semantic information of each sub-region to be hidden, to obtain the first scrambled sub-region to be hidden, includes: Based on the semantic information of each initial scrambled and hidden sub-region, the initial scrambled and hidden sub-regions are grouped to obtain at least one group of initial scrambled and hidden sub-regions. Based on the geometric constraints of each initial scrambled sub-region to be hidden in each group of initial scrambled sub-regions to be hidden, a scrambling sequence for each initial scrambled sub-region to be hidden is generated. Based on the scrambling sequence of each initially scrambled hidden sub-region, the image blocks in the corresponding initially scrambled hidden region are scrambled to obtain the first scrambled hidden sub-region.
5. The image-based information hiding method according to claim 1, characterized in that, Before the step of dividing the target region where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, the method further includes: Brightness analysis is performed on the acquired raw images to obtain the brightness uniformity parameters of the raw images; If the brightness uniformity parameter of the original image is greater than or equal to a preset parameter threshold, the brightness of the original image is adjusted to obtain the image to be processed.
6. The image-based information hiding method according to claim 5, characterized in that, The step of adjusting the brightness of the original image to obtain the image to be processed includes: In response to the original image having a dark area ratio greater than or equal to a dark area ratio threshold and a bright area ratio less than a bright area ratio threshold, the dark areas of the original image are brightened to obtain the image to be processed. In response to the original image having a dark area ratio greater than or equal to a dark area ratio threshold and a bright area ratio greater than or equal to a bright area ratio threshold, the dark areas of the original image are brightened and the bright areas of the original image are suppressed to obtain the image to be processed.
7. The image-based information hiding method according to claim 1, characterized in that, Before the step of dividing the target region where the target object is located in the acquired image to be processed into sub-regions to obtain at least one sub-region to be hidden, the method further includes: Edge extraction processing is performed on the region of interest in the acquired current locker image to obtain at least one initial edge segment; The initial edge segments are filtered to obtain the target edge segments; The included angle between the cabinet door and the cabinet body is calculated based on the target edge line segment and the preset edge line segment; If the angle between the cabinet door and the cabinet body of the locker is greater than a preset angle threshold, the image to be processed is acquired.
8. The image-based information hiding method according to claim 7, characterized in that, The step of filtering each initial edge segment to obtain the target edge segment includes: Error calculation is performed on each edge point in each initial edge segment to obtain the sum of edge pixel errors for each initial edge segment; If the edge pixel error of the initial edge segment is less than a preset error threshold and the segment length of the initial edge segment is greater than a preset length threshold, then the initial edge segment is determined as the target edge segment.
9. An electronic device, characterized in that, include: A memory and a processor, wherein the memory stores program instructions, and the processor retrieves the program instructions from the memory to perform the method as claimed in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, include: The system stores program data, which, when executed by a processor, is used to implement the method as described in any one of claims 1-8.