CN105373798A - K neighbor image matting and mathematical morphology-based calligraphy character extracting method - Google Patents

K neighbor image matting and mathematical morphology-based calligraphy character extracting method Download PDF

Info

Publication number
CN105373798A
CN105373798A CN201510810577.3A CN201510810577A CN105373798A CN 105373798 A CN105373798 A CN 105373798A CN 201510810577 A CN201510810577 A CN 201510810577A CN 105373798 A CN105373798 A CN 105373798A
Authority
CN
China
Prior art keywords
image
reference image
calligraphy
edge
pixel
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
CN201510810577.3A
Other languages
Chinese (zh)
Other versions
CN105373798B (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.)
Northwest University
Original Assignee
Northwest University
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 Northwest University filed Critical Northwest University
Priority to CN201510810577.3A priority Critical patent/CN105373798B/en
Publication of CN105373798A publication Critical patent/CN105373798A/en
Application granted granted Critical
Publication of CN105373798B publication Critical patent/CN105373798B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/44Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components
    • G06V10/443Local feature extraction by analysis of parts of the pattern, e.g. by detecting edges, contours, loops, corners, strokes or intersections; Connectivity analysis, e.g. of connected components by matching or filtering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Character Input (AREA)

Abstract

The invention discloses a K neighbor image matting and mathematical morphology-based calligraphy character extracting method. According to the method, a reference image is established through K neighbor image matting; guided filtering of different window sizes is performed on the interior and edge of a character respectively through using a mathematical morphology-based edge extraction method according to the characteristic that the change of the shade of the ink of a calligraphy image is complex; and more morphological and expressional information is searched through utilizing image fusion technologies. With the K neighbor image matting and mathematical morphology-based calligraphy character extracting method of the invention adopted, expressional information about the emotion and personality of a calligrapher, which is carried by calligraphy itself can be extracted more accurately; Chinese character information can be extracted more accurately for ancient calligraphy works in China which are complex in the change of the shade of ink and are fuzzy in the edge of typefaces; and the effects of the extraction of the expressional information of Chinese characters are significant.

Description

Calligraphy character extraction method based on K neighbor matting and mathematical morphology
Technical Field
The invention belongs to the technical field of image processing, and relates to a calligraphy art information extraction method based on K neighbor matting and digital morphology in the fields of Chinese calligraphy art research and historical cultural heritage protection, which is used for extracting the expression information of Chinese characters in calligraphy work images.
Background
In the fields of Chinese calligraphy and art research and historical cultural heritage protection, image preprocessing and image segmentation are adopted to more completely and accurately extract the shape and quality and expression information of Chinese characters from ancient Chinese calligraphy works. At present, the method for extracting Chinese character information mainly adopts a method of combining image denoising, edge detection, image segmentation and the like to extract the shape and quality information of Chinese characters.
A method for detecting pictures and characters is disclosed in the patent application of Beijing university (publication No. CN101122952, grant date: 2008, 2 and 13 months, and application date: 2007, 9 and 21 months) of the patent application. The method comprises the steps of firstly, combining edge images of an original image on each color component to obtain an accumulated edge image; setting the edge points in the accumulated edge graph as the corresponding colors of the edge points in the original graph, and decomposing the accumulated edge graph into a plurality of sub-edge graphs by a clustering method according to the difference of the colors of the edge points; and finally, performing horizontal and vertical projection for multiple times in each sub-edge image, performing region segmentation in the vertical direction and the horizontal direction according to the projection image, and positioning character regions in the image. The method can accurately obtain the regional information of the characters in the image and the shape and quality information of the characters, but the key for detecting the character information in the method mainly depends on the edge information of the image, namely the shape and quality information of the characters is mainly concerned, and the spiritual information of the characters is not considered, so that the detected character information is incomplete, and the adverse effect is brought to the research work of the calligraphy works in the later period.
XiaoqingLu et al, in the literature "XiaoqingLu, ZhiTang, Yanliu, Liangcaigao, TingWang, Zhipeng Wang. 'Stroke-based character segmentation of Low-quality ImagesonPinnecticChinese tablet' [ C ],201312 the International conference amplification and recognition", 2013 proposed a method for extracting Chinese characters from low-quality ancient tablet images based on Stroke. The method comprises the following specific steps: (1) carrying out denoising pretreatment on the original stele image; (2) applying a mapping-based segmentation method to the denoised image to obtain an initial segmentation result; (3) setting a minimum intensity threshold value by using a self-adaptive Otsu method to obtain a Stroke filtering mask, and performing filtering processing on the de-noised image by using the mask to obtain strength information of Stroke; (4) the segmentation result obtained in the step 2 and the filtering mask obtained in the step 3 are used for selecting the components with higher Stroke strength as initial seeds; (5) based on the guiding information in the seed window, an iterative process is used for extracting Chinese character information contained in the tablet image; (6) and after the iteration is finished, the obtained segmentation result is the extracted Chinese character information. The method can better process the influence of cracks in the tombstone image on Chinese character extraction, and can more completely extract Chinese character information in the tombstone image. However, the method only focuses on extracting the shape and quality information of the Chinese characters, and is difficult to be applied to extracting the magical information of the Chinese characters in the paste image; in the implementation process of the method, more parameters are obtained according to experience. Therefore, the method has a large limitation.
Disclosure of Invention
Aiming at the problems in the prior art, the invention aims to provide a method for extracting the artistic information of the calligraphy work based on K neighbor matting and mathematical morphology, so as to overcome the defect that the detail information of the Chinese character extraction method adopted in the technology for extracting the artistic information in the calligraphy work is seriously lost, and improve the accuracy of extracting the artistic information of the calligraphy work and the artistic appreciation value.
In order to realize the task, the invention adopts the following technical scheme:
a calligraphy character extraction method based on K neighbor matting and mathematical morphology comprises the following steps:
reading a color image to be processed by using software in a computer;
converting the color image to be processed from the RGB color space to the CTE-Lab color space to obtain an L channel;
extracting Chinese character information in the image by using a K neighbor matting algorithm to obtain a gray image serving as a reference image for extracting calligraphy characters;
after the reference image is binarized, corroding the binarized reference image by using mathematical morphology, and subtracting the corroded reference image from the reference image obtained in the third step to obtain an edge image of the calligraphy character;
step five, performing small-window guide filtering processing on the edge image, and selecting a window with a proper size to perform guide filtering processing on the calligraphy character internal image;
and sixthly, performing pixel-level image fusion on the filtering result of the edge image and the filtering result of the image inside the calligraphy character to finish the process.
Further, the specific process of the third step includes:
step S30, extracting feature vectors using the color and position information of the image, the formula is as follows:
X(i)=(cos(h),sin(h),s,v,x,y)i
in the above formula, x (i) is a feature vector, h, s, v are three components of the space of HSV color, respectively, and x, y are position coordinates of a pixel;
step S31, defining a kernel function:
k(i,j)=1-||X(i)-X(j)||/C
in the above formula, k (i, j) is a kernel function, x (i) and x (j) are different feature vectors, and C is a weight adjustment coefficient for ensuring that k (i, j) belongs to (0, 1);
obtaining a Laplace matrix from a kernel function:
L=D-A
in the above formula, D is a diagonal matrix, and the elements on the diagonal of DA is a similarity matrix;
step S32, adding user constraint information to obtain a closed solution:
α=(L+λM)-1(λV)
in the above formula, M is a diagonal matrix representing the user's label of a known pixel, V is a vector representing the user's label of a foreground region, λ is a constraint coefficient, and L is the brightness of the color image in the Lab color space;
step S33, substituting the value of the closed solution α into the following formula to obtain a reference image:
R=αf+(1-α)b
in the above formula, R is a reference image, f is an unknown foreground layer, and b is an unknown background layer.
Further, the specific process of the fourth step includes:
step S40, binarizing the reference image
The average pixel value of the reference image is calculated using the following formula:
u = Σ x = 1 , y = 1 x = M , y = N f ( x , y ) M × N
in the above formula, u represents an average pixel value of the L channel, f (x, y) represents a pixel value of a pixel at coordinates (x, y) in the image, and M and N represent the length and width of the image, respectively;
step S41, setting the optimal threshold value for binarization processing of the reference image as T, and counting the proportion w of pixels with pixel values larger than T in the L channel to the image1And the proportion w of pixels with pixel values less than or equal to T in the L channel to the image2And calculating the average pixel value u of the pixels with the pixel values larger than T in the L channel1And an average pixel value u of pixels having a pixel value of T or less in the L channel2
Step S42, traversing each possible value of T, and calculating the inter-class difference value using the following formula:
G=w1×(u1-u)×(u1-u)+w2×(u2-u)×(u2-u)
in the above formula, G represents a difference value between the target portion and the background portion during the binarization processing, when G reaches a maximum value, an optimal threshold T for binarization can be obtained, and then the reference image is subjected to binarization processing using the following formula:
step S43, corroding the binarized reference image by using a matrix with 3 x 3 structural elements to reduce the edge of the calligraphy character by one pixel, and subtracting the corroded reference image from the reference image to obtain the edge of the calligraphy character; wherein:
the erosion operation is defined as:
RΘBs={Z,Bz∈R}
the mathematical form edge extraction operator is as follows:
ED(R)=R-(RΘB)
in the above two formulas, B is a structural element of 3 x 3, BZAs a result of the translation of the structuring element by Z units, BSFor a set of structural elements that are symmetric about the origin, ed (R) is the edge of the calligraphic word in the reference image R.
Compared with the prior art, the invention has the following advantages:
1. the method uses the K-nearest neighbor image matting and the guiding filter, well solves the problems that the traditional method lacks gray level details and is difficult to extract fuzzy edges of calligraphy characters, can better extract the form and quality and the expression information of the Chinese characters in the calligraphy works, and improves the integrity of Chinese character information extraction.
2. The invention uses the edge extraction method based on mathematical morphology, and well solves the problem that the traditional method can not keep sharp edges of Chinese characters. The method ensures that the calligraphy characters keep smooth edges and improves the accuracy of Chinese character information extraction.
3. According to the method, the reference image is established through K-neighbor matting, according to the characteristic that the calligraphy image is complex in ink shade change, guiding filtering of different window sizes is respectively carried out on the inner part and the edge of a font by using an edge extraction method based on mathematical morphology, and more form and expression information is searched by using an image fusion technology, so that the problem that the detail information of a Chinese character extraction method adopted in the art information extraction technology in the existing calligraphy works is seriously lost is solved, and the accuracy of calligraphy work art information extraction and the art appreciation value are improved.
Drawings
FIG. 1 is an overall flow diagram of the process of the present invention;
FIG. 2 is a partial image of a calligraphy image "Songfeng Geshi";
FIG. 3 shows the result after color space conversion and K-nearest neighbor matting, where FIG. 3(a) is the L-channel of the original image and FIG. 3(b) is the reference image;
FIG. 4 shows the result after edge extraction of a reference image, wherein FIG. 4(a) is an internal image and FIG. 4(b) is an edge image;
FIG. 5 shows the result of different window size guided filtering for an intra image and an edge image, where FIG. 5(a) is the intra image and FIG. 5(b) is the edge image;
FIG. 6 is a graph of the results of image fusion;
FIG. 7 is a graph comparing the experimental results of the first set of two image works in simulation experiment 2;
FIG. 8 is a graph comparing the results of the second set of two image works in simulation experiment 2;
FIG. 9 is a graph comparing the results of the simulation experiment 2 for the third set of two image works;
Detailed Description
First, detailed steps
The flow chart of the invention is shown in fig. 1, and the specific process is as follows:
a calligraphy character extraction method based on K neighbor matting and mathematical morphology comprises the following steps:
reading a color image to be processed by using software in a computer; the software used in the computer can adopt Matlab software;
step two, converting the color image to be processed from the RGB color space to the CTE-Lab color space to obtain an L channel, wherein the specific conversion formula is as follows:
X=0.412453×R+0.357580×G+0.180423×B
Y=0.212671×R+0.715160×G+0.072169×B
Z=0.019334×R+0.119193×G+0.950227×B
X1=X/(255×0.950456)
Y1=Y/255
Z1=Z/(255×1.088754)
wherein X, Y and Z respectively represent tristimulus values of CIE1931 standard chromaticity observer spectrum, R, G and B respectively represent red, green and blue channels of the color image in RGB color space, and X1,Y1,Z1Respectively representing the values of X, Y and Z in linear normalization;
if Y >0.008856, then:
f(X1)=X1^(1/3)
f(Y1)=Y1^(1/3)
f(Z1)=Z1^(1/3)
L=116×f(Y1)-16
if Y <0.008856, then:
f(X1)=7.787×X1+16/116
f(Y1)=7.787×Y1+16/116
f(Z1)=7.787×Z1+16/116
L=903.3×Y1
a=500×(f(X1)-f(Y1))+128
b=200×(f(Y1)-f(Z1))+128
where f (·) is the correction function, L represents the luminance of the color image in the Lab color space, a, b represents the color of the color image in the Lab color space, the positive half axis of a represents red, the negative half axis represents green, the positive half axis of b represents yellow, and the negative half axis represents blue.
Extracting Chinese character information in the image by using a K neighbor matting algorithm to obtain a gray image serving as a reference image for extracting calligraphy characters; the specific process is as follows:
step S30, extracting feature vectors using the color and position information of the image, the formula is as follows:
X(i)=(cos(h),sin(h),s,v,x,y)i
in the above formula, x (i) is a feature vector, h, s, v are three components of the space of HSV color, respectively, and x, y are position coordinates of a pixel;
step S31, defining a kernel function:
k(i,j)=1-||X(i)-X(j)||/C
in the above formula, k (i, j) is a kernel function, x (i) and x (j) are different feature vectors, and C is a weight adjustment coefficient for ensuring that k (i, j) belongs to (0, 1);
obtaining a Laplace matrix from a kernel function:
L=D-A
in the above formula, D is a diagonal matrix, and the elements on the diagonal of DA is a similarity matrix;
step S32, adding user constraint information to obtain a closed solution:
α=(L+λM)-1(λV)
in the above formula, M is a diagonal matrix representing the user's label of a known pixel, V is a vector representing the user's label of a foreground region, λ is a constraint coefficient, and L is the brightness of the color image in the Lab color space;
step S33, substituting the value of the closed solution α into the following formula to obtain a reference image:
R=αf+(1-α)b
in the above formula, R is a reference image, f is an unknown foreground layer, and b is an unknown background layer.
After the reference image is binarized, corroding the binarized reference image by using mathematical morphology, and subtracting the corroded reference image from the reference image obtained in the third step to obtain an edge image of the calligraphy character; the specific process is as follows:
step S40, binarizing the reference image by using OTSU
The average pixel value of the reference image is calculated using the following formula:
u = &Sigma; x = 1 , y = 1 x = M , y = N f ( x , y ) M &times; N
in the above formula, u represents an average pixel value of the L channel, f (x, y) represents a pixel value of a pixel at coordinates (x, y) in the image, and M and N represent the length and width of the image, respectively;
step S41, setting the optimal threshold value for binarization processing of the reference image as T, and counting the proportion w of pixels with pixel values larger than T in the L channel to the image1And the proportion w of pixels with pixel values less than or equal to T in the L channel to the image2And calculating the average pixel value u of the pixels with the pixel values larger than T in the L channel1And an average pixel value u of pixels having a pixel value of T or less in the L channel2(ii) a The correlation formula is:
w 1 = W 1 M &times; N
w 2 = W 2 M &times; N
u 1 = &Sigma; i &times; n ( i ) W 1 i > T
u 2 = &Sigma; i &times; n ( i ) W 2 i &le; T
wherein, W1And W2Respectively representing the number of pixels of which the pixel value is greater than T and the number of pixels of which the pixel value is less than or equal to T in an L channel, i represents the pixel value of a pixel in an image, and n (i) represents the number of pixels of which the pixel value is equal to i;
step S42, traversing each possible value of T, and calculating the inter-class difference value using the following formula:
G=w1×(u1-u)×(u1-u)+w2×(u2-u)×(u2-u)
in the above formula, G represents a difference value between the target portion and the background portion during the binarization processing, when G reaches a maximum value, an optimal threshold T for binarization can be obtained, and then the reference image is subjected to binarization processing using the following formula:
in step S43, in the mathematical morphology calculation, the erosion has an effect of eliminating the object boundary. Corroding the binarized reference image by using a matrix with 3 x 3 structural elements to reduce the edge of the calligraphy character by one pixel, and subtracting the corroded reference image from the reference image to obtain the edge of the calligraphy character; wherein:
the erosion operation is defined as:
RΘBs={Z,Bz∈R}
the mathematical form edge extraction operator is as follows:
ED(R)=R-(RΘB)
in the above two formulas, B is a structural element of 3 x 3, BZAs a result of the translation of the structuring element by Z units, BSFor a set of structural elements that are symmetric about the origin, ed (R) is the edge of the calligraphic word in the reference image R.
Step five, performing small-window guide filtering processing on the edge image, and selecting a window with a proper size to perform guide filtering processing on the calligraphy character internal image;
in step S50, a small-window guiding filter process is first performed on the edge image ED:
taking the edge image ED as the input image I and the image L channel as the guide image Ig, the guide filter is a linear transformation to the guide image, that is:
I o ( x , y ) = a k I g ( x , y ) + b k , &ForAll; ( x , y ) &Element; &omega; k
wherein, Io(x, y) is the pixel value at the coordinate position in the filtered output image, akAnd bkIs a linear coefficient, Ig(x, y) is the pixel value at coordinate position (x, y) in the guide image, ωkA local window centered at a pixel point and having a radius r. In guiding the filtering process to the edge image, in order to keep the edge sharp, the filter is guided by a small window, i.e. a local window ω of r2 is used2
In order to make the input image I and the output image IoThe difference between them is minimal, i.e. it needs to be in the window omega2To minimize the function of:
E=∑((Io(x,y)-I(x,y))2+ak 2)
=∑((akIg(x,y)+bk-I(x,y))2+ak 2)
where I (x, y) is a pixel value at a coordinate position of (x, y) in the input image, and E is IoThe difference between (x, y) and I (x, y) is a regularization parameter that prevents excessive values. When E reaches the minimum akAnd bkRespectively as follows:
a k = ( &sigma; k 2 + &epsiv; ) - 1 ( 1 | &omega; | &Sigma; ( x , y ) &Element; &omega; k I g ( x , y ) I ( x , y ) - &mu; k I &OverBar; k )
b k = I &OverBar; k - a k &mu; k
wherein σk 2And mukAre respectively at the window omega2Inner IgThe mean and variance of (x, y),is I (x, y)) At window omega2Inner mean, | ω2Is the window omega2The number of internal pixel points.
Since a pixel may be covered by multiple windows, the parameter a can be calculated based onkAnd bkThe filter output I is calculated by the following formulao(x,y):
I o ( x , y ) = a &OverBar; x y I g ( x , y ) + b &OverBar; x y
Wherein,andis the average of all window coefficients covering pixel (x, y).
From Io(x, y) leads to a guided filtering result ED' of the edge image ED.
Step S51, performing a guide filtering process on the calligraphy character internal image:
taking the internal image IE as the input image I, taking the image L channel as the guide image Ig, and using a larger filtering window, i.e. using a local window omega of r-8, to extract more gray information8(ii) a The other processes are the same as step S50, and the guided filtering result IE' of the intra image is obtained.
And sixthly, performing pixel-level image fusion on the filtering result of the edge image and the filtering result of the image inside the calligraphy character to finish the process.
In order to enable the final extraction result to simultaneously contain rich gray information in the calligraphy character and sharp edges of strokes, image fusion is carried out on ED 'and IE' to obtain the complete and accurate shape, quality and verve of the calligraphy character.
The pixel value at (x, y) for ED 'and IE' is taken to be the minimum, namely:
g(x,y)=min(ED′(x,y),IE′(x,y))
where ED '(x, y) is the pixel value of ED' at coordinate (x, y), IE '(x, y) is the pixel value of IE' at coordinate (x, y), g (x, y) is the pixel value of the image fusion result at coordinate (x, y), and min (·) is the minimum value.
Second, simulation experiment
Simulation experiment 1: the method for extracting the Chinese character shape and character and the expression information in the calligraphy image is simulated.
The simulation condition of simulation 1 was performed under MATLABR2013a software, and the parameter of the pilot filtering was 0.110The parameter lambda of the K neighbor matting algorithm is 100, the level is 0.5, and l is 1.
Referring to fig. 2 to 6, a simulation experiment was performed on a part of the "songfeng poem" of the calligraphy image huang court jia. The calligraphy image is well stored, the reference image contains main shape and quality information of Chinese characters, then the reference image is subjected to edge extraction to obtain an internal image and an edge image, the internal image and the edge image are respectively subjected to filtering processing by guide filters with different window sizes, gray level details and sharp edges can be obtained, and filtering results are subjected to image fusion to extract complete expression information, so that the calligraphy image can truly reflect the concentration change of pen and ink and the trend of pen points, and the edge condition of calligraphy characters can be accurately restored. In the result image, the calligraphy owners can better show the true and false of strokes and the sudden change and gradual change of the stroke tips when writing Chinese characters.
Simulation experiment 2, the comparative analysis simulation is performed on the method of the present invention.
The simulation conditions of simulation experiment 2 were performed under MATLABR2013a software, and the parameters of the pilot filtering were 0.110The parameter lambda of the K neighbor matting algorithm is 100, the level is 0.5, and l is 1. The method is mainly compared and analyzed with OTSU, FastFuzzyC-means (FFCM) and MultiChanneland guided filters (MCGF), so that the method has obvious advantages in the aspect of extracting the expression information of Chinese characters in the calligraphy works. The comparison and analysis of the experimental results are described below:
referring to fig. 7, fig. 8 and fig. 9 (two calligraphy image works are selected for each group), for the calligraphy images, complete and accurate shape and quality information and spiritual information need to be extracted simultaneously. Firstly, in the aspect of extracting the shape and quality information of the Chinese characters, all the methods can accurately extract the shape and quality information of the Chinese characters. But the shape and quality information of the extraction result of the method of the invention is more complete, as shown in fig. 7 and fig. 9. In the extraction of the artifact information of the chinese characters, for the area with fuzzy edges in the calligraphic characters, the Otsu, FFCM and MCGF extraction results have a large loss of detail, as shown in fig. 8 and 9. For strokes written by a dry pen, the difficulty of extraction is large, and most of the information is lost by OTSU, FFCM and MCGF, as shown in FIG. 7, FIG. 8 and FIG. 9. However, compared with the method, the method has higher accuracy in the aspect of extracting the shape and character information and the expression information, can keep rich gray level details for both the whitening area and the dry stroke, and has clear and complete edges of the strokes.

Claims (3)

1. A calligraphy character extraction method based on K neighbor matting and mathematical morphology is characterized by comprising the following steps:
reading a color image to be processed by using software in a computer;
converting the color image to be processed from the RGB color space to the CTE-Lab color space to obtain an L channel;
extracting Chinese character information in the image by using a K neighbor matting algorithm to obtain a gray image serving as a reference image for extracting calligraphy characters;
after the reference image is binarized, corroding the binarized reference image by using mathematical morphology, and subtracting the corroded reference image from the reference image obtained in the third step to obtain an edge image of the calligraphy character;
step five, performing small-window guide filtering processing on the edge image, and selecting a window with a proper size to perform guide filtering processing on the calligraphy character internal image;
and sixthly, performing pixel-level image fusion on the filtering result of the edge image and the filtering result of the image inside the calligraphy character to finish the process.
2. The method for extracting calligraphy characters based on K-neighbor matting and mathematical morphology as claimed in claim 1, wherein the specific process of the third step comprises:
step S30, extracting feature vectors using the color and position information of the image, the formula is as follows:
X(i)=(cos(h),sin(h),s,v,x,y)i
in the above formula, x (i) is a feature vector, h, s, v are three components of the space of HSV color, respectively, and x, y are position coordinates of a pixel;
step S31, defining a kernel function:
k(i,j)=1-||X(i)-X(j)||/C
in the above formula, k (i, j) is a kernel function, x (i) and x (j) are different feature vectors, and C is a weight adjustment coefficient for ensuring that k (i, j) belongs to (0, 1);
obtaining a Laplace matrix from a kernel function:
L=D-A
in the above formula, D is a diagonal matrix, and the elements on the diagonal of DA is a similarity matrix;
step S32, adding user constraint information to obtain a closed solution:
α=(L+λM)-1(λV)
in the above formula, M is a diagonal matrix representing the user's label of a known pixel, V is a vector representing the user's label of a foreground region, λ is a constraint coefficient, and L is the brightness of the color image in the Lab color space;
step S33, substituting the value of the closed solution α into the following formula to obtain a reference image:
R=αf+(1-α)b
in the above formula, R is a reference image, f is an unknown foreground layer, and b is an unknown background layer. .
3. The method for extracting calligraphy characters based on K-neighbor matting and mathematical morphology as claimed in claim 1, wherein the specific process of the fourth step comprises:
step S40, binarizing the reference image
The average pixel value of the reference image is calculated using the following formula:
u = &Sigma; x = 1 , y = 1 x = M , y = N f ( x , y ) M &times; N
in the above formula, u represents an average pixel value of the L channel, f (x, y) represents a pixel value of a pixel at coordinates (x, y) in the image, and M and N represent the length and width of the image, respectively;
step S41, if the optimal threshold for binarization processing of the reference image is T, then the ratio of pixels with pixel values greater than T in the L channel to the image is countedExample w1And the proportion w of pixels with pixel values less than or equal to T in the L channel to the image2And calculating the average pixel value u of the pixels with the pixel values larger than T in the L channel1And an average pixel value u of pixels having a pixel value of T or less in the L channel2
Step S42, traversing each possible value of T, and calculating the inter-class difference value using the following formula:
G=w1×(u1-u)×(u1-u)+w2×(u2-u)×(u2-u)
in the above formula, G represents a difference value between the target portion and the background portion during the binarization processing, when G reaches a maximum value, an optimal threshold T for binarization can be obtained, and then the reference image is subjected to binarization processing using the following formula:
step S43, corroding the binarized reference image by using a matrix with 3 x 3 structural elements to reduce the edge of the calligraphy character by one pixel, and subtracting the corroded reference image from the reference image to obtain the edge of the calligraphy character; wherein:
the erosion operation is defined as:
RΘBs={Z,Bz∈R}
the mathematical form edge extraction operator is as follows:
ED(R)=R-(RΘB)
in the above two formulas, B is a structural element of 3 x 3, BZAs a result of the translation of the structuring element by Z units, BSFor a set of structural elements that are symmetric about the origin, ed (R) is the edge of the calligraphic word in the reference image R.
CN201510810577.3A 2015-11-20 2015-11-20 One kind scratching figure and the morphologic writing brush word extracting method of mathematics based on k nearest neighbor Expired - Fee Related CN105373798B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510810577.3A CN105373798B (en) 2015-11-20 2015-11-20 One kind scratching figure and the morphologic writing brush word extracting method of mathematics based on k nearest neighbor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510810577.3A CN105373798B (en) 2015-11-20 2015-11-20 One kind scratching figure and the morphologic writing brush word extracting method of mathematics based on k nearest neighbor

Publications (2)

Publication Number Publication Date
CN105373798A true CN105373798A (en) 2016-03-02
CN105373798B CN105373798B (en) 2018-08-28

Family

ID=55375980

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510810577.3A Expired - Fee Related CN105373798B (en) 2015-11-20 2015-11-20 One kind scratching figure and the morphologic writing brush word extracting method of mathematics based on k nearest neighbor

Country Status (1)

Country Link
CN (1) CN105373798B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106340027A (en) * 2016-08-26 2017-01-18 西北大学 Calligraphy background reconstruction method based on image super resolution
CN107403405A (en) * 2016-05-20 2017-11-28 富士通株式会社 Image processing apparatus, image processing method and information processor
CN109460735A (en) * 2018-11-09 2019-03-12 中国科学院自动化研究所 Document binary processing method, system, device based on figure semi-supervised learning
CN112396581A (en) * 2020-11-13 2021-02-23 国网天津市电力公司营销服务中心 Method for detecting and repairing scratches on upper cover of disassembled and reused electrical information acquisition terminal

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1885317A (en) * 2006-07-06 2006-12-27 上海交通大学 Adaptive edge detection method based on morphology and information entropy
CN101930597A (en) * 2010-08-10 2010-12-29 浙江大学 Mathematical morphology-based image edge detection method
CN103020917A (en) * 2012-12-29 2013-04-03 中南大学 Method for restoring ancient Chinese calligraphy and painting images on basis of conspicuousness detection
CN104834890A (en) * 2015-02-13 2015-08-12 浙江大学 Method for extracting expression information of characters in calligraphy work

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1885317A (en) * 2006-07-06 2006-12-27 上海交通大学 Adaptive edge detection method based on morphology and information entropy
CN101930597A (en) * 2010-08-10 2010-12-29 浙江大学 Mathematical morphology-based image edge detection method
CN103020917A (en) * 2012-12-29 2013-04-03 中南大学 Method for restoring ancient Chinese calligraphy and painting images on basis of conspicuousness detection
CN104834890A (en) * 2015-02-13 2015-08-12 浙江大学 Method for extracting expression information of characters in calligraphy work

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107403405A (en) * 2016-05-20 2017-11-28 富士通株式会社 Image processing apparatus, image processing method and information processor
CN106340027A (en) * 2016-08-26 2017-01-18 西北大学 Calligraphy background reconstruction method based on image super resolution
CN106340027B (en) * 2016-08-26 2019-02-01 西北大学 A kind of calligraphy Background Rebuilding Method based on image super-resolution
CN109460735A (en) * 2018-11-09 2019-03-12 中国科学院自动化研究所 Document binary processing method, system, device based on figure semi-supervised learning
CN112396581A (en) * 2020-11-13 2021-02-23 国网天津市电力公司营销服务中心 Method for detecting and repairing scratches on upper cover of disassembled and reused electrical information acquisition terminal

Also Published As

Publication number Publication date
CN105373798B (en) 2018-08-28

Similar Documents

Publication Publication Date Title
CN110619642B (en) Method for separating seal and background characters in bill image
CN105654436B (en) A kind of backlight image enhancing denoising method based on prospect background separation
CN104050471B (en) Natural scene character detection method and system
CN107516316B (en) Method for segmenting static human body image by introducing focusing mechanism into FCN
CN109558806B (en) Method for detecting high-resolution remote sensing image change
CN104834890B (en) A kind of extracting method to word expression information in calligraphy work
CN103824091B (en) A kind of licence plate recognition method for intelligent transportation system
Harraj et al. OCR accuracy improvement on document images through a novel pre-processing approach
CN103020917B (en) Method for restoring ancient Chinese calligraphy and painting images on basis of conspicuousness detection
CN110309806B (en) Gesture recognition system and method based on video image processing
CN109948625A (en) Definition of text images appraisal procedure and system, computer readable storage medium
CN109978848B (en) Method for detecting hard exudation in fundus image based on multi-light-source color constancy model
CN108830857B (en) Self-adaptive Chinese character copy label image binarization segmentation method
CN111145209A (en) Medical image segmentation method, device, equipment and storage medium
CN105373798B (en) One kind scratching figure and the morphologic writing brush word extracting method of mathematics based on k nearest neighbor
CN109472788B (en) Method for detecting flaw on surface of airplane rivet
CN111539409B (en) Ancient tomb question and character recognition method based on hyperspectral remote sensing technology
CN104766344B (en) Vehicle checking method based on movement edge extractor
Li et al. Saliency based image segmentation
US9852354B2 (en) Method and apparatus for image scoring and analysis
Shaikh et al. A novel approach for automatic number plate recognition
CN107066972A (en) Natural scene Method for text detection based on multichannel extremal region
CN104021566A (en) GrabCut algorithm-based automatic segmentation method of tongue diagnosis image
CN112287765B (en) Face living body detection method, device, equipment and readable storage medium
CN113158977A (en) Image character editing method for improving FANnet generation network

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180828

Termination date: 20201120

CF01 Termination of patent right due to non-payment of annual fee