CN-115829943-B - Image difference region detection method based on super-pixel segmentation
Abstract
The invention discloses an image difference region detection method based on super-pixel segmentation, which comprises the steps of S1, registering images to be compared by using a sift algorithm, enabling the images to be changed to the same plane, enabling coordinates of corresponding points to correspond to each other one by one, S2, constructing respective image pyramids of a source image and a target image through a Gaussian function, S3, extracting a first image of the topmost layer of the target image pyramid, carrying out SLIC processing on the first image, segmenting the image into a plurality of subareas with relatively consistent information, S4, carrying out differential discrimination on each subarea, calculating the gradient size, the gradient direction and the color information of the pixels of each subarea, and carrying out differential comparison on the 3 dimensional information and the corresponding pixels. The invention utilizes SLIC algorithm to cluster the image area, and uses the clustered area as the image block to calculate the difference, so that the information in the block is more consistent.
Inventors
- WEI FUBIN
Assignees
- 炜呈智能电力科技(杭州)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20221116
Claims (1)
- 1. The image difference region detection method based on super-pixel segmentation is characterized by comprising the following steps of: s1, registering images to be compared by using a sift algorithm to enable the images to be changed to the same plane, and enabling coordinates of corresponding points to correspond one by one; s2, constructing respective image pyramids of a source image and a target image through a Gaussian function; s3, extracting a first image at the topmost layer of the target image pyramid, performing SLIC processing on the first image, and dividing the image into a plurality of sub-areas with relatively consistent information; S4, differentiating and judging each sub-area, namely calculating the gradient size, direction and color information of the pixels of each sub-area, performing difference comparison on the 3 dimensional information of the corresponding pixels of the source image and the target image, and adding 1 to the difference of the point when the difference value of one dimension is larger than a preset threshold value, wherein when the information difference value of the 3 dimensions is larger than the threshold value, the difference of the point is additionally added by 1, namely the difference value of each pixel point is 0-4; The image pyramid of the S2 comprises two parameters of layer height and layer number, the layer number determines the resolution of how many images exist in the pyramid, the layer height determines the number of images subjected to filtering processing under a single resolution, and the shape of the pyramid is adjusted through the two parameters, so that the ratio of a detection area to a total detection area at a difference position in subsequent processing is the largest; The step S3 is followed by diffusing the segmentation information of the first image on the top layer of the pyramid to each layer of the pyramid by utilizing an interpolation algorithm, so that all the images of the pyramid acquire corresponding consistent image area distribution; the step S4 comprises the following steps: s41, calculating gradient amplitude and direction of pixels by using a sobel operator: (1); (2); (3); (4); Wherein, the In order to input an image of the subject, And Sobel operators in the x-direction and y-direction respectively, And For the gradient map in the corresponding direction, For the magnitude of the gradient, Is the direction of the gradient; S42, converting the image into HSV color space, and obtaining the value of the H dimension of the image, namely the color information of the pixel Respectively acquiring a source image pixel and a target image pixel 、 And After the 3-dimension information, calculating difference values corresponding to the 3 dimensions: (5); (6); (7); Wherein, the 、 、 For the corresponding 3-dimensional information value of the source image, 、 、 For the 3-dimensional information value corresponding to the target image, when 、 、 Are respectively greater than a preset threshold value 、 、 When the pixel is totally different Respectively add 1, otherwise add, when 、 、 When all three are greater than the corresponding threshold value, Then 1 is additionally added; s43, summing and normalizing the difference degrees of all pixels in the region to obtain the total difference degree of the region : (8); Where n is the number of area pixels, For the ith pixel Value when the region is totally different Greater than a threshold value When the area is marked as 1, a difference area can exist, otherwise, the table is 0, after all the image areas in the pyramid are marked, when the number of the images with the area marked as 1 is larger than the total number of the images When the difference exists in the area; (9); in the formula (9), the amino acid sequence of the compound, For the marker value of the region with the final difference image index k, m is the total number of pyramid images, The index value of the kth region of the ith image.
Description
Image difference region detection method based on super-pixel segmentation Technical Field The invention belongs to the field of image discrimination, and relates to an image difference region detection method based on super-pixel segmentation. Background The image discrimination is used for calculating the difference area between images, provides more useful information on a time sequence space, and has important influence in the fields of detection, tracking and the like. The image discrimination algorithm calculates differences among pixels with pixels as targets, and calculates differences among image blocks with blocks as targets. The two methods have advantages and disadvantages, the calculation with the pixel as the target is finer, the tiny change can be reflected better, the calculation with the block as the target is more robust, the anti-interference capability on noise and other influences is stronger, meanwhile, the information calculated based on the pixel is noisier and is easily influenced by noise, offset and other factors, the information difference is larger due to inconsistent components in the region based on the block calculation, and useful information is filtered out to ensure that the detection of the difference region is not fine enough. Disclosure of Invention The invention provides an image difference region detection method based on super-pixel segmentation, which aims to solve the problems and comprises the following steps: s1, registering images to be compared by using a sift algorithm to enable the images to be changed to the same plane, and enabling coordinates of corresponding points to correspond one by one; s2, constructing respective image pyramids of a source image and a target image through a Gaussian function; s3, extracting a first image at the topmost layer of the target image pyramid, performing SLIC processing on the first image, and dividing the image into a plurality of sub-areas with relatively consistent information; And S4, differentiating and judging each sub-area, namely calculating the gradient size, direction and color information of the pixels of each sub-area, performing difference comparison on the 3-dimension information and the corresponding pixels, adding 1 to the difference degree of the point when the difference value of a certain dimension is larger than a preset threshold value, and adding 1 to the difference degree of the point when the information difference value of the 3 dimensions is larger than the threshold value, namely, the difference value of each pixel point is 0-4. Preferably, the image pyramid of S2 includes two parameters, i.e. a layer height and a layer number, the layer number determines the resolution of how many images are in the pyramid, the layer height determines the number of images after filtering processing under a single resolution, and the shape of the pyramid is adjusted by the two parameters, so that the ratio of the detection area at the difference position to the total detection area in the subsequent processing is the largest. Preferably, the step S3 further includes using an interpolation algorithm to spread the segmentation information of the first image on the top layer of the pyramid onto each layer of the pyramid, so that all the images of the pyramid acquire the corresponding consistent image area distribution. Preferably, the step S4 includes the steps of: s41, calculating gradient amplitude and direction of pixels by using a sobel operator: Ix=GxI (1) Iy=GyI (2) Wherein, I is an input image, G x and G y are sobel operators in the x direction and the y direction respectively, I x and I y are gradient diagrams in the corresponding directions, I I is the amplitude of the gradient, and I θ is the direction of the gradient; S42, converting the image into HSV color space, obtaining the value of the H dimension, namely the color information I H of the pixel, respectively obtaining the I G、Iθ and I H dimension information of the source image pixel and the target image pixel, and then calculating the difference value corresponding to 3 dimensions: wherein I' G、I′θ、I′H is a 3-dimensional information value corresponding to the source image, For the 3-dimensional information value corresponding to the target image, when S G、Sθ、SH is respectively larger than the gradient threshold tau G、τθ、τH, the total difference degree D p of the pixels is respectively increased by 1, otherwise, the total difference degree D p is not increased, and when all three of S G、Sθ、SH are larger than the corresponding threshold, D p is additionally increased by 1; S43, after summing and normalizing the difference degrees of all pixels in the region, obtaining the region overall difference degree D t: Wherein n is the number of pixels in the region, D pi is the value of D p of the ith pixel, when the total difference degree D t of the region is larger than the threshold value tau t, the region is marked as 1, namely a difference region exists,