CN113610940A - Ocean vector file and image channel threshold based coastal area color homogenizing method - Google Patents

Ocean vector file and image channel threshold based coastal area color homogenizing method Download PDF

Info

Publication number
CN113610940A
CN113610940A CN202110913115.XA CN202110913115A CN113610940A CN 113610940 A CN113610940 A CN 113610940A CN 202110913115 A CN202110913115 A CN 202110913115A CN 113610940 A CN113610940 A CN 113610940A
Authority
CN
China
Prior art keywords
image
ocean
pixel
sea
pixel value
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
CN202110913115.XA
Other languages
Chinese (zh)
Other versions
CN113610940B (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 CN202110913115.XA priority Critical patent/CN113610940B/en
Publication of CN113610940A publication Critical patent/CN113610940A/en
Application granted granted Critical
Publication of CN113610940B publication Critical patent/CN113610940B/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
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs
    • 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/10032Satellite or aerial image; Remote sensing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30181Earth observation
    • G06T2207/30184Infrastructure
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02ATECHNOLOGIES FOR ADAPTATION TO CLIMATE CHANGE
    • Y02A90/00Technologies having an indirect contribution to adaptation to climate change
    • Y02A90/10Information and communication technologies [ICT] supporting adaptation to climate change, e.g. for weather forecasting or climate simulation

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 a method for homogenizing color of a coastal area based on an ocean vector file and an image channel threshold value, S2, respectively carrying out pixel value aggregation statistics on n different optical channels of a continental template image near P, and acquiring n pixel ranges pixs (c) corresponding to the n different optical channels of the continental template image near P1,c2,...,cn). The method combines the vector file of Geographic Information (GIS) and the raster file of Remote Sensing (RS) images, breaks through the barrier of subdivision industry, solves the problems of low recognition rate, time and labor consumption of a single method, improves the accuracy of land and sea recognition, and improves the recognition of the traditional fixed threshold method by adopting a dynamic threshold methodThe invention fully automatically and respectively completes the automatic color-homogenizing function of land and coastal images, and improves the method that the conventional coastal area images are basically processed by hands in the later period.

Description

Ocean vector file and image channel threshold based coastal area color homogenizing method
Technical Field
The invention relates to the technical field of remote sensing image processing, in particular to a marine area color homogenizing method based on marine vector files and image channel thresholds.
Background
In the current technology for homogenizing the color of the coastal image, the main purpose of the design of the terrestrial optical satellite is to shoot the terrestrial image, and the difference between the seawater image shot by the terrestrial optical satellite and the terrestrial image (including inland river and lake water systems) is large due to the large difference between various physical and chemical characteristics of the seawater and the terrestrial resources;
the ocean vector diagram is a method for marking the conventional ocean boundary condition, and is related to the time, scale and the like of reference background data when the vector diagram is manufactured, but the time, resolution and even satellite angle of a shot image are different from the current reference background of the vector diagram, so that the judgment of the sea surface condition is inaccurate when the judgment is directly carried out only through the ocean vector diagram;
in addition, the existing method for homogenizing color of the coastal area generally comprises the steps of manually homogenizing the color of the coastal area in the image by image processing software, or identifying the ocean part of the coastal area based on a neural network training model, then homogenizing the color respectively,
meanwhile, the threshold method and the sea-land boundary detection method have the condition of low recognition rate, the image processing mode is manually carried out on the sea-facing area, the time and the labor are extremely consumed, a large amount of training data are needed for sea recognition of the sea-facing area based on the neural network, the training data needs a large amount of manpower for labeling, the time consumption is very large, the training data can be obtained only by a large amount of manpower and material resources, a large amount of operation resources are needed for training the model on the training data, the effect is strongly related to the training data, and the universality is poor. After the model training is assumed to be completed, the images are identified through neural network calculation, so that the identification is very slow, and the use scene is limited.
Aiming at the situations, a method for homogenizing color of the coastal area based on an ocean vector file and an image channel threshold is needed, a vector file of Geographic Information (GIS) and a raster file of a Remote Sensing (RS) image are combined, the barrier of subdivision industry is broken, the problems of low recognition rate, time consumption and labor consumption of a single method are solved, the accuracy of land and sea recognition is improved, a dynamic threshold method is adopted, the recognition rate of a traditional fixed threshold method is improved, the method fully automatically and respectively completes the automatic color homogenizing function of land and coastal images, the cost is low, the performance is good, parallel operation can be conveniently carried out, and the method that the existing coastal area image is basically processed in a post-processing mode by hands is improved.
Disclosure of Invention
The invention aims to provide a method for homogenizing the color of an offshore area based on an ocean vector file and an image channel threshold value, so as to solve the problems in the background technology.
In order to solve the technical problems, the invention provides the following technical scheme: a method for leveling colors of an offshore area based on an ocean vector file and an image channel threshold comprises the following steps:
s1, acquiring original data, namely a continental template image and a sea vector file of a sea image near a sea image P, P;
s2, respectively carrying out pixel value aggregation statistics on n different optical channels of the continental template image near P to obtain n pixel ranges pixs (c) corresponding to the n different optical channels of the continental template image near P1,c2,...,cn),
C is mentionednIs the pixel range of the nth light in the continental template image near P,
the aggregation statistics is that each pixel value is traversed, and the number of the pixel values is counted;
s3, Pixs (c) obtained in step S21,c2,...,cn) Analyzing n different optical channels of the coastal image to obtain an image ocean identification mask Ar
S4, reading the ocean vector file of the coastal image, rasterizing the ocean vector file of the coastal image into a pixel image, and giving pixel values of ocean areas in the pixel image AS 0 and pixel values of other areas AS 1 to obtain an ocean vector mask AS;
s5, directly multiplying the image ocean identification mask and the ocean vector mask to obtain the final ocean identification mask AmI.e. Am=Ar*AS;
And S6, multiplying the ocean identification mask and the near-sea image to distinguish the ocean part and the land part of the near-sea image, and then homogenizing the ocean part and the land part of the near-sea image.
In n different optical channels, n is more than or equal to 1, and light in the different optical channels can be visible light of different wave bands or invisible light of all wave bands.
Further, in step S2, the pixel value aggregation statistics is performed on n different optical channels of the continental template image near P, which further includes the following steps: obtaining the pixel value distribution maps of n different optical channels according to the pixel value aggregation statistical result, and respectively representing as res _ c1、res_c2、...、res_cnRes _ c, the saidnAnd the pixel value distribution diagram comprises each pixel value and the corresponding number of the pixel values under a certain visible light channel.
Further, n different optical channels of the continental template image near P obtained in the step 2 correspond to n pixel ranges pixs (c)1,c2,...,cn) The method comprises the following steps:
s2.1, recording the number of the continental template images near P as a, and respectively obtaining peak pixels Max (res _ c) of pixel value distribution maps of n different optical channels of each continental template image near P1)、Max(res_c2)、...、Max(res_cn) The peak pixel is the pixel value with the most number of the same pixel values in the pixel value distribution diagram corresponding to a certain visible light channel,
s2.2, adding peak pixels of the same channel in the continental template images near each P, and averaging to obtain the median pixs1 (c) of the range of n pixels corresponding to n different optical channels 11,c 21,...,cn1) C to c ofn1 represents the pixel model corresponding to the nth optical channelThe value of the circumference median is,
namely, it is
Figure BDA0003204592440000031
I represents the ith continental template image near P, a is the number of the continental template images near P,
namely, it is
Figure BDA0003204592440000032
Figure BDA0003204592440000033
...
Figure BDA0003204592440000034
S2.3, obtaining the median pixs1 of the range of n pixels corresponding to n different optical channels (c)11,c 21,...,cn1) Then, setting dynamic pixel ranges 2d and m1, and further obtaining n pixel ranges pixs (c) corresponding to n different optical channels of the continental template image near P1,c2,...,cn),
C is mentioned1Corresponding pixel range is c1-m1≤c1≤c1+ m2, and m2 ═ 2d-m 1;
c is mentioned2Corresponding pixel range is c2-m1≤c2≤c2+ m2, and m2 ═ 2d-m 1;
...
c is mentionednCorresponding pixel range is cn-m1≤cn≤cn+ m2, and m2 ═ 2d-m1, where m1 and m2 are both positive numbers.
The invention obtains n different optical channels of continental template images near P corresponding to n pixel ranges pixs (c)1,c2,...,cn) The dynamic threshold method is adopted instead of the traditional threshold method, because the threshold value of the traditional threshold method is determined by a fixed area or some empirical values, the stability is poorThe method is characterized in that a dynamic threshold method is adopted, for each target image, the nearest neighbor is found, a threshold value is extracted according to the nearest neighbor, and after peak pixels of channels of all land images adjacent to the marine image are extracted, the average value is recorded as pixs1 (c)11,c 21,...,cn1) Compared with the traditional threshold method, the method has higher identification degree and stability. The dynamic pixel range is set for limiting the recognition degree of the pixels, and is generally set according to empirical values, so that the recognition rate is low when the range is high. Typically 20.
Further, in the step S3, n different optical channels of the ocean image are analyzed to obtain the image ocean identification mask arThe method comprises the following steps:
s3.1, obtaining pixs (c) obtained in step S21,c2,...,cn);
S3.2, separating n different optical channels of the sea-facing image, and traversing the pixel value of each channel;
s3.3, respectively judging each pixel and c in the first optical channel1If the pixel value is in c1In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values1
Respectively judging each pixel and c in the second optical channel2If the pixel value is in c2In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values2
...
Respectively judging each pixel and c in the nth optical channelnIf the pixel value is in cnIn, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 valuesn
S3.4, converting A in the step S3.31、A2、...、AnMultiplying the values of the corresponding positions of the n masks to obtain the final mask Ar1=A1*A2*...*AnFinal mask Ar1Is single-channel black and whiteImaging results;
s3.5, setting the area with the largest white block area in the step S3.4 as 0 and setting other areas as 1 to obtain the image ocean identification mask Ar
In step S3, n different optical channels of the coastal image are analyzed to obtain corresponding masks, and then the n masks are multiplied to obtain an image ocean identification mask, which can distinguish ocean and land parts in the coastal image to a certain extent.
Further, the method for rasterizing the ocean vector file of the coastal image into the pixel image in the step S4 includes the following steps:
s4.1, expressing the point coordinates in the vector data of the ocean vector file of the ocean image by X, Y, and expressing the row and column numbers of the pixels in the raster data by I, J;
s4.2, setting O as the coordinate origin of the vector data and O '(Xo, Yo) as the coordinate origin of the grid data, namely, the coordinate origin 0 of the vector data is superposed with the coordinate origin O' of the grid data;
s4.3, k is any point on the pixel diagram to be converted, coordinates of the point in vector data and grid data can be respectively expressed as (X, Y) and (I, J), DX and DY respectively express the width and height of a grid, and [ ] expresses the value rounding;
s4.4, substituting (X, Y) corresponding to the k point in the vector data into a conversion formula
Figure BDA0003204592440000051
And obtaining coordinates (I, J) of the k point in the raster data, and further obtaining a pixel image of the sea vector file of the sea image after rasterization.
The ocean vector mask is obtained by the method, because the pixel range obtained by a dynamic threshold method is an empirical value, the ocean range cannot be recognized in hundreds, the accuracy is improved by adding the existing ocean vector diagram, the vector file is generally earlier than the obtaining time of the existing image because the making time is generally longer, and the hydrological line of the ocean is changed all the time because of the influence of a plurality of factors, so that the land and the ocean cannot be accurately separated by the vector file alone, and the two methods are required to be combined for analysis.
Further, the method for distinguishing the sea part and the land part of the sea-facing image in step S6 is as follows:
the sea part for distinguishing the coastal image
Figure BDA0003204592440000052
The land part for distinguishing the sea-facing image
Figure BDA0003204592440000053
-AmIs to identify the ocean as a maskmThe number of 0's in (1) and the number of 1's in (0) are changed to obtain a new mask.
When the land part in the coastal image is distinguished, the ocean identification mask A is used for identifying the oceanmThe transformation is performed to make the difference between the sea and land parts in the near-sea image more distinct.
Further, the algorithm f for leveling the ocean part and the land part of the coastal image in the step S6 includes the following steps:
s6.1, respectively calculating histograms of a template image and an image to be processed, and respectively counting the distribution proportion of pixel values on 0-255, wherein the template image is a sea part and a land part in the sea image, and the image to be processed is p corresponding to the sea part in the sea imagesP corresponding to land portion in sea-facing imagel
S6.2, respectively calculating absolute values of distribution ratio differences corresponding to each pixel value in the image to be processed and distribution ratio differences corresponding to 256 pixel values in the template image to obtain 256 difference values, wherein the 256 difference values form a difference value table corresponding to the pixel value in the image to be processed, and the 256 difference value tables are obtained when the pixel values in the image to be processed have 256 conditions;
s6.3, respectively screening out a pixel value h corresponding to the minimum value in the difference table corresponding to each pixel value in the template image and a pixel value q corresponding to the pixel value in the image to be processed from small to large according to the sequence of the pixel values in the image to be processed, marking as (q, h), summarizing all the screened (q, h), and generating a lookup table;
6.4, traversing each pixel value in the image to be processed, and replacing the pixel value q in the image to be processed with h by referring to the lookup table;
i.e. the result after the even color is carried out on the ocean part of the sea-facing image
Figure BDA0003204592440000061
Said p issn is the pixel value condition of the nth optical channel before the color homogenization of the ocean part of the distinguished near-sea image, and f (p)sn) is the pixel value condition of the nth optical channel after the color of the ocean part of the distinguished near-sea image is homogenized,
the land part of the sea image is homogenized
Figure BDA0003204592440000062
Said p isln is the pixel value condition of the nth optical channel before the land part of the distinguished sea-facing image is homogenized, and f (p)ln) is the pixel value condition of the nth optical channel after the land part of the distinguished sea-facing image is homogenized,
after the ocean part and the land part of the sea-facing image are homogenized, the ocean part and the land part are combined to obtain a final color homogenizing result v3 of the sea-facing image, namely
Figure BDA0003204592440000063
Compared with the prior art, the invention has the following beneficial effects:
the method combines the vector file of Geographic Information (GIS) and the raster file of Remote Sensing (RS) image, breaks the barrier of subdivision industry, solves the problems of low recognition rate, time and labor consumption of a single method, and improves the accuracy of land and sea recognition;
secondly, the invention adopts a dynamic threshold value method, and improves the recognition rate of the traditional fixed threshold value method;
the pixel resolution of the image is obtained by reading the raster information of the image to be processed, the pixel resolution is converted into a corresponding scale of the vector file, and then the vector file is rasterized and binarized under the scale, so that the problem of unification of files with different formats in two different subdivision industries is solved;
the invention fully automatically and respectively completes the automatic color-homogenizing function of land and coastal images, has low cost and good performance, can also conveniently carry out parallel operation, and improves the method that the current coastal area images are basically processed by hands in the later period.
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 schematic flow chart of a method for smoothing color in a coastal area based on an ocean vector file and an image channel threshold value according to the present invention;
FIG. 2 is a chart of an image ocean identification mask A obtained in the ocean current region color homogenizing method based on ocean vector files and image channel threshold valuesrA schematic flow diagram of the method of (1);
fig. 3 is a schematic flow chart of the method for rasterizing the ocean vector file of the ocean image into a pixel image in step S4 of the method for smoothing the color of the ocean current region based on the ocean vector file and the image channel threshold value.
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: a method for leveling colors of an offshore area based on an ocean vector file and an image channel threshold comprises the following steps:
s1, acquiring original data, namely a continental template image and a sea vector file of a sea image near a sea image P, P;
s2, respectively carrying out pixel value aggregation statistics on n different optical channels of the continental template image near P to obtain n pixel ranges pixs (c) corresponding to the n different optical channels of the continental template image near P1,c2,...,cn),
C is mentionednIs the pixel range of the nth light in the continental template image near P,
the aggregation statistics is that each pixel value is traversed, and the number of the pixel values is counted;
s3, Pixs (c) obtained in step S21,c2,...,cn) Analyzing n different optical channels of the coastal image to obtain an image ocean identification mask Ar
S4, reading the ocean vector file of the coastal image, rasterizing the ocean vector file of the coastal image into a pixel image, and giving pixel values of ocean areas in the pixel image AS 0 and pixel values of other areas AS 1 to obtain an ocean vector mask AS;
s5, directly multiplying the image ocean identification mask and the ocean vector mask to obtain the final ocean identification mask AmI.e. Am=Ar*AS;
And S6, multiplying the ocean identification mask and the near-sea image to distinguish the ocean part and the land part of the near-sea image, and then homogenizing the ocean part and the land part of the near-sea image.
In this embodiment, a green band of visible light and an infrared band of invisible light are used.
In step S2, performing pixel value aggregation statistics on n different optical channels of the continental template image near P, further including the following steps: obtaining the pixel value distribution maps of n different optical channels according to the pixel value aggregation statistical result, and respectively representing as res _ c1、res_c2、...、res_cnRes _ c, the saidnThe pixel value distribution diagram of the nth optical channel comprises each pixel value and pair under a certain visible light channelThe number of such elements.
In this embodiment, if the number of occurrences of the pixel value 25 in the aggregation statistics is 1000, the value corresponding to the pixel value 25 in the pixel value distribution map is 1000.
In the step 2, n different optical channels of the continental template image near P corresponding to n pixel ranges pixs (c)1,c2,...,cn) The method comprises the following steps:
s2.1, recording the number of the continental template images near P as a, and respectively obtaining peak pixels Max (res _ c) of pixel value distribution maps of n different optical channels of each continental template image near P1)、Max(res_c2)、...、Max(res_cn) The peak pixel is the pixel value with the most number of the same pixel values in the pixel value distribution diagram corresponding to a certain visible light channel,
s2.2, adding peak pixels of the same channel in the continental template images near each P, and averaging to obtain the median pixs1 (c) of the range of n pixels corresponding to n different optical channels 11,c 21,...,cn1) C to c ofn1 represents the median value of the pixel range corresponding to the nth optical channel,
namely, it is
Figure BDA0003204592440000081
I represents the ith continental template image near P, a is the number of the continental template images near P,
namely, it is
Figure BDA0003204592440000082
Figure BDA0003204592440000083
...
Figure BDA0003204592440000084
S2.3, obtaining n different optical channel pairsThe median pixs1 (c) should be in the range of n image elements 11,c 21,...,cn1) Then, setting dynamic pixel ranges 2d and m1, and further obtaining n pixel ranges pixs (c) corresponding to n different optical channels of the continental template image near P1,c2,...,cn),
C is mentioned1Corresponding pixel range is c1-m1≤c1≤c1+ m2, and m2 ═ 2d-m 1;
c is mentioned2Corresponding pixel range is c2-m1≤c2≤c2+ m2, and m2 ═ 2d-m 1;
...
c is mentionednCorresponding pixel range is cn-m1≤cn≤cn+ m2, and m2 ═ 2d-m1, where m1 and m2 are both positive numbers.
The invention obtains n different optical channels of continental template images near P corresponding to n pixel ranges pixs (c)1,c2,...,cn) The dynamic threshold method is adopted instead of the traditional threshold method, because the threshold value of the traditional threshold method is determined by a fixed area or some empirical values, the stability is poor, high human errors exist, the effect in some places is good, and the effect in some places is not good, the dynamic threshold method is adopted, for each target image, the nearest neighbor is found, the threshold value is extracted according to the nearest neighbor, the peak value pixel of each land image channel adjacent to the sea image is extracted, and then the average value is taken and recorded as pixs1 (c)11,c 21,...,cn1) Compared with the traditional threshold method, the method has higher identification degree and stability. The dynamic pixel range is set for limiting the recognition degree of the pixels, and is generally set according to empirical values, so that the recognition rate is low when the range is high. Typically 20.
In the step S3, n different optical channels of the ocean image are analyzed to obtain an image ocean identification mask arThe method comprises the following steps:
s3.1, obtaining pixs (c) obtained in step S21,c2,...,cn);
S3.2, separating n different optical channels of the sea-facing image, and traversing the pixel value of each channel;
s3.3, respectively judging each pixel and c in the first optical channel1If the pixel value is in c1In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values1
Respectively judging each pixel and c in the second optical channel2If the pixel value is in c2In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values2
...
Respectively judging each pixel and c in the nth optical channelnIf the pixel value is in cnIn, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 valuesn
S3.4, converting A in the step S3.31、A2、...、AnMultiplying the values of the corresponding positions of the n masks to obtain the final mask Ar1=A1*A2*...*AnFinal mask Ar1Is a single-channel black-and-white image result;
s3.5, setting the area with the largest white block area in the step S3.4 as 0 and setting other areas as 1 to obtain the image ocean identification mask Ar
In step S3, n different optical channels of the coastal image are analyzed to obtain corresponding masks, and then the n masks are multiplied to obtain an image ocean identification mask, which can distinguish ocean and land parts in the coastal image to a certain extent. Taking the red channel as an example, usually most of the pel values of land will be within the peak range of land, which is assumed here to be between 25-45, while those of sea will tend to be much larger than 45, possibly 90-120, and most of the pel values will tend to be out of range.
The method for rasterizing the ocean vector file of the coastal image into the pixel image in the step S4 comprises the following steps:
s4.1, expressing the point coordinates in the vector data of the ocean vector file of the ocean image by X, Y, and expressing the row and column numbers of the pixels in the raster data by I, J;
s4.2, setting O as the coordinate origin of the vector data and O '(Xo, Yo) as the coordinate origin of the grid data, namely, the coordinate origin 0 of the vector data is superposed with the coordinate origin O' of the grid data;
s4.3, k is any point on the pixel diagram to be converted, coordinates of the point in vector data and grid data can be respectively expressed as (X, Y) and (I, J), DX and DY respectively express the width and height of a grid, and [ ] expresses the value rounding;
s4.4, substituting (X, Y) corresponding to the k point in the vector data into a conversion formula
Figure BDA0003204592440000101
And obtaining coordinates (I, J) of the k point in the raster data, and further obtaining a pixel image of the sea vector file of the sea image after rasterization.
The ocean vector mask is obtained by the method, because the pixel range obtained by a dynamic threshold method is an empirical value, the ocean range cannot be recognized in hundreds, the accuracy is improved by adding the existing ocean vector diagram, the vector file is generally earlier than the obtaining time of the existing image because the making time is generally longer, and the hydrological line of the ocean is changed all the time because of the influence of a plurality of factors, so that the land and the ocean cannot be accurately separated by the vector file alone, and the two methods are required to be combined for analysis.
Further, the method for distinguishing the sea part and the land part of the sea-facing image in step S6 is as follows:
the sea part for distinguishing the coastal image
Figure BDA0003204592440000102
The land part for distinguishing the sea-facing image
Figure BDA0003204592440000103
-AmIs to identify the ocean as a maskmThe number of 0's in (1) and the number of 1's in (0) are changed to obtain a new mask.
When the land part in the coastal image is distinguished, the ocean identification mask A is used for identifying the oceanmThe transformation is performed to make the difference between the sea and land parts in the near-sea image more distinct.
The algorithm f for leveling the ocean part and the land part of the coastal image in the step S6 includes the following steps:
s6.1, respectively calculating histograms of a template image and an image to be processed, and respectively counting the distribution proportion of pixel values on 0-255, wherein the template image is a sea part and a land part in the sea image, and the image to be processed is p corresponding to the sea part in the sea imagesP corresponding to land portion in sea-facing imagel
S6.2, respectively calculating absolute values of distribution ratio differences corresponding to each pixel value in the image to be processed and distribution ratio differences corresponding to 256 pixel values in the template image to obtain 256 difference values, wherein the 256 difference values form a difference value table corresponding to the pixel value in the image to be processed, and the 256 difference value tables are obtained when the pixel values in the image to be processed have 256 conditions;
s6.3, respectively screening out a pixel value h corresponding to the minimum value in the difference table corresponding to each pixel value in the template image and a pixel value q corresponding to the pixel value in the image to be processed from small to large according to the sequence of the pixel values in the image to be processed, marking as (q, h), summarizing all the screened (q, h), and generating a lookup table;
6.4, traversing each pixel value in the image to be processed, and replacing the pixel value q in the image to be processed with h by referring to the lookup table;
i.e. the result after the even color is carried out on the ocean part of the sea-facing image
Figure BDA0003204592440000111
Said p issn is the pixel value condition of the nth optical channel before the color homogenization of the ocean part of the distinguished near-sea image, and f (p)sn) is the pixel value condition of the nth optical channel after the color of the ocean part of the distinguished near-sea image is homogenized,
knot after land part of sea-facing image is homogenizedFruit
Figure BDA0003204592440000112
Said p isln is the pixel value condition of the nth optical channel before the land part of the distinguished sea-facing image is homogenized, and f (p)ln) is the pixel value condition of the nth optical channel after the land part of the distinguished sea-facing image is homogenized,
after the ocean part and the land part of the sea-facing image are homogenized, the ocean part and the land part are combined to obtain a final color homogenizing result v3 of the sea-facing image, namely
Figure BDA0003204592440000113
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 (7)

1. A method for smoothing colors of an offshore area based on an ocean vector file and an image channel threshold is characterized by comprising the following steps:
s1, acquiring original data, namely a continental template image and a sea vector file of a sea image near a sea image P, P;
s2, respectively carrying out pixel value aggregation statistics on n different optical channels of the continental template image near P to obtain n pixel ranges pixs (c) corresponding to the n different optical channels of the continental template image near P1,c2,...,cn),
C is mentionednIs the pixel range of the nth light in the continental template image near P,
the aggregation statistics is that each pixel value is traversed, and the number of the pixel values is counted;
s3, Pixs (c) obtained in step S21,c2,...,cn) Analyzing n different optical channels of the coastal image to obtain an image ocean identification mask Ar
S4, reading the ocean vector file of the coastal image, rasterizing the ocean vector file of the coastal image into a pixel image, and giving pixel values of ocean areas in the pixel image AS 0 and pixel values of other areas AS 1 to obtain an ocean vector mask AS;
s5, directly multiplying the image ocean identification mask and the ocean vector mask to obtain the final ocean identification mask AmI.e. Am=Ar*AS;
And S6, multiplying the ocean identification mask and the near-sea image to distinguish the ocean part and the land part of the near-sea image, and then homogenizing the ocean part and the land part of the near-sea image.
2. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold value as claimed in claim 1, wherein: in step S2, performing pixel value aggregation statistics on n different optical channels of the continental template image near P, further including the following steps: obtaining the pixel value distribution maps of n different optical channels according to the pixel value aggregation statistical result, and respectively representing as res _ c1、res_c2、...、res_cnRes _ c, the saidnAnd the pixel value distribution diagram comprises each pixel value and the corresponding number of the pixel values under a certain visible light channel.
3. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold as claimed in claim 2, wherein: in the step 2, n different optical channels of the continental template image near P corresponding to n pixel ranges pixs (c)1,c2,...,cn) The method comprises the following steps:
s2.1, recording the number of the continental template images near P as a, and respectively obtaining peak pixels Max (res _ c) of pixel value distribution maps of n different optical channels of each continental template image near P1)、Max(res_c2)、...、Max(res_cn) The peak pixel is the pixel value with the most number of the same pixel values in the pixel value distribution diagram corresponding to a certain visible light channel,
s2.2, adding peak pixels of the same channel in the continental template images near each P, and averaging to obtain the median pixs1 (c) of the range of n pixels corresponding to n different optical channels11,c21,...,cn1) C to c ofn1 represents the median value of the pixel range corresponding to the nth optical channel,
namely, it is
Figure FDA0003204592430000021
I represents the ith continental template image near P, a is the number of the continental template images near P,
namely, it is
Figure FDA0003204592430000022
Figure FDA0003204592430000023
...
Figure FDA0003204592430000024
S2.3, obtaining the median pixs1 of the range of n pixels corresponding to n different optical channels (c)11,c21,...,cn1) Then, setting dynamic pixel ranges 2d and m1, and further obtaining n pixel ranges pixs (c) corresponding to n different optical channels of the continental template image near P1,c2,...,cn),
C is mentioned1Corresponding pixel range is c1-m1≤c1≤c1+ m2, and m2 ═ 2d-m 1;
c is mentioned2Corresponding pixel range is c2-m1≤c2≤c2+ m2, and m2 ═ 2d-m 1;
...
c is mentionednCorresponding pixel range is cn-m1≤cn≤cn+ m2, and m2 ═ 2d-m1, where m1 and m2 are both positive numbers.
4. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold value as claimed in claim 1, wherein: in the step S3, n different optical channels of the ocean image are analyzed to obtain an image ocean identification mask arThe method comprises the following steps:
s3.1, obtaining pixs (c) obtained in step S21,c2,...,cn);
S3.2, separating n different optical channels of the sea-facing image, and traversing the pixel value of each channel;
s3.3, respectively judging each pixel and c in the first optical channel1If the pixel value is in c1In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values1
Respectively judging each pixel and c in the second optical channel2If the pixel value is in c2In, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 values2
...
Respectively judging each pixel and c in the nth optical channelnIf the pixel value is in cnIn, 255 is generated, otherwise 0 is generated, resulting in mask A containing only 0 and 255 valuesn
S3.4, converting A in the step S3.31、A2、...、AnMultiplying the values of the corresponding positions of the n masks to obtain the final mask Ar1=A1*A2*...*AnFinal mask Ar1Is a single-channel black-and-white image result;
s3.5, setting the area with the largest white block area in the step S3.4 as 0 and setting other areas as 1 to obtain the image ocean identification mask Ar
5. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold value as claimed in claim 1, wherein: the method for rasterizing the ocean vector file of the coastal image into the pixel image in the step S4 comprises the following steps:
s4.1, expressing the point coordinates in the vector data of the ocean vector file of the ocean image by X, Y, and expressing the row and column numbers of the pixels in the raster data by I, J;
s4.2, setting O as the coordinate origin of the vector data and O '(Xo, Yo) as the coordinate origin of the grid data, namely, the coordinate origin 0 of the vector data is superposed with the coordinate origin O' of the grid data;
s4.3, k is any point on the pixel diagram to be converted, coordinates of the point in vector data and grid data can be respectively expressed as (X, Y) and (I, J), DX and DY respectively express the width and height of a grid, and [ ] expresses the value rounding;
s4.4, substituting (X, Y) corresponding to the k point in the vector data into a conversion formula
Figure FDA0003204592430000031
And obtaining coordinates (I, J) of the k point in the raster data, and further obtaining a pixel image of the sea vector file of the sea image after rasterization.
6. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold value as claimed in claim 1, wherein: the method for distinguishing the sea part and the land part of the near-sea image in the step S6 is as follows:
the sea part for distinguishing the coastal image
Figure FDA0003204592430000032
The land part for distinguishing the sea-facing image
Figure FDA0003204592430000041
-AmIs to identify the ocean as a maskmThe number of 0's in (1) and the number of 1's in (0) are changed to obtain a new mask.
7. The method for smoothing the color of the coastal area based on the ocean vector file and the image channel threshold value as claimed in claim 1, wherein: the algorithm f for leveling the ocean part and the land part of the coastal image in the step S6 includes the following steps:
s6.1, respectively calculating histograms of a template image and an image to be processed, and respectively counting the distribution proportion of pixel values on 0-255, wherein the template image is a sea part and a land part in the sea image, and the image to be processed is p corresponding to the sea part in the sea imagesP corresponding to land portion in sea-facing imagel
S6.2, respectively calculating absolute values of distribution ratio differences corresponding to each pixel value in the image to be processed and distribution ratio differences corresponding to 256 pixel values in the template image to obtain 256 difference values, wherein the 256 difference values form a difference value table corresponding to the pixel value in the image to be processed, and the 256 difference value tables are obtained when the pixel values in the image to be processed have 256 conditions;
s6.3, respectively screening out a pixel value h corresponding to the minimum value in the difference table corresponding to each pixel value in the template image and a pixel value q corresponding to the pixel value in the image to be processed from small to large according to the sequence of the pixel values in the image to be processed, marking as (q, h), summarizing all the screened (q, h), and generating a lookup table;
6.4, traversing each pixel value in the image to be processed, and replacing the pixel value q in the image to be processed with h by referring to the lookup table;
i.e. the result after the even color is carried out on the ocean part of the sea-facing image
Figure FDA0003204592430000042
Said p issn is the pixel value condition of the nth optical channel before the color homogenization of the ocean part of the distinguished near-sea image, and f (p)sn) is the pixel value condition of the nth optical channel after the color of the ocean part of the distinguished near-sea image is homogenized,
the land part of the sea image is homogenized
Figure FDA0003204592430000043
Said p isln is the pixel value condition of the nth optical channel before the land part of the distinguished sea-facing image is homogenized, and f (p)ln) is the pixel value condition of the nth optical channel after the land part of the distinguished sea-facing image is homogenized,
after the ocean part and the land part of the sea-facing image are homogenized, the ocean part and the land part are combined to obtain a final color homogenizing result v3 of the sea-facing image, namely
Figure FDA0003204592430000051
CN202110913115.XA 2021-08-10 2021-08-10 Ocean vector file and image channel threshold based coastal area color homogenizing method Active CN113610940B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110913115.XA CN113610940B (en) 2021-08-10 2021-08-10 Ocean vector file and image channel threshold based coastal area color homogenizing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110913115.XA CN113610940B (en) 2021-08-10 2021-08-10 Ocean vector file and image channel threshold based coastal area color homogenizing method

Publications (2)

Publication Number Publication Date
CN113610940A true CN113610940A (en) 2021-11-05
CN113610940B CN113610940B (en) 2022-06-07

Family

ID=78307911

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110913115.XA Active CN113610940B (en) 2021-08-10 2021-08-10 Ocean vector file and image channel threshold based coastal area color homogenizing method

Country Status (1)

Country Link
CN (1) CN113610940B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840761A (en) * 2023-03-01 2023-03-24 自然资源部第三地理信息制图院 Satellite image pixel value modification method, system, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463166A (en) * 2014-11-13 2015-03-25 环境保护部卫星环境应用中心 Extraction method and system for target water body
CN108230376A (en) * 2016-12-30 2018-06-29 北京市商汤科技开发有限公司 Remote sensing image processing method, device and electronic equipment
US20190171862A1 (en) * 2017-12-05 2019-06-06 Transport Planning and Research Institute Ministry of Transport Method of extracting image of port wharf through multispectral interpretation
CN111027446A (en) * 2019-12-04 2020-04-17 中国地质环境监测院 Coastline automatic extraction method of high-resolution image
US20210004964A1 (en) * 2018-04-05 2021-01-07 Nec Corporation Image processing device, image processing method, and recording medium having image processing program stored thereon

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104463166A (en) * 2014-11-13 2015-03-25 环境保护部卫星环境应用中心 Extraction method and system for target water body
CN108230376A (en) * 2016-12-30 2018-06-29 北京市商汤科技开发有限公司 Remote sensing image processing method, device and electronic equipment
US20190171862A1 (en) * 2017-12-05 2019-06-06 Transport Planning and Research Institute Ministry of Transport Method of extracting image of port wharf through multispectral interpretation
US20210004964A1 (en) * 2018-04-05 2021-01-07 Nec Corporation Image processing device, image processing method, and recording medium having image processing program stored thereon
CN111027446A (en) * 2019-12-04 2020-04-17 中国地质环境监测院 Coastline automatic extraction method of high-resolution image

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
付萧等: "面向地震灾区高分辨遥感影像信息提取方法", 《地震研究》 *
韩学锋等: "基于空间插值彩色扫描地形图等高线的自动矢量化", 《测绘科学》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115840761A (en) * 2023-03-01 2023-03-24 自然资源部第三地理信息制图院 Satellite image pixel value modification method, system, equipment and medium
CN115840761B (en) * 2023-03-01 2023-04-14 自然资源部第三地理信息制图院 Satellite image pixel value modification method, system, equipment and medium

Also Published As

Publication number Publication date
CN113610940B (en) 2022-06-07

Similar Documents

Publication Publication Date Title
CN110544251B (en) Dam crack detection method based on multi-migration learning model fusion
CN106960427A (en) The method and apparatus of image in 2 D code processing
CN112149543B (en) Building dust recognition system and method based on computer vision
CN110084129B (en) Machine vision-based real-time detection method for river floating objects
CN108985305B (en) Laser etching industrial detonator coded image positioning and correcting method
CN106096610A (en) A kind of file and picture binary coding method based on support vector machine
CN103971126A (en) Method and device for identifying traffic signs
CN107256547A (en) A kind of face crack recognition methods detected based on conspicuousness
CN109376740A (en) A kind of water gauge reading detection method based on video
CN104657980A (en) Improved multi-channel image partitioning algorithm based on Meanshift
CN105701491A (en) Method for making fixed-format document image template and application thereof
CN106682684A (en) K-means clustering-based target recognition method
CN116468640B (en) Video image enhancement method for Internet teaching
CN107992856A (en) High score remote sensing building effects detection method under City scenarios
CN110852207A (en) Blue roof building extraction method based on object-oriented image classification technology
CN113077486A (en) Method and system for monitoring vegetation coverage rate in mountainous area
CN113610940B (en) Ocean vector file and image channel threshold based coastal area color homogenizing method
CN104598914A (en) Skin color detecting method and device
CN106803078A (en) A kind of SAR image Ship Target dividing method
JP2002090308A (en) Evaluation system for degree of surface degradation of steel using image processing
CN113705441A (en) High-spatial-temporal-resolution surface water body extraction method cooperating with multispectral and SAR images
Lin et al. License plate location method based on edge detection and mathematical morphology
CN113052234A (en) Jade classification method based on image features and deep learning technology
CN106204596B (en) Panchromatic waveband remote sensing image cloud detection method based on Gaussian fitting function and fuzzy mixed estimation
CN116402802A (en) Underwater image quality evaluation method based on color space multi-feature fusion

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