An expected part extraction method based on image processing model training
By combining global and local target enhancement methods with an image detection model, the problems of invalid redundant search and residual background information in image processing are solved, thereby improving the accuracy and speed of target recognition.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QINGHAI UNIV FOR NATITIES
- Filing Date
- 2022-11-30
- Publication Date
- 2026-05-15
AI Technical Summary
Existing image processing techniques suffer from problems such as invalid redundant searches and residual background information, which affect the accuracy of image target recognition.
The global and local target enhancement methods are used to extract the global and local target regions. The local target regions are then used to enhance and fuse the target image. Finally, a pre-established image detection model is used to identify the target, thus extracting the target region.
It improves the accuracy and speed of target recognition, reduces the scope of invalid searches, and enhances detection efficiency and automation.
Smart Images

Figure CN116310278B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and more specifically to a method for extracting desired parts based on image processing model training. Background Technology
[0002] Image processing is the technique of using computers to analyze images to achieve desired results. It is also known as image processing. Image processing generally refers to digital image processing. A digital image is a large two-dimensional array obtained by capturing images using equipment such as industrial cameras, video cameras, and scanners. The elements of this array are called pixels, and their values are called grayscale values. Image processing techniques generally include three parts: image compression, enhancement and restoration, and matching, description, and recognition.
[0003] Current image processing methods typically identify targets across the entire image pixel area. Therefore, identifying pixels other than those representing the target is an ineffective and redundant process. Furthermore, directly identifying targets in the original image leaves behind a certain amount of background information in the identified target area, which is difficult to remove and thus affects the accuracy of image target recognition. Summary of the Invention
[0004] The purpose of this invention is to provide a method for extracting desired parts based on image processing model training, so as to solve the technical problems of invalid redundant search and residual background information in image target recognition in the prior art.
[0005] To solve the above-mentioned technical problems, the present invention specifically provides the following technical solution:
[0006] A method for extracting desired parts based on image processing model training, characterized by the following steps:
[0007] Step S1: Perform global target enhancement on the target image to obtain the global desired region in the target image, and perform local target enhancement on the global desired region to obtain the local desired region in the global desired region;
[0008] Step S2: Enhance and fuse the target image using the local desired region to obtain an enhanced target image representing the enhancement of the desired part;
[0009] Step S3: Use a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired part of the target image, so as to extract the desired part from the target image.
[0010] As a preferred embodiment of the present invention, the step of performing global target enhancement on the target image to obtain a globally desired region in the target image includes:
[0011] Multiple sets of filtered images are obtained by filtering the target images using multiple sets of functional filters. The functional expression for the multi-channel filtering process is as follows:
[0012] M i (x,y)=F i {I(x,y)};
[0013] In the formula, M i (x,y) represents the i-th filtered image group, F i Let I(x,y) be the i-th functional filter, where x and y are the pixel coordinates of the target image, and i is the measurement value.
[0014] Multiple fully connected graphs are constructed using pixels from multiple filtered images as nodes, and the difference between pixels in the filtered images is mapped to the edge weights between nodes in the fully connected graphs. The functional expression for the difference is:
[0015]
[0016] In the formula, d i (a,b) represents the difference between pixel a and pixel b in the i-th filtered image, M i (x a ,y a M i (x b ,y b Let be the pixel features of pixel a and pixel b in the i-th filtered image, and (x) a ,y a (x) represents the pixel coordinates of pixel a. b ,y b () represents the pixel coordinates of pixel b;
[0017] The functional expression for the edge weights between nodes is:
[0018]
[0019] In the formula, w i (a,b) represents the edge weights between nodes a and b in the i-th fully connected graph, γ is a random parameter, γ∈[0.1H,0.2H], and H is the width of the filtered image;
[0020] A Markov chain is defined in each group of fully connected graphs. The nodes in the fully connected graphs are mapped to the states in the Markov chain, and the edge weights in the fully connected graphs are mapped to the transition probabilities in the Markov chain. The equilibrium state of the Markov chain is described as the dwell time at each state node to obtain the response map of each group of filtered images.
[0021] The response maps of multiple filtered images are regularized, and the response maps of the regularized multiple filtered images are superimposed and fused to obtain the global desired region.
[0022] As a preferred embodiment of the present invention, the regularization process includes:
[0023] The pixels in the response graph of the filtered image are used as nodes to construct regularized graphs, and the response values of the pixels in the response graph of the filtered image are mapped to the edge weights between nodes in the regularized graph. The functional expression of the edge weights between nodes in the regularized graph is as follows:
[0024]
[0025] In the formula, L i (a,b) represents the edge weights between nodes a and b in the i-th regularized graph, A i (x a ,y a Let ) be the response value at node a in the i-th regularized graph;
[0026] The edge weights between nodes in the regularized graph are normalized, and the normalized regularized graph is mapped to a Markov chain. The stationary distribution of each node in the Markov chain is calculated so that high response values are concentrated in the response graph of the filtered image.
[0027] As a preferred embodiment of the present invention, the step of performing local target enhancement on the global desired region to obtain a local desired region within the global desired region includes:
[0028] The global desired region is divided into multiple local image blocks, and the division size function of the local image blocks is expressed as follows:
[0029]
[0030] In the formula, S part S is the image size of a local image patch. global R is the image size of the global desired region, R is the image resolution of the global desired region, and δ is the balancing parameter;
[0031] The Fourier transform is used to quantify the difference between local image patches. The formula for the Fourier transform between the local image patches is as follows:
[0032]
[0033] In the formula, F k (u,v) represents the k-th local image patch after the Fourier transform, F k (x,y) represents the kth local image patch, where k is the number of pixels;
[0034] Among them, F k (u,v) is converted to polar coordinates, and then in F... k The amplitude spectrum of the k-th local image patch is obtained from the polar coordinates of (u,v), and the difference between local image patches is obtained based on the Euclidean distance of the amplitude spectra between the local image patches.
[0035] The formula for the difference between local image blocks is:
[0036]
[0037] In the formula, D kr The difference between the k-th local image patch and the r-th local image patch;
[0038] Each local image patch is assigned a value based on the difference between them. The assigned local image patches are then subjected to Gaussian low-pass filtering, fully connected graph construction, response graph construction, and fusion to obtain the desired local region. The assignment expression for each local image patch is as follows:
[0039]
[0040] In the formula, F k (x,y)' represents the k-th local image patch after assignment, F k (x,y) represents the k-th local image patch, F r (x,y) represents the r-th local image patch, and k and r are the numbers.
[0041] As a preferred embodiment of the present invention, the step of enhancing and fusing the target image using a local desired region to obtain an enhanced target image representing the desired enhancement includes:
[0042] The enhanced target image is obtained by weighting the expected values of the local desired regions and applying them to the corresponding positions in the target image. The functional expression of the enhanced target image is as follows:
[0043] SI(x,y)=I(x,y)×S(x,y);
[0044] In the formula, SI(x,y) is the enhanced target image, S(x,y) is the local desired region, and I(x,y) is the target image.
[0045] As a preferred embodiment of the present invention, the step of using a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired portion of the target image includes:
[0046] The enhanced target image is input into a pre-established image detection model, and the image detection model outputs the target region of the enhanced target image.
[0047] The target region of the enhanced target image is taken as the desired part of the target image.
[0048] As a preferred embodiment of the present invention, the pre-establishment method of the image detection model includes:
[0049] Acquire a set of sample images, mark the desired parts in the sample images, and perform global target enhancement and local target enhancement on the sample images in sequence;
[0050] The enhanced sample image is used as the input of the YOLO network, and the desired part is used as the output of the YOLO network. The YOLO network is used to train the model on the input and output to obtain the desired extraction model.
[0051] The model expression for the expected extraction model is:
[0052] g = YOLO(SI);
[0053] In the formula, g represents the desired part, SI represents the enhanced sample image, and YOLO represents the YOLO network.
[0054] As a preferred embodiment of the present invention, the sample image and the target image are images of the same specification.
[0055] As a preferred embodiment of the present invention, the desired part is marked in the sample image by segmentation using the FCM algorithm, and the desired part is marked with the minimum bounding rectangle.
[0056] As a preferred embodiment of the present invention, the functions of the multiple functional filters include contrast, gradient, and pixel intensity.
[0057] Compared with the prior art, the present invention has the following advantages:
[0058] This invention performs global target enhancement on a target image to obtain a global desired region, and performs local target enhancement on the global desired region to obtain a local desired region. The target image is then enhanced and fused using the local desired regions to obtain an enhanced target image representing the enhanced desired portion. A pre-established image detection model is used to perform target recognition on the enhanced target image to obtain the desired portion of the target image. This achieves image enhancement and background information removal on the image region representing the target in the target image, which not only increases the probability of the target being correctly detected, but also greatly narrows the target search range and speeds up the overall detection speed. Attached Figure Description
[0059] To more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are merely exemplary, and those skilled in the art can derive other embodiments based on the provided drawings without creative effort.
[0060] Figure 1 A flowchart of the desired portion extraction method provided in an embodiment of the present invention. Detailed Implementation
[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0062] like Figure 1 As shown, this invention provides a method for extracting desired parts based on image processing model training, characterized by the following steps:
[0063] Step S1: Perform global target enhancement on the target image to obtain the global desired region in the target image, and perform local target enhancement on the global desired region to obtain the local desired region in the global desired region;
[0064] The step of performing global target enhancement on the target image to obtain the globally desired region in the target image includes:
[0065] Multiple sets of filtered images are obtained by filtering the target images using multiple sets of functional filters. The functional expression for the multi-channel filtering process is as follows:
[0066] M i (x,y)=F i {I(x,y)};
[0067] In the formula, M i (x,y) represents the i-th filtered image group, F i Let I(x,y) be the i-th functional filter, where x and y are the pixel coordinates of the target image, and i is the measurement value.
[0068] Multiple fully connected graphs are constructed using pixels from multiple filtered images as nodes, and the difference between pixels in the filtered images is mapped to the edge weights between nodes in the fully connected graphs. The functional expression for the difference is:
[0069]
[0070] In the formula, d i (a,b) represents the difference between pixel a and pixel b in the i-th filtered image, M i (x a ,y a M i (x b ,y b Let be the pixel features of pixel a and pixel b in the i-th filtered image, and (x) a ,y a (x) represents the pixel coordinates of pixel a. b ,y b () represents the pixel coordinates of pixel b;
[0071] The functional expression for the edge weights between nodes is:
[0072]
[0073] In the formula, w i (a,b) represents the edge weights between nodes a and b in the i-th fully connected graph, γ is a random parameter, γ∈[0.1H,0.2H], and H is the width of the filtered image;
[0074] A Markov chain is defined in each group of fully connected graphs. The nodes in the fully connected graphs are mapped to the states in the Markov chain, and the edge weights in the fully connected graphs are mapped to the transition probabilities in the Markov chain. The equilibrium state of the Markov chain is described as the dwell time at each state node to obtain the response map of each group of filtered images.
[0075] The response maps of multiple filtered images are regularized, and the response maps of the regularized multiple filtered images are superimposed and fused to obtain the global desired region.
[0076] The regularization process includes:
[0077] The pixels in the response graph of the filtered image are used as nodes to construct regularized graphs, and the response values of the pixels in the response graph of the filtered image are mapped to the edge weights between nodes in the regularized graph. The functional expression of the edge weights between nodes in the regularized graph is as follows:
[0078]
[0079] In the formula, L i (a,b) represents the edge weights between nodes a and b in the i-th regularized graph, A i (x a ,y a Let ) be the response value at node a in the i-th regularized graph;
[0080] The edge weights between nodes in the regularized graph are normalized, and the normalized regularized graph is mapped to a Markov chain. The stationary distribution of each node in the Markov chain is calculated so that high response values are concentrated in the response graph of the filtered image.
[0081] Global target enhancement of the target image can initially highlight the desired part representing the target pixel in the target image, that is, the global expectation region. In other words, it can reduce the dimensionality of target recognition in the target image from the entire target image region to the global expectation region, thereby achieving an initial dimensionality reduction of the search range for target recognition in the target image and avoiding invalid and redundant searches.
[0082] The step of performing local target augmentation on the global desired region to obtain a local desired region within the global desired region includes:
[0083] The global desired region is divided into multiple local image blocks, and the division size function of the local image blocks is expressed as follows:
[0084]
[0085] In the formula, S part S is the image size of a local image patch. global R is the image size of the global desired region, R is the image resolution of the global desired region, and δ is the balancing parameter;
[0086] The Fourier transform is used to quantify the difference between local image patches. The formula for the Fourier transform between the local image patches is as follows:
[0087]
[0088] In the formula, F k (u,v) represents the k-th local image patch after the Fourier transform, F k (x,y) represents the kth local image patch, where k is the number of pixels;
[0089] Among them, F k (u,v) is converted to polar coordinates, and then in F... k The amplitude spectrum of the k-th local image patch is obtained from the polar coordinates of (u,v), and the difference between local image patches is obtained based on the Euclidean distance of the amplitude spectra between the local image patches.
[0090] The formula for the difference between local image blocks is:
[0091]
[0092] In the formula, D kr The difference between the k-th local image patch and the r-th local image patch;
[0093] Each local image patch is assigned a value based on the difference between them. The assigned local image patches are then subjected to Gaussian low-pass filtering, fully connected graph construction, response graph construction, and fusion to obtain the desired local region. The assignment expression for each local image patch is as follows:
[0094]
[0095] In the formula, F k (x,y)' represents the k-th local image patch after assignment, F k (x,y) represents the k-th local image patch, F r (x,y) represents the r-th local image patch, and k and r are the numbers.
[0096] While the extraction of the global expectation region can effectively highlight the target area, it often includes background information that is undesirable for subsequent target recognition. Therefore, the amplitude spectrum method of Fourier transform is used to construct a local saliency map to eliminate background information mixed in with the target, obtain a precise target region, and strengthen spatial relationships. Further local target enhancement is then performed within the global expectation region to further reduce the dimensionality of the search range for target image recognition, thereby further avoiding unnecessary and redundant searches.
[0097] Extracting the global and local expected regions can effectively reduce redundant computation and remove invalid information related to target recognition, thus effectively improving the efficiency and accuracy of subsequent target recognition.
[0098] Step S2: Enhance and fuse the target image using the local desired region to obtain an enhanced target image representing the enhancement of the desired part;
[0099] The enhancement and fusion of the target image using local desired regions to obtain an enhanced target image representing the desired enhancement includes:
[0100] The enhanced target image is obtained by weighting the expected values of the local desired regions and applying them to the corresponding positions in the target image. The functional expression of the enhanced target image is as follows:
[0101] SI(x,y)=I(x,y)×S(x,y);
[0102] In the formula, SI(x,y) is the enhanced target image, S(x,y) is the local desired region, and I(x,y) is the target image.
[0103] The enhanced target image is obtained by weighting the expected value of the local expected region to the corresponding position of the target image, thereby enhancing the pixel intensity of the expected part in the target image, increasing the difference between the expected part and the non-expected part during the recognition process, and thus improving the accuracy of extracting the expected part.
[0104] Step S3: Use a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired part of the target image, so as to extract the desired part from the target image.
[0105] The step of using a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired portion of the target image includes:
[0106] The enhanced target image is input into a pre-established image detection model, and the image detection model outputs the target region of the enhanced target image.
[0107] The target region of the enhanced target image is taken as the desired part of the target image.
[0108] The pre-establishment method for the image detection model includes:
[0109] Acquire a set of sample images, mark the desired parts in the sample images, and perform global target enhancement and local target enhancement on the sample images in sequence;
[0110] The enhanced sample image is used as the input of the YOLO network, and the desired part is used as the output of the YOLO network. The YOLO network is used to train the model on the input and output to obtain the desired extraction model.
[0111] The model expression for the expected extraction model is:
[0112] g = YOLO(SI);
[0113] In the formula, g represents the desired part, SI represents the enhanced sample image, and YOLO represents the YOLO network.
[0114] A desired extraction model is constructed to characterize the mapping relationship between the sample image and the desired part. This model can extract the desired part from the sample image alone, improving the automation level of extraction and thus improving extraction efficiency. It also avoids human subjectivity and improves the accuracy of the desired part extraction.
[0115] The sample images and target images are images of the same specifications.
[0116] The FCM algorithm is used to segment and mark the desired part in the sample image, and the desired part is marked with the minimum bounding rectangle.
[0117] The functions of the multiple functional filters include contrast, gradient, and pixel intensity.
[0118] This invention performs global target enhancement on a target image to obtain a global desired region, and performs local target enhancement on the global desired region to obtain a local desired region. The target image is then enhanced and fused using the local desired regions to obtain an enhanced target image representing the enhanced desired portion. A pre-established image detection model is used to perform target recognition on the enhanced target image to obtain the desired portion of the target image. This achieves image enhancement and background information removal on the image region representing the target in the target image, which not only increases the probability of the target being correctly detected, but also greatly narrows the target search range and speeds up the overall detection speed.
[0119] The above embodiments are merely exemplary embodiments of this application and are not intended to limit this application. The scope of protection of this application is defined by the claims. Those skilled in the art can make various modifications or equivalent substitutions to this application within its substance and scope of protection, and such modifications or equivalent substitutions should also be considered to fall within the scope of protection of this application.
Claims
1. A method for extracting desired parts based on image processing model training, characterized in that: Includes the following steps: Step S1: Perform global target enhancement on the target image to obtain the global desired region in the target image, and perform local target enhancement on the global desired region to obtain the local desired region in the global desired region; Step S2: Enhance and fuse the target image using the local desired region to obtain an enhanced target image representing the enhancement of the desired part; Step S3: Use a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired part of the target image, so as to extract the desired part from the target image; Global target augmentation is performed on the target image to obtain the globally desired region in the target image, including: Multiple sets of functional filters are used to filter the target images to obtain multiple sets of filtered images. The function expression for multi-channel filtering is as follows: ; In the formula, M i (x,y) represents the i-th filtered image group, F i Let I(x,y) be the i-th functional filter, where x and y are the pixel coordinates of the target image, and i is the measurement value. Multiple fully connected graphs are constructed using pixels from multiple filtered images as nodes. The difference between pixels in the filtered images is mapped to the edge weights between nodes in the fully connected graphs. The function expression for the difference is: ; In the formula, d i ( a b) represents the pixel points in the i-th filtered image group. a The difference between pixel b and M i ( x a , y a M i ( x b , y b Let be the pixel features of pixel a and pixel b in the i-th filtered image. x a , y a (pixel) a pixel coordinates, ( x b , y b (pixel) b Pixel coordinates; The functional expression for the edge weights between nodes is: ; In the formula, w i ( a b) represents the nodes in the i-th fully connected graph. a The edge weight between node b and node γ is a random parameter, γ∈[0.1H,0.2H], and H is the width of the filtered image; A Markov chain is defined in each group of fully connected graphs. The nodes in the fully connected graphs are mapped to the states in the Markov chain, and the edge weights in the fully connected graphs are mapped to the transition probabilities in the Markov chain. The equilibrium state of the Markov chain is described as the dwell time at each state node to obtain the response map of each group of filtered images. The response maps of multiple filtered images are regularized, and the response maps of the regularized multiple filtered images are superimposed and fused to obtain the global desired region. Local target augmentation is performed on the global desired region to obtain a local desired region within the global desired region, including: The global desired region is divided into multiple local image patches, and the function expression for the partitioning size of the local image patches is as follows: ; In the formula, S part S is the image size of a local image patch. global R is the image size of the global desired region, R is the image resolution of the global desired region, and δ is the balancing parameter; The Fourier transform is used to quantify the differences between local image patches. The formula for the Fourier transform between local image patches is: ; In the formula, F k (u,v) represents the k-th local image patch after the Fourier transform, F k (x,y) represents the kth local image patch, where k is the number of pixels; Among them, F k (u,v) is converted to polar coordinates, and then in F... k The amplitude spectrum of the k-th local image patch is obtained from the polar coordinates of (u,v), and the difference between local image patches is obtained based on the Euclidean distance of the amplitude spectra between the local image patches. The formula for the difference between local image patches is: ; In the formula, D kr The difference between the k-th local image patch and the r-th local image patch; Each local image patch is assigned a value based on the difference between them. The assigned local image patches are then subjected to Gaussian low-pass filtering, fully connected graph construction, response graph construction, and fusion to obtain the desired local region. The assignment expression for each local image patch is as follows: ; In the formula, F k (x,y)' represents the k-th local image patch after assignment, F k (x,y) represents the k-th local image patch, F r (x,y) represents the r-th local image patch, and k and r are the numbers; Methods for pre-building image detection models include: Acquire a set of sample images, mark the desired parts in the sample images, and perform global target enhancement and local target enhancement on the sample images in sequence; The enhanced sample image is used as the input of the YOLO network, and the desired part is used as the output of the YOLO network. The YOLO network is used to train the model on the input and output to obtain the desired extraction model. The desired model expression for extraction is: ; In the formula, g represents the desired part, SI represents the enhanced sample image, and YOLO represents the YOLO network.
2. The method for extracting desired parts based on image processing model training according to claim 1, characterized in that: The regularization process includes: The pixels in the response graph of the filtered image are used as nodes to construct regularized graphs, and the response values of the pixels in the response graph of the filtered image are mapped to the edge weights between nodes in the regularized graph. The functional expression of the edge weights between nodes in the regularized graph is as follows: ; In the formula, L i ( a b) represents the node in the i-th group of regularized graphs. a The edge weight between node A and node b, A i ( x a , y a ) represents a node in the i-th group of regularized graphs. a The response value at the location; The edge weights between nodes in the regularized graph are normalized, and the normalized regularized graph is mapped to a Markov chain. The stationary distribution of each node in the Markov chain is calculated so that high response values are concentrated in the response graph of the filtered image.
3. The method for extracting the desired portion based on image processing model training according to claim 2, characterized in that: The enhancement and fusion of the target image using local desired regions to obtain an enhanced target image representing the desired enhancement includes: The enhanced target image is obtained by weighting the expected values of the local desired regions and applying them to the corresponding positions in the target image. The functional expression of the enhanced target image is as follows: ; In the formula, SI(x,y) is the enhanced target image, S(x,y) is the local desired region, and I(x,y) is the target image.
4. The method for extracting desired parts based on image processing model training according to claim 3, characterized in that: The step of using a pre-established image detection model to perform target recognition on the enhanced target image to obtain the desired portion of the target image includes: The enhanced target image is input into a pre-established image detection model, and the image detection model outputs the target region of the enhanced target image. The target region of the enhanced target image is taken as the desired part of the target image.
5. The method for extracting desired parts based on image processing model training according to claim 4, characterized in that, The sample images and target images are images of the same specifications.
6. The method for extracting desired parts based on image processing model training according to claim 5, characterized in that, The FCM algorithm is used to segment and mark the desired part in the sample image, and the desired part is marked with the minimum bounding rectangle.
7. The method for extracting desired parts based on image processing model training according to claim 6, characterized in that, The functions of the multiple functional filters include contrast, gradient, and pixel intensity.