Method is equalized based on the sonar image of SLIC and adaptive-filtering
Technical field
The present invention relates to sonar images to enhance technical field, more particularly to the sonar image based on SLIC and adaptive-filtering
Equalization method.
Background technique
Sonar image classification be sub-sea floor targets identification important means, can be used for seafloor topography detection, submarine survey,
The fields such as submarine pipeline tracking and state-detection.Currently, the unbalanced problem of gray scale in sonar image has seriously affected sonar figure
As the effect of classification, so, solution sonar image gray scale is unbalanced to have a direct impact raising sonar image classification accuracy rate.
It is influenced by sea bottom complex environment, acoustic noise and towed body motion state, it is abnormal often to there is gray scale in sonar image
Become.Existing sonar image grayscale equalization method is based primarily upon towed body motion state, these states are passed by the posture in towed body
Sensor and height sensor provide.The method of sonar image rectification is paper Data of the Capus et al. in 2008 at present
Correction for visualisation and classification of sidescan SONAR imagery intermediary
The method to continue.It is influenced by ocean wave motion and sea bottom complex terrain, the towed body motion state that sensor provides is constantly in variation
State, meanwhile, the sensitivity and accuracy of sensor itself have error, by these sensor data correction sonar images,
Correction course can be made to have biggish calculation amount and calculate error.In the segmentation and classification of sonar image, unbalanced gray scale is to influence
One main problem of sonar image segmentation accuracy.At present about in the research that sonar image is divided and classifies, gray scale is uneven
Weighing apparatus problem is not considered separately, and people focus primarily on emphasis in the method for classification or segmentation, although can also obtain in this way compared with
Good classification or segmentation effect, but algorithm design is more complex, process is also extremely time-consuming.
Simple linear iteration clusters (SLIC): Simple Linear Iterative Clustering.
Summary of the invention
It is an object of the invention in view of the above technical problems, obtain the sonar image of not tonal distortion, one kind is provided
Method is equalized based on the sonar image of SLIC and adaptive-filtering, realizes the grayscale equalization of a variety of sonar images, is seabed
Target acquisition and classification provide the sonar image of correction, super-pixel cluster are carried out to sonar image, based on adaptive-filtering to poly-
The sonar image block that class divides is filtered, and by the way that above steps may be repeated multiple times, realizes the grayscale equalization of sonar image.Specifically
Steps are as follows:
Step 1, the speckle noise in sonar image is filtered out;
Step 2, sonar image is divided into irregular image block using simple linear iterative clustering methods;
Step 3, it carries out pixel value respectively to each image block uniquely to change, sorted pixels value, obtains pixel median;
To image block P0And its all adjacent image block { P1,P2,K,Pk, uniquely change their pixel value, obtains pixel
Race { A0,A1,A2,...,Ak, Ai(i=0,1 ..., k) indicate image block PiWhat the pixel value of (i=0,1 ..., k) was uniquely changed
As a result, removal PiIn repetition pixel value;To AiPixel value in (i=0,1 ..., k) is arranged according to sequence from small to large
Sequence;Take AiIntermediate value ai(i=0,1 ..., k).
Step 4, image block gray value is updated, traverses all image blocks according to step 3;
If method particularly includes: ai(i=1,2 ..., k) is equal to 0 or 255, then image block PiPicture in (i=1,2 ..., k)
Plain value all resets to 0 or 255;If ai(i=1,2 ..., k) be not equal to 0, also be not equal to 255, and | ai-a0| (i=1,2 ...,
K) it is less than given threshold, then uses Pi'=a0± rand (X) updates image block Pi(i=1,2 ..., gray value k), rand
(X) it indicates to generate a number at random in [1, X] range, updated image block is Pi'。
Step 5, sonar image is repeatedly divided into the image block of different number, repeats step 3 and step 4 respectively;
Step 6, the equalization image of the step 5 repeatedly obtained is averaged, obtains final grayscale equalization image.
Further: X=5.
Further: image block number is 3000.
Further: the image block number in step 5 is 2500 and/or 2000 and/or 1500 and/or 1000.
The technical program is based on simple linear iterative clustering methods and sonar image is divided into irregular super-pixel image
Block is filtered each super-pixel image block using adaptive filter method, has fully considered neighbouring super pixels image block
Grey similarity and each super-pixel image block gray scale balance, pass through local equalization realize image entirety equilibrium
Change, after realizing grayscale equalization, can be obtained by preferably using simple image partition method (such as k means clustering algorithm)
Segmentation result;This method does not use the attitude data of sonar towed body mounted, avoids inherent data present in calculating process
Error.The sonar image obtained using this method, can solve the unbalanced problem of gray scale in sonar image, grayscale equalization effect
It is good, there is positive effect to sonar image classification accuracy rate is improved.
Detailed description of the invention
Fig. 1: sonar image;
Fig. 2: simple linear iteration clusters the cluster result to Fig. 1;
Fig. 3: Fig. 1 grayscale equalization result;
Segmentation result of Fig. 4: the k means clustering algorithm to Fig. 1;
Segmentation result of Fig. 5: the k means clustering algorithm to Fig. 3.
Wherein, the white grid lines in Fig. 2 is the boundary of each cluster block.
Specific embodiment
1-5 with reference to the accompanying drawings specifically describes embodiments of the present invention.
Step 1, median filtering is carried out to sonar image, the size of filter multiplies 3 for 3, and the purpose of this step is to filter out sound
Speckle noise in image.Median filtering is the common method in image filtering.
Step 2, it (is proposed within Achanta 2012) using simple linear iterative clustering methods, sonar image is divided into not
The image block of rule.The size of sonar image is 419 × 317, K in Fig. 1l=3000, KlIndicate the number for the image block that SLIC is divided
Amount.Fig. 2 is SLIC cluster result, and the white grid lines in figure is the boundary of each cluster block.
Step 3- step 5, to each image block that SLIC is obtained, using adaptive-filtering, this step is pass of the invention
Key step.Detailed process are as follows:
A. pixel value is carried out respectively to each image block and its adjacent image block uniquely to change.To image block P0And its institute
There is adjacent image block { P1,P2,K,Pk, uniquely change their pixel value, obtains pixel race { A0,A1,A2,...,Ak, Ai(i=0,
1 ..., k) indicate image block PiThe result that the pixel value of (i=0,1 ..., k) is uniquely changed.If PiPixel value be 4,7,0,0,
0,1,2,3,3,4, }, the result A that pixel value is uniquely changediFor { 4,7,0,1,2,3 }.
B. to AiPixel value in (i=0,1 ..., k) is ranked up according to sequence from small to large.If AiFor 4,7,0,
1,2,3 }, the result of sequence is { 0,1,2,3,4,7 }.
C. after sorting, the intermediate value a of pixel value is foundi(i=0,1 ..., k).AiIntermediate value aiIt is 2.5.
The processing of a-c step can reduce the unbalanced influence to intermediate value of gray value.If image block is that grey value profile is equal
Weighing apparatus, then the maximum value and minimum value and intermediate value difference of its gray value are little.And if image block grey value profile is unbalanced,
The possible gap of maxima and minima is larger.When gray value number less than normal is more, intermediate value is biased to lesser gray value;Work as gray scale
Be worth number bigger than normal it is more when, intermediate value can be biased to biggish gray value.Uniqueization processing in a step can reduce this deviation.
If d. ai(i=1,2 ..., k) is equal to 0 or 255, then image block PiPixel value in (i=1,2 ..., k) is all heavy
It is set to 0 or 255.
If ai(i=1,2 ..., k) be not equal to 0, also be not equal to 255, and | ai-a0| (i=1,2 ..., k) it is less than setting
Threshold value illustrates image block PiWith image block P0Gray value it is similar, according to formula (1) update image block Pi(i=1,2 ..., k)
Gray value, rand (5) expression generate a number at random in [1,5] range.Updated image block is Pi'.After update, figure
As block Pi' gray value and P0Approximation realizes P0Neighborhood gray value equalization.
Pi'=a0±rand(5) (1)
E. all image blocks are traversed according to step a-d.
Step 6, using smaller KlValue (such as Kl=2500, Kl=2000, Kl=1500, Kl=1000) step, is repeated
3- step 5, to different KlThe equalization image that value obtains is averaged, and obtains final grayscale equalization image.The gray scale of Fig. 1 is equal
Weighing apparatusization result is as shown in Figure 3.
By grayscale equalization, the contrast of target (the white high bright part of Fig. 3) is become apparent from sonar image, in Fig. 1
The unbalanced problem of gray scale effectively solved;After grayscale equalization, sonar image can be achieved with using simple dividing method
Effectively segmentation.It is (white that sonar image (Fig. 1 and Fig. 3) using simple k means clustering algorithm is divided into target area by Fig. 4 and Fig. 5
Color), background area (grey) and shadow region (black).As can be seen from the results, by grayscale equalization, segmentation effect is more preferable.
Embodiment only illustrates technical solution of the present invention, rather than carries out any restrictions to it;Although with reference to the foregoing embodiments
Invention is explained in detail, for those of ordinary skill in the art, still can be to previous embodiment institute
The technical solution of record is modified or equivalent replacement of some of the technical features;And these modifications or substitutions, and
The essence of corresponding technical solution is not set to be detached from the spirit and scope of claimed technical solution of the invention.