Disclosure of Invention
In order to solve the technical problem, the invention provides a complete salient object detection method adopting contour detection.
In order to achieve the purpose, the invention adopts the technical scheme that:
a complete salient object detection method adopting contour detection comprises the following steps,
segmenting the image by a super-pixel segmentation method, and constructing the image into a graph mode;
acquiring a saliency map based on contour extraction;
acquiring a two-value segmentation graph based on a background template;
and obtaining a final saliency map based on the saliency map and the two-value segmentation map.
The process of constructing the graphical schema is that,
reading image data information, adaptively setting a threshold value to eliminate a noise contour, and constructing a graph mode;
the threshold formula for removing the noise profile is,
where xi is the threshold for eliminating the noise profile, xiiIs the gradient value of the ith contour line in the image, and N is the number of contour lines in the image.
And acquiring a saliency map based on contour extraction, specifically,
extracting initial contour features of an image in an image mode by using a contour detection algorithm based on a global probability boundary, and preprocessing the initial contour features by using a self-adaptive threshold method to obtain a self-adaptive contour map;
acquiring a contour map based on virtual connection by using a contour processing scheme based on virtual connection;
acquiring a complete contour map by using a closed-loop searching scheme based on the shortest path, and dividing the complete contour map into a plurality of regions with complete boundaries;
a saliency map based on contour detection is acquired.
A virtual join-based contour processing scheme, specifically,
if the end point of a certain contour line is only close to the end point of another contour line or the other end point of the contour line, a virtual end point is created by using the virtual connecting structure, and the end point of the contour line is connected with the virtual end point to form a new contour line;
if the end point of a contour line is close to a certain pixel point on another contour line, the pixel point is taken as a boundary point, the contour line is divided into two independent contour lines, and the end point is connected with the newly formed boundary point;
if two end points of a certain contour line can not establish a virtual connection point with other contour lines in the self-adaptive contour map, the contour line is regarded as an isolated contour line and is removed from the self-adaptive contour map;
if there are multiple close contours in a certain direction, these contours are fused into a new contour.
A shortest path based closed loop search scheme, specifically,
suppose there is N in a virtual join-based profileeA non-closed end point;
computing any two non-closed end points ej1And ej2Length of path between L (e)j1,ej2),
Wherein ξj2Is a non-closed end point ej2Gradient value of the contour line;
by continuously calculating the path lengths of any two non-closed end points and connecting the non-closed end points with the shortest path length, a plurality of closed annular contour lines can be formed, and a complete contour map can be obtained.
The process of obtaining a saliency map based on contour detection is,
suppose a complete profile is segmentedRegion with complete N1 boundaries I1,I2,...,IN1};
Region I
i′The intensity, color and direction characteristic values are respectively the mean values of the corresponding characteristic values of all the pixel points in the area, namely the intensity characteristic value
Color characteristic value
Direction characteristic value
The gradient values of the boundary lines belonging to the background template are set to 0, the others to 1, one saliency value is set for each region,
wherein, P
i′Is region I
i′The significance of (a) of (b),
is region I
i′R is a coefficient variable, A
i′As the area of the region of significance to be extracted, A
kIs region I
kIs k ∈ [1, N1 ]]And k ≠ i';
all the significant values are normalized, and then the cumulative sum of the significant values is calculated and is assigned to a corresponding target, so that a significant map based on contour detection is obtained.
The process of obtaining the two-value segmentation map based on the background template is that,
acquiring a saliency map based on a saliency detection algorithm of background template suppression;
and acquiring a corresponding significant pixel point and binary segmentation map by using a self-adaptive threshold segmentation method.
Computing corresponding adaptive thresholds from the saliency map sTa;
wherein S (x, y) is the significant value of pixel point I (x, y), IxAnd IyRespectively refer to the width and height of a saliency image;
and if the significance value of a certain pixel point is smaller than the adaptive threshold sTa, the significance value of the pixel point is assigned to be 0, otherwise, the significance value of the pixel point is set to be 1 and is regarded as a significant pixel point, and the obtained adaptive threshold sTa is utilized to perform adaptive threshold segmentation on the significant map to obtain a two-value segmentation map.
The process of obtaining the final saliency map is,
reserving a region in which the proportion of the salient pixel points in the salient image based on the contour detection is higher than the reference proportion, and obtaining an optimized salient image based on the contour detection;
and carrying out linear fusion on the binary segmentation image and the optimized salient image based on contour detection to obtain a final complete salient image.
The reference proportion formula is as follows,
wherein, B kappa is a reference proportion, and n is the number of significant pixel points;
the linear fusion formula is as follows,
wherein, IFTo complete the saliency map, IssAs a binary segmentation map, IfsFor the optimized outline-based detection saliency map, alpha and beta are respectively Iss,IfsThe coefficient of (a). .
The invention achieves the following beneficial effects: the method can not only further highlight the salient region of the image, but also well inhibit the background region, and can be applied to scenes such as image retrieval, image segmentation, image classification, target recognition and the like.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
As shown in fig. 1, a complete salient object detection method using contour detection includes the following steps:
step 1, segmenting an image by a super-pixel segmentation method and constructing the image into a graph mode.
The subsequent steps are carried out based on the image of the graph mode, and the process of constructing the graph mode comprises the following steps: reading image data information, adaptively setting a threshold value to eliminate a noise contour, and constructing a graph mode.
The threshold formula for eliminating the noise profile is:
where xi is the threshold for eliminating the noise profile, xiiIs the gradient value of the ith contour line in the image, and N is the number of contour lines in the image.
Step 2, obtaining a saliency map extracted based on the contour; and acquiring a two-value segmentation graph based on the background template.
The specific process of obtaining the saliency map is as follows:
201) and extracting initial contour features of the image in the image mode by using a contour detection algorithm based on a global probability boundary, and preprocessing the initial contour features by using a self-adaptive threshold method to obtain a self-adaptive contour map.
202) And acquiring a virtual connection-based contour map by using a virtual connection-based contour processing scheme.
A contour processing scheme that performs the following operations:
if the end point of a certain contour line is only close to the end point of another contour line or the other end point of the contour line itself (when the distance between the two end points is smaller than the set threshold value, the two end points are considered to be close), a virtual end point is created by using the virtual connection structure, and the end point of the contour line is connected with the virtual end point to form a new contour line;
if the end point of a contour line is close to a certain pixel point on the other contour line (when the distance between the end point and the pixel point is smaller than a set threshold value, the end point is considered to be close to the pixel point), the pixel point is taken as a boundary point, the contour line is divided into two independent contour lines, and the end point is connected with the newly formed boundary point;
if two end points of a certain contour line can not establish a virtual connection point with other contour lines in the self-adaptive contour map, the contour line is regarded as an isolated contour line and is removed from the self-adaptive contour map;
if a plurality of contour lines close to each other exist in a certain direction (when the distance between two contour lines is smaller than a set threshold value, the two contour lines are considered to be close to each other), the contour lines are fused into a new contour line, wherein the plurality of contour lines comprise mutually parallel contour lines and contour lines positioned on a straight line.
203) And acquiring a complete contour map by using a closed-loop searching scheme based on the shortest path, and dividing the complete contour map into a plurality of regions with complete boundaries.
A closed-loop search scheme, performing the following operations:
a) suppose there is N in a virtual join-based profileeA non-closed end point.
b) Any two non-closed end points ej1And ej2Length of path between L (e)j1,ej2) Has positive correlation with Euclidean distance between two points and has same non-closed end point ej2The gradient values of the contour lines are in a negative correlation relationship, so that L (e)j1,ej2) The formula for calculating (a) is as follows,
wherein ξj2Is a non-closed end point ej2The gradient value of the contour line.
c) By continuously calculating the path lengths of any two non-closed end points and connecting the non-closed end points with the shortest path length, a plurality of closed annular contour lines can be formed, and a complete contour map can be obtained.
204) A saliency map based on contour detection is acquired.
The process of obtaining the saliency map is as follows:
a1) suppose the complete contour map is divided into N1 regions with complete boundaries I1,I2,...,IN1And each image consists of three color channels of red (R), green (G) and blue (B), and the intensity characteristic value omega of each pixel pointin,i′In order to realize the purpose,
ωin,i′=(R+G+B)/3
aiming at the four color pairs of (R, G), (G, R), (B, Y) and (Y, B), the following method is adopted to extract four wide tuning color channels,
any two pixel points pi″And pj″Color characteristic value ω therebetweenRG,i″j″、ωBY,i″j″Respectively, are as follows,
wherein RR (i '), GG (i'), BB (i ') and Y (i') are pixel points pi"four widely tuned color channels, RR (j"), GG (j "), BB (j"), and Y (j ") are pixel points pj"of four widely tuned color channels,
for a pixel point pi″Its color characteristic value omegaRG,i′、ωBY,i′Can be regarded as belonging to the same complete region Ii′The cumulative sum of the color characteristic values between all pixel points in the interior, i.e.
Wherein N isiTo remove a pixel point pi″Outer region Ii′The number of other pixel points in the pixel array,
by carrying out Gabor kernel convolution on the obtained intensity image, respectively adopting theta epsilon {0 degrees, 45 degrees, 90 degrees and 135 degrees } as the direction of the Gabor kernel, extracting direction characteristics, and aiming at any two pixel points p
i″And p
j″Inter directional characteristic value omega
o,i″j″Where O () represents a computational kernel convolution, like color features, pixel point p
i″Strength characteristics of
b1) The gradient values of the boundary lines belonging to the background template are set to 0, the others to 1, one saliency value is set for each region,
wherein, P
i′Is region I
i′The significance of (a) of (b),
is region I
i′R is a coefficient variable, A
i′As the area of the region of significance to be extracted, A
kIs region I
kIs k ∈ [1, N1 ]]And k ≠ i'.
c1) All the significant values are normalized, and then the cumulative sum of the significant values is calculated and is assigned to a corresponding target, so that a significant map based on contour detection is obtained.
The specific process of obtaining the two-value segmentation graph is as follows:
211) and acquiring a saliency map based on a saliency detection algorithm of background template suppression.
The corresponding adaptive threshold sTa is calculated from the saliency map,
wherein S (x, y) is the significant value of pixel point I (x, y), IxAnd IyRespectively refer to the width and height of a saliency image;
and if the significance value of a certain pixel point is smaller than the adaptive threshold sTa, the significance value of the pixel point is assigned to be 0, otherwise, the significance value of the pixel point is set to be 1 and is regarded as a significant pixel point, and the obtained adaptive threshold sTa is utilized to perform adaptive threshold segmentation on the significant map to obtain a two-value segmentation map.
212) And acquiring a corresponding significant pixel point and binary segmentation map by using a self-adaptive threshold segmentation method.
And 3, obtaining a final saliency map based on the saliency map and the binary segmentation map.
The specific process of obtaining the final saliency map is as follows:
301) and reserving the area in which the proportion of the salient pixel points in the salient image based on the contour detection is higher than the reference proportion, and obtaining the optimized salient image based on the contour detection.
Screening out a region larger than the reference proportion, namely a region belonging to a significant target, and removing a background region smaller than the reference proportion;
the reference proportion formula is as follows:
wherein, B kappa is a reference proportion, and n is the number of significant pixel points.
302) And carrying out linear fusion on the binary segmentation image and the optimized salient image based on contour detection to obtain a final complete salient image.
The linear fusion formula is:
wherein, IFTo complete the saliency map, IssAs a binary segmentation map, IfsFor the optimized outline-based detection saliency map, alpha and beta are respectively Iss,IfsThe coefficient of (a).
The principle of the invention is shown in fig. 2, the method uses a superpixel segmentation method to segment an image, constructs the image into a graph mode, extracts and obtains a saliency map based on contour extraction, obtains a binary segmentation map based on a background template, and linearly fuses the saliency map and the binary segmentation map to obtain a final saliency map, thereby not only further highlighting the saliency region of the image, but also well inhibiting the background region, and being applicable to scenes such as image retrieval, image segmentation, image classification, target identification and the like.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.