A remote sensing image pixel extreme value detection method and system

By performing blocking and connecting area detection on remote sensing images, the problem of remote sensing image pixel extreme value detection in the prior art requires two images to be read, and the effect of quickly detecting the area where the pixel extreme value is located is achieved.

CN115345899BActive Publication Date: 2025-05-13SICHUAN SURVEYING & MAPPING PROD QUALITY SUPERVISION & INSPECTION STATION OF THE MINIST OF NATURAL RESOURCES SICHUAN SURVEYING & MAPPING PROD QUALITY SUPERVISION & INSPECTION STATION
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210975857.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2025-05-13
Estimated Expiration
2042-08-15

AI Technical Summary

Technical Problem

In the prior art, when detecting the location of the pixel extreme value 0 or 255 in the effective data coverage area of ​​the remote sensing image, the remote sensing image needs to be read twice, resulting in an increase in the data reading time.

Method used

By blocking the remote sensing image, and without distinguishing the valid data coverage area from the invalid data coverage area, the connected areas in each row are detected, the connected areas are merged, the number of pixels in the new connected areas is calculated, and the area with the number of pixels is filtered out to quickly detect the area where the pixel extreme value is located.

Benefits of technology

It is realized that by reading the image at one time, the position of pixel extreme value 0 or 255 appears in the effective data coverage area of ​​the remote sensing image is quickly detected, reducing the data reading time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115345899B_ABST
    Figure CN115345899B_ABST
Patent Text Reader

Abstract

The present invention relates to a remote sensing image pixel extreme value detection method and system, comprising: dividing the remote sensing image into blocks according to a preset number of rows, and reading the image data into a computer memory by blocks, and detecting the connected area in each row for each image block; the connected area refers to an area in which each pixel position in the area has at least one band with a pixel extreme value of 0 or 255; merging the connected areas with connectivity to obtain a plurality of new connected areas; calculating the number of pixels in each of the new connected areas; filtering out the areas with a pixel number greater than a set threshold from the new connected areas to obtain the connected areas of the valid data coverage area, and the connected areas of the valid data coverage area are the areas where the pixel extreme values ​​are located. The method does not need to distinguish between the valid data coverage area and the invalid data coverage area of ​​the remote sensing image in advance, and can quickly detect the position where the pixel extreme value 0 or 255 appears in the valid data coverage area by reading the image once.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of remote sensing image pixel detection, and in particular to a remote sensing image pixel extreme value detection method and system. Background Art

[0002] The valid data coverage area and invalid data coverage area of ​​remote sensing images are represented by different pixel values. For 8-bit remote sensing images, the pixel values ​​of each band in the valid data coverage area are required to be between 1-254, and the pixel values ​​of each band in the invalid data coverage area are required to be 0. However, during the data acquisition and data processing of remote sensing images, the pixel extreme values ​​0 or 255 will appear in the valid data coverage area. It is necessary to find the location of the pixel extreme values ​​0 or 255 in the valid data coverage area and modify it to other specified pixel values.

[0003] The conventional method for detecting the occurrence of pixel extreme values ​​0 or 255 in the effective data coverage area of ​​the remote sensing image requires first finding the range lines of the effective data coverage area and the invalid data coverage area, and then finding the position where the pixel extreme value 0 or 255 appears within the range line of the effective data coverage area. This method requires reading the remote sensing image twice, and the data volume of the remote sensing image is usually large, which increases the time for reading the data. Based on this, a remote sensing image pixel extreme value detection method and system are urgently needed to quickly detect the area where the pixel extreme value 0 or 255 appears in the effective data coverage area of ​​the remote sensing image. Summary of the invention

[0004] The purpose of the present invention is to provide a remote sensing image pixel extreme value detection method and system. The method does not need to first distinguish between the remote sensing image valid data coverage area and the invalid data coverage area. By reading the image once, the position of the pixel extreme value 0 or 255 in the valid data coverage area can be quickly detected.

[0005] To achieve the above object, the present invention provides the following solutions:

[0006] A remote sensing image pixel extreme value detection method, comprising:

[0007] Divide the remote sensing image into blocks according to the preset number of rows, and read the image data into the computer memory block by block;

[0008] For each image, detect the connected area in each row; the connected area refers to the area where each pixel position has at least one band with a pixel extreme value of 0 or 255;

[0009] Merge the connected regions with connectivity to obtain several new connected regions;

[0010] Calculating the number of pixels in each of the new connected regions;

[0011] The area where the number of pixels is greater than a set threshold is filtered out from the new connected area to obtain the connected area of ​​the valid data coverage area, where the connected area of ​​the valid data coverage area is the area where the pixel extreme value is located.

[0012] As an optional implementation manner, the connected regions having connectivity are merged to obtain a plurality of new connected regions, specifically including:

[0013] Obtain a ternary array of each connected region, wherein the ternary array includes a row number, a start column number, and an end column number;

[0014] Establishing a label array with the total number of all the connected areas as the size, and initializing the value of each label number A in the label array to 0, each connected area corresponds to one label number, and establishing an equivalent array E with a value of zero;

[0015] The first label value corresponding to the first connected area is recorded as , determine whether the other connected areas are connected areas in the same industry, and set the second mark value corresponding to the connected areas in the same industry Recorded as the maximum value of the number of connected region marks in the current state plus 1, the connected region in the same row is the connected region in the same row as the first connected region;

[0016] According to the ternary array, the intersection between the non-same connected area and the previous row connected area is determined to obtain a first determination result; the previous row connected area is the connected area of ​​the previous row of the non-same connected area, and the intersection includes no intersection and intersection at x points. ;

[0017] Determine whether the third mark value corresponding to the non-in-line connected area is 0, and obtain a second determination result;

[0018] Obtain the third tag value according to the first judgment result and the second judgment result, and obtain an equivalent pair corresponding to each tag value according to the first judgment result and the second judgment result, and store the equivalent pair in an equivalent array;

[0019] Determine whether the equivalent array is zero to obtain a third determination result, and if the third determination result is yes, do not modify the tag value corresponding to the equivalent array;

[0020] If the third judgment result is no, re-assigning the label number according to the equivalence list and the principle that the label values ​​of multiple connected regions with connectivity are the same; the equivalence list is composed of the equivalence array;

[0021] The connected areas corresponding to the number of markers with the same reassigned values ​​are combined into new connected areas.

[0022] As an optional implementation manner, the calculating the number of pixels in each of the new connected regions specifically includes:

[0023] Calculate the difference between the end column number and the start column number of each row in the new connected area, and add 1 to the difference to obtain the number of pixels in each row of the new connected area;

[0024] The total number of pixels in the new connected area is calculated according to the number of pixels in each row of the new connected area.

[0025] Optionally, when the connected area in a different row satisfies the formula: , it is determined that the non-same row connected area intersects with the previous row connected area;

[0026] in, startCol cur Indicates the starting column number of the current non-peer connected area; endCol pre Indicates the end column number of the connected area in the previous row; endCol cur Indicates the end column number of the current non-connected area; startCol pre Indicates the starting column number of the connected area in the previous row; Row cur Indicates the row number of the current non-peer connected area; Row pre Indicates the row number of the connected region in the previous row.

[0027] Optionally, obtaining the third tag value according to the first judgment result and the second judgment result, and obtaining an equivalent pair corresponding to each tag value according to the first judgment result and the second judgment result, and storing the equivalent pair in an equivalent array specifically includes:

[0028] When the first judgment result is no intersection and the second judgment result is yes, the third mark value is Recorded as the maximum number of connected area markers plus 1;

[0029] When the first judgment result is that there is one intersection, and the second judgment result is yes, the third mark value is Recorded as the label value of the intersecting connected area in the previous row ; The intersecting connected regions in the previous row are the connected regions in the previous row that intersect with the current row;

[0030] When the first judgment result is that there is one intersection, and the second judgment result is no, then the third mark value is judged Connected regions that intersect with the previous row are labeled with numerical values Are they equal? ​​If not, get the equivalent pair. , and store it in the equivalent array E;

[0031] When the first judgment result is that there are two or more intersections, and the second judgment result is yes, the third mark value is Recorded as the mark value of the first connected area in the previous row that intersects with the current row , and obtain the equivalent pair , and store it in the equivalent array E; Mark the other connected regions in the previous row that intersect with the current row with numerical values, wherein the other connected regions are connected regions other than the first connected region that intersects with the current row, Not unique;

[0032] When the first judgment result is that there are two or more intersections, and the second judgment result is no, then the third mark value is determined. Are the values ​​of all connected regions that intersect in the previous row different? If so, obtain an equivalent pair , and store it in the equivalent array E, Mark the connected areas in the previous row that intersect with the connected areas in the current row. Not unique.

[0033] As an optional implementation, the re-assigning of the label number according to the equivalent list and the principle that the label values ​​of multiple connected regions with connectivity are the same specifically includes:

[0034] Get the maximum element value in the marked number, create an array F with the maximum element value as the size, and initialize the value of the array F to 0, and create a new equivalent array with a value of zero ;

[0035] For each equivalence pair in the equivalence array E, compare the two values ​​in the equivalence pair, and put the smaller value in the first position of the equivalence pair and the larger value in the second position;

[0036] Sorting the equivalent pairs in the equivalent array E to obtain an ordered equivalent array; when sorting, arranging in ascending order according to the values ​​of the first position in the equivalent pairs, and when the values ​​of the first position are equal, sorting in ascending order according to the values ​​of the second position in the equivalent pairs;

[0037] Removing duplicate equivalent pairs in the ordered equivalent array to obtain a deduplicated equivalent array;

[0038] For each equivalence pair in the deduplicated equivalence array, determining whether the F arrays corresponding to the two values ​​of the equivalence pair are zero;

[0039] when and season , ;in, refers to the first value in the i-th equivalence pair, Refers to the second value in the i-th equivalence pair;

[0040] when and season ;

[0041] when and season ;

[0042] when and and When , record the new equivalent pair , stored in a new equivalent array ;

[0043] According to the value of the array F, according to the condition if , Reassign the number of labels corresponding to the connected area;

[0044] Determine the new equivalent array Is it empty? If not, jump to step "obtain the maximum element value in the number of tags"; if so, end.

[0045] The present invention also provides a remote sensing image pixel extreme value detection system, comprising:

[0046] A block division module is used to divide the remote sensing image into blocks according to a preset number of rows, and read the image data into the computer memory in blocks;

[0047] A checking module is used to detect the connected area in each row of each image; the connected area refers to an area in which each pixel position in the area has at least one band with a pixel extreme value of 0 or 255;

[0048] A merging module is used to merge connected regions with connectivity to obtain several new connected regions;

[0049] A pixel number calculation module, used for calculating the number of pixels in each of the new connected areas;

[0050] The pixel extreme value region determination module is used to filter out the region where the number of pixels is greater than a set threshold from the new connected region to obtain the connected region of the valid data coverage region, where the connected region of the valid data coverage region is the region where the pixel extreme value is located.

[0051] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects:

[0052] The present invention provides a remote sensing image pixel extreme value detection method and system. First, the remote sensing image is divided into blocks according to a preset number of rows, and the image data is read into a computer memory by block. For each block of the image, the connected area in each row is detected; the connected area refers to an area in which each pixel position in the area has at least one band with a pixel extreme value of 0 or 255; the connected areas with connectivity are merged to obtain a plurality of new connected areas; the number of pixels in each of the new connected areas is calculated; the area with a pixel number greater than a set threshold is filtered out from the new connected areas to obtain the connected area of ​​the valid data coverage area, and the connected area of ​​the valid data coverage area is the area where the pixel extreme value is located. The above method provided by the present invention does not need to distinguish between the valid data coverage area and the invalid data coverage area of ​​the remote sensing image in advance, and the position of the pixel extreme value 0 or 255 in the valid data coverage area can be quickly detected by reading the image once. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0054] Figure 1 A flow chart of a remote sensing image pixel extreme value detection method provided in Example 1 of the present invention;

[0055] Figure 2 A schematic diagram of a method for obtaining a tag array value according to the first embodiment of the present invention;

[0056] Figure 3 A schematic diagram of a method for obtaining a tag array value according to the second embodiment of the present invention;

[0057] Figure 4 A schematic diagram of the third type of marking array value provided in Example 1 of the present invention;

[0058] Figure 5 A schematic diagram of a method for obtaining a tag array value according to the fourth embodiment of the present invention provided in Embodiment 1;

[0059] Figure 6 A schematic diagram of the fifth type of marking array value provided in Example 1 of the present invention;

[0060] Figure 7 A distribution diagram of valid data areas and invalid data areas provided in Example 1 of the present invention;

[0061] Figure 8 An image for which pixel extreme values ​​need to be detected provided in Embodiment 1 of the present invention;

[0062] Fig. 9 The record result of the row number, the starting column number, and the ending column number provided in Example 1 of the present invention;

[0063] Fig.10 A diagram of a process for recording a number of marks provided in Example 1 of the present invention;

[0064] Fig.11 A schematic diagram of equivalent results formed by equivalent pairs provided in Example 1 of the present invention;

[0065] Fig.12 A schematic diagram of the connected region labeling result provided in Example 1 of the present invention;

[0066] Fig.13 A schematic diagram of an equivalent array processing process provided in Example 1 of the present invention;

[0067] Fig.14 The array F assignment diagram provided in Example 1 of the present invention;

[0068] Fig.15 A new equivalent array diagram provided by Embodiment 1 of the present invention;

[0069] Fig.16 A schematic diagram of reassigning the marking number provided in Example 1 of the present invention;

[0070] Fig.17 A schematic diagram of initializing and assigning values ​​to an array F provided in Example 1 of the present invention;

[0071] Fig.18 A schematic diagram of reassigning the tag number using array F provided in Embodiment 1 of the present invention;

[0072] Fig.19 A schematic diagram of the final connected area result provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0073] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0074] The object of the present invention is to provide a method and system for detecting pixel extreme values in remote sensing images, which do not need to first distinguish the effective data coverage area and the invalid data coverage area of the remote sensing image, and can quickly detect the positions where pixel extreme values 0 or 255 appear in the effective data coverage area by reading the image once.

[0075] To make the above objects, features, and advantages of the present invention more obvious and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0076] Embodiment 1

[0077] This embodiment provides a method for detecting pixel extreme values in remote sensing images. Please refer to Figure 1 , including:

[0078] S1. Divide the remote sensing image into blocks according to a preset number of rows, and read the image data into the computer memory block by block.

[0079] In this embodiment, the remote sensing image is divided into blocks with every N rows, and each image block is read into the computer memory; the total number of rows of the remote sensing image is M, where N < M; then it takes n = INT(M / N)+1 times to read the entire remote sensing image. For the first n - 1 times, the size of the row block read each time is N, and for the nth time, the size of the row block read is M - N(n - 1).

[0080] S2. For each image block, detect the connected regions in each row; the connected region refers to a region where at least one band of pixel values at each pixel position in the region is the pixel extreme value 0 or 255.

[0081] Specifically, for the connected regions in each row, starting from the first pixel position in the order from left to right, if at least one band of pixel values at a certain pixel position is the pixel extreme value 0 or 255, then continue to check whether at least one band of pixel values at the adjacent pixel position on the right side of this pixel position is the pixel extreme value 0 or 255. If so, continue to repeat the above check until all bands of pixel values at a certain adjacent pixel position on the right side are not the pixel extreme value 0 or 255. At this time, the search for a connected region is completed; then continue to search for the pixel positions on the right side until all pixel positions are searched.

[0082] S3. Merge connected regions with connectivity to obtain several new connected regions.

[0083] As an optional implementation, step S3 specifically includes:

[0084] S31, obtaining a ternary array of each connected region, wherein the ternary array includes a row number, a start column number, and an end column number;

[0085] S32, establishing a label array with the total number of all the connected areas as the size, and initializing the value of each label number A in the label array to 0, each of the row connected areas corresponds to one label number, and establishing an equivalent array E with a value of zero;

[0086] After the label array and the equivalence array E are established, the subsequent steps S33-S39 begin to determine the connectivity between connected regions.

[0087] S33, record the first mark value corresponding to the first connected area as , determine whether other connected areas except the first connected area are connected areas in the same line, and set the second mark value corresponding to the connected area in the same line Recorded as the maximum value of the number of connected region marks in the current state plus 1, the connected region in the same row is the connected region in the same row as the first connected region;

[0088] S34, judging the intersection of the non-same row connected area and the previous row connected area according to the ternary array, and obtaining a first judgment result; the previous row connected area is the connected area of ​​the previous row of the non-same row connected area, and the intersection includes no intersection and intersection at x points, ;

[0089] Optionally, when the connected area in a different row satisfies the formula: , it is determined that the non-same row connected area intersects with the previous row connected area;

[0090] in, startCol cur Indicates the starting column number of the current non-peer connected area; endCol pre Indicates the end column number of the connected area in the previous row; endCol cur Indicates the end column number of the current non-connected area; startCol pre Indicates the starting column number of the connected area in the previous row; Row cur Indicates the row number of the current non-peer connected area; Row pre Indicates the row number of the connected region in the previous row.

[0091] S35, determining whether the third mark value corresponding to the non-in-line connected area is 0, and obtaining a second determination result;

[0092] S36, obtaining the third tag value according to the first judgment result and the second judgment result, and obtaining an equivalent pair corresponding to each tag value according to the first judgment result and the second judgment result, and storing the equivalent pair in an equivalent array;

[0093] As an optional implementation, in this embodiment, the following method is used to determine the third labeling number A and the value of the equivalent pair in the equivalent array.

[0094] 1) When the first judgment result is disjoint and the second judgment result is yes, the third mark value is Recorded as the maximum number of connected area markers plus 1;

[0095] Please refer to Figure 2 That is, if a connected area in the current row has no intersection with all connected areas in the previous row, and the number of marks corresponding to the connected area is not marked (the value is zero), then the value of the number of marks corresponding to the connected area is Recorded as the maximum number of connected area labels plus 1.

[0096] 2) When the first judgment result is that there is one intersection, and the second judgment result is yes, then the third mark value Recorded as the label value of the intersecting connected area in the previous row ; The intersecting connected regions in the previous row are the connected regions in the previous row that intersect with the current row;

[0097] Please refer to Figure 3 That is, if a connected area in the current row intersects with a connected area in the previous row, and the number of marks corresponding to the connected area is not marked, then the value of the number of marks corresponding to the connected area is recorded as the value of the number of marks of the connected area in the previous row. .

[0098] 3) When the first judgment result is that there is one intersection, and the second judgment result is no, then determine the third mark value Connected regions that intersect with the previous row are labeled with numerical values Are they equal? ​​If not, get the equivalent pair. , the equivalent pair Store into equivalent array E;

[0099] Please refer to Figure 4That is, if a connected area in the current row intersects with a connected area in the previous row, and the number of marks corresponding to the connected area has been marked, and the mark values ​​are not equal, then , then record the label values ​​of the two connected regions to form an equivalent pair , stored in the equivalent array E.

[0100] 4) When the first judgment result is that there are 2 or more intersections, and the second judgment result is yes, then the third mark value Recorded as the mark value of the first connected area in the previous row that intersects with the current row , and obtain the equivalent pair , the equivalent pair Store in equivalent array E; Mark the other connected regions in the previous row that intersect with the current row with numerical values, wherein the other connected regions are connected regions other than the first intersecting connected region. Not unique;

[0101] Please refer to Figure 5 That is, if a connected area in the current row intersects with two or more connected areas in the previous row, and the number of marks corresponding to the connected area is not marked, then the mark value corresponding to the connected area is recorded as the value of the mark number of the first intersecting connected area in the previous row. , and form an equivalent pair with other intersecting connected regions in the previous row , Etc., stored in equivalent array E.

[0102] 5) When the first judgment result is that there are 2 or more intersections, and the second judgment result is no, then determine the third mark value Are the values ​​of all connected regions that intersect in the previous row different? If so, obtain an equivalent pair , stored in the equivalent array E, the Mark the connected areas in the previous row that intersect with the connected areas in the current row. Not unique;

[0103] Please refer to Figure 6 That is, if a connected area in the current row intersects with two or more connected areas in the previous row, and the number of marks corresponding to the connected area has been marked, then the number of marks corresponding to the connected area and the number of marks corresponding to all intersecting connected areas in the previous row form an equivalent pair if the mark values ​​are not equal. , , Etc., stored in equivalent array E.

[0104] It should be noted that, except for the connected areas in the first row, the connected areas in each subsequent row perform operations 1)-5) with all the connected areas in the previous row, and finally form the marked number A and the equivalent array E.

[0105] S37, judging whether the equivalent array is zero, and obtaining a third judgment result, if the third judgment result is yes, then the tag value corresponding to the equivalent array is not modified;

[0106] S38, if the third judgment result is no, re-assigning the label number according to the equivalence list and the principle that the label values ​​of the connected regions with connectivity are the same; the equivalence list is composed of the equivalence array;

[0107] Optionally, the step S38 specifically includes:

[0108] S381, obtain the maximum element value in the tag number, establish an array F with the maximum element value as the size, and initialize the value of the array F to 0, and establish a new equivalent array with a value of zero ;

[0109] S382, for each equivalence pair in the equivalence array E, compare the sizes of the two values ​​in the equivalence pair, and place the smaller value in the first position of the equivalence pair and the larger value in the second position;

[0110] S383, sorting the equivalent pairs in the equivalent array to obtain an ordered equivalent array; when sorting, arranging in ascending order according to the values ​​of the first position in the equivalent pairs, and when the values ​​of the first position are equal, sorting in ascending order according to the values ​​of the second position in the equivalent pairs;

[0111] S384, removing duplicate equivalent pairs in the ordered equivalent array to obtain a deduplicated equivalent array;

[0112] S385, for each equivalent pair in the deduplicated equivalent array, determine whether the F arrays corresponding to the two values ​​of the equivalent pair are zero;

[0113] when and season , ;in, refers to the first value in the i-th equivalence pair, Refers to the second value in the i-th equivalence pair;

[0114] when and season ;

[0115] when and season ;

[0116] when and and When , record the new equivalent pair , stored in a new equivalent array ;

[0117] S386, according to the value of the array F, according to the condition Reassign the number of labels corresponding to the connected area;

[0118] S387, determine the new equivalent array Is it empty? If not, jump to step S381; if so, end.

[0119] S39, the connected areas corresponding to the number of marks with the same value after reassignment are combined into a new connected area.

[0120] S4. Calculate the number of pixels in each of the new connected regions.

[0121] Optionally, the S4 includes:

[0122] Calculate the difference between the end column number and the start column number of each row in the new connected area, and add 1 to the difference to obtain the number of pixels in each row of the new connected area;

[0123] The total number of pixels in the new connected area is calculated according to the number of pixels in each row of the new connected area.

[0124] Step S4 mainly counts the marker types in the connected region marker number A (i.e., the different element values ​​in A). Each marker type corresponds to a connected region in the remote sensing image consisting of pixel extreme values ​​0 or 255. It is a one-to-one correspondence. The number of pixels corresponding to a marker type is counted, that is, the sum of the difference between the end column number and the start column number of all row-connected regions in the ternary array corresponding to the marker is counted, that is, .

[0125] S5. Filter out the area where the number of pixels is greater than a set threshold from the new connected area to obtain the connected area of ​​the valid data coverage area, where the connected area of ​​the valid data coverage area is the area where the pixel extreme value is located.

[0126] After the number of pixels in all connected areas in the remote sensing image is counted, a threshold t is set to filter out connected areas with a number of pixels greater than the threshold t (that is, areas where the pixel value is 0 in the area covered by invalid image data). The remaining connected areas are areas where the pixel extreme values ​​0 or 255 appear in the area covered by valid image data. The coordinates of these connected areas are expressed in a ternary array. The position of the pixel extreme value 0 or 255 can be found.

[0127] Usually, the areas covered by valid data have pixel extreme values ​​of 0 or 255 which are scattered, while the areas covered by invalid data have pixel values ​​of 0 which are concentrated. Figure 7 The distribution diagram of the valid data area and the invalid data area is shown. The connected area detection method is used to find the position of the remote sensing image pixel extreme value 0 or 255. This embodiment first detects the connected area with pixel value 0 or 255 in the entire remote sensing image, and then filters out the relatively concentrated connected areas with pixel value 0 representing the invalid data coverage area, and the remaining ones are the connected areas with pixel extreme value 0 or 255 representing the valid data coverage area.

[0128] The conventional method for detecting the occurrence of pixel extreme values ​​0 or 255 in the effective data coverage area of ​​remote sensing images requires first finding the range lines of the effective data coverage area and the invalid data coverage area, and then finding the position where the pixel extreme value 0 or 255 appears within the range line of the effective data coverage area. This method requires reading the remote sensing image twice, and the amount of data of remote sensing images is usually large, which increases the time for reading data. The advantage of using this method is that there is no need to first distinguish between the effective data coverage area and the invalid data coverage area of ​​the remote sensing image, and the position where the pixel extreme value 0 or 255 appears in the effective data coverage area can be quickly detected by reading the image once.

[0129] In order to enable those skilled in the art to more clearly understand the remote sensing image pixel extreme value detection method provided by the present invention, an example is now provided for illustration.

[0130] See also Figure 8 , Figure 8 This is an image that needs to detect pixel extreme values. The numbers on the left and top of the figure are used to represent the row and column coordinates of the pixels. The shaded squares in the figure represent the pixels where the pixel extreme values ​​appear.

[0131] From top to bottom and from left to right, detect the row-connected regions that appear in each row, and use a three-element array to record the row number, starting column number, and ending column number of each row-connected region. The recorded results are as follows: Fig. 9 , the total number of row connected regions obtained at this time is 16.

[0132] For the connected area of ​​each row, start searching from the first pixel position in order from left to right. If the pixel value of at least one band of a certain pixel position is the pixel extreme value 0 or 255, continue to search whether the pixel value of at least one band of the right adjacent pixel position is the pixel extreme value 0 or 255. If so, continue to repeat the above search until the pixel values ​​of all bands of a certain right adjacent pixel position are not the pixel extreme value 0 or 255. At this time, the search for a row connected area is completed; then continue to search to the right pixel position until all pixel positions are searched.

[0133] For unified explanation, A[1], A[2], E[1], E[2], F[1], F[2], etc. that appear in the subsequent figures represent the element value at the position in the array.

[0134] Create a marker array A with a size of 16, and initialize the value of each marker in the marker array to 0 ( Fig.10 Part a of the above), the marked array and the connected areas of the ternary array are in one-to-one correspondence; establish an equivalent array E of size zero.

[0135] Then, starting from the first row connected region, record its mark number as A[1]=1, and then detect other connected regions in the same row, and record their mark number A[i] as the maximum mark number of the current connected region plus 1, such as Fig.12 For the three connected areas in gray in the second row, first record the number of connected areas corresponding to the (2,2,2) triple as A[1]=1, then continue to mark the connected areas in the same line, and record the number of connected areas of the (2,4,4) triple as A[2]=2 (the current maximum number of marks is 1 plus 1), then continue to mark the connected areas in the same line, and record the number of connected areas of the (2,6,6) triple as A[3]=3 (the current maximum number of marks is 2 plus 1).

[0136] Finally, the intersection relationship between the connected areas of the non-same row and its previous row is detected, and the marking numbers of the connected areas of the non-same row are assigned to form equivalent pairs and stored in the equivalent array E (see the patent specification for the principle). The equivalent pairs are (1,2), (1,3), (4,5), (4,6), (4,7), (7,8), and (1,8).

[0137] Fig.10 Part b is the result of the marking array A. The same number of markings indicates that the row-connected regions are connected, while the row-connected regions indicated by different number of markings are temporarily disconnected. It is necessary to search for an equivalent list for the equivalent array and reassign the number of markings to finally determine the connectivity relationship. Fig.11 The equivalent array is formed by the equivalent pairs, and the formed equivalent array includes 7 equivalent pairs; Fig.12This is the intuitive result after marking the connected areas in the image graph.

[0138] Process the equivalent array E, find the equivalent list in the equivalent array, and reassign the tag number A through the equivalent list. First, determine whether the size of the equivalent array E is zero. If it is zero, no processing is performed. If it is not zero, subsequent processing is performed. In this example, the size of the equivalent array is 7, and subsequent processing is continued.

[0139] Create an array F with the maximum element value in the marker number A as its size (the maximum element in the marker number A is 8 at this time), and initialize the value of F to 0. The result is as follows Fig.14 A part of the value; create a new equivalent array with value zero . Then compare the values ​​of the first position and the second position of each equivalent pair in the equivalent array E. The smaller value is placed in the first position and the larger value is placed in the second position. Then sort the equivalent pairs in the equivalent array in ascending order according to the value of the first position. If the values ​​of the first position are equal, they are sorted in ascending order according to the value of the second position. Finally, remove the duplicate equivalent pairs in the equivalent array.

[0140] In this example, the order of the two values ​​of the equivalent pair does not need to be processed, and there is no duplication of the equivalent pair, so only the sorting of the equivalent array is demonstrated. The processing of the equivalent array E is as follows Fig.13 .

[0141] The principle of assigning equivalent array E to array F is shown in the patent specification.

[0142] Take them in order Fig.13 The equivalent pairs (1,2), (1,3), and (1,8) in the equivalent array of part b are assigned to array F respectively. The results are as follows Fig.14 In this case, the tag values ​​1, 2, 3, and 8 form an equivalent list, indicating that the row-connected regions corresponding to the tag values ​​1, 2, 3, and 8 are connected to each other.

[0143] Next, take them in order Fig.13 The equivalent pairs (4,5), (4,6), and (4,7) in the equivalent array of part b are assigned to array F respectively. The result is as follows Fig.14 In the c part, the tag values ​​4, 5, 6, and 7 form an equivalent list, indicating that the row-connected regions corresponding to the tag values ​​4, 5, 6, and 7 are connected to each other.

[0144] Then follow the order Fig.13 The equivalent pair (7,8) in the equivalent array of part b is formed because F[7]!=0 and F[8]!=0 and F[7]!=F[8], so a new equivalent pair (F[7],F[8]) is formed, that is, the new equivalent pair (1,4), which is stored in the new equivalent array , the results are as follows Fig.15 .

[0145] With array F( Fig.14 Part c of the above example reassigns the number of markers A. According to the condition if(F[A[i]!=0), A[i]=F[A[i]], that is, when F[A[i]] is not equal to zero, A[i]=F[A[i]]. The reassigned number of markers A is as follows: Fig.16 Part c.

[0146] The assignment process is demonstrated by A[1]=F[A[1]]. A[1] represents the number of the mark at the first position in the mark array A, which is 1, that is, A[1]=1. At this time, F[A[1]] is F[1], and F[1] represents the value of the first position in the array F, which is 1, that is, F[1]=1. Finally, A[1]=F[A[1]]=F[1]=1, that is, the number of marks after reassignment is A[1]=1.

[0147] The assignment process is demonstrated by A[2]=F[A[2]]. A[2] represents the number of the mark at the second position in the mark array A, which is 2, that is, A[2]=2. At this time, F[A[2]] is F[2], and F[2] represents the value of the second position in the array F, which is 1, that is, F[2]=1. Finally, A[2]=F[A[2]]=F[2]=1, that is, the number of marks after reassignment is A[2]=1.

[0148] Since the new equivalent array The size of is not 0 (the size is 1 at this time), so the newly assigned marker number A ( Fig.16 c part) and the new equivalent array ( Fig.15 ), repeat the work of searching the equivalent list and reassigning the marked number.

[0149] Create an array F with the maximum element value in the marker number A as its size (the maximum element in the marker number A is 4 at this time), and initialize the value of F to 0. The result is as follows Fig.17 a part of the equivalent array; then create a new equivalent array with a value of zero. Then For each equivalence pair, the values ​​in the first position and the values ​​in the second position are compared. The smaller value is placed in the first position and the larger value is placed in the second position. Then sort the equivalence pairs in the equivalence array in ascending order according to the value in the first position. If the values ​​in the first position are equal, they are sorted in ascending order according to the value in the second position. Finally, duplicate equivalence pairs are removed. Equivalence array The processed results are as follows Fig.15 .

[0150] Take in order Fig.15The equivalent pairs (1,4) in the equivalent array. Assign values ​​to array F respectively, and the results are as follows Fig.17 In the b part, the tag values ​​1 and 4 now form an equivalent list, indicating that the row-connected regions corresponding to the tag values ​​1 and 4 in the reassigned identification array A are connected to each other.

[0151] With array F( Fig.17 Part b) Re-assign the number of markers A after the last re-assignment. According to the condition if(F[A[i]!=0), A[i]=F[A[i]], that is, when F[A[i]] is not equal to zero, A[i]=F[A[i]]. The re-assigned number of markers A is as follows: Fig.18 Part c.

[0152] Since no new equivalent pair is formed, the process of reassigning the label number A ends.

[0153] From the last reassigned tag number A ( Fig.18 Part c) We know that there is only one element 1 in the marker array, indicating that the new connected area formed by all the row connected areas in this example is a region, such as Fig.19 .

[0154] The subsequent counting of the number of pixels in the new connected area and the principle of filtering the connected area are shown in the manual. The number of pixels in the new connected area is S = (2-2+1) + (4-4+1) + (6-6+1) + (6-2+1) + ... + (17-2+1) = 40.

[0155] Example 2

[0156] This embodiment provides a remote sensing image pixel extreme value detection system, including:

[0157] The block division module M1 is used to divide the remote sensing image into blocks according to a preset number of lines, and read the image data into the computer memory in blocks;

[0158] The inspection module M2 is used to detect the connected area in each row of each image block; the connected area refers to the area where each pixel position has at least one band with a pixel extreme value of 0 or 255;

[0159] A merging module M3 is used to merge connected regions with connectivity to obtain a number of new connected regions;

[0160] A pixel number calculation module M4, used for calculating the number of pixels in each of the new connected areas;

[0161] The pixel extreme value region determination module M5 is used to filter out the region where the number of pixels is greater than a set threshold from the new connected region to obtain the connected region of the valid data coverage region, where the connected region of the valid data coverage region is the region where the pixel extreme value is located.

[0162] Optionally, the merging module M3 specifically includes:

[0163] A ternary array acquisition submodule M31 is used to acquire a ternary array of each connected region, wherein the ternary array includes a row number, a start column number, and an end column number;

[0164] The label array and equivalent array establishment submodule M32 is used to establish a label array with the total number of all the connected areas as the size, and initialize the value of each label number A in the label array to 0, each connected area corresponds to one label number, and establish an equivalent array E with a value of zero;

[0165] The same-line connected region acquisition submodule M33 is used to record the first tag value corresponding to the first connected region as , determine whether the other connected areas are connected areas in the same industry, and set the second mark value corresponding to the connected areas in the same industry Recorded as the maximum value of the number of connected region marks in the current state plus 1, the connected region in the same row is the connected region in the same row as the first connected region;

[0166] The first judgment submodule M34 is used to judge the intersection of the non-same row connected area and the previous row connected area according to the ternary array, and obtain a first judgment result; the previous row connected area is the connected area of ​​the previous row of the non-same row connected area, and the intersection includes no intersection and intersection at x points. ;

[0167] The second judgment submodule M35 is used to judge whether the third mark value corresponding to the non-in-line connected area is 0, and obtain a second judgment result;

[0168] A third tag array value acquisition submodule M36 is used to obtain the third tag value according to the first judgment result and the second judgment result, and obtain an equivalent pair corresponding to each tag number according to the first judgment result and the second judgment result, and store the equivalent pair in an equivalent array;

[0169] The third judgment submodule M37 is used to judge whether the equivalent array is zero, and obtain a third judgment result. If the third judgment result is yes, the tag value corresponding to the equivalent array is not modified;

[0170] A re-assignment submodule M38 is used for re-assigning the label number according to the equivalence list and the principle that the label values ​​of the connected regions with connectivity are the same if the third judgment result is no; the equivalence list is composed of the equivalence array;

[0171] The new connected region acquisition submodule M39 is used to combine the connected regions corresponding to the number of labels with the same re-assigned values ​​into a new connected region.

[0172] Optionally, the pixel number calculation module M4 specifically includes:

[0173] The difference calculation submodule M41 is used to calculate the difference between the end column number and the start column number of each row in the new connected area, and add 1 to the difference to obtain the number of pixels in each row of the new connected area;

[0174] The total pixel number calculation submodule M42 is used to calculate the total number of pixels in the new connected area according to the number of pixels in each row of the new connected area.

[0175] Optionally, when the connected area in a different row satisfies the formula: , it is determined that the non-same row connected area intersects with the previous row connected area;

[0176] in, startCol cur Indicates the starting column number of the current non-peer connected area; endCol pre Indicates the end column number of the connected area in the previous row; endCol cur Indicates the end column number of the current non-connected area; startCol pre Indicates the starting column number of the connected area in the previous row; Row cur Indicates the row number of the current non-peer connected area; Row pre Indicates the row number of the connected region in the previous row.

[0177] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0178] The principles and implementation methods of the present invention are described in this article using specific examples. The description of the above embodiments is only used to help understand the method and core idea of ​​the present invention. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A remote sensing image pixel extreme value detection method, characterized in that: include: Divide the remote sensing image into blocks according to the preset number of rows, and read the image data into the computer memory block by block; For each image, detect the connected area in each row; the connected area refers to the area where each pixel position has at least one band with a pixel extreme value of 0 or 255; The connected regions with connectivity are merged to obtain several new connected regions, including: Obtain a ternary array of each connected region, wherein the ternary array includes a row number, a start column number, and an end column number; Establishing a label array with the total number of all the connected areas as the size, and initializing the value of each label number A in the label array to 0, each connected area corresponds to one label number, and establishing an equivalent array E with a value of zero; The first mark value corresponding to the first connected area is recorded as A[1]=1, and it is determined whether other connected areas except the first connected area are connected areas in the same row, and the second mark value A[i] corresponding to the connected areas in the same row is recorded as the maximum value of the mark number of the current connected areas plus 1. The connected areas in the same row are connected areas in the same row as the first connected area; According to the ternary array, the intersection between the non-same row connected area and the previous row connected area is determined to obtain a first determination result; the previous row connected area is the connected area of ​​the previous row of the non-same row connected area, and the intersection includes no intersection and intersection at x points, x≥1; Determine whether the third mark value corresponding to the non-in-line connected area is 0, and obtain a second determination result; Obtain the third tag value according to the first judgment result and the second judgment result, and obtain an equivalent pair corresponding to each tag value according to the first judgment result and the second judgment result, and store the equivalent pair in an equivalent array; Determine whether the equivalent array is zero to obtain a third determination result, and if the third determination result is yes, do not modify the tag value corresponding to the equivalent array; If the third judgment result is no, re-assigning the label number according to the equivalence list and the principle that the label values ​​of the connected regions with connectivity are the same; the equivalence list is composed of the equivalence array; Combine the connected regions corresponding to the number of markers with the same reassigned values ​​into new connected regions; Calculating the number of pixels in each of the new connected regions; The area where the number of pixels is greater than a set threshold is filtered out from the new connected area to obtain the connected area of ​​the valid data coverage area, where the connected area of ​​the valid data coverage area is the area where the pixel extreme value is located.

2. The method according to claim 1, characterized in that The calculating the number of pixels in each of the new connected regions specifically includes: Calculate the difference between the end column number and the start column number of each row in the new connected area, and add 1 to the difference to obtain the number of pixels in each row of the new connected area; The total number of pixels in the new connected area is calculated according to the number of pixels in each row of the new connected area.

3. The method according to claim 1, characterized in that When the non-row connected area and the previous row connected area satisfy the formula: startCol cur ≤endCol pre +1&endCol cur ≥startCol pre -1&Row cur ==Row pre +1, it is determined that the connected area in a different row intersects with the connected area in the previous row; Among them, startCol cur Indicates the starting column number of the current non-connected area; endCol pre Indicates the end column number of the connected area in the previous row; endCol cur Indicates the end column number of the current non-connected area; startCol pre Indicates the starting column number of the connected area in the previous row; Row cur Indicates the row number of the current non-connected area; Row pre Indicates the row number of the connected region in the previous row.

4. The method according to claim 1, characterized in that: The step of obtaining the third tag value according to the first judgment result and the second judgment result, and obtaining an equivalent pair corresponding to each tag value according to the first judgment result and the second judgment result, and storing the equivalent pair in an equivalent array specifically includes: When the first judgment result is disjoint, and the second judgment result is yes, the third mark value A[j] is recorded as the maximum value of the number of marks of the current connected area plus 1; When the first judgment result is that there is one intersection, and the second judgment result is yes, the third mark value A[j] is recorded as the mark value A[a] of the connected area that intersects in the previous row; the connected area that intersects in the previous row is the connected area in the previous row that intersects with the current row; When the first judgment result is that there is one intersection, and the second judgment result is no, then determine whether the third mark value A[j] is equal to the mark value A[a] of the connected area that intersects in the previous row. If not, obtain an equivalent pair (A[a], A[j]), and store the equivalent pair (A[a], A[j]) in the equivalent array E; When the first judgment result is that there are two or more intersections, and the second judgment result is yes, the third mark value A[j] is recorded as the mark value A[z] of the first connected area in the previous row that intersects with the current row, and an equivalent pair (A[j], A[k]) is obtained, and the equivalent pair (A[j], A[k]) is stored in the equivalent array E; the A[k] is the mark value of other connected areas in the previous row that intersect with the current row, and the other connected areas are connected areas other than the first connected area that intersects with the current row, and the A[k] is not unique; When the first judgment result is that there are 2 or more intersections, and the second judgment result is no, then determine whether the third mark value A[j] is different from the mark values ​​of all intersecting connected areas in the previous row. If so, obtain an equivalent pair (A[j], A[t]), and store the equivalent pair (A[j], A[t]) in the equivalent array E, where A[t] is the mark value of the connected area in the previous row that intersects with the connected area in the current row, and A[t] is not unique.

5. The method according to claim 4, characterized in that The re-assigning of the marking number according to the equivalent list and the principle that the marking values ​​of the connected regions are the same specifically includes: Obtain the maximum element value in the marked number, establish an array F with the maximum element value as the size, and initialize the value of the array F to 0, and establish a new equivalent array E' with a value of zero; For each equivalence pair in the equivalence array E, compare the two values ​​in the equivalence pair, and put the smaller value in the first position of the equivalence pair and the larger value in the second position; Sorting the equivalent pairs in the equivalent array E to obtain an ordered equivalent array; when sorting, arranging in ascending order according to the values ​​of the first position in the equivalent pairs, and when the values ​​of the first position are equal, sorting in ascending order according to the values ​​of the second position in the equivalent pairs; Removing duplicate equivalent pairs in the ordered equivalent array to obtain a deduplicated equivalent array; For each equivalence pair in the deduplicated equivalence array, determining whether the F arrays corresponding to the two values ​​of the equivalence pair are zero; When F[E i,1 ]=0 and F[E i,2 ]=0, let F[E i,1 ]=E i,1 , F[E i,2 ]=E i,1 ; Among them, E i,1 refers to the first value in the i-th equivalence pair, E i,2 Refers to the second value in the i-th equivalence pair; When F[E i,1 ]≠0 and F[E i,2 ]=0, let F[E i,2 ]=F[E i,1 ]; When F[E i,1 ]=0 and F[E i,2 ]≠0, let F[E i,1 ]=F[E i,2 ]; When F[E i,1 ]≠0 and F[E i,2 ]≠0 and F[E i,1 ]≠F[E i,2 ], record the new equivalent pair (F[E i,1 ],F[E i,2 ]), store it into the new equivalent array E'; According to the value of the array F, the number of labels corresponding to the connected area is reassigned according to the condition if F[A[i]]≠0, A[i]=F[A[i]]; Determine whether the new equivalent array E' is empty. If not, jump to step "obtain the maximum element value in the tag number"; if yes, end.

6. A remote sensing image pixel extreme value detection system, characterized in that: include: A block division module is used to divide the remote sensing image into blocks according to a preset number of rows, and read the image data into the computer memory in blocks; A checking module is used to detect the connected area in each row of each image; the connected area refers to an area in which each pixel position in the area has at least one band with a pixel extreme value of 0 or 255; A merging module is used to merge connected regions with connectivity to obtain a number of new connected regions. The merging module specifically includes: A ternary array acquisition submodule, used to acquire a ternary array of each connected region, wherein the ternary array includes a row number, a start column number, and an end column number; The submodule for establishing the number of markers and equivalent array is used to establish a marker array with the total number of all the connected areas as the size, and initialize the value of each marker number A in the marker array to 0, so that each connected area corresponds to one marker number, and establish an equivalent array E with a value of zero; A submodule for obtaining connected regions in the same row, for recording a first mark value corresponding to a first connected region as A[1]=1, determining whether other connected regions are connected regions in the same row, recording a second mark value A[i] corresponding to the connected regions in the same row as the maximum mark value of the current connected regions plus 1, and the connected regions in the same row are connected regions in the same row as the first connected region; A first judgment submodule is used to judge the intersection of the non-same row connected area and the previous row connected area according to the ternary array, and obtain a first judgment result; the previous row connected area is the connected area of ​​the previous row of the non-same row connected area, and the intersection includes no intersection and intersection at x, x≥1; A second judgment submodule is used to judge whether the third mark value corresponding to the non-in-line connected area is 0, and obtain a second judgment result; a third tag array value acquisition submodule, configured to obtain the third tag value according to the first judgment result and the second judgment result, and obtain an equivalent pair corresponding to each tag number according to the first judgment result and the second judgment result, and store the equivalent pair in an equivalent array; A third judgment submodule is used to judge whether the equivalent array is zero, and obtain a third judgment result. If the third judgment result is yes, the mark value corresponding to the equivalent array is not modified; a re-assignment submodule, for re-assigning the tag number according to an equivalence list and the principle that the connected regions with connectivity have the same tag value if the third judgment result is no; the equivalence list is composed of the equivalence array; A new connected region acquisition submodule is used to combine connected regions corresponding to the number of markers with the same reassigned values ​​into a new connected region; A pixel number calculation module, used for calculating the number of pixels in each of the new connected areas; The pixel extreme value region determination module is used to filter out the region where the number of pixels is greater than a set threshold from the new connected region to obtain the connected region of the valid data coverage region, where the connected region of the valid data coverage region is the region where the pixel extreme value is located.

7. The system according to claim 6, characterized in that The pixel number calculation module specifically includes: A difference calculation submodule is used to calculate the difference between the end column number and the start column number of each row in the new connected area, and add 1 to the difference to obtain the number of pixels in each row of the new connected area; The total pixel number calculation submodule is used to calculate the total number of pixels in the new connected area according to the number of pixels in each row of the new connected area.

8. The system according to claim 6, characterized in that When the non-row connected area and the previous row connected area satisfy the formula: startCol cur ≤endCol pre +1&endCol cur ≥startCol pre -1&Row cur ==Row pre +1, it is determined that the connected area in a different row intersects with the connected area in the previous row; Among them, startCol cur Indicates the starting column number of the current non-connected area; endCol pre Indicates the end column number of the connected area in the previous row; endCol cur Indicates the end column number of the current non-connected area; startCol pre Indicates the starting column number of the connected area in the previous row; Row cur Indicates the row number of the current non-connected area; Row pre Indicates the row number of the connected region in the previous row.

Citation Information

Patent Citations

  • Connection flux statistical information extraction method and VLSI structure

    CN104680531A

  • Image detection method and device

    CN106846339A