Image target edge enhancement processing method based on sliding window algorithm
By using the non-critical edge suppression and critical edge enhancement operators of the sliding window algorithm, the problem of feature extraction for images with indistinct textures or small color differences in image processing is solved, achieving fast and accurate edge enhancement and target recognition, and improving the effect of image processing and neural network segmentation.
Patent Information
- Application Number
- CN202211359931.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-02
- Publication Date
- 2025-12-16
- Estimated Expiration
- 2042-11-02
AI Technical Summary
Existing technologies struggle to quickly and accurately extract target features when processing images with indistinct textures or small color differences, resulting in reduced data volume, high computational costs, and inaccurate recognition results.
An image target edge enhancement processing method based on the sliding window algorithm is adopted. By using the non-critical edge suppression operator HQ1 and the critical edge enhancement operator HQ2, edge features are adaptively acquired and enhanced to reduce the impact of noise and extract significant feature edges.
It achieves fast and accurate target feature extraction, improves the accuracy and efficiency of image processing, enhances the saliency of image edges, and improves the target segmentation accuracy of neural network segmentation models.
Smart Images

Figure CN115660993B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of image processing, and particularly relates to an image target edge enhancement processing method based on a sliding window algorithm. BACKGROUND
[0002] In the image processing process, for some images with unobvious textures or small color differences, the target cannot be quickly and accurately captured when the image is subjected to feature extraction or image target acquisition. When the above technical problems occur, the following methods are used by the technical personnel to solve them. One method is to directly discard the images with unobvious textures or small color differences in the image preprocessing. However, when most images have the above defects, a large number of images will be discarded, thereby greatly reducing the data volume, causing a large number of omissions in image feature extraction, and greatly deviating the image processing result, which seriously affects the result. Another method is a direct processing and extraction method. However, since the textures in the image are unobvious, the edge features of the target object are not easy to determine, a large number of calculation steps are required in the processing process, there is no fixed calculation method, different processing methods need to be used for different image databases, a large amount of manpower and material resources are consumed in the processing process, and a large deviation may occur in the acquisition of the target region, causing over-extraction or under-extraction, and the problem of inaccurate target extraction or difficulty in obtaining the target affecting the recognition result in the later identification.
[0003] Based on the above defects, it is necessary to propose a technical scheme to highlight the texture contrast and improve the accuracy of feature acquisition in the image processing process, and to standardize and simplify the image processing scheme for edge highlighting. SUMMARY
[0004] In view of the above deficiencies of the prior art, the application provides an image target edge enhancement processing method based on a sliding window algorithm. According to the texture features of the image target, the edge features are adaptively acquired and subjected to enhancement processing, and the non-edge region is subjected to weakening processing, thereby reducing the influence of image processing noise and obtaining a smooth image with significant typical features.
[0005] The application adopts the following technical scheme:
[0006] The key technology of the image target edge enhancement processing method based on the sliding window algorithm lies in the specific steps:
[0007] Step 1: Collect image data in an image database, and obtain a training image set, a training image label set and a test image set after preprocessing, wherein the training image set and the training image label set each contain N images; N is a positive integer.
[0008] Step 2: Feature extraction is performed on the m images in the training image set and the training image label set obtained in step 1 by using a sliding window algorithm to obtain an input subset: an input training subset and an input training label subset; wherein m is greater than or equal to 1 and less than or equal to N;
[0009] Step 3: From the input subset in step 2, non-edge sub-blocks in the images are selected to form a non-edge typical feature sub-block set; a non-edge image sub-block set and a non-edge image label sub-block set;
[0010] Step 4: Matrix solving is performed on the images in the non-edge typical feature sub-block set to obtain a non-key edge suppression operator HQ1, and non-related edge suppression is performed in combination with the image data in the image database to obtain an initial feature map F init with weakened non-edge regions;
[0011] Step 5: The non-edge region weakened initial feature map F init obtained in step 4 is used to obtain an edge typical feature sub-block set: an edge feature image sub-block set and an edge feature image label sub-block set, and after matrix solving, a key edge enhancement operator HQ2 is obtained;
[0012] Step 6: In combination with the non-key edge suppression operator obtained in step 4 and the key edge enhancement operator HQ2 obtained in step 5, the non-key edge suppression operator HQ1 and the key edge enhancement operator HQ2 are sequentially called for the test images in the test image set to obtain an edge enhancement feature map F out .
[0013] Through the above design, two image processing operators, i.e., a non-key edge suppression operator HQ1 and a key edge enhancement operator HQ2, are proposed. By using the above two operators, edge enhancement processing can be performed on the original image data, the target can be quickly and accurately extracted, and segmentation or image feature recognition can be realized. The algorithm can be applied to any image edge division scheme, and the technical difficulty of image processing is solved.
[0014] Further, in step 1, it is assumed that the original image training set collected from the image database is I origin ={A1,...,A n ,...,A N}; the original image label set corresponding to the original image training set is I label ={B1,...,B n ,...,B N}; all target image contours and backgrounds in the original image training set form the original image label set;
[0015] The original image training set I origin is divided into a training image set I n and a training image label set I N .origin , the original image label set is I label The images in the original image label set I
[0016] The original image training set I origin , the original image label set is I label Each image in the original image label set I The image label set
[0017] The image training set
[0018] The image label set
[0019] The n-th image in the image training set (X n ) H×W The matrix form is:
[0020]
[0021] The n-th image in the image label set (L n ) H×W The matrix form is:
[0022]
[0023] Wherein, H is the height of the image, W is the width of the image; H=W, and both are even numbers.
[0024] The further step is: step 2, the specific content is:
[0025] Step 21: determine the size of the sliding window and the sliding step; the size of the sliding window is cxc(c≤H,c≤W), and the step is s(s≤H-c);
[0026] The image sub-block set P containing the local features of the image is obtained by using the sliding window algorithm.
[0027] Step 22: determine the total number of image sub-blocks obtained from each image;
[0028] The number of each row Row:
[0029]
[0030] The number of each column Col:
[0031]
[0032] The total number of image sub-blocks obtained from each image is T = Row × Col. Therefore, the set of image sub-blocks is P = {p1,...,p...} t ,...,p T};
[0033] Step 23: Set the sliding window direction (sliding left to right, top to bottom), and sequentially slide the images X in the training set. n and the label image L in the label set n Using the sliding window algorithm, we obtain the input subset: the input training subset. and input training label subset
[0034] Where t represents the t-th image;
[0035] The input training subset The t-th image The specific form is:
[0036]
[0037] The input training label subset The t-th image in Specifically:
[0038]
[0039] in, Let be the pixel at position c in the t-th image sub-block. The value range of the pixel position marker is [1, c·c].
[0040] Using the steps described above, the entire image is divided into smaller blocks one by one using the sliding window algorithm, forming a set of sub-blocks.
[0041] A further technical solution defines: non-edge feature sub-blocks as sub-blocks containing only the background or only the target; edge feature sub-blocks as sub-blocks containing both the background and the target.
[0042] Step 3 details:
[0043] Step 31: The label image L in the image label set n The value of each pixel e in the image is V = {0, 1}. Then, combining the target image outline and the image background, we set V = 1 to represent the target, V = 0 to represent the background, and the two adjacent pixels of V = 0 and V = 1 to represent the edge.
[0044] Step 32: Input a subset of training labels In the process, q random sub-blocks of the label image with all pixel values of 0 are extracted to form a set. in denotes the qth label image sub-block with all pixel values being 0 in size of c x c, and in the input image subset , a set of q image sub-blocks with the same position as all selected label image sub-blocks is selected , wherein denotes the qth image sub-block with all pixel values being 0 in size of c x c;
[0045] Step 33: when all pixel values are 1, a set of q label image sub-blocks containing the selected set of image sub-blocks is obtained and the set of image sub-blocks , wherein denotes the qth label image sub-block with all pixel values being 1 in size of c x c, denotes the qth image sub-block with all pixel values being 1 in size of c x c;
[0046] Step 34: merging the sets of selected pixel values of 0 and 1 to obtain a set of non-edge typical feature sub-blocks; a set of non-edge image sub-blocks and a set of non-edge image label sub-blocks
[0047] The above steps are used to divide the sub-blocks into edge and non-edge. Steps 32 and 33 can be exchanged.
[0048] Further steps are as follows: the specific content of step 4 is:
[0049] Step 41: splicing each element in the set of non-edge image label sub-blocks to obtain a non-edge label image sub-block splicing matrix The specific form is:
[0050]
[0051] splicing each element in the set of non-edge image sub-blocks to obtain a non-edge image sub-block splicing matrix The form is:
[0052]
[0053] Step 42: defining an anchor frame M of K x K, wherein K is a positive odd number and K < c;
[0054] Step 43: in the non-edge image sub-block splicing matrix , using the anchor frame M, frame selection is performed according to the sliding direction of the sliding window, and the element values in the range of K x K are sequentially framed; finally, the matrix E n is obtained.
[0055] The specific framing step is:
[0056] Anchor frame M is a matrix of non-edge image sub-blocks stitched together sequentially. The element values in the matrix are used to select the center, and the anchor box M is used in the non-edge image sub-block stitching matrix. Fill the area outlined outside the edge with 0;
[0057] Anchor box M is a stitching matrix of non-edge image sub-blocks. In The selected result is E1; its dimension is K×K; expanding this result results in a dimension of 1×K. 2 vector
[0058] stitching matrix of non-edge image sub-blocks The remaining pixels Results of selecting boxes Expanding sequentially, we obtain Immediately afterwards, By piecing them together, we obtain The corresponding matrix E n :
[0059]
[0060] Step 44: For m images X1...X m (2≤m≤N), according to the selection step in step 43, m images X1...X are obtained respectively. m The corresponding matrix E 1 ...E m Immediately afterwards, regarding E 1 ...E m By stitching together the images, we obtain the matrix E corresponding to the m images. 1:m :
[0061]
[0062] Step 45: Solve for E 1:m The inverse matrix, i.e., calculating the inverse matrix. inverse matrix
[0063] (E 1:m ) + =((E) 1:m ) T ·E 1:m ) -1 ·(E 1:m ) T (0.24)
[0064] Step 46: Combine the m images X1...X m The corresponding non-edge image tag sub-block splicing matrix In Expand into column vectors Then concatenate the m non-edge image tag sub-blocks into a matrix. Concatenate the data to obtain the label column vector L. 1:m :
[0065]
[0066] Step 47: Inverse the matrix With label column vector L 1:m Perform matrix multiplication to obtain the result matrix P. 1:m :
[0067]
[0068] matrix Convert to a square matrix (P) 1:m ) K×K ; Square (P) 1:m ) K×K This is the desired non-critical edge suppression operator HQ1;
[0069] Step 48: Apply the non-critical edge suppression operator HQ1 to the original image X n Unrelated feature suppression is performed to obtain the initial feature map F of the weakened non-edge region. init .
[0070] Following the steps above, non-edge regions are extracted, and their features are weakened to obtain an initial feature map with weakened non-edge regions. These non-edge regions can then be ignored during subsequent target selection.
[0071] Furthermore, step 51: Based on the initial feature map F obtained in step 4, weaken the non-edge regions. init Obtain a set of typical edge feature sub-blocks; the specific content is as follows:
[0072] Combining step 3, we can obtain the set of edge feature label sub-blocks. To obtain the nth image L n In the q image label sub-blocks obtained, each c×c sub-block contains Pixels with all values of 0 and Pixels with all values of 1; set of edge feature label sub-blocks This represents a tag sub-block of size c×c whose q-th pixel value contains both 0 and 1;
[0073] The set of edge feature image sub-blocks corresponding to the set of edge feature label sub-blocks is the set of edge feature image sub-blocks of the training image. Specifically in representing the qth pixel value of size cxc, which contains both the background and the target image sub-block;
[0074] the edge feature image sub-block set and the edge feature label sub-block set together constitute an edge typical feature sub-block set;
[0075] Step 52: the edge feature image sub-block set is set as the matrix after splicing each element in the edge feature label sub-block set is set as the matrix after splicing each element in Similarly, the contents of steps 41 to 47 are performed to obtain the key edge enhancement operator HQ2=(P 1:m )2;
[0076] Step 53: using the key edge enhancement operator HQ2 to weaken the initial feature map F init of the non-edge region to obtain the edge enhancement feature map F out .
[0077] According to the specific content of step 4, after the non-edge region is extracted, the remaining region is the edge region, and the same step content, combined with the key edge enhancement operator HQ2=(P 1:m )2, can realize the layout recovery of the edge region.
[0078] The beneficial effects of the present application are:
[0079] The edge extraction operator can adaptively obtain edge features according to image and texture characteristics, can smooth non-key edges, reduce noise influence, can enhance key edges, strengthen the difference between the target and the background, and obtain an edge smoothed image highlighting typical features. Using the obtained image for data expansion can effectively increase the feature expression of training, on the other hand, using the expanded data as the input of the neural network segmentation model, and cooperating with the edge extraction operator (extracting the edges of the target and the background, such as the Laplace edge extraction operator), can further improve the accuracy of the model for target segmentation.
[0080] In the present application, the non-key edge suppression operator HQ1 and the key edge enhancement operator HQ2 are proposed, which can be applied to any image edge enhancement image processing, and provide a processing method for image processing. BRIEF DESCRIPTION OF DRAWINGS
[0081] Figure 1 is the flow chart of the image processing method of the present application;
[0082] Figure 2 This is a diagram illustrating how to select and expand image elements using anchor frames.
[0083] Figure 3 A diagram illustrating the selection of edge and non-edge sub-blocks;
[0084] Figure 4 This is a schematic diagram of image target edge enhancement processing. Detailed Implementation
[0085] The present invention will now be described in further detail with reference to the accompanying drawings.
[0086] In practical implementation: such as Figures 1 to 3 As shown,
[0087] A method for enhancing image target edges based on a sliding window algorithm, see [link to relevant documentation]. Figure 1 and Figure 4 The specific steps are as follows:
[0088] Step 1: Collect image data from the image database, and after preprocessing, obtain a training image set, a training image label set, and a test image set. The training image set and the training image label set each contain N images; N is a positive integer.
[0089] In this embodiment, in step 1, let the original training image set collected from the image database be: I origin ={A1,...,A n ,...,A N The original image label set corresponding to the original training image set is I. label ={B1,...,B n ,...,B N};
[0090] In this embodiment, see Figure 4 The training image labels corresponding to the training images in the original training image set are composed of the target image outline and the background;
[0091] For the original training image set I origin The original training image label set is I label The image undergoes dimensionality reduction preprocessing, which involves converting a color image into a grayscale photo.
[0092] In this embodiment, the specific dimensionality reduction step is as follows: using the averaging method, the original training image set I is reduced... origin Original training image label set I label Each image in the dataset is converted into a single-channel image, and the resulting set constitutes the training image set. Training image label set
[0093] wherein the training image set
[0094] the training image label set
[0095] the n-th image (Xn) in the training image set n ) H×W The matrix form is:
[0096]
[0097] the n-th image (Ln) in the training image label set n H×W The matrix form is:
[0098]
[0099] wherein H is the height of the image, and W is the width of the image;
[0100] In this embodiment, H=W, which is convenient for subsequent calculation, and both are even numbers.
[0101] Step 2: using a sliding window algorithm to extract features from the m images in the training image set and the training image label set obtained in step 1, to obtain input subsets: input training subset and input training label subset; wherein m is greater than or equal to 1, and m is less than or equal to N;
[0102] The specific content of step 2 is:
[0103] Step 21: determine the size and sliding step of the sliding window;
[0104] In this embodiment, the sliding direction is from left to right and from top to bottom.
[0105] The size of the sliding window is c×c (c≤H, c≤W), and the step is s (s≤H-c); using the sliding window algorithm to obtain an image sub-block set P containing local features of the image;
[0106] Step 22: determine the total number of image sub-blocks obtained from each image;
[0107] The number of rows Row:
[0108]
[0109] The number of columns Col:
[0110]
[0111] The total number of image sub-blocks obtained from each image is T = Row × Col. Therefore, the set of image sub-blocks is P = {p1,...,p...} t ,...,p T};
[0112] Step 23: Set the sliding window direction (sliding from left to right, then from top to bottom), and sequentially slide the images X in the training image set. n and the label image L in the training image label set n Using the sliding window algorithm, we obtain the input subset: the input training subset. and input training label subset
[0113] Where t represents the t-th image;
[0114] The input training subset The t-th image The specific form is:
[0115]
[0116] The input training label subset The t-th image in Specifically:
[0117]
[0118] in, Let be the pixel at position c in the t-th image sub-block. The value range of the pixel position marker is [1, c·c].
[0119] Step 3: From the input subset in Step 2, select non-edge sub-blocks in the image to form a set of non-edge typical feature sub-blocks; a set of non-edge image sub-blocks; and a set of non-edge image label sub-blocks.
[0120] set up:
[0121] Non-edge feature sub-blocks are sub-blocks that contain only the background or only the target; see also Figure 3 (a) contains only sub-blocks of the target;
[0122] Edge feature sub-blocks are sub-blocks that contain both background sub-blocks and target sub-blocks; see also Figure 3 (b) contains a background sub-block and a target sub-block.
[0123] Combination Figure 3 As can be seen, the specific content of step 3 is as follows:
[0124] Step 31: The label image L in the image label set nThe value of each pixel point e in the set is V={0,1}, and combined with the target image contour and image background, it is set that V=1 represents the target, V=0 represents the background, and adjacent two pixel points of V=0 and V=1 represent the edge;
[0125] Step 32: randomly extracting q image subblocks with all pixel values being 0 from the input training label subset to form a set wherein represents the qth image subblock with all pixel values being 0 and the size being c×c, and in the input image subset , q image subblocks with the same positions as all selected label image subblocks are selected to form a set wherein represents the qth image subblock with all pixel values being 1 and the size being c×c;
[0126] Step 33: when the pixel value is all 1, the set containing q label image subblocks and the image subblock set wherein represents the qth label image subblock with all pixel values being 1 and the size being c×c, represents the qth image subblock with all pixel values being 1 and the size being c×c;
[0127] Step 34: merging the sets of selected pixel values being 0 and 1 to obtain a set of non-edge typical feature subblocks; a set of non-edge image subblocks and a set of non-edge image label subblocks
[0128] Step 4: performing matrix solving on the images in the set of non-edge typical feature subblocks to obtain a non-key edge suppression operator HQ1, and combining the image data in the image database to perform non-related edge suppression to obtain an initial feature map F init of a non-edge region weakened;
[0129] The specific content of step 4 is:
[0130] Step 41: splicing each element in the set of non-edge image label subblocks to obtain a non-edge label image subblock splicing matrix The specific form is:
[0131]
[0132] Splicing each element in the set of non-edge image subblocks to obtain a non-edge image subblock splicing matrix The form is:
[0133]
[0134] Step 42: Define a K×K anchor frame M: where K is a positive odd number and K < c;
[0135] Step 43: Concatenate the matrix in non-edge image sub-blocks In the process, using anchor box M, the elements within a range of K×K are selected sequentially according to the sliding direction of the sliding window; finally, matrix E is obtained. n ;
[0136] The specific steps for selecting the box are as follows:
[0137] Anchor frame M is a matrix of non-edge image sub-blocks stitched together sequentially. The element values in the matrix are used to select the center, and the anchor box M is used in the non-edge image sub-block stitching matrix. Fill the area outlined outside the edge with 0;
[0138] Anchor box M is a stitching matrix of non-edge image sub-blocks. In The selected result is E1; its dimension is K×K; expanding this result results in a dimension of 1×K. 2 vector
[0139] stitching matrix of non-edge image sub-blocks The remaining pixels Results of selecting boxes Expanding sequentially, we obtain Immediately afterwards, By piecing them together, we obtain The corresponding matrix E n :
[0140]
[0141] Step 44: For m images X1...X m (2≤m≤N), according to the selection step in step 43, m images X1...X are obtained respectively. m The corresponding matrix E 1 ...E m Immediately afterwards, regarding E 1 ...E m By stitching together the images, we obtain the matrix E corresponding to the m images. 1:m :
[0142]
[0143] Step 45: Solve for E 1:m The inverse matrix, i.e., calculating the inverse matrix. inverse matrix
[0144] (E 1:m ) + = ((E 1:m ) T · E 1:m ) -1 · (E 1:m ) T (0.37)
[0145] Step 46: Unfold the non-edge image label sub-block stitching matrix m corresponding to m image X1...X into column vectors respectively Then stitch the m non-edge image label sub-block stitching matrix to get the label column vector L 1:m :
[0146]
[0147] Step 47: Perform matrix multiplication between the inverse matrix and the label column vector L 1:m to get the result matrix P 1:m :
[0148]
[0149] Convert the matrix into a square matrix (P 1:m ) K×K ; the square matrix (P 1:m ) K×K is the non-key edge suppression operator HQ1 sought;
[0150] Step 48: Perform non-relevant feature suppression on the original image X n using the non-key edge suppression operator HQ1 to obtain the initial feature map F init with weakened non-edge regions.
[0151] Non-key edge suppression refers to weakening the texture of non-target edges in the image to a range close to the surrounding background gray value, thereby increasing the distinction between the target edges, achieving the effect of suppressing non-key edges. Therefore, non-relevant feature suppression is performed on the original image X n by HQ1.
[0152] Step 5: Obtain the edge typical feature sub-block set from the initial feature map F init with weakened non-edge regions obtained in step 4: the edge feature image sub-block set and the edge feature image label sub-block set, and perform matrix solving on them to obtain the key edge enhancement operator HQ2;
[0153] Step 51: the initial feature map F of the non-edge region weakening obtained according to step 4 init Obtain an edge typical feature sub-block set; the specific content is:
[0154] It can be obtained in combination with step 3 that the edge feature label sub-block set For the q image label sub-blocks obtained from the nth image L n , each c×c sub-block contains pixel points with all 0 pixel values and pixel points with all 1 pixel values; the edge feature label sub-block set represents a label sub-block of the qth pixel value with a size of c×c, which contains both 0 and 1;
[0155] The edge feature image sub-block set corresponding to the training image of the edge feature label sub-block set is Specifically, Wherein represents an image sub-block of the qth pixel value with a size of c×c, which contains both background and target;
[0156] The edge feature image sub-block set and the edge feature label sub-block set jointly constitute an edge typical feature sub-block set.
[0157] Step 52: set the matrix after splicing each element of the edge feature image sub-block set as Set the matrix after splicing each element of the edge feature label sub-block set as Similarly, in combination with steps 41 to 47, the key edge enhancement operator HQ2=(P 1:m )2 is obtained.
[0158] Step 6, in combination with Figure 1 and 4 It can also be seen that, in combination with step 4 to obtain the non-key edge suppression operator and step 5 to obtain the key edge enhancement operator HQ2, the initial feature map F of the non-edge region weakening of the test picture in the test image set can be obtained after sequentially calling the non-key edge suppression operator HQ1. init Again, calling the key edge enhancement operator HQ2, the feature extraction is performed on the initial feature map F of the non-edge region weakening of the test picture by using the key edge enhancement operator HQ2, and the edge enhancement feature map F init of the test picture can be obtained. out
[0159] In the implementation process, the obtained final edge enhancement feature map is put into an original database to perform picture data expansion, so that the feature expression of the sample can be effectively increased. The expanded data is used as the input of a segmentation model such as a neural network, and is matched with an edge (target edge or background edge) extraction operator such as a Laplace edge extraction operator, so that the accuracy of the model for target segmentation can be further improved. The above is only a preferred implementation manner of the present application, and it should be pointed out that the technical solutions of several deformations and improvements made by those skilled in the art without departing from the present technical solution should also be considered to fall within the scope of protection of the present application.
Claims
1. A method for enhancing image target edges based on a sliding window algorithm, characterized in that... The specific steps are as follows: Step 1: Collect image data from the image database, and after preprocessing, obtain a training image set, a training image label set, and a test image set. The training image set and the training image label set each contain N images; N is a positive integer. Step 2: Use the sliding window algorithm to extract features from the m images in the training image set and training image label set obtained in Step 1 to obtain the input subsets: the input training subset and the input training label subset; where m is greater than or equal to 1 and m is less than or equal to N; Step 2 consists of the following steps: Step 21: Determine the size and step size of the sliding window; the size of the sliding window is c×c (c≤H,c≤W), and the step size is s (s≤Hc); use the sliding window algorithm to obtain image sub-blocks containing local image features to form a set P; Step 22: Determine the total number of image sub-blocks obtained for each image; Number of rows per line: Quantity per column (Col): The total number of image sub-blocks obtained from each image is T = Row × Col. Therefore, the set of image sub-blocks is P = {p1,...,p...} t ,...,p T }; Step 23: Set the sliding window direction, and sequentially slide the X images in the training image set. n and the label image L in the training image label set n Using the sliding window algorithm, we obtain the input subset: the input training subset. and input training label subset Where t represents the t-th image; The input training subset The t-th image The specific form is: The input training label subset The t-th image in Specifically: in, Let c be the pixel at position c in the t-th image sub-block. The value range of the position marker of this pixel is [1, c·c]. Step 3: From the input subset in Step 2, select non-edge sub-blocks in the image to form a set of non-edge typical feature sub-blocks; a set of non-edge image sub-blocks; and a set of non-edge image label sub-blocks. set up: Non-edge feature sub-blocks are sub-blocks that contain only the background or sub-blocks that contain only the target; The edge feature sub-block is a sub-block that includes both the background sub-block and the target; Step 3 details: Step 31: The label image L in the image label set n The value of each pixel e in the image is V = {0, 1}. Then, combining the target image outline and the image background, we set V = 1 to represent the target, V = 0 to represent the background, and the two adjacent pixels of V = 0 and V = 1 to represent the edge. Step 32: Input training label subset In the process, q random sub-blocks of the label image with all pixel values of 0 are extracted to form a set. in This represents a labeled image sub-block of size c×c whose q-th pixel value is all 0. Meanwhile, in the input image subset... In the process, select q image sub-blocks that are in the same position as all selected label image sub-blocks to form a set. in This represents an image sub-block of size c×c where the q-th pixel value is all 0. Step 33: When all pixel values are 1, select the set containing q labeled image sub-blocks. and image sub-block set in This represents a label image sub-block of size c×c where the q-th pixel value is all 1. This represents an image sub-block of size c×c where the q-th pixel value is all 1; Step 34: Merge the selected sets of pixel values of 0 and 1 to obtain a set of non-edge typical feature sub-blocks; non-edge image sub-block set Non-edge image label sub-block set Step 4: Solve the matrix for each image in the set of typical non-edge feature blocks to obtain the non-critical edge suppression operator HQ1. Combine this with image data from the image database to perform irrelevant edge suppression, resulting in the initial feature map F of the weakened non-edge region. init ; Step 41: Concatenate the set of non-edge image tag sub-blocks The elements in the matrix are used to obtain the non-edge labeled image sub-block stitching matrix. The specific form is as follows: Stitching non-edge image sub-blocks Each element in the matrix is used to obtain the non-edge image sub-block stitching matrix. Its form is: Step 42: Define a K×K anchor frame M: where K is a positive odd number and K < c; Step 43: Concatenate the matrix in non-edge image sub-blocks In the process, using anchor box M, the elements within a range of K×K are selected sequentially according to the sliding direction of the sliding window; finally, matrix E is obtained. n ; The specific steps for selecting the box are as follows: Anchor frame M is a matrix of non-edge image sub-blocks stitched together sequentially. The element values in the matrix are used to select the center, and the anchor box M is used in the non-edge image sub-block stitching matrix. Fill the area outlined outside the edge with 0; Anchor box M is a stitching matrix of non-edge image sub-blocks. In The selected result is E1; its dimension is K×K; expanding this result results in a dimension of 1×K. 2 vector stitching matrix of non-edge image sub-blocks The remaining pixels Results of selecting boxes Expanding sequentially, we obtain Immediately afterwards, By piecing them together, we obtain The corresponding matrix E n : Step 44: For m images X1...X m (1 < m ≤ N), according to the selection step in step 43, m images X1...X are obtained respectively. m The corresponding matrix E 1 ...E m Immediately afterwards, regarding E 1 ...E m By stitching together the images, we obtain the matrix E corresponding to the m images. 1:m : Step 45: Solve for E 1:m The inverse matrix, i.e., calculating the inverse matrix. inverse matrix (AND 1:m ) + =((And 1:m ) T ·AND 1:m ) -1 ·(AND 1:m ) T (0.9) Step 46: Combine the m images X1...X m The corresponding non-edge image tag sub-block splicing matrix In Expand into column vectors Then concatenate the m non-edge image tag sub-blocks into a matrix. Concatenate the data to obtain the label column vector L. 1:m : Step 47 will inverse the matrix With label column vector L 1:m Perform matrix multiplication to obtain the result matrix P. 1:m : matrix Convert to a square matrix (P) 1:m ) K×K Square (P) 1:m ) K×K This is the desired non-critical edge suppression operator HQ1; Step 48: Apply the non-critical edge suppression operator HQ1 to the original image X n Unrelated feature suppression is performed to obtain the initial feature map F of the weakened non-edge region. init ; Step 5: Use the initial feature map F obtained in Step 4 to weaken the non-edge regions. init The obtained set of typical edge feature sub-blocks: the set of edge feature image sub-blocks and the set of edge feature image label sub-blocks, after matrix solving, yields the key edge enhancement operator HQ2; Step 51: Based on the initial feature map F obtained in Step 4, weaken the non-edge regions. init Obtain a set of typical edge feature sub-blocks; the specific content is as follows: Combining step 3, we can obtain the set of edge feature label sub-blocks. To obtain the nth image L n In the q image label sub-blocks obtained, each c×c sub-block contains Pixels with all values of 0 and Pixels with all values of 1; set of edge feature label sub-blocks This represents a tag sub-block of size c×c whose q-th pixel value contains both 0 and 1; The set of edge feature image sub-blocks corresponding to the set of edge feature label sub-blocks is the set of edge feature image sub-blocks of the training image. Specifically in This represents an image sub-block of size c×c whose q-th pixel value contains both the background and the target. The set of edge feature image sub-blocks and the set of edge feature labels Together they constitute a set of typical edge feature sub-blocks; Step 52: Assemble the edge feature image sub-blocks into The matrix formed by concatenating the elements in the matrix is set as follows: The set of edge feature labels The matrix after splicing the elements is set as follows Combining steps 41 to 47, the critical edge enhancement operator HQ2 = (P) is obtained. 1:m )2 Step 6: Combining the non-critical edge suppression operator obtained in Step 4 and the critical edge enhancement operator HQ2 obtained in Step 5, the non-critical edge suppression operator HQ1 and the critical edge enhancement operator HQ2 are sequentially applied to the test images in the test image set to obtain the edge enhancement feature map F of the corresponding image data. out .
2. The image target edge enhancement processing method based on the sliding window algorithm according to claim 1, characterized in that: In step 1, let the original training image set collected from the image database be: I origin ={A1,...,A n ,...,A N The original image label set corresponding to the original training image set is I. label ={B1,...,B n ,...,B N The original training image set contains the outlines and backgrounds of all target images. For the original training image set I origin The original training image label set is I label Dimensionality reduction preprocessing of the image: Using the averaging method, the original training image set I origin Original training image label set I label Each image in the dataset is converted into a single-channel image, and the resulting set constitutes the training image set. Training image label set Wherein, the training image set The training image label set The nth image (X) in the training image set n ) H×W The matrix form is as follows: The label image (L) corresponding to the nth image in the training image label set. n ) H×W The matrix form is as follows: Where H is the height of the image and W is the width of the image.
3. The image target edge enhancement processing method based on the sliding window algorithm according to claim 1, characterized in that: In step 6, the initial feature map F, which is weakened in the non-edge region, is applied using the critical edge enhancement operator HQ2. init Feature extraction is performed to obtain the edge enhancement feature map F. out .