CN113763410B - Image shadow detection method based on HIS combined with spectral feature detection condition - Google Patents

Image shadow detection method based on HIS combined with spectral feature detection condition Download PDF

Info

Publication number
CN113763410B
CN113763410B CN202111161946.2A CN202111161946A CN113763410B CN 113763410 B CN113763410 B CN 113763410B CN 202111161946 A CN202111161946 A CN 202111161946A CN 113763410 B CN113763410 B CN 113763410B
Authority
CN
China
Prior art keywords
image
shadow
color space
component
remote sensing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111161946.2A
Other languages
Chinese (zh)
Other versions
CN113763410A (en
Inventor
袁鹏
顾行发
黄祥志
王珂
朱玉婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Tianhui Spatial Information Research Institute Co ltd
Original Assignee
Jiangsu Tianhui Spatial Information Research Institute Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Tianhui Spatial Information Research Institute Co ltd filed Critical Jiangsu Tianhui Spatial Information Research Institute Co ltd
Priority to CN202111161946.2A priority Critical patent/CN113763410B/en
Publication of CN113763410A publication Critical patent/CN113763410A/en
Application granted granted Critical
Publication of CN113763410B publication Critical patent/CN113763410B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/194Segmentation; Edge detection involving foreground-background segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses an image shadow detection method based on HIS combined with spectral feature detection conditions, which comprises the steps of firstly, based on the shadow segmentation of an HIS color space, converting an image from an RGB color space to the HIS color space, then respectively extracting an S component map and an I component map, obtaining a shadow S1 by using the maximum inter-class variance OTSU threshold segmentation, then carrying out the shadow segmentation of the spectral feature detection conditions, analyzing the presentation effect of the image in different spectral bands, wherein a shadow area not only has low brightness and high tone characteristics, but also has higher numerical values in the band of a blue component B 'of normalized RGB, and the vegetation has higher characteristic value in a green component G' of the normalized RGB, utilizing the vegetation to remove the vegetation, and then, through S 2 ={(i,j)|B′(i,j)>T_B′&&G '(i, j) < T' _ G } to construct a spectral feature detection condition, and finally performing shadow comprehensive processing.

Description

Image shadow detection method based on HIS combined with spectral feature detection condition
Technical Field
The invention relates to the technical field of shadow detection, in particular to an image shadow detection method based on HIS combined spectral feature detection conditions.
Background
The main means for obtaining the remote sensing information is to interpret the image, and because of the influence of the sun altitude at the shooting moment and the ground feature shielding with a certain height, shadows inevitably exist in the remote sensing image, so that the optical characteristic information in the image is weakened, the information such as the color tone and the shape of an image area is changed, and the existence of the shadows brings a lot of difficulties to the interpretation work of the image, such as increasing the difficulty of classifying the ground features and extracting the features, so the processing research of detecting and compensating the high-resolution remote sensing image is realized, and the method has very important application prospect;
the shadow detection concept is mainly divided into two types: the first type is model-based; the second type is based on features. The method based on the model type is characterized in that a geometric model is established based on prior knowledge of environmental conditions such as geometric shapes of ground objects, solar altitude angles, sensor parameters and the like to realize shadow detection, the black body radiation model based on Makarau and the like realizes shadow detection according to the black body radiation principle that different color temperatures are caused by different illumination light sources of shadow regions and non-shadow regions, and the method is poor in applicability due to the fact that the method is large in calculation amount, high in calculation complexity, applied to specific scenes and difficult to acquire the prior knowledge. The method based on the characteristic class is that the shadow detection is realized by generally adopting a threshold segmentation method according to the difference of the shadow area on the characteristics such as brightness, color, texture and the like from the non-shadow area, and is subdivided into three types: a GF-1 image shadow detection method based on HSL-PCA integration is provided based on a texture feature method, an edge detection method and a spectral characteristic method, such as Sun poetry, Poplar tree and the like, the method is simple and easy to implement, but the method has the problems of large difference of results of different image detection and high omission ratio and false detection ratio.
Disclosure of Invention
The invention aims to provide an image shadow detection method based on HIS combined with spectral feature detection conditions, so as to solve the problems in the background technology.
In order to solve the technical problems, the invention provides the following technical scheme: an image shadow detection method based on HIS combined with spectral feature detection conditions comprises the following steps:
step S100: obtaining an original image of the remote sensing image, and converting the original image of the remote sensing image from an RGB color space to an HIS color space to obtain a first image based on shadow segmentation of the HIS color space;
step S200: calculating a normalized difference value to obtain a normalized difference value image S' by applying the normalized difference value to the first image obtained in the step S100; the calculation precision is improved through the normalization calculation, so that the obtained result of the normalization difference image S' is more accurate.
Step S300: applying the maximum inter-class method difference OTSU threshold segmentation to the normalized difference map S' obtained in the step S200 to obtain a shadow S 1
The maximum inter-class method difference OTSU divides the normalized difference image into a background part and a target part according to the gray characteristic of the normalized difference image, wherein the target is a target image to be acquired in the normalized difference image, and the background part is all images except the target; the larger the inter-class variance between the background and the target is, the larger the difference between two parts forming the image is, and when part of the target is wrongly classified as the background or part of the background is wrongly classified as the target, the difference between the two parts is reduced, so that the segmentation with the largest inter-class variance means the probability of wrong classification is the smallest;
step S400: carrying out shadow segmentation of spectral feature detection conditions on an original image of the remote sensing image, and analyzing the presentation effect of the original image of the remote sensing image under different spectral wave bands;
step S500: calculating a blue component B 'and a green component G' in a normalized RGB color space for an original image of the remote sensing image;
the specific calculation process is as follows:
Figure GDA0003710948620000021
Figure GDA0003710948620000022
r is a red component of each pixel point in the remote sensing image, G is a green component of each pixel point in the remote sensing image, and B is a blue component of each pixel point in the remote sensing image;
finding a shadow S 1 The color filter has the characteristics of low brightness and high tone, and also has a higher numerical value on the wave band of the blue component B' of the normalized RGB; shadow and green vegetation occupy high-end data in the B 'characteristic value, and the vegetation has higher characteristic value in the green component G' of the normalized RGB, and can be just utilized to remove the vegetation;
step S600: establishing a spectral feature detection condition for the blue component B 'and the green component G' calculated in the step S500 to obtain a shadow set S 2
The specific process is as follows;
step S610: firstly, adopting a limiting condition { I < T _ I } for the component B' in the step S500, wherein I is a color brightness component in an HIS color space, and T _ I is an OTSU threshold of an I component map;
step S620: carrying out a maximum inter-class difference method on the B ' pixel set S _ B ' meeting the limiting condition { I < T _ I }, wherein the obtained threshold is T _ B ';
step S630: obtaining a shadow set S by using a calculation formula 2 :S 2 ={(i,j)|B′(i,j)>T_B′&&G ' (i, j) < T ' _ G }, wherein T ' _ G is obtained by a maximum inter-class difference OSTU method, wherein (i, j) is a pixel point coordinate in a remote sensing image based on an RGB color space, T _ B ' is a characteristic threshold value of a blue component of the remote sensing image obtained in the RGB color space, and T ' _ G is a characteristic threshold value of a green component of the remote sensing image obtained in the RGB color space;
step S700: then the shadow S obtained in step S300 1 And the shade S obtained in step S600 2 Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S 1 ∪S 2 The shadow missing detection probability in the image is reduced, and the purpose of improving the detection precision is achieved;
step S800: finally, optimizing the shadow S obtained in the step S700 to obtain a shadow detection result; because there are many scattered debris shadows in the detection result, in order to improve the continuity and integrity of the shadow region, an optimization process is required to eliminate the debris shadows.
Further, in step S100, based on the shadow segmentation of the HIS color space, the original image of the remote sensing image is converted from the RGB color space to the HIS color space, and the specific process is as follows:
step S110: collecting a red component R, a blue component B and a green component G of each pixel point in an original image of the remote sensing image;
step S120: an H component map, an I component map and an S component map converted into the HIS color space are obtained by the following calculation formulas,
Figure GDA0003710948620000041
Figure GDA0003710948620000042
Figure GDA0003710948620000043
Figure GDA0003710948620000044
step S130: the S-component map and the I-component map are extracted from the HIS color space converted in step S120, respectively.
Further, in step S200, a normalized difference map S' is obtained by applying a normalized difference calculation to the first image, and the calculation formula is as follows:
S′=(S-I)/(S+I)
s in the normalized difference value (S-I)/(S + I) is saturation in the first image, and I is color brightness in the first image.
Further, in step S300, the maximum inter-class method difference OTSU threshold is applied for segmentation to obtain the shadow S 1 The specific process is as follows:
step S310: based on the HIS color space, the normalized difference image S 'is marked as I (x, y), the segmentation threshold values of the target image and the background image in the normalized difference image S' are marked as T, and the proportion of the number of pixels belonging to the target image to the whole image is marked as omega 0 The average gray scale is recorded as mu 0
Step S320: the proportion of the number of pixels of the background image in the normalized difference image S' to the whole image is omega 1 Average gray of μ 1
Step S330: the total average gray scale of the normalized difference graph S' is recorded as mu, and the inter-class variance is recorded as g;
step S340: when the background brightness of the normalized difference image S' is smaller than the set brightness threshold, the size of the image is M multiplied by N pixels, M is a horizontal pixel in the normalized difference image, N is a vertical pixel in the normalized difference image, and the number of the pixels with the gray value smaller than the threshold T in the image is taken as N 0 The number of pixels having a pixel gray level greater than the threshold T is denoted by N 1
Further, in step S300, the maximum inter-class method difference OTSU threshold is applied for segmentation to obtain the shadow S 1 The specific calculation formula is as follows:
ω 0 =N 0 /M×N
ω 1 =N 1 /M×N
N 0 +N 1 =M×N
ω 01 =1
μ=ω 0011
g=ω 00 -μ)^2+ω 11 -μ)^2
changing mu to omega 0011 Bringing g to ω 00 -μ)^2+ω 11 - μ) 2, the equivalence formula is obtained: g-omega 0 ω 101 ) 2, obtaining a threshold value T which enables the inter-class variance to be maximum by adopting a traversal method, namely the obtained threshold value T is the S 1
The traversing method comprises the following steps: setting j as a threshold value, and calculating the inter-class difference g according to a calculation inter-class difference formula on the basis of the target image and the background image in the normalized difference value image S j J is added 1 each time from 1 to 255, and finally g is compared j Choosing the largest g j I.e. the maximum inter-class difference g j The corresponding j is the optimal threshold T.
Further, in step S800, the shadow S is optimized, wherein the optimization includes 8-domain noise reduction and connected component noise reduction, the 8-domain noise reduction is for eliminating small shadows in the shadow S, and the connected component noise reduction is for eliminating large shadows in the shadow S.
Further, the 8-field noise reduction specific process is as follows:
and denoising the obtained shadow S, counting the number of gray values of pixels in the surrounding area of each shadow pixel point which is detected as 0 or 255, setting a threshold value to be T1 if gray values of pixels in other surrounding areas are not 0 or 255 and are small shadows and the surrounding of the small shadows are background black, and assigning the pixel point to be 0 if the number of black pixels is more than T1, so that the small shadows of the fragments are eliminated.
Further, the connected domain noise reduction specific optimization process is as follows:
step S810: in the process of scanning the shadow S, when the ith scanning of the shadow S scans a pixel point with a gray value of 255, the gray values of all the pixel points communicated with the point are changed into i to obtain a connected domain, and i connected domains are obtained until all the pixel points in the shadow S are scanned; wherein the initial value of i is 1;
step S820: secondly, scanning all the pixel points again, and counting the number of the pixel points corresponding to each gray value, wherein the number of the pixel points of each gray value corresponds to the size of the connected domain, and because the gray values of different connected domains are different, each point is only calculated once and cannot be repeated;
step S830: therefore, the size of each connected domain is counted, and then the connected domain is noise according to a preset threshold value if the size of the connected domain is smaller than the threshold value.
The connected domain noise reduction is carried out to eliminate larger debris shadows, because the shadows are connected with each other, the number of each connected white point is calculated, if the number of the white points is large, the pixel point is probably the character part, and if the number of the pixel points of one connected domain is small, the pixel point can be determined to be the background black.
Compared with the prior art, the invention has the following beneficial effects: the shadow detection algorithm provided by the invention has the advantages that the total detection error is low, the water body which is falsely detected in the shadow can be removed, the anti-interference performance to the water body is strong, the detected shadow region is continuous, the outline is clear and tidy, the shadow can be completely extracted, the shadow extracted by the algorithm is more continuous in some details and simpler in algorithm compared with the shadow extracted by the MSTD algorithm, and the detection precision can meet the detection requirement.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings:
FIG. 1 is a flow chart of an image shadow detection method based on HIS combined with spectral feature detection conditions according to the present invention;
FIG. 2 is a diagram showing a detection result of an image shadow detection method based on HIS combined with spectral feature detection conditions according to the present invention;
FIG. 3 is a detection result of the second influence of the image shadow detection method based on the HIS combined spectral feature detection condition according to the present invention;
FIG. 4 is a shadow detection result statistical table of the image shadow detection method based on HIS combined with spectral feature detection conditions according to the present invention;
FIG. 5 is a diagram of an image-accuracy evaluation result of an image shadow detection method based on HIS combined with spectral feature detection conditions according to the present invention;
FIG. 6 is a diagram of the result of image two-precision evaluation of the image shadow detection method based on HIS combined with spectral feature detection conditions according to the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
Referring to fig. 1-3, the present invention provides a technical solution: an image shadow detection method based on HIS combined with spectral feature detection conditions comprises the following steps:
step S100: obtaining an original image of the remote sensing image, and converting the original image of the remote sensing image from an RGB color space to an HIS color space to obtain a first image based on shadow segmentation of the HIS color space;
step S200: calculating a normalized difference value to obtain a normalized difference value image S' by applying the normalized difference value to the first image obtained in the step S100; the calculation precision is improved through the normalization calculation, so that the obtained result of the normalization difference image S' is more accurate;
step S300: applying the maximum inter-class method difference OTSU threshold segmentation to the normalized difference map S' obtained in the step S200 to obtain a shadow S 1
The maximum inter-class method difference OTSU divides the normalized difference image into a background part and a target part according to the gray characteristic of the normalized difference image, wherein the target is a target image to be acquired in the normalized difference image, and the background part is all images except the target; the larger the inter-class variance between the background and the target is, the larger the difference between two parts forming the image is, and when part of the target is wrongly classified as the background or part of the background is wrongly classified as the target, the difference between the two parts is reduced, so that the segmentation with the largest inter-class variance means the probability of wrong classification is the smallest;
step S400: carrying out shadow segmentation of spectral feature detection conditions on an original image of the remote sensing image, and analyzing the presentation effect of the original image of the remote sensing image under different spectral wave bands;
step S500: calculating a blue component B 'and a green component G' in a normalized RGB color space for an original image of the remote sensing image;
the specific calculation process is as follows:
Figure GDA0003710948620000081
Figure GDA0003710948620000082
r is a red component of each pixel point in the remote sensing image, G is a green component of each pixel point in the remote sensing image, and B is a blue component of each pixel point in the remote sensing image;
finding a shadow S 1 The color filter has the characteristics of low brightness and high tone, and also has a higher numerical value on the wave band of the blue component B' of the normalized RGB; shadow and green vegetation occupy high-end data in the B 'characteristic value, and the vegetation has higher characteristic value in the green component G' of the normalized RGB, and can be just utilized to remove the vegetation;
step S600: establishing a spectral feature detection condition for the blue component B 'and the green component G' calculated in the step S500 to obtain a shadow set S 2
The specific process is as follows:
step S610: firstly, adopting a limiting condition { I < T _ I } for the component B' in the step S500, wherein I is a color brightness component in an HIS color space, and T _ I is an OTSU threshold of an I component map;
step S620: carrying out a maximum inter-class difference method on the B ' pixel set S _ B ' meeting the limiting condition { I < T _ I }, wherein the obtained threshold is T _ B ';
step S630: obtaining a shadow set S by using a calculation formula 2 :S 2 ={(i,j)|B′(i,j)>T_B′&&G ' (i, j) < T ' _ G }, wherein T ' _ G is obtained by a maximum inter-class difference OSTU method, wherein (i, j) is a pixel point coordinate in a remote sensing image based on an RGB color space, T _ B ' is a characteristic threshold value of a blue component of the remote sensing image obtained in the RGB color space, and T ' _ G is a characteristic threshold value of a green component of the remote sensing image obtained in the RGB color space;
step S700: then the shadow S obtained in step S300 1 And the shade S obtained in step S600 2 Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S 1 ∪S 2 The shadow missing detection probability in the image is reduced, and the purpose of improving the detection precision is achieved;
step S800: finally, optimizing the shadow S obtained in the step S700 to obtain a shadow detection result; because there are many scattered debris shadows in the detection result, in order to improve the continuity and integrity of the shadow region, an optimization process is required to eliminate the debris shadows.
In step S100, based on the shadow segmentation of the HIS color space, the original image of the remote sensing image is converted from the RGB color space to the HIS color space, and the specific process is as follows:
step S110: collecting a red component R, a blue component B and a green component G of each pixel point in an original image of the remote sensing image;
step S120: an H component map, an I component map and an S component map converted into the HIS color space are obtained by the following calculation formulas,
Figure GDA0003710948620000091
Figure GDA0003710948620000092
Figure GDA0003710948620000093
Figure GDA0003710948620000094
step S130: the S-component map and the I-component map are extracted from the HIS color space converted in step S120, respectively.
In step S200, a normalized difference map S' is obtained by applying a normalized difference calculation to the first image, and the calculation formula is as follows:
S′=(S-I)/(S+I)
s in the normalized difference (S-I)/(S + I) is the saturation in the first image, and I is the color brightness in the first image.
In step S300, the maximum inter-class method difference OTSU threshold is applied for segmentation to obtain a shadow S 1 The specific process is as follows:
step S310: based on the HIS color space, the normalized difference image S 'is marked as I (x, y), the segmentation threshold values of the target image and the background image in the normalized difference image S' are marked as T, and the proportion of the number of pixels belonging to the target image to the whole image is marked as omega 0 The average gray scale is recorded as mu 0
Step S320: the proportion of the number of pixels of the background image in the normalized difference image S' to the whole image is omega 1 Average gray of μ 1
Step S330: the total average gray scale of the normalized difference graph S' is recorded as mu, and the inter-class variance is recorded as g;
step S340: when the background brightness of the normalized difference image S' is smaller than the set brightness threshold, the size of the image is M multiplied by N pixels, M is a horizontal pixel in the normalized difference image, N is a vertical pixel in the normalized difference image, and the number of the pixels with the gray value smaller than the threshold T in the image is taken as N 0 The number of pixels having a pixel gray level greater than the threshold T is denoted by N 1
In step S300, the maximum inter-class method difference OTSU threshold is applied for segmentation to obtain a shadow S 1 The specific calculation formula is as follows:
ω 0 =N 0 /M×N
ω 1 =N 1 /M×N
N 0 +N 1 =M×N
ω 01 =1
μ=ω 0011
g=ω 00 -μ)^2+ω 11 -μ)^2
by changing mu to omega 0011 Bringing g to ω 00 -μ)^2+ω 11 - μ) 2, the equivalence formula is obtained: g-omega 0 ω 101 ) 2, obtaining a threshold value T which maximizes the inter-class variance by using a traversal method, namely the obtained S 1
The traversing method comprises the following steps: setting j as a threshold value, and calculating the inter-class difference g according to a calculation inter-class difference formula on the basis of the target image and the background image in the normalized difference value image S j J is added 1 each time from 1 to 255, and finally g is compared j Choosing the largest g j I.e. the maximum inter-class difference g j The corresponding j is the optimal threshold T.
The shadow S in step S800 is subjected to optimization processing, where the optimization processing includes 8-domain noise reduction and connected domain noise reduction, the 8-domain noise reduction is for eliminating small shadows in the shadow S, and the connected domain noise reduction is for eliminating large shadows in the shadow S.
The specific process of noise reduction in the 8 fields is as follows:
and (3) reducing noise of the obtained shadow S, counting the number of gray values of pixel points in the surrounding field of each detected shadow pixel point to be 0 or 255, setting the gray values of the pixel points in the other surrounding fields to be small shadows if the gray values of the pixel points in the other surrounding fields are not 0 or 255, setting a threshold value to be T1 if the surrounding of the small shadows is background black, and assigning the pixel point to be 0 if the number of the black pixel points is more than T1, so that the small shadow of the fragments is eliminated.
The specific optimization process of connected domain noise reduction is as follows:
step S810: in the process of scanning the shadow S, when the ith scanning of the shadow S scans a pixel point with a gray value of 255, the gray values of all the pixel points communicated with the point are changed into i to obtain a connected domain, and i connected domains are obtained until all the pixel points in the shadow S are scanned; wherein the initial value of i is 1;
step S820: secondly, scanning all the pixel points again, and counting the number of the pixel points corresponding to each gray value, wherein the number of the pixel points of each gray value corresponds to the size of the connected domain, and because the gray values of different connected domains are different, each point is only calculated once and cannot be repeated;
step S830: therefore, the size of each connected domain is counted, and then the connected domain is noise according to a preset threshold value if the size of the connected domain is smaller than the threshold value.
The connected domain noise reduction is carried out to eliminate larger debris shadows, because the shadows are connected with each other, the number of each connected white point is calculated, if the number of the white points is large, the pixel point is probably the character part, and if the number of the pixel points of one connected domain is small, the pixel point can be determined to be the background black.
In order to verify the performance of the proposed algorithm, shadow detection is carried out on a large number of high-resolution remote sensing images, and all experimental results are realized on a NET platform by means of C language programming. Comparing the algorithm with various spectral feature threshold detection conditions provided by Gaojun, Wan-Yongchuan and the like in combination with an automatic threshold algorithm, wherein the various spectral feature threshold detection conditions in combination with the automatic threshold algorithm are abbreviated as MSTD hereinafter, and two representative remote sensing image test results are listed, wherein in fig. 1, (a) is an obtained remote sensing image I, (b) is a shadow region manually marked in the image I, (c) is a shadow region obtained by using the MSTD in the image I, and (d) is a shadow detection result obtained by using the method in the application in the image I; fig. 2 (a) shows a second obtained remote sensing image, (b) shows a manually marked shadow area in the second image, (c) shows a shadow detection result obtained by MSTD in the second image, and (d) shows a shadow detection result obtained by the method of the present application in the second image;
from fig. 2 and fig. 3, it can be seen that the MSTD and the method herein can extract the shadow more completely, the method herein extracts the shadow more continuously in some details than the MSTD, and the detection result almost completely coincides with the shadow region marked by the manual operation;
the shadow detection statistical table in fig. 4, the first-precision evaluation result in fig. 5, and the second-precision evaluation result in fig. 6 show the detection precision evaluation of the two images, and it can be seen from the missing detection rate that the missing detection rate averagely increases by 6% compared with the MSTD; from the false detection rate analysis, compared with the MSTD, the average decrease of the algorithm is 12.51%, from the total error rate analysis, the average increase of the algorithm is 3.14%, and the detection precision of the comprehensive analysis algorithm can meet the detection requirement.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, it will be apparent to those skilled in the art that changes may be made in the embodiments and/or equivalents thereof without departing from the spirit and scope of the invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. The image shadow detection method based on HIS combined with spectral feature detection conditions is characterized by comprising the following steps of:
step S100: obtaining an original image of the remote sensing image, and converting the original image of the remote sensing image from an RGB color space to an HIS color space to obtain a first image based on shadow segmentation of the HIS color space;
step S200: calculating a normalized difference value to obtain a normalized difference value image S' by applying the normalized difference value to the first image obtained in the step S100;
step S300: applying the maximum inter-class method difference OTSU threshold segmentation to the normalized difference map S' obtained in the step S200 to obtain a shadow S 1
Step S400: carrying out shadow segmentation of spectral feature detection conditions on an original image of the remote sensing image, and analyzing the presentation effect of the original image of the remote sensing image under different spectral wave bands;
step S500: calculating a blue component B 'and a green component G' in a normalized RGB color space for an original image of the remote sensing image;
the specific calculation process is as follows:
Figure FDA0003710948610000011
Figure FDA0003710948610000012
r is a red component of each pixel point in the remote sensing image, G is a green component of each pixel point in the remote sensing image, and B is a blue component of each pixel point in the remote sensing image;
step S600: establishing a spectral feature detection condition for the blue component B 'and the green component G' calculated in the step S500 to obtain a shadow set S 2
The specific process is as follows:
step S610: firstly, adopting a limiting condition { I < T _ I } for the B' component in the step S500, wherein I is a color brightness component in an HIS color space, and T _ I is an OTSU threshold of an I component map;
step S620: carrying out a maximum inter-class difference method on the B ' pixel set S _ B ' meeting the limiting condition { I < T _ I }, wherein the obtained threshold is T _ B ';
step S630: obtaining a shadow set S by using a calculation formula 2 :S 2 ={(i,j)|B′(i,j)>T_B′&&G ' (i, j) < T ' _ G }, wherein T ' _ G is obtained by a maximum inter-class difference OSTU method, wherein (i, j) is a pixel point coordinate in a remote sensing image based on an RGB color space, T _ B ' is a characteristic threshold value of a blue component of the remote sensing image obtained in the RGB color space, and T ' _ G is a characteristic threshold value of a green component of the remote sensing image obtained in the RGB color space;
step S700: then the shadow S obtained in step S300 1 And the shade S obtained in step S600 2 Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S 1 ∪S 2
Step S800: and finally, optimizing the shadow S obtained in the step S700 to obtain a shadow detection result.
2. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: in step S100, the image segmentation based on the HIS color space converts the original image of the remote sensing image from the RGB color space to the HIS color space, and the specific process is as follows:
step S110: collecting a red component R, a blue component B and a green component G of each pixel point in an original image of the remote sensing image;
step S120: an H component map, an I component map and an S component map converted into the HIS color space are obtained by the following calculation formulas,
Figure FDA0003710948610000021
Figure FDA0003710948610000022
Figure FDA0003710948610000023
Figure FDA0003710948610000024
step S130: the S-component map and the I-component map are extracted from the HIS color space converted in step S120, respectively.
3. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: in step S200, a normalized difference map S' is obtained by applying a normalized difference calculation to the first image, and the calculation formula is as follows:
S′=(S-I)/(S+I)
s in the normalized difference value (S-I)/(S + I) is saturation in the first image, and I is color brightness in the first image.
4. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: in step S300, the maximum inter-class method difference OTSU threshold is applied to obtain a shadow S 1 The specific process is as follows:
step S310: based on the HIS color space, the normalized difference image S ' is marked as I (x, y), the segmentation threshold values of the target image and the background image in the normalized difference image S ' are marked as T, and the proportion of the pixel points belonging to the target image to the whole normalized difference image S ' is marked as omega 0 The average gray scale is recorded as mu 0
Step S320: the proportion of the number of pixels of the background image in the normalized difference image S' to the whole image is omega 1 Average gray of μ 1
Step S330: the total average gray scale of the normalized difference graph S' is recorded as mu, and the inter-class variance is recorded as g;
step S340: when the background brightness of the normalized difference image S ' is smaller than the set brightness threshold, the normalized difference image S ' has a size of M × N pixels, M is a horizontal pixel in the normalized difference image S ', N is a vertical pixel in the normalized difference image S ', and the number of pixels having a gray value smaller than the threshold T in the normalized difference image S ' is counted as N 0 The number of pixels having a pixel gray level greater than the threshold T is denoted by N 1
5. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 4, wherein: in step S300, the maximum inter-class method difference OTSU threshold is applied to obtain a shadow S 1 The specific calculation formula is as follows:
ω 0 =N 0 /M×N
ω 1 =N 1 /M×N
N 0 +N 1 =M×N
ω 01 =1
μ=ω 0011
g=ω 00 -μ)^2+ω 11 -μ)^2
changing mu to omega 0011 Bringing g to ω 00 -μ)^2+ω 11 - μ) 2, the equivalence formula is obtained: g-omega 0 ω 101 ) 2, obtaining a threshold value T which enables the inter-class variance to be maximum by adopting a traversal method, namely the obtained threshold value T is the S 1
The traversal method comprises the following steps: setting j as a threshold value, and calculating the inter-class difference g according to a calculation inter-class difference formula on the basis of the target image and the background image in the normalized difference value image S j J is added 1 each time from 1 to 255, and finally g is compared j Choosing the largest g j I.e. the maximum inter-class difference and the maximum inter-class differenceg j The corresponding j is the optimal threshold T.
6. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: in step S800, the shadow S is optimized, where the optimization includes 8-neighborhood noise reduction and connected domain noise reduction, the 8-neighborhood noise reduction aims at eliminating small shadows in the shadow S, and the connected domain noise reduction aims at eliminating large shadows in the shadow S.
7. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 6, wherein: the specific process of 8-neighborhood noise reduction is as follows:
and denoising the obtained shadow S, counting the number of gray values of pixels in the surrounding field of each detected shadow pixel point, wherein the gray values of the pixels in the surrounding field are 0 or 255, the gray values of the pixels in the other surrounding fields are not 0 or 255 are small shadows, the surrounding of each small shadow is background black, setting a threshold value to be T1, and when the number of the black pixels is greater than T1, assigning the pixel to be 0.
8. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 7, wherein: the specific optimization process of connected domain noise reduction is as follows:
step S810: in the process of scanning the shadow S, when the ith scanning of the shadow S scans a pixel point with a gray value of 255, the gray values of all the pixel points communicated with the point are changed into i to obtain a connected domain, and i connected domains are obtained until all the pixel points in the shadow S are scanned; wherein the initial value of i is 1;
step S820: secondly, scanning all the pixel points again, and counting the number of the pixel points corresponding to each gray value, wherein the number of the pixel points of each gray value corresponds to the size of the connected domain, and because the gray values of different connected domains are different, each point is only calculated once and cannot be repeated;
step S830: therefore, the size of each connected domain is counted, and then the connected domain is noise according to a preset threshold value if the size of the connected domain is smaller than the threshold value.
CN202111161946.2A 2021-09-30 2021-09-30 Image shadow detection method based on HIS combined with spectral feature detection condition Active CN113763410B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111161946.2A CN113763410B (en) 2021-09-30 2021-09-30 Image shadow detection method based on HIS combined with spectral feature detection condition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111161946.2A CN113763410B (en) 2021-09-30 2021-09-30 Image shadow detection method based on HIS combined with spectral feature detection condition

Publications (2)

Publication Number Publication Date
CN113763410A CN113763410A (en) 2021-12-07
CN113763410B true CN113763410B (en) 2022-08-02

Family

ID=78798554

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111161946.2A Active CN113763410B (en) 2021-09-30 2021-09-30 Image shadow detection method based on HIS combined with spectral feature detection condition

Country Status (1)

Country Link
CN (1) CN113763410B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637301A (en) * 2012-03-20 2012-08-15 武汉大学 Method for automatically evaluating color quality of image during aerial photography in real time
CN102855627A (en) * 2012-08-09 2013-01-02 武汉大学 City remote sensing image shadow detection method based on spectral characteristic and topological relation
CN104899881A (en) * 2015-05-28 2015-09-09 湖南大学 Shadow detection method for moving vehicle in video image
CN106407895A (en) * 2016-08-30 2017-02-15 天津天地伟业数码科技有限公司 Vehicle shadow detection algorithm based on image gray and Lab color space
CN107292328A (en) * 2016-03-31 2017-10-24 武汉大学 The remote sensing image shadow Detection extracting method and system of multiple dimensioned multiple features fusion
CN110796113A (en) * 2019-11-05 2020-02-14 洛阳师范学院 City blue terrain detection method based on WorldView-2 image

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102637301A (en) * 2012-03-20 2012-08-15 武汉大学 Method for automatically evaluating color quality of image during aerial photography in real time
CN102855627A (en) * 2012-08-09 2013-01-02 武汉大学 City remote sensing image shadow detection method based on spectral characteristic and topological relation
CN104899881A (en) * 2015-05-28 2015-09-09 湖南大学 Shadow detection method for moving vehicle in video image
CN107292328A (en) * 2016-03-31 2017-10-24 武汉大学 The remote sensing image shadow Detection extracting method and system of multiple dimensioned multiple features fusion
CN106407895A (en) * 2016-08-30 2017-02-15 天津天地伟业数码科技有限公司 Vehicle shadow detection algorithm based on image gray and Lab color space
CN110796113A (en) * 2019-11-05 2020-02-14 洛阳师范学院 City blue terrain detection method based on WorldView-2 image

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
A Shadow Detection Method from Urban High Resolution Remote Sensing Image Based on Color Features of Shadow;Hui Luo等;《2012 Fourth International Symposium on Information Science and Engineering》;20130411;第48-51页 *
Detection of and Compensation for Shadows in Colored Urban Aerial Images;Jianjun Huang等;《Fifth World Congress on Intelligent Control and Automation》;20041018;第3098-3100页 *
Detection of Building Shadow in Remote Sensing Imagery of Urban Areas With Fine Spatial Resolution Based on Saturation and Near-Infrared Information;Hong Fang等;《 IEEE Journal of Selected Topics in Applied Earth Observations and Remote Sensing》;20190830;第12卷(第8期);第2695-2706页 *
结合多种特征的高分辨率遥感影像阴影检测;张先鹏等;《自动化学报》;20160228;第42卷(第2期);第290-298页 *
结合辐射与分形的高分遥感建筑物阴影检测;王超等;《仪器仪表学报》;20180228;第39卷(第2期);第241-247页 *
航空遥感影像阴影的自动检测与补偿;高贤君等;《武汉大学学报·信息科学版》;20121130;第37卷(第11期);第1299-1302页 *

Also Published As

Publication number Publication date
CN113763410A (en) 2021-12-07

Similar Documents

Publication Publication Date Title
US20210199579A1 (en) Method and system for urban impervious surface extraction based on remote sensing
US7068840B2 (en) Determination of an illuminant of digital color image by segmentation and filtering
CN111915704A (en) Apple hierarchical identification method based on deep learning
CN112149543B (en) Building dust recognition system and method based on computer vision
Mostafa et al. Shadow identification in high resolution satellite images in the presence of water regions
CN111881801B (en) Newly-added construction land remote sensing monitoring method and equipment based on invariant detection strategy
CN110175556B (en) Remote sensing image cloud detection method based on Sobel operator
CN109859231A (en) A kind of leaf area index extraction threshold segmentation method based on optical imagery
CN108711160B (en) Target segmentation method based on HSI (high speed input/output) enhanced model
CN110929562A (en) Answer sheet identification method based on improved Hough transformation
CN110852207A (en) Blue roof building extraction method based on object-oriented image classification technology
Zhan et al. Quantitative analysis of shadow effects in high-resolution images of urban areas
CN114359143A (en) Remote sensing image road extraction method
CN111046782B (en) Quick fruit identification method for apple picking robot
Fang et al. Detection of building shadow in remote sensing imagery of urban areas with fine spatial resolution based on saturation and near-infrared information
CN109583330B (en) Pore detection method for face photo
Shi et al. Automatic shadow detection in high-resolution multispectral remote sensing images
CN113763410B (en) Image shadow detection method based on HIS combined with spectral feature detection condition
Shi et al. Urban feature shadow extraction based on high-resolution satellite remote sensing images
JP4285640B2 (en) Object identification method, apparatus and program
JP2009123234A (en) Object identification method, apparatus and program
Xiaoxu et al. Image dehazing base on two-peak channel prior
CN115456886A (en) Aviation remote sensing image shadow removing method based on deep learning and illumination model
CN111192332A (en) Smoke detection-based smoke machine control method and smoke machine
CN111080562B (en) Substation suspender identification method based on enhanced image contrast

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant