Irregular ROI setting method and device based on industrial image texture features
By setting multiple blocks in industrial images and calculating the texture feature number using partial discrete cosine transformation, and automatically setting irregular ROIs, the problem of difficulty in setting complex shape ROIs in the prior art is solved, and efficient and accurate image processing is achieved.
Patent Information
- Application Number
- CN202510455595.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-11
- Publication Date
- 2025-07-25
AI Technical Summary
The prior art is difficult to efficiently set up complex, irregularly shaped ROIs, resulting in inaccuracy and inefficiency of identification in industrial inspection.
By setting multiple blocks with side length W in the target image, the texture feature number of the block is calculated using partial discrete cosine transformation, and a texture value sequence is set for each pixel, and the ROI is set according to the texture feature number, so that the automatic recognition of irregular ROI is achieved.
It improves the accuracy and efficiency of image processing, can adapt to complex shapes and frequently changing ROIs, realizes pixel-level precise processing, and is suitable for complex scenarios with insufficient lighting and low signal-to-noise ratio.
Smart Images

Figure CN120374947A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of industrial inspection. Specifically, it relates to a method and device for setting irregular ROIs based on industrial image texture features. Background Art
[0002] Industrial cameras play an important role in the fields of industrial inspection, automated production, and machine vision. ROI (region of interest) refers to the region of interest in the images captured by industrial cameras, usually including the objects to be recognized or detected. The setting of ROI allows users to select one or more regions from the images for analysis and processing, improving the efficiency and accuracy of subsequent image processing systems.
[0003] Traditional ROI setting methods rely on manual operations. Users specify the shape, position, and size of the ROI through a graphical interface or programming interface. However, this method is cumbersome to operate and has low efficiency in scenarios where a large number of images need to be processed or the ROI needs to be frequently changed. In addition, manually setting the ROI is easily affected by human factors and difficult to meet actual requirements.
[0004] In recent years, ROI setting methods based on image features have emerged. These methods automatically identify and set the ROI through features in the images. However, most of these methods are limited to setting ROIs with regular shapes (such as squares and circles). In real application scenarios, it is often necessary to process a large number of ROIs with complex and irregular shapes, and their shapes, sizes, and positions may vary in each detection. For such applications, existing methods cannot adapt to the application scenarios, resulting in problems with setting failures. Summary of the Invention
[0005] The purpose of this application is to: aiming at the deficiencies of the prior art, provide a method for setting irregular ROIs based on industrial image texture features to solve the problems of difficult or failed setting of ROIs with complex and irregular shapes by existing methods.
[0006] The technical solution of this application is: providing a method for setting irregular ROIs based on industrial image texture features, the method includes:
[0007] Step 1, using an industrial camera to capture a target image;
[0008] Step 2, sequentially setting multiple blocks with side length W in the target image, and taking all the blocks in the image as a block set, where any pixel in the target image belongs to at least one block in the block set;
[0009] Step 3, defining a one-dimensional vector with a length of W as a basis function, performing a partial discrete cosine transform on each block using the basis function, determining a texture feature vector of the block based on an inner product of the basis function and each pixel row in a single block, and determining a texture feature number of the block based on an inner product of the texture feature vector and the basis function;
[0010] Step 4, setting an empty texture value sequence for each pixel in the image, traversing all blocks, judging whether the block is a texture block based on the texture feature number, if it is, filling the texture feature number of the block into the texture value sequence of each pixel contained therein, if it is not, filling 0 into the texture value sequence of each pixel contained therein, wherein the number of texture values contained in the texture value sequence of a single pixel is equal to the number of blocks to which the pixel belongs;
[0011] Step 5, traverse all pixels, calculate the corresponding texture feature number based on the texture value sequence of a single pixel, take the pixels with texture feature numbers greater than a preset threshold as the region of interest ROI, and output the target image.
[0012] Furthermore, in step 2, a plurality of blocks with a side length of W are sequentially set in the target image, specifically including:
[0013] Take the adjacent W×W pixels in the image as a block, take the pixel in the upper left corner of a single block as the anchor point, and set the sampling step size in the row direction to S x , the sampling step length in the column direction is S y , starting from the pixel with the smallest row and column coordinate value in the image, move the anchor point in the order of small to large coordinates and row priority according to the sampling step, set multiple blocks P(u,v) in sequence, and record the coordinates (u,v) of the anchor point in each block until the number of remaining pixel rows is less than S x And the number of remaining pixel columns is less than S y So far, check whether there are any remaining pixel rows in the image. If so, add N-W+1 to the value set of u. Check whether there are any remaining pixel columns in the image. If so, add M-W+1 to the value set of v, where N is the number of rows and M is the number of columns of the target image.
[0014] Furthermore, in step 3, a one-dimensional vector with a length of W is defined as a basis function, specifically including:
[0015] Define three one-dimensional vectors F0[i], F1[i] and F2[i] of length W, and use F0[i], F1[i] and F2[i] as basis functions, where the elements in the basis functions are calculated by the following formula:
[0016]
[0017] Wherein, i traverses positive integers from 1 to W.
[0018] Further, in step 3, calculating the texture feature vector of the block according to the inner product of the basis function and each pixel row in a single block specifically includes:
[0019] Performing partial discrete cosine transform on each block in the order of coordinates from small to large and row first. For a single block P(u, v), calculating the inner product of F0[i] and each pixel row in the block to obtain a W-dimensional first texture feature vector G0, calculating the inner product of F1[i] and each pixel row in the block to obtain a W-dimensional second texture feature vector G1, and calculating the inner product of F2[i] and each pixel row in the block to obtain a W-dimensional third texture feature vector G2.
[0020] Further, in step 3, calculating the texture coefficient of the block according to the inner product of the texture feature vector and the basis function specifically includes:
[0021] For a single block, calculating the inner product of the first texture feature vector G0 and F1[i], denoted as c 01 , calculating the inner product of the first texture feature vector G0 and F2[i], denoted as c 02 , calculating the inner product of the second texture feature vector G1 and F0[i], denoted as c 10 , calculating the inner product of the second texture feature vector G1 and F1[i], denoted as c 11 , calculating the inner product of the third texture feature vector G2 and F0[i], denoted as c 20 , taking c 01 , c 02 , c 10 , c 11 and c 20 as the five texture coefficients of the current block; setting a block frequency domain coefficient threshold T, and taking the number of texture coefficients greater than or equal to T as the texture feature number S(u, v) of the block.
[0022] Further, step 4 specifically includes:
[0023] Setting a block frequency domain coefficient quantity threshold N1. For a single block, comparing its texture feature number with N1. If its texture feature number is greater than or equal to N1, determining it as a texture block, and adding the texture feature number S(u, v) corresponding to the block as a texture value to the texture value sequence of each pixel it contains. If its texture feature number is less than N1, determining it as a smooth block, and adding 0 as a texture value to the texture value sequence of each pixel it contains.
[0024] Further, step 5 specifically includes:
[0025] Set the threshold N2 for the number of pixel frequency domain coefficients. For a single pixel, calculate the mean value of all texture values in its texture value sequence, and use the mean value of the texture values as the texture feature number of the pixel. Compare the texture feature number of the pixel with N2. If the texture feature number of the pixel is greater than or equal to N2, it is determined that the pixel belongs to the region of interest ROI; if the texture feature number of the pixel is less than N2, it is determined that the pixel does not belong to the region of interest ROI.
[0026] Further, step 5 further includes:
[0027] Set the pixels belonging to the ROI and the pixels not belonging to the ROI to different colors to distinguish the ROI and the background region in the image.
[0028] The beneficial effects of this application are:
[0029] The technical solution in this application first sets blocks in the target image, calculates the texture feature numbers of each block by means of partial discrete cosine transform, then sets an empty texture value sequence for each pixel in the image. For a single pixel, according to the texture feature numbers of the blocks it participates in, set the corresponding texture values in its sequence, and use the sequence containing a series of texture values to describe the texture features of a single pixel. Finally, the pixels with the mean value of the texture values greater than the preset threshold are used as the ROI region; compared with the existing ROI setting methods, the technical solution in this application has at least the following advantages:
[0030] (1) The technical solution in this application can set multiple ROI regions with irregular shapes in the target image, not limited to the setting of a few regular-shaped ROIs, such as square ROIs, circular ROIs, etc. Compared with the existing ROI setting methods, it will not fail to set due to the complex or frequently changing shape of the ROI, resulting in problems such as omission or incorrect setting, and is more suitable for application scenarios that need to process a large number of images, frequently change the ROI or set irregular-shaped ROIs, significantly improving the accuracy and efficiency of image processing.
[0031] (2) The technical solution in this application first calculates the texture features of the blocks, then refines the texture features of different blocks into the texture features of each pixel, and finally uses the texture features of each pixel to set the ROI region. The technical solution of this application can process images accurately to the pixel level, rather than the block or image level. Compared with the existing ROI setting methods, the technical solution in this application significantly improves the accuracy rate and calculation precision of image processing, is robust to noise, and can be applied to complex application scenarios such as insufficient illumination and low signal-to-noise ratio of the acquired images.
[0032] (3) The technical solution in this application has low time and space complexity. The target image includes multiple blocks, and partial discrete cosine transforms can be independently performed between different blocks, enabling parallel processing during image processing and meeting application scenarios with high real-time requirements. Description of the Drawings
[0033] The above and / or additional aspects of the present application will become obvious and easy to understand in the description of the embodiments in conjunction with the following drawings, where:
[0034] Figure 1 is a schematic flowchart of the overall technical solution of an irregular ROI setting method based on industrial image texture features according to an embodiment of the present application;
[0035] Figure 2 is a schematic flowchart of the process for determining the texture features of blocks according to an embodiment of the present application;
[0036] Figure 3 is a schematic flowchart of the process for determining whether all pixels in the target image belong to the ROI according to an embodiment of the present application;
[0037] Figure 4 is the target image captured by an industrial camera according to an embodiment of the present application;
[0038] Figure 5 is a schematic diagram of the number of pixel texture features according to an embodiment of the present application;
[0039] Figure 6 is a schematic diagram of the setting result of an irregular-shaped ROI according to an embodiment of the present application. Detailed Embodiments
[0040] In order to more clearly understand the above objects, features, and advantages of the present application, the present application will be further described in detail below in conjunction with the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments may be combined with each other.
[0041] In the following description, many specific details are set forth in order to fully understand the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below.
[0042] As Figures 1 to 3 shown, this embodiment provides an irregular ROI setting method based on industrial image texture features, including:
[0043] Step 1, capturing a target image using an industrial camera.
[0044] After artificially selecting the target to be detected, an industrial camera is used to capture the target image during the exposure time, and the number of rows N and columns M of the obtained target image are acquired.
[0045] In this embodiment, after the image acquisition is completed, tools such as the camera SDK can be used to read the image size to obtain the number of rows and columns of the image.
[0046] Step 2: Set multiple blocks with a side length of W in the target image in the order of pixel arrangement. The set of all blocks in the target image is used as the block set, where any pixel in the image belongs to at least one block.
[0047] Take W×W pixels with adjacent row and column coordinates in the image as a block, denoted as P(u, v), where u is the pixel row coordinate and v is the pixel column coordinate. The pixel in the upper left corner of a single block (i.e., the pixel with the smallest row and column coordinate values in a single block) is used as the anchor point (i.e., the reference starting point of the block), and the sampling step size in the row direction is set as S x , and the sampling step size in the column direction is S y , starting from the pixel with the smallest row and column coordinate values in the image, move the anchor point position in the order of increasing coordinate values with row coordinates taking precedence according to the sampling step size, set multiple blocks in sequence, and record the pixel coordinates (u, v) of the anchor point in each block until the number of remaining pixel rows is less than the sampling step size S in the row direction x and the number of remaining pixel columns is less than the sampling step size S in the column direction y until. Check whether there are remaining pixel rows (i.e., pixel rows not included in the blocks) in the image. If so, add N - W + 1 to the value set of u (i.e., include the pixels in the Nth row in the blocks). Check whether there are remaining pixel columns in the image. If so, add M - W + 1 to the value set of v, where N is the number of rows of the target image and M is the number of columns of the target image, so that any pixel in the image belongs to at least one block. The set of all blocks in the image is used as the block set.
[0048] In this embodiment, since the side length W of the block and the preset sampling step size are fixed, when moving the block anchor point according to the sampling step size, if the number of remaining pixel rows or pixel columns at the image edge is less than the corresponding sampling step size, the anchor point cannot be moved anymore, and the remaining pixel rows or pixel columns at the image edge will also not be able to be included in the blocks; therefore, after the anchor point cannot be moved, it is necessary to check whether there are remaining pixel rows and pixel columns in the image. If so, the remaining pixel rows and pixel columns need to be included in the blocks so that the block set can cover all pixels in the image.
[0049] Step 3: Define a one-dimensional vector of length W as the basis function of the partial discrete cosine transform filter. Traverse each block in the image, perform partial discrete cosine transform on each block using the basis function, determine the texture feature vector of the block based on the inner product of the basis function and each pixel row in a single block, and determine the texture feature number of the block based on the inner product of the texture feature vector and the basis function.
[0050] Specifically, define a one-dimensional vector of length W as the basis function of the partial discrete cosine transform filter, where W is a positive integer, and the steps are as follows:
[0051] Define three one-dimensional vectors F0[i], F1[i], and F2[i] of length W, and use F0[i], F1[i], and F2[i] as the basis functions of the partial discrete cosine transform filter. The elements in the basis functions F0[i], F1[i], and F2[i] are calculated by the following formula:
[0052]
[0053] In the formula, F0[i], F1[i], and F2[i] are three one-dimensional vectors of length W, and i traverses positive integers from 1 to W. For example, when W is 7, When performing image processing in FPGA, the numerical values of the elements in the basis functions F0[i], F1[i], and F2[i] can be pre-stored in a table, and the results can be quickly obtained by looking up the values in the table during actual operation, without performing real-time mathematical calculations.
[0054] In this embodiment, the inner product refers to the sum of all calculation results after multiplying the corresponding elements of two vectors of the same length. For example, when W is 7 and the values of the pixels in the first row of the current block P(u, v) are a1, a2, a3, a4, a5, a6, a7 respectively, the inner product of the basis function F0[i] and the first row of pixels is
[0055] Traverse each block in the image, and perform partial discrete cosine transform on each block using the basis function. Specifically, the steps are as follows:
[0056] In the order of ascending coordinate values with the row coordinate taking precedence, perform partial discrete cosine transform on each block in turn. For a single block P(u, v), calculate the inner product of the basis function F0[i] and each pixel row in the block to obtain the first texture feature vector G0 of dimension W, calculate the inner product of the basis function F1[i] and each pixel row in the block to obtain the second texture feature vector G1 of dimension W, calculate the inner product of the basis function F2[i] and each pixel row in the block to obtain the third texture feature vector G2 of dimension W. Among them, the i-th component of the first texture feature vector G0 is the inner product of F0[i] and the pixels in the i-th row of the block; calculate the inner product of the first texture feature vector G0 and the basis function F1[i], denoted as c 01 , calculate the inner product of the first texture feature vector G0 and the basis function F2[i], denoted as c 02 , calculate the inner product of the second texture feature vector G1 and the basis function F0[i], denoted as c 10 , calculate the inner product of the second texture feature vector G1 and the basis function F1[i], denoted as c 11 , calculate the inner product of the third texture feature vector G2 and the basis function F0[i], denoted as c 20 , take c 01 , c 02 , c 10 , c 11 and c 20 as the five texture coefficients of the current block.
[0057] Set the block frequency domain coefficient threshold T. For a single block, compare its corresponding five texture coefficients c 01 , c 02 , c 10 , c 11 , c 20 with the block frequency domain coefficient threshold T respectively, and determine whether the conditions |c 01 |≥T, |c 02 |≥T, |c 10 |≥T, |c 11 |≥T, |c 20 |≥T hold. Take the number of the above conditions that hold as the texture feature number of the current block P(u, v), denoted as S(u, v).
[0058] In this embodiment, the partial discrete cosine transform refers to the transform that acts on a locally selected block in an image and uses a pre-set specific filter kernel.
[0059] Step 4: Set an empty texture value sequence for each pixel in the image. Traverse all blocks. Based on the number of texture features of a single block, determine whether it is a texture block. If it belongs to a texture block, fill the number of texture features of this block into the texture value sequence of each pixel it contains; if it does not belong to a texture block, fill 0 into the texture value sequence of each pixel it contains. Here, the number of texture values contained in the texture value sequence of a single pixel is equal to the number of blocks to which the pixel belongs.
[0060] Set the threshold N1 for the number of frequency domain coefficients of a block. Set an empty texture value sequence for each pixel in the image. Traverse each block and compare the number of texture features of each block with the threshold N1 for the number of frequency domain coefficients of a block. For a single block, determine whether its number of texture features is less than the threshold N1 for the number of frequency domain coefficients of a block. If its number of texture features S(u, v) is greater than or equal to the threshold N1 for the number of frequency domain coefficients of a block, then determine it as a texture block, take the corresponding number of texture features S(u, v) of this block as the texture value, and fill it into the texture value sequence of each pixel. If its number of texture features S(u, v) is less than the threshold N1 for the number of frequency domain coefficients of a block, then determine it as a smooth block, and fill 0 as the texture value into the texture value sequence of each pixel. Here, the number of texture values contained in the texture value sequence of a single pixel is equal to the number of blocks to which the pixel belongs. After traversing each block, mark it as processed and proceed to traverse the next block until all blocks are marked as processed.
[0061] In this embodiment, for any pixel in the target image, its texture features are described by a texture feature sequence, and each element in the sequence is a non - negative integer.
[0062] Step 5: Traverse all pixels in the image. Calculate the corresponding number of texture features based on the texture value sequence of a single pixel. Take the pixels with the number of texture features greater than the preset threshold as the region of interest (ROI) and output the target image.
[0063] Set the threshold N2 for the number of frequency domain coefficients of a pixel. For a single pixel in the image, calculate the mean value of all texture values in its texture value sequence. Take the mean value of the texture values as the number of texture features of the pixel. Compare the number of texture features of the pixel with the threshold N2 for the number of frequency domain coefficients of a pixel. If the number of texture features of the pixel is greater than or equal to N2, then determine that this pixel belongs to the region of interest (ROI); if the number of texture features of the pixel is less than N2, then determine that this pixel does not belong to the region of interest (ROI).
[0064] In this embodiment, if this step is implemented in an FPGA, the process of "using the mean value of texture values as the texture feature number of a pixel and comparing the texture feature number of the pixel with the pixel frequency domain coefficient quantity threshold N2" in this step can be equivalently replaced by "comparing the sum of the texture value sequence corresponding to the pixel with the product of the threshold N2 and the number of elements in the texture value sequence" to avoid division operations.
[0065] Summarize all pixels belonging to the ROI, and set the pixels belonging to the ROI and the pixels not belonging to the ROI to different colors to distinguish the ROI and the background area in the image.
[0066] In this embodiment, after setting the ROI, distinguish all pixels belonging to the ROI from the pixels not belonging to the ROI, and output the processed image in a form that meets the requirements of the industrial camera data format, including but not limited to binary images, run-length encoding, etc.
[0067] This embodiment also provides a system for executing the above-mentioned irregular ROI setting method based on industrial image texture features, including:
[0068] An image acquisition module, configured to acquire a target image.
[0069] An image texture feature calculation module, configured to calculate the texture feature number of each pixel of the target image.
[0070] An image irregular ROI setting module, configured to set an irregular ROI according to the obtained texture feature number of each pixel and output it in the data format required by the industrial camera.
[0071] The technical solution of this application can be applied to an industrial camera system or other systems involving image processing, such as document or image scanning and recognition, stamp texture feature extraction, object surface texture defect recognition, etc. An interested region ROI can be set by the method of the present invention to improve the accuracy of subsequent image processing. When the technical solution of this application is applied to an industrial camera system, an industrial camera can be used to take a target image with an arbitrary exposure time; based on modules such as a processor and an FPGA, the method of the present invention is used to calculate the texture feature number of each pixel in the target image, and an irregular ROI is set according to the texture feature number, and finally output in the data format required by the industrial camera.
[0072] Example:
[0073] Use an industrial camera to take a target image, as shown in the target image Figure 4 Before image processing, set parameters in advance (such as W = 7, S x = 3, S y= 3, T = 30, N1 = 1, N2 = 1), and then use the method of the present invention to extract the pixel texture feature numbers of the target image, obtaining an image as shown in Figure 5 . In the figure, the pixel texture feature numbers of the digital and text areas are significantly higher than those of the background part of the target image. Process the image shown in Figure 5 . Take the pixels with texture feature numbers greater than N2 as the region of interest ROI, and the remaining pixels as the background region. Let the pixels of the region of interest ROI be displayed as the original gray scale of the target image, and the pixels of the background region be displayed as black, obtaining an irregular ROI setting result as shown in Figure 6 . As can be seen from Figure 6 , the method of the present invention can accurately set an irregular ROI in the target image to highlight the regions where the numbers and text in the figure are located.
[0074] The steps in this application can be adjusted, combined, and deleted in order according to actual needs.
[0075] The units in this application device can be combined, divided, and deleted according to actual needs.
[0076] Although this application is disclosed in detail with reference to the accompanying drawings, it should be understood that these descriptions are merely exemplary and are not used to limit the application of this application. The protection scope of this application is defined by the appended claims and may include various variations, modifications, and equivalent solutions made to the invention without departing from the protection scope and spirit of this application.
Claims
1. An irregular ROI setting method based on industrial image texture features, characterized in that The method includes: Step 1: Using an industrial camera to capture a target image; Step 2: Sequentially setting multiple blocks with side length W in the target image, and taking all the blocks in the image as a block set, where any pixel in the target image belongs to at least one block in the block set; Step 3: Defining a one-dimensional vector with length W as a basis function, performing partial discrete cosine transform on each block using the basis function, determining the texture feature vector of the block based on the inner product of the basis function and each pixel row in a single block, and determining the texture feature number of the block based on the inner product of the texture feature vector and the basis function; Step 4: Setting an empty texture value sequence for each pixel in the image, traversing all blocks, determining whether the block is a texture block based on the texture feature number, if it belongs, filling the texture feature number of the block into the texture value sequence of each pixel it contains, if it does not belong, filling 0 into the texture value sequence of each pixel it contains, where the number of texture values contained in the texture value sequence of a single pixel is equal to the number of blocks to which the pixel belongs; Step 5: Traversing all pixels, calculating the corresponding texture feature number based on the texture value sequence of a single pixel, taking the pixels with texture feature numbers greater than a preset threshold as the region of interest ROI, and outputting the target image.
2. The irregular ROI setting method based on industrial image texture features according to claim 1, wherein, In the said Step 2, sequentially setting multiple blocks with side length W in the target image specifically includes: Take W×W adjacent pixels in the image as a block, take the pixel in the upper left corner of a single block as the anchor point, and set the sampling step size in the row direction to S x , and the sampling step size in the column direction is S y , starting from the pixel with the smallest row and column coordinate values in the image, move the anchor point in the order of increasing coordinates and row priority according to the sampling step size, and sequentially set multiple blocks P(u, v), and record the coordinates (u, v) of the anchor point in each block until the number of remaining pixel rows is less than S x and the number of remaining pixel columns is less than S y . Check whether there are remaining pixel rows in the image. If so, add N - W + 1 to the value set of u. Check whether there are remaining pixel columns in the image. If so, add M - W + 1 to the value set of v, where N is the number of rows of the target image and M is the number of columns of the target image.
3. The irregular ROI setting method based on industrial image texture features according to claim 1, characterized in that, In the said Step 3, defining a one-dimensional vector with length W as a basis function specifically includes: Defining three one-dimensional vectors F0[i], F1[i] and F2[i] with length W, and taking F0[i], F1[i] and F2[i] as the basis function, and the elements in the basis function are calculated by the following formula: In the formula, i traverses positive integers from 1 to W.
4. The method for setting an irregular ROI based on industrial image texture features according to claim 1, characterized in that, In the said Step 3, calculating the texture feature vector of the block according to the inner product of the basis function and each pixel row in a single block specifically includes: Performing partial discrete cosine transform on each block in ascending order of coordinates and row-first order. For a single block P(u, v), calculating the inner product of F0[i] and each pixel row in the block to obtain a W-dimensional first texture feature vector G0, calculating the inner product of F1[i] and each pixel row in the block to obtain a W-dimensional second texture feature vector G1, and calculating the inner product of F2[i] and each pixel row in the block to obtain a W-dimensional third texture feature vector G2.
5. The irregular ROI setting method based on industrial image texture features according to claim 4, characterized in that, In the said Step 3, calculating the texture coefficient of the block according to the inner product of the texture feature vector and the basis function specifically includes: For a single block, calculate the inner product of the first texture feature vector G0 and F1[i], denoted as c 01 , calculate the inner product of the first texture feature vector G0 and F2[i], denoted as c 02 , calculate the inner product of the second texture feature vector G1 and F0[i], denoted as c 10 , calculate the inner product of the second texture feature vector G1 and F1[i], denoted as c 11 , calculate the inner product of the third texture feature vector G2 and F0[i], denoted as c 20 , take c 01 , c 02 , c 10 , c 11 and c 20 as the five texture coefficients of the current block; set the block frequency domain coefficient threshold T, and take the number of texture coefficients greater than or equal to T as the texture feature number S(u, v) of the block.
6. The irregular ROI setting method based on industrial image texture features according to claim 4, characterized in that The said Step 4 specifically includes: Setting a block frequency domain coefficient quantity threshold N1. For a single block, comparing its texture feature number with N1. If its texture feature number is greater than or equal to N1, determining that it is a texture block, and adding the texture feature number S(u, v) corresponding to the block as a texture value to the texture value sequence of each pixel it contains. If its texture feature number is less than N1, determining that it is a smooth block, and adding 0 as a texture value to the texture value sequence of each pixel it contains.
7. The method for setting an irregular ROI based on industrial image texture features according to claim 4, wherein The said Step 5 specifically includes: Set the threshold N2 for the number of pixel frequency domain coefficients. For a single pixel, calculate the mean value of all texture values in its texture value sequence, take the mean value of the texture values as the texture feature number of the pixel, and compare the texture feature number of the pixel with N2. If the texture feature number of the pixel is greater than or equal to N2, it is determined that the pixel belongs to the region of interest ROI; if the texture feature number of the pixel is less than N2, it is determined that the pixel does not belong to the region of interest ROI.
8. The irregular ROI setting method based on industrial image texture features according to claim 4, characterized in that, The step 5 further includes: Set the pixels belonging to the ROI and the pixels not belonging to the ROI to different colors to distinguish the ROI and the background area in the image.