Ancient tomb question and character recognition method based on hyperspectral remote sensing technology

文档序号:1379189 发布日期:2020-08-14 浏览:6次 中文

阅读说明:本技术 一种基于高光谱遥感技术的古墓题记文字识别方法 (Ancient tomb question and character recognition method based on hyperspectral remote sensing technology ) 是由 孟庆祥 于 2020-04-09 设计创作,主要内容包括:本发明公开了一种基于高光谱遥感技术的古墓题记文字识别方法,包括:步骤1、利用高光谱仪器按顺序获取古墓碑刻的图像数据,每个区域获取多张高光谱图像;步骤2、对碑刻的高光谱图像进行预处理;步骤3、选择光谱波段对高光谱图像进行光谱处理;步骤4、对光谱处理后的碑刻图像进行图像增强;步骤5、对图像增强后的碑刻图像进行文字识别,利用文字图像库与待识别的碑刻图像进行相似度比较,根据相似度输出文字识别结果。本发明能对于处于不同环境下的碑刻题记的文字进行识别,有较好的适应性,能够在对肉眼无法识别的文字进行提取,在对包含文字的图片增强的同时平滑噪声,文字识别效果的可靠性,实用性和可行性较好。(The invention discloses a method for identifying ancient tomb topic note characters based on a hyperspectral remote sensing technology, which comprises the following steps: step 1, sequentially acquiring image data of an ancient tombstone by using a hyperspectral instrument, and acquiring a plurality of hyperspectral images in each area; step 2, preprocessing the inscription hyperspectral image; step 3, selecting a spectrum wave band to perform spectrum processing on the hyperspectral image; step 4, carrying out image enhancement on the inscription image after the spectrum processing; and 5, performing character recognition on the inscription image after image enhancement, comparing the similarity of the inscription image to be recognized by using a character image library, and outputting a character recognition result according to the similarity. The invention can identify the characters of inscription under different environments, has better adaptability, can extract the characters which can not be identified by naked eyes, enhances the pictures containing the characters, smoothes noise, and has better reliability, practicability and feasibility of character identification effect.)

1. A method for identifying ancient tomb topic inscription characters based on a hyperspectral remote sensing technology is characterized by comprising the following steps:

step 1, partitioning the historic tombstone, adjusting a hyperspectral instrument according to the set number and size of the partitions, sequentially acquiring image data of the historic tombstone by using the hyperspectral instrument, and acquiring a plurality of hyperspectral images in each area;

step 2, preprocessing the inscription hyperspectral image, comprising: image correction, image transformation, image splicing and noise reduction processing; respectively acquiring images in a dark field and a bright field, averaging according to point positions, and respectively determining the fixed noise self-adaptive threshold detection of the dark field and the bright field; listing position coordinate information, and carrying out edge filling and low-pass filtering processing;

step 3, selecting a spectrum wave band to perform spectrum processing on the hyperspectral image;

and 4, performing image enhancement on the spectrally processed inscription image, wherein the image enhancement comprises the following steps: carrying out nonlinear stretching, increasing the image contrast, and carrying out tone adjustment and sharpening on the image;

and 5, performing character recognition on the inscription image after image enhancement, comparing the similarity of the inscription image to be recognized by utilizing a character image library, extracting the image characteristics of the inscription image to be recognized, comparing the image characteristics with the character image characteristics in the image library, and outputting a character recognition result according to the similarity.

2. The ancient tomb topic character recognition method based on the hyperspectral remote sensing technology as recited in claim 1, characterized in that the specific method in step 1 is as follows:

setting the number and the size of the subareas, designing the most appropriate sequence of the collected images, and numbering the images respectively: s ═ S1, S2, S3, …, S25, S26, S27, … }; focusing the image after the partition is completed; and adjusting the position of the hyperspectral instrument, selecting an object distance to enable the resolution of the acquired image to reach the maximum value, and acquiring a plurality of hyperspectral images in each area.

3. The ancient tomb topic character recognition method based on the hyperspectral remote sensing technology as recited in claim 1, characterized in that the specific method in step 2 is as follows:

step 201, splicing a plurality of hyperspectral images acquired by a domain, specifically comprising the following steps:

step 2011, the corner detection is performed on the image according to the following formula:

R=det(M)-k(trace(M))2

wherein, I (I, j) is the image gray value of the pixel coordinate position (I, j), ω (I, j) is the window function, det (M) is the determinant of the square matrix, trace (M) is the sum of each element on the main diagonal of the square matrix, k is an empirical constant, the value range is 0.04-0.06, M is the obtained characteristic matrix, whether the R is an angular point is judged by the value of R, and when the R value is positive, the coordinate position (I, j) is considered as the angular point;

step 2012, performing normalized cross-correlation calculation on the connected images:

wherein, I1(xi) Is the original image, xi(I, j) is the pixel coordinate of the window, I2(xi+ u) is the graph to be matched, u ═ displacement (m, n) needs to traverse, the higher the ncc (u) value is, the larger x in the original graph is explainediX in the graph to be matchediThe point of + u is the same-name point;

step 2013, performing deformation fusion on the image according to the following steps:

p2=Hp1

the homography matrix of the original image and the image to be matched is H, p1(x1,y1) And p1(x1,y1) A pair of matching points, and H can be calculated using the matching points in step 2012; and calculating new coordinates of points in the images to be matched by using the calculated H, and splicing the images.

Then mapping the pixel of each input image to the plane defined by the participating images; and finally, fusing pixel colors in the overlapping area according to the following formula:

wherein, in the image I (I, j), (R, G, B) is that the color values α 1 and α 2 of the pixels are the corresponding weight coefficients, and the simplest case is 1;

step 202, performing denoising processing on the image, wherein the specific process is as follows:

2021, respectively acquiring a plurality of images in a dark field and a bright field, and averaging pixel points of the images belonging to different fields according to a point-to-point position method to remove random noise; respectively determining a dark field fixed noise self-adaptive detection threshold and a bright field fixed noise self-adaptive detection threshold;

step 2022, listing position coordinate information of dark field and bright field fixed noise according to the image coordinate information in step 201, and detecting whether the image is an edge; if the noise point is an edge, filling the edge by a mirror reflection method, and performing 3x3 median filtering algorithm processing on a pixel point where the noise point is located according to the following formula:

g(i,j)=[f(i,j)+f(i+1,j)+f(i-1,j)+f(i,j+1)+f(i,j-1)+f(i+1,j+1)+f(i+1,i-1)+f(i-1,i+1)+f(i-1,i-1)]/9

wherein f (i, j) is the image gray scale value of the original image pixel coordinate position (i, j), and g (i, j) is the processed picture.

4. The ancient tomb topic inscription character recognition method based on the hyperspectral remote sensing technology as recited in claim 1, wherein the specific method for performing spectral processing on the inscription image in the step 3 is as follows:

301, realizing spectrum processing through band operation, and obtaining new pixel values through an operation process after corresponding pixels of a single or multiple band images are spatially registered; the formula of the band operation method is as follows:

band1+band2

band1-band2

band1×band2

band1÷band2

the formula for the multiband operation is:

(band1-band2)/(band3-band4)

wherein, the bands 1-4 are respectively images of the selected wave bands, and point operation is carried out one by one according to corresponding pixel positions;

step 302, performing multi-band selection to select an optimal band, specifically comprising the following steps:

step 3021, dividing the images belonging to the same waveband in the pictures of all the wavebands into the same waveband subset, selecting 3 subset representative wavebands as a group, forming n groups of waveband sets B ═ B1, B2, B3, …, Bn }, and combining each group to synthesize a false color image;

step 3022, solving a combined waveband method OIF of each waveband, wherein the correlation between the wavebands is less than 0.3, the standard deviation of the wavebands is greater than 1.8, outputting characteristic wavebands, and deleting the rest wavebands; the calculation formula of OIF is:

Cov(i,j)=E[SiSj]-E[Si]E[Sj]

wherein s isiFor the ith band image, SiIs the standard deviation, t, of the ith band imageiIs the size of the ith band image, RijIs the correlation coefficient of the i, j two bands.

5. The ancient tomb topic character recognition method based on the hyperspectral remote sensing technology according to claim 1, characterized in that the specific method for increasing the image contrast by performing the nonlinear stretching processing in the step 4 and then performing the color tone adjustment and sharpening to make the edge sharper and clearer is as follows:

step 401, performing nonlinear stretching processing on the image; firstly, reading in a hyperspectral image, and applying the following mathematical expression to transform pixel points:

wherein the gray scale range of the original image p (i, j) is [0, M ]f]The range of the image P (i, j) after the linear transformation is [0, M ]g];(c/a)>At 1, the gray scale interval [0, a-is linearly stretched, 0<(c/a)<1, compressing; dividing all gray scales of the image according to the method and adjusting the gray scales;

the specific treatment method comprises the following two steps:

step 4011, the brightness of the exposed part of the inscription image below the threshold is reduced to make the ink more obvious, and the brightness of the exposed part of the inscription image above the threshold is reduced to avoid the influence of background brightness on interpretation, but still ensure the contrast between the whole and the ink is greater than the threshold;

step 4012, adjusting the brightness of the exposed part of the image below the threshold value to be higher, and adjusting the brightness of the exposed part of the image above the threshold value to be lower, so that the ink marks in the obtained image are bright white and are convenient to interpret;

step 402, adjusting the color tone of the hyperspectral image; firstly, converting image data read in an RGB format into an HIS format according to the following formula;

wherein, R, G and B are values of RGB channels corresponding to the original image, and the solved H is the tone to be adjusted; continuously adjusting the H value to enable the image tone to reach a certain threshold value, so that the current picture can be distinguished conveniently;

step 403, sharpening the hyperspectral image; sharpening the original image Q (i, j) to Q (i, j) according to the following formula:

Q(i,j)=5q(i,j)-[q(i+1,j)+q(i-1,j)+q(i,j+1)+q(i,j-1)]。

6. the ancient tomb question and word recognition method based on the hyperspectral remote sensing technology according to claim 5, characterized in that after the image is processed in step 5, the question and word picture is subjected to feature extraction, and the specific method is as follows:

step 501, dividing the image into a plurality of rectangles according to pixels, and calculating the average value of pixel values in each small rectangle:

wherein, Kr,Kg,KbThe values of the RGB channels corresponding to the processed image are obtained, and c and d are the length and width of the selected rectangle;

step 5021, if the method for processing the picture is to brighten the text part and darken the stele part, all the image pixels are traversed, and the requirement of traversing all the image pixels is metThe pixels are set to black and stored in a blank pure white image according to the position of a pointSlicing;

step 5022, if the method for processing the picture is to darken the text part and lighten the stele part, all the image pixels are traversed, and the requirement of traversing all the image pixels is metThe pixel is set as black and is stored into a blank pure white picture according to the point position;

step 503, calculating the characteristics according to the following method:

step 5031, calculating gradients of the image in the x-axis direction and the y-axis direction respectively by the image, and calculating a gradient direction value of each pixel position according to the gradients;

Gx(x,y)=H(x+1,y)-H(x-1,y)

Gy(x,y)=H(x,y+1)-H(x,y-1)

wherein G isx(x,y),Gy(x, y), H (x, y), G (x, y), α (x, y) respectively represent a horizontal direction gradient, a vertical direction gradient, a pixel value, a gradient magnitude, and a gradient direction at a pixel point (x, y) in the input image;

step 5032, constructing a gradient histogram; dividing the single-word picture processed in the step 502 into a plurality of cell units, dividing a direction interval according to every 2 pi/9, and counting gradient histogram characteristics of 9 intervals, wherein alpha (x, y) is used as a weight of projection;

step 5033, the feature vectors of the cell units in the picture are connected in series to obtain character features.

7. The ancient tomb question and word recognition method based on the hyperspectral remote sensing technology according to claim 1, characterized in that after the image is processed in step 6, the words of the question and word are recognized and classified, and the method comprises the following steps:

step 601, through simple identification, selecting the alternative character of the character to be confirmed, selecting an alternative character sample, and extracting the characteristics according to step 6, wherein the number of the samples isn+Positive feature sample ofAnd the number of samples is n-Negative characteristic sample ofThe mean value point of the positive and negative training samples is x+And x-

Respectively pass x+,x-The two class hyperplanes of (d) are:

the distance from a sample point in the positive class to the hyperplane within the positive class is ηi+Also for negative examples ηi-:

D+=max{ηi+}

D-=max{ηi-}

And (3) calculating a membership function:

is a predetermined normal number less than a certain threshold value, in order to ensure 0<Si≤1,SiThe larger the word, the more likely it is that the sample represents the word.

Technical Field

The invention relates to the field of character recognition of cultural relic identification and protection, in particular to an ancient tomb question character recognition method based on a hyperspectral remote sensing technology.

Background

China is a civilized ancient country with a long history and has a huge amount of remnants. How to effectively protect the relics is a major challenge facing current researchers. As an important carrier of ancient text information, the ancient tombstone is a cultural relic type with extremely high historical value and artistic value. Common ancient tombstone carving degradation modes comprise various irreversible damages such as weathering erosion, crack hollowing, biological diseases and the like, which can cause permanent loss of cultural relic information and bring great threat to the integrity of the literal information and the value of the cultural relic carved on the ancient tombstone.

The traditional inscription character information extraction mainly aims at enabling professionals to recognize characters visually according to experiences, has the defects of low efficiency, high word error rate and the like, and cannot meet the requirements of large-quantity and high-precision inscription character recognition. Therefore, the development of a novel efficient and high-precision ancient tombstone inscription character recognition technology is urgent.

In recent years, due to the improvement of software and hardware conditions of a computer, the development of computer graphics subjects and the continuous improvement of digital image processing technology, the trial application of a remote sensing hyperspectral technology in the field of cultural relics research and protection appears, but similar research on ancient tombstone inscriptions is not precedent.

With the development of the hyperspectral remote sensing technology, the spectral resolution and the spatial resolution are higher and higher, and the hyperspectral remote sensing technology has the characteristics of high spectral resolution, integrated atlas, nondestructive detection and the like by virtue of large information quantity and is widely applied to many fields.

At present, hyperspectral remote sensing plays a certain role in cultural relic protection work, but research is limited to colored drawing, and the processing effect of the hyperspectral remote sensing on inscriptions in an ancient tomb environment is usually not good. And the efficiency of analyzing the cultural relics by using the hyperspectral imaging technology is low at present, and only part of the cultural relics can be analyzed when the imaging area is small at each time, so that how to improve the efficiency of analyzing the painting and calligraphy cultural relics by using the hyperspectral imaging technology becomes a great research direction in the future. In addition, remote sensing is taken as a cross discipline, along with the continuous development of a calculation theory and an optimization theory, a large number of new theories, new methods and new technologies emerge in the fields of pattern recognition, machine learning and artificial intelligence, and how to apply the achievements to hyperspectral image processing and information extraction is a problem to be considered.

The invention develops a comprehensive technical scheme about ancient tombstone carving protection, which is established on the basis technologies of remote sensing hyperspectrum, hyperspectral image enhancement, mode recognition and the like. The invention can identify characters of various ancient tombstones with different materials, different fonts and the like, and the obtained experimental data can be used as an important reference for identifying the characters of the ancient tombstones, thereby providing great support for the research and protection work of the ancient tombstones.

Disclosure of Invention

The technical problem to be solved by the invention is to provide a method for identifying the characters of the ancient tomb inscription based on the hyperspectral remote sensing technology, aiming at the defects in the prior art, the method is simple and practical, has better adaptability to the character identification of the inscription under different environments, can extract the characters which can not be identified by naked eyes, enhances the pictures containing the characters, smoothes noise, and has better reliability, practicability and feasibility of the character identification effect.

The technical scheme adopted by the invention for solving the technical problems is as follows:

the invention provides a method for identifying ancient tomb topic writing characters based on a hyperspectral remote sensing technology, which comprises the following steps:

step 1, partitioning the historic tombstone, adjusting a hyperspectral instrument according to the set number and size of the partitions, sequentially acquiring image data of the historic tombstone by using the hyperspectral instrument, and acquiring a plurality of hyperspectral images in each area;

step 2, preprocessing the inscription hyperspectral image, comprising: image correction, image transformation, image splicing and noise reduction processing; respectively acquiring images in a dark field and a bright field, averaging according to point positions, and respectively determining the fixed noise self-adaptive threshold detection of the dark field and the bright field; listing position coordinate information, and carrying out edge filling and low-pass filtering processing;

step 3, selecting a spectrum wave band to perform spectrum processing on the hyperspectral image;

and 4, performing image enhancement on the spectrally processed inscription image, wherein the image enhancement comprises the following steps: carrying out nonlinear stretching, increasing the image contrast, and carrying out tone adjustment and sharpening on the image;

and 5, performing character recognition on the inscription image after image enhancement, comparing the similarity of the inscription image to be recognized by utilizing a character image library, extracting the image characteristics of the inscription image to be recognized, comparing the image characteristics with the character image characteristics in the image library, and outputting a character recognition result according to the similarity.

Further, the specific method in step 1 of the present invention is:

setting the number and the size of the subareas, designing the most appropriate sequence of the collected images, and numbering the images respectively: s ═ S1, S2, S3, …, S25, S26, S27, … }; focusing the image after the partition is completed; and adjusting the position of the hyperspectral instrument, selecting an object distance to enable the resolution of the acquired image to reach the maximum value, and acquiring a plurality of hyperspectral images in each area.

Further, the specific method in step 2 of the present invention is:

step 201, splicing a plurality of hyperspectral images acquired by a domain, specifically comprising the following steps:

step 2011, the corner detection is performed on the image according to the following formula:

R=det(M)-k(trace(M))2

wherein, I (I, j) is the image gray value of the pixel coordinate position (I, j), ω (I, j) is the simplest case of the window function, that is, the weight coefficients corresponding to all pixels in the window are all 1, det (M) is the determinant of the square matrix, trace (M) is the sum of each element on the main diagonal of the square matrix, k is an empirical constant, the general value range is 0.04-0.06, M is the obtained feature matrix, and whether the corner point is the angular point is judged by the value of R. When the R value is positive, the coordinate position (i, j) is regarded as the angular point;

step 2012, performing normalized cross-correlation calculation on the connected images:

wherein, I1(xi) Is the original image, xi(I, j) is the pixel coordinate of the window, I2(xi+ u) is the graph to be matched, u ═ displacement (m, n) needs to traverse, the higher the ncc (u) value is, the larger x in the original graph is explainediX in the graph to be matchediThe point of + u is the same-name point;

step 2013, performing deformation fusion on the image according to the following steps:

p2=Hp1

the homography matrix of the original image and the image to be matched is H, p1(x1,y1) And p1(x1,y1) Is a pair of matching points, and H can be calculated using the matching points in step 2012. And calculating new coordinates of points in the images to be matched by using the calculated H, and splicing the images.

Then mapping the pixel of each input image to the plane defined by the participating images; and finally, fusing pixel colors in the overlapping area according to the following formula:

wherein, in the image I (I, j), (R, G, B) is that the color values α 1 and α 2 of the pixels are the corresponding weight coefficients, and the simplest case is 1;

step 202, performing denoising processing on the image, wherein the specific process is as follows:

2021, respectively acquiring a plurality of images in a dark field and a bright field, and averaging pixel points of the images belonging to different fields according to a point-to-point position method to remove random noise; respectively determining a dark field fixed noise self-adaptive detection threshold and a bright field fixed noise self-adaptive detection threshold;

step 2022, listing position coordinate information of dark field and bright field fixed noise according to the image coordinate information in step 201, and detecting whether the image is an edge; if the noise point is an edge, filling the edge by a mirror reflection method, and performing 3x3 median filtering algorithm processing on a pixel point where the noise point is located according to the following formula:

g(i,j)=[f(i,j)+f(i+1,j)+f(i-1,j)+f(i,j+1)+f(i,j-1)+f(i+1,j+1)

+f(i+1,i-1)+f(i-1,i+1)+f(i-1,i-1)]/9

wherein f (i, j) is the image gray scale value of the original image pixel coordinate position (i, j), and g (i, j) is the processed picture.

Further, the specific method for performing spectral processing on the inscription image in the step 3 of the invention comprises the following steps:

301, realizing spectrum processing through band operation, and obtaining new pixel values through an operation process after corresponding pixels of a single or multiple band images are spatially registered; the formula of the band operation method is as follows:

band1+band2

band1-band2

band1×band2

band1÷band2

the formula for the multiband operation is:

(band1-band2)/(band3-band4)

wherein, the bands 1-4 are respectively images of the selected wave bands, and point calculation is performed one by one according to the corresponding pixel positions.

Step 302, performing multi-band selection to select an optimal band, specifically comprising the following steps:

step 3021, dividing the images belonging to the same waveband in the pictures of all the wavebands into the same waveband subset, selecting 3 subset representative wavebands as a group, forming n groups of waveband sets B ═ B1, B2, B3, …, Bn }, and combining each group to synthesize a false color image;

step 3022, solving a combined waveband method OIF of each waveband, wherein the correlation between the wavebands is less than 0.3, the standard deviation of the wavebands is greater than 1.8, outputting characteristic wavebands, and deleting the rest wavebands; the calculation formula of OIF is:

Cov(i,j)=E[SiSj]-E[Si]E[Sj]

wherein s isiFor the ith band image, SiIs the standard deviation, t, of the ith band imageiIs the size of the ith band image, RijIs the correlation coefficient of the i, j two bands.

Further, the specific method for performing the non-linear stretching processing in the step 4 to increase the image contrast and then performing the color tone adjustment and sharpening to make the edge sharper and clearer comprises the following steps:

step 401, performing nonlinear stretching processing on the image; firstly, reading in a hyperspectral image, and applying the following mathematical expression to transform pixel points:

wherein the gray scale range of the original image p (i, j) is [0, M ]f]The range of the image P (i, j) after the linear transformation is [0, M ]g];(c/a)>1 hour, for the gray scale interval [0, a ]]Is subjected to linear stretching, 0<(c/a)<1, compressing; dividing all gray scales of the image according to the method and adjusting the gray scales;

the specific treatment method comprises the following two steps:

step 4011, the brightness of the exposed part of the inscription image below the threshold is reduced to make the ink more obvious, and the brightness of the exposed part of the inscription image above the threshold is reduced to avoid the influence of background brightness on interpretation, but still ensure the contrast between the whole and the ink is greater than the threshold;

step 4012, adjusting the brightness of the exposed part of the image below the threshold value to be higher, and adjusting the brightness of the exposed part of the image above the threshold value to be lower, so that the ink marks in the obtained image are bright white and are convenient to interpret;

step 402, adjusting the color tone of the hyperspectral image; firstly, converting image data read in an RGB format into an HIS format according to the following formula;

wherein, R, G and B are values of RGB channels corresponding to the original image, and the solved H is the tone to be adjusted; continuously adjusting the H value to enable the image tone to reach a certain threshold value, so that the current picture can be distinguished conveniently;

step 403, sharpening the hyperspectral image; sharpening the hyperspectral image; sharpening the original image Q (i, j) to Q (i, j) according to the following formula:

Q(i,j)=5q(i,j)-[q(i+1,j)+q(i-1,j)+q(i,j+1)+q(i,j-1)]

further, after the image is processed in step 5, feature extraction is performed on the inscription picture, and the specific method is as follows:

step 501, dividing the image into a plurality of rectangles according to pixels, and calculating the average value of pixel values in each small rectangle:

wherein, Kr,Kg,KbFor the values of the corresponding RGB channels of the processed image, c and d are the length and width of the selected rectangle.

Step 502, if the method for processing the picture is to brighten the character part and darken the stone tablet part, traversing all the image pixels to meet the requirementThe pixels of (a) are stored in a blank solid black picture by dot position.

Step 502, if the method for processing the picture is to darken the text part and lighten the stone tablet part, traversing all the image pixels to meet the requirementThe pixels of (a) are stored in a blank pure white picture by dot position.

Step 503, calculating the characteristics according to the following method:

step 5031, calculating the gradient of the image in the x-axis direction and the y-axis direction respectively, and calculating the gradient direction value of each pixel position according to the gradient direction values.

Gx(x,y)=H(x+1,y)-H(x-1,y)

Gy(x,y)=H(x,y+1)-H(x,y-1)

Wherein G isx(x,y),Gy(x, y), H (x, y), G (x, y), α (x, y) respectively represent a horizontal direction gradient, a vertical direction gradient, a pixel value, a gradient magnitude, and a gradient direction at the pixel point (x, y) in the input image.

Step 5032, constructing a gradient histogram. Dividing the single-word image processed in the step 502 into a plurality of cell units, dividing a direction interval according to every 2 pi/9, and counting gradient histogram characteristics of 9 intervals, wherein alpha (x, y) is used as a weight of projection.

Step 5033, the feature vectors of the cell units in the picture are connected in series to obtain character features.

Further, after the image is processed in step 6, the inscription words are identified and classified, and the method comprises the following steps:

step 601, through simple identification, selecting the alternative character of the character to be confirmed, selecting an alternative character sample, and extracting the characteristics according to step 6, wherein the number of the samples is n+Positive feature sample ofAnd the number of samples is n-Negative characteristic sample ofThe mean value point of the positive and negative training samples is x+And x-

Respectively pass x+,x-The two class hyperplanes of (d) are:

the distance from a sample point in the positive class to the hyperplane within the positive class is ηi+Also for negative examples ηi-:

D+=max{ηi+}

D-=max{ηi-}

And (3) calculating a membership function:

is a predetermined small positive constant, in order to ensure 0<Si≤1。SiThe larger the word, the more likely it is that the sample represents the word.

The invention has the following beneficial effects:

1. the hyperspectral imager is used for acquiring image data with large information amount, high spectral resolution and atlas integration, and the hyperspectral imager has unique advantages in the aspects of character information enhancement, hidden information extraction, manuscript line extraction, pigment analysis and the like;

2. different wave bands are processed by using related software, the wave band with the most obvious characteristic is selected, characters are highlighted through an image sharpening function, and recognition of images which are difficult to recognize by naked eyes can be achieved;

3. the hyperspectral technology can effectively extract some chemical properties of inscription handwriting, has incomparable superiority in handwriting recognition by other methods, makes up for the technical vacancy in the aspect of cultural relic protection, and provides a new way and a new method for cultural relic protection work in China.

In conclusion, the method is simple and practical, has better adaptability to character recognition of inscription under different environments, can extract characters which cannot be recognized by naked eyes, enhances pictures containing the characters, smoothes noise, and has better reliability, practicability and feasibility of the character recognition effect.

Drawings

The invention will be further described with reference to the accompanying drawings and examples, in which:

FIG. 1 is a flow chart of a method of the present invention;

FIG. 2 is a design diagram of a hyperspectral meter for sectional acquisition of ancient tombstone inscriptions;

FIG. 3A is a graphical representation of an inscription of a tombstone over 2 bands for a given partition;

FIG. 3B shows the image obtained by the band operation of the partition;

FIG. 4A is an original inscription image of a partition;

FIG. 4B is an original inscription image of a band in a partition;

FIG. 4C shows the image obtained after the partition is non-linearly stretched;

FIG. 4D shows the region sharpened to obtain an image;

FIG. 5 is a result of the method of the present invention successfully identifying text that is not visually discernible.

Detailed Description

In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

As shown in fig. 1, the ancient tomb topic writing identification method based on the hyperspectral remote sensing technology in the embodiment of the invention comprises the following steps:

step 1, acquiring a carved hyperspectral image. The ancient tombstone needs to be processed by a hyperspectral technology, and tombstone image acquisition is firstly carried out. In the pattern acquisition process, there are two core points: and partitioning and focusing. Because the ancient tombstone is generally wide in area and large in range, the whole image cannot be acquired at one time, the tombstone must be partitioned: first, the number and size of the partitions are set in advance, the most appropriate order of the captured images is designed, and the images are numbered, S ═ S1, S2, S3, …, S25, S26, S27, …. After the division is completed, the image is focused. And adjusting the position of the hyperspectral instrument, selecting the most appropriate object distance to enable the acquired image resolution to be the highest, and acquiring a plurality of hyperspectral images in each area.

Step 2, preprocessing the hyperspectral inscription image, firstly correcting the image: and transforming the images and splicing the images. Then removing noise or some factors which reduce the image quality in the image. In hyperspectral images, dark current noise is most common. Dark current of the hyperspectral imager generates noise in the acquired image, so that correction of the dark current is needed in hyperspectral imaging. Dark current noise is removed and general noise is also typically present in inscription images. For general noise, the general noise removing method can be adopted for the inscription image to solve.

And 3, selecting the characteristic wave bands of the inscription images, and selecting the images which are high in quality and easy to process from a plurality of hyperspectral images for later processing after denoising processing. Through the research on inscription surface chemicals and the investigation on physical properties, the approximate range of high-quality images can be determined in thousands of high-spectrum inscription images, so that the selection time is greatly shortened. After the selection of the characteristic wave band is finished, the image is visually judged, examined and subjected to attribute inspection, and the tone, color, shadow, texture, contrast and definition of the ink characters in the ancient tombstone image are used as basic judgment criteria. From the remaining few images, the best quality image is selected.

And 4, carrying out image enhancement on the inscription image, wherein the image enhancement can be divided into two steps of image processing and spectrum processing. The image processing uses the nonlinear stretching suitable for inscription images, and the processing process has the following two ideas:

1. firstly, the brightness of a darker part in an inscription image is adjusted to be lower to make ink marks more obvious, the brightness of a higher exposed part in the image is slightly reduced to avoid the influence of over-brightness of a background on interpretation, and the contrast between the whole image and the ink marks is still ensured to be larger;

2. and the brightness of the darker part in the image is increased, and the brightness of the originally bright part in the image is reduced, so that the ink marks in the obtained image are bright white, and the image is convenient to interpret.

In addition, on the basis of stretching processing, color tone adjustment and sharpening are continuously carried out, and related algorithms are written for carrying out color tone adjustment and color level adjustment in sequence, so that the writing of inscription images is clearer. And then sharpening operation is carried out, so that the edge of the handwriting is sharper and clearer, and the subsequent interpretation is facilitated. And then realizing spectral processing through waveband operation, and obtaining new pixel values through related operation processes after corresponding pixels of a single or a plurality of waveband images are spatially registered, or carrying out spectral analysis through extracting end-member wave spectrums. After the graphic enhancement is carried out on the inscription image, the resolution of the inscription image is greatly improved.

And 5, performing character recognition on characters in the inscription image. Firstly, character recognition is carried out by utilizing an algorithm designed by us, and then, on the basis of the existing high-definition image, history and a cultural relic are requested to carry out help recognition. In addition, the similarity comparison can be carried out by utilizing the existing character image library and the retrieval image. And (4) storing the data with higher similarity, waiting for the judgment of an expert, processing the data again if the similarity is lower and cannot be identified, and judging the data by the expert after the definition is improved. And if the picture is too fuzzy and cannot be identified, storing the characteristic information of the characters in a database through a characteristic extraction algorithm, and waiting for later processing. In the ancient tomb topic writing character recognition method based on the hyperspectral remote sensing technology, the specific process of the processing method for the image noise is as follows:

and step 201, splicing the images. The specific process is as follows:

step 2011, the corner detection is performed on the image according to the following formula:

R=det(M)-k(trace(M))2(4)

wherein, I (I, j) is the image gray value of the pixel coordinate position (I, j), ω (I, j) is the simplest case of the window function, that is, the weight coefficients corresponding to all pixels in the window are all 1, det (M) is the determinant of the square matrix, trace (M) is the sum of each element on the main diagonal of the square matrix, k is an empirical constant, the general value range is 0.04-0.06, M is the obtained feature matrix, and whether the corner point is the angular point is judged by the value of R. When the R value is positive, the coordinate position (i, j) is considered as the corner point.

Step 2012, perform normalized cross-correlation calculations on the connected images (e.g., S5 and S1, S2, S3, S4, S6, S7, S8, S9):

wherein, I1(xi) Is the original image, xi(I, j) is the pixel coordinate of the window, I2(xi+ u) is the graph to be matched, u ═ displacement (m, n) needs to traverse, the higher the ncc (u) value is, the larger x in the original graph is explainediX in the graph to be matchediThe point of + u is the same-name point;

step 2013, performing deformation fusion on the image according to the following steps:

p2=Hp1(9)

the homography matrix of the original image and the image to be matched is H, p1(x1,y1) And p1(x1,y1) Is a pair of matching points, and H can be calculated using the matching points in step 2012. And calculating new coordinates of points in the images to be matched by using the calculated H, and splicing the images.

Then mapping the pixel of each input image to the plane defined by the participating images; and finally, fusing pixel colors in the overlapping area according to the following formula:

wherein, in the image I (I, j), (R, G, B) is that the color values α 1 and α 2 of the pixels are the corresponding weight coefficients, and the simplest case is 1;

step 202, denoising the image. The specific process is as follows:

step 2021, collecting 10 dark field images and 5 bright field images;

step 2022, averaging the 10 dark field images and the 5 bright field images according to point positions respectively, and removing random noise;

step 2023, determining dark field and bright field fixed noise adaptive threshold detection respectively;

step 2024, listing position coordinate information of dark field and bright field fixed noise;

step 2025, if the edge is incomplete, filling the edge by a mirror reflection method, and then performing 3 × 3 median filtering algorithm correction, otherwise, directly performing correction on the pixel point at the position where the fixed noise is located.

g(i,j)=[f(i,j)+f(i+1,j)+f(i-1,j)+f(i,j+1)+f(i,j-1)+f(i+1,j+1)+f(i+1,i-1)+f(i-1,i+1)+f(i-1,i-1)]/9 (11)

Wherein f (i, j) is the image gray scale value of the original image pixel coordinate position (i, j), and g (i, j) is the processed picture.

In step 3, the characteristics of many wave bands, large data volume, large redundancy of wave band information and the like of the hyperspectral image are considered, and a plurality of images in the same acquisition area have certain quality difference, multi-band selection is required to be carried out, and the optimal wave band is selected, wherein the specific process comprises the following steps:

301, dividing all wave bands into wave band subsets;

step 302, selecting a subset representative wave band;

step 303, taking 3 wave bands as a group, forming n groups of wave band combinations by the subset representative wave bands, and synthesizing a false color image by the 3 wave band combinations;

step 304, solving the OIF value of each band combination, selecting the maximum value, and judging whether the maximum value is more than 1.8; wherein S isiIs the standard deviation of the ith band, RijIs the correlation coefficient of the two bands of i and j.

E[Si]=∑m,ns(m,n)/ti(13)

Cov(i,j)=E[SiSj]-E[Si]E[Sj](14)

Wherein s isiFor the ith band image, SiIs the standard deviation, t, of the ith band imageiIs the size of the ith band image, RijIs the correlation coefficient of the i, j two bands.

And 305, if the correlation coefficient is larger than 1.8, continuously judging whether the correlation coefficient is smaller than 0.3, outputting the characteristic waveband only if the two conditions are simultaneously met, or continuously judging whether the number of the waveband combinations is smaller than or equal to n, removing the waveband combinations, returning to the step 304, or returning to the step 302.

The band operation in the fourth step is a process of obtaining a new pixel value through a related operation process after corresponding pixels of a single or a plurality of band images are spatially registered, so as to achieve the purposes of highlighting certain special features or carrying out change detection and the like.

The band operation method comprises the following steps:

band1+band2 (17)

band1-band2 (18)

band1×band2 (19)

band1÷band2 (20)

and multi-band operations such as:

(band1-band2)/(band3-band4) (21)

wherein, the bands 1-4 are respectively images of the selected wave bands, and point calculation is performed one by one according to the corresponding pixel positions.

The example adopts the formula (19) to carry out the wave band operation on the inscription image, thereby obtaining an image with obvious handwriting and easy recognition. Through repeated experimental comparison, the following band operations in VNIR and SWIR ranges can obtain ideal results:

Result(vnir)=band764-band650 (22)

Result(swir)=band1733-band1303 (23)

and 4, performing nonlinear stretching treatment to increase the contrast of the image. Then, adjusting and sharpening the color tone, and the specific process of making the edge sharper and clearer is as follows:

step 401, performing a non-linear stretching process on the image. Reading in a hyperspectral image, and processing pixel points by applying transformation shown in the following mathematical expression:

wherein the gray scale range of the original image p (i, j) is [0, M ]f]The range of the image P (i, j) after the linear transformation is [0, M ]g];(c/a)>1 hour, for the gray scale interval [0, a ]]Is subjected to linear stretching, 0<(c/a)<1, compressing; dividing all gray scales of the image according to the method and adjusting the gray scales;

the specific treatment method has the following two options:

step 4011, adjust the brightness of the darker part of the inscription image to be lower to make the ink mark more obvious, and slightly reduce the brightness of the higher exposed part of the image to avoid the background from being over-bright to influence the interpretation, but still ensure the overall contrast with the ink mark to be larger.

Step 4012, the brightness of the darker part of the image is increased, and the brightness of the originally bright part of the image is decreased, so that the ink marks in the obtained image are bright white, and the image is convenient to interpret.

And step 402, adjusting the color tone of the hyperspectral image. The image data read in RGB format is converted into HIS format according to the following formula.

Wherein, R, G and B are the values of the RGB channels corresponding to the original image, and the solved H is the hue to be adjusted. And continuously adjusting the H value to ensure that the image tone is most suitable for distinguishing the current picture.

And step 403, sharpening the hyperspectral image. Sharpening the hyperspectral image; sharpening the original image Q (i, j) to Q (i, j) according to the following formula:

Q(i,j)=5q(i,j)-[q(i+1,j)+q(i-1,j)+q(i,j+1)+q(i,j-1)](20)

in the step 4, the following method is adopted for spectrum analysis:

4041, MNF conversion is carried out on the hyperspectral image;

step 4042, judging data dimension, thereby determining whether to extract an end member spectrum from the image;

step 4043, if the end member spectrum is not extracted, inputting the external end member spectrum for spectrum identification, otherwise, extracting the end member spectrum for the following operations:

4051, calculating a pure pixel index;

4052, performing N-dimensional visualization and end member selection;

step 4053, whether an external end member spectrum is input is selected, if the external end member spectrum is not input, the spectrum identification is directly performed, otherwise, the spectrum identification is performed on the input end member spectrum.

Step 5, the character matching process by using the character image library is as follows:

step 501, dividing the image into a plurality of rectangles according to pixels, and calculating the average value of pixel values in each small rectangle:

wherein, Kr,Kg,KbFor the values of the corresponding RGB channels of the processed image, c and d are the sum of the lengths of the selected rectanglesAnd (4) wide.

Step 502, if the method for processing the picture is to brighten the character part and darken the stone tablet part, traversing all the image pixels to meet the requirementThe pixels of (a) are stored in a blank solid black picture by dot position.

Step 502, if the method for processing the picture is to darken the text part and lighten the stone tablet part, traversing all the image pixels to meet the requirementThe pixels of (a) are stored in a blank pure white picture by dot position.

Step 503, calculating the characteristics according to the following method:

step 5031, calculating the gradient of the image in the x-axis direction and the y-axis direction respectively, and calculating the gradient direction value of each pixel position according to the gradient direction values.

Gx(x,y)=H(x+1,y)-H(x-1,y) (24)

Gy(x,y)=H(x,y+1)-H(x,y-1) (25)

Wherein G isx(x,y),Gy(x, y), H (x, y), G (x, y), α (x, y) respectively represent a horizontal direction gradient, a vertical direction gradient, a pixel value, a gradient magnitude, and a gradient direction at the pixel point (x, y) in the input image.

Step 5032, constructing a gradient histogram. Dividing the single-word image processed in the step 502 into a plurality of cell units, dividing a direction interval according to every 2 pi/9, and counting gradient histogram characteristics of 9 intervals, wherein alpha (x, y) is used as a weight of projection.

Step 5033, the feature vectors of the cell units in the picture are connected in series to obtain character features.

After the image is processed in the step 6, the characters of the inscription are identified and classified, and the method comprises the following steps:

step 601, through simple identification, selecting the alternative character of the character to be confirmed, selecting an alternative character sample, and extracting the characteristics according to step 6, wherein the number of the samples is n+Positive feature sample ofAnd the number of samples is n-Negative characteristic sample ofThe mean value point of the positive and negative training samples is x+And x-

Respectively pass x+,x-The two class hyperplanes of (d) are:

the distance from a sample point in the positive class to the hyperplane within the positive class is ηi+Also for negative examples ηi-:

D+=max{ηi+} (35)

D-=max{ηi-} (36)

And (3) calculating a membership function:

is a predetermined small positive constant, in order to ensure 0<Si≤1。SiThe larger the word, the more likely it is that the sample represents the word.

It will be understood that modifications and variations can be made by persons skilled in the art in light of the above teachings and all such modifications and variations are intended to be included within the scope of the invention as defined in the appended claims.

24页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:字符识别方法及装置、电子设备和存储介质

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!