CN113763410A - 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
CN113763410A
CN113763410A CN202111161946.2A CN202111161946A CN113763410A CN 113763410 A CN113763410 A CN 113763410A CN 202111161946 A CN202111161946 A CN 202111161946A CN 113763410 A CN113763410 A CN 113763410A
Authority
CN
China
Prior art keywords
image
shadow
color space
component
threshold
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.)
Granted
Application number
CN202111161946.2A
Other languages
Chinese (zh)
Other versions
CN113763410B (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, converting an image from an RGB color space to an HIS color space based on shadow segmentation of the HIS color space, then respectively extracting an S component diagram and an I component diagram, obtaining a shadow S1 by using maximum inter-class variance OTSU threshold segmentation, then carrying out shadow segmentation of the spectral feature detection conditions, analyzing the presentation effect of the image under different spectral bands, wherein a shadow area not only has low brightness and high tone characteristics, but also has higher numerical values on the band of a blue component B' of normalized RGB,the vegetation has higher characteristic value in the green component G' of the normalized RGB, and is utilized to remove the vegetation, and then S is used2={(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 S1
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;
finding a shadow S1Not only has low brightness and high tone characteristics, but also normalizes RGThe blue component B' of B also has a higher value in the wave band; 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 S2
Step S700: then the shadow S obtained in step S3001And the shade S obtained in step S6002Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S1∪S2The 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, the step S100 of performing the shadow 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 BDA0003290505150000031
Figure BDA0003290505150000032
Figure BDA0003290505150000033
Figure BDA0003290505150000034
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, the step S300 of applying the maximum inter-class method difference OTSU threshold segmentation to obtain the shadow S1The 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 omega0The average gray scale is recorded as mu0
Step S320: the proportion of the number of pixels of the background image in the normalized difference image S' to the whole image is omega1Average 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 N0The number of pixels having a pixel gray level greater than the threshold T is denoted by N1
Further, the step S300 of applying the maximum inter-class method difference OTSU threshold segmentation to obtain the shadow S1The specific calculation formula is as follows:
ω0=N0/M×N
ω1=N1/M×N
N0+N1=M×N
ω01=1
μ=ω0011
g=ω00-μ)^2+ω11-μ)^2
changing mu to omega0011Bringing g to ω00-μ)^2+ω11- μ) 2, the equivalence formula is obtained: g-omega0ω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 S1
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 SjI is added with 1 to 255 from 1, and finally g is comparedjChoosing the largest gjI.e. the maximum inter-class difference gjThe corresponding j is the optimal threshold T.
Further, in step S500, the blue component B 'and the green component G' are calculated as follows:
Figure BDA0003290505150000041
Figure BDA0003290505150000042
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;
further, the shadow set S obtained in step S6002The 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 formula2:S2={(i,j)|B′(i,j)>T_B′&&G ' (i, j) < T ' _ G }, wherein the T _ G ' characteristic threshold is obtained by a maximum inter-class difference OSTU method, wherein (i, j) is a pixel point coordinate in the remote sensing image based on the RGB color space, T _ B ' is a characteristic threshold of a blue component of the remote sensing image obtained in the RGB color space, and T ' _ G is a characteristic threshold of a green component of the remote sensing image obtained in the RGB color space.
Further, the shadow S described in step S800 is subjected to an optimization process, where the optimization process 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 (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.
Further, the connected domain denoising specifically optimizing 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 shows the detection results of the second influence of the image shadow detection method based on the HIS combined with the spectral feature detection conditions 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 derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1-3, the present invention provides the following technical solutions: 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 S1
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;
finding a shadow S1The 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 S2
Step S700: then the shadow S obtained in step S3001And the shade S obtained in step S6002Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S1∪S2The 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.
The step S100 of performing the shadow 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 BDA0003290505150000071
Figure BDA0003290505150000072
Figure BDA0003290505150000073
Figure BDA0003290505150000081
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 value (S-I)/(S + I) is saturation in the first image, and I is color brightness in the first image.
The method difference between the maximum classes OTSU threshold segmentation is applied in step S300 to obtain the shadow S1The 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 omega0The average gray scale is recorded as mu0
Step S320: background map in normalized difference map SThe ratio of the number of pixels to the whole image is omega1Average 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 N0The number of pixels having a pixel gray level greater than the threshold T is denoted by N1
The method difference between the maximum classes OTSU threshold segmentation is applied in step S300 to obtain the shadow S1The specific calculation formula is as follows:
ω0=N0/M×N
ω1=N1/M×N
N0+N1=M×N
ω01=1
μ=ω0011
g=ω00-μ)^2+ω11-μ)^2
changing mu to omega0011Bringing g to ω00-μ)^2+ω11- μ) 2, the equivalence formula is obtained: g-omega0ω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 S1
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 SjI is added with 1 to 255 from 1, and finally g is comparedjChoosing the largest gjI.e. the maximum inter-class difference gjThe corresponding j is the optimal threshold T.
In step S500, the blue component B 'and the green component G' are calculated as follows:
Figure BDA0003290505150000091
Figure BDA0003290505150000092
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;
the shadow set S obtained in step S6002The 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 a 0TSU 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 formula2:S2={(i,j)|B′(i,j)>T_B′&&G ' (i, j) < T ' _ G }, wherein the T _ G ' characteristic threshold is obtained by a maximum inter-class difference OSTU method, wherein (i, j) is a pixel point coordinate in the remote sensing image based on the RGB color space, T _ B ' is a characteristic threshold of a blue component of the remote sensing image obtained in the RGB color space, and T ' _ G is a characteristic threshold of a green component of the remote sensing image obtained in the RGB color space.
The shadow S described in step S800 is optimized, where the optimization includes 8-domain noise reduction and connected domain noise reduction, the 8-domain 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.
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 an obtained remote sensing image two, (b) shows a shadow region manually marked in the image two, (c) shows a shadow detection result obtained by using MSTD in the image two, and (d) shows a shadow detection result obtained by using the method of the present application in the image two;
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 (10)

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 S1
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;
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 S2
Step S700: then the shadow S obtained in step S3001And the shade S obtained in step S6002Combining the union set to obtain the shade S, wherein the calculation formula is as follows: s ═ S1∪S2
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: the step S100 of shadow 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 FDA0003290505140000011
Figure FDA0003290505140000021
Figure FDA0003290505140000022
Figure FDA0003290505140000023
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: the method difference between the maximum classes OTSU threshold segmentation is applied in step S300 to obtain the shadow S1The 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 omega0The average gray scale is recorded as mu0
Step S320: the proportion of the number of pixels of the background image in the normalized difference image S' to the whole image is omega1Average 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 N0The number of pixels having a pixel gray level greater than the threshold T is denoted by N1
5. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 4, wherein: the method difference between the maximum classes OTSU threshold segmentation is applied in step S300 to obtain the shadow S1The specific calculation formula is as follows:
ω0=N0/M×N
ω1=N1/M×N
N0+N1=M×N
ω01=1
μ=ω0011
g=ω00-μ)^2+ω11-μ)^2
changing mu to omega0011Bringing g to ω00-μ)^2+ω11- μ) 2, the equivalence formula is obtained: g-omega0ω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 S1
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 SjI is added with 1 to 255 from 1, and finally g is comparedjChoosing the largest gjI.e. the maximum inter-class difference gjThe 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 S500, the blue component B 'and the green component G' are calculated as follows:
Figure FDA0003290505140000031
Figure FDA0003290505140000032
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.
7. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: the shadow set S obtained in step S6002The 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 a B ' pixel set S _ B ' meeting a limiting condition { I < T _ I }, wherein the obtained threshold is T _ B ';
step S630: obtaining a shadow set S by using a calculation formula2:S2={(i,j)|B'(i,j)>T_B'&&G'(i,j)<T '_ G }, wherein the T _ G' characteristic threshold 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 of a blue component of the remote sensing image acquired in the RGB color space, and T' _ G is a characteristic threshold of a green component of the remote sensing image acquired in the RGB color space.
8. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 1, wherein: the shadow S described in step S800 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.
9. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 8, 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.
10. The image shadow detection method based on HIS combined with spectral feature detection condition of claim 8, 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 true CN113763410A (en) 2021-12-07
CN113763410B 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
HONG FANG等: "Detection of Building Shadow in Remote Sensing Imagery of Urban Areas With Fine Spatial Resolution Based on Saturation and Near-Infrared Information", 《 IEEE JOURNAL OF SELECTED TOPICS IN APPLIED EARTH OBSERVATIONS AND REMOTE SENSING》 *
HUI LUO等: "A Shadow Detection Method from Urban High Resolution Remote Sensing Image Based on Color Features of Shadow", 《2012 FOURTH INTERNATIONAL SYMPOSIUM ON INFORMATION SCIENCE AND ENGINEERING》 *
JIANJUN HUANG等: "Detection of and Compensation for Shadows in Colored Urban Aerial Images", 《FIFTH WORLD CONGRESS ON INTELLIGENT CONTROL AND AUTOMATION》 *
张先鹏等: "结合多种特征的高分辨率遥感影像阴影检测", 《自动化学报》 *
王超等: "结合辐射与分形的高分遥感建筑物阴影检测", 《仪器仪表学报》 *
高贤君等: "航空遥感影像阴影的自动检测与补偿", 《武汉大学学报·信息科学版》 *

Also Published As

Publication number Publication date
CN113763410B (en) 2022-08-02

Similar Documents

Publication Publication Date Title
Jonckheere et al. Assessment of automatic gap fraction estimation of forests from digital hemispherical photography
US7068840B2 (en) Determination of an illuminant of digital color image by segmentation and filtering
CN111915704A (en) Apple hierarchical identification method based on deep learning
JP2001195591A (en) Method for detecting void in image
CN114118144A (en) Anti-interference accurate aerial remote sensing image shadow detection method
CN110175556B (en) Remote sensing image cloud detection method based on Sobel operator
van Zwanenberg et al. Edge detection techniques for quantifying spatial imaging system performance and image quality
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
Zhan et al. Quantitative analysis of shadow effects in high-resolution images of urban areas
CN110852207A (en) Blue roof building extraction method based on object-oriented image classification technology
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
CN115457249A (en) Method and system for fusing and matching infrared image and visible light image
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
WO2004028141A1 (en) A method and system for determining and correcting image orientation angle
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
CN114049571A (en) Method and device for extracting water body area of hyperspectral image and electronic equipment
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