CN103646247A - Music score recognition method - Google Patents
Music score recognition method Download PDFInfo
- Publication number
- CN103646247A CN103646247A CN201310445379.2A CN201310445379A CN103646247A CN 103646247 A CN103646247 A CN 103646247A CN 201310445379 A CN201310445379 A CN 201310445379A CN 103646247 A CN103646247 A CN 103646247A
- Authority
- CN
- China
- Prior art keywords
- image
- ordinate
- connected domain
- horizontal
- vertical
- 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
Links
Images
Landscapes
- Auxiliary Devices For Music (AREA)
- Character Discrimination (AREA)
Abstract
The invention discloses a music score recognition method. The music score recognition method comprises: a music image is inputted, and a binary image of the music image is acquired; horizontal correction is performed on each region of the binary image through the cross-correlation function to acquire a horizontal image; score line locating is performed on the horizontal image, and score lines are deleted to acquire an image of the deleted score lines; note stems are located in the image of the deleted score lines to acquire coordinate data of note stem primitives, and an image of the note stems is deleted; trailbridges are located in the image of the deleted note stems to acquire coordinate data of trailbridge primitives, and an image of the trailbridges is deleted; note heads are located in the image of the deleted trailbridges to acquire coordinate data of note head primitives; and the data of the primitive note stems, the data of the trailbridges and the data of the note heads are matched, and the part number, the duration and the pitch are integrated to generate a music XML file for saving. According to the embodiments of the invention, a music score can be recorded into a computer, so the music score low recording efficiency problem can be solved.
Description
Technical field
The present invention relates to field of computer technology, relate in particular to a kind of music score recognition methods
Background technology
Along with the development of computer utility, all kinds of audio edited softwares constantly perfect, computing machine has become an indispensable instrument in musical composition process.Staff is as a kind of relative standard and comprehensive music recording mode, at aspects such as the creation of music and teaching, used widely.Digitized music score, for traditional papery music score, not only has huge advantage aspect portable and memory capacity, and can inquire about easily by network, manages and shares with other people.
Under the environment in large epoch of informationization, arise at the historic moment in network music score of Chinese operas storehouse, and music score of Chinese operas retrieval and search-read function have been released respectively in Google's books (Google Books) and Gu Dengbao plan (Project Gutenberg)." international music score library item order " (being called for short IMSLP), has been built this website of IMSLP music library (imslp.org), for collecting the electronic music of uploading from global backers.
Yet the music score that still has at present considerable quantity exists with the form of papery, even if storage is also mostly preserved with the form of picture on computers.When people need to utilize function abundant on computing machine to edit music score, inevitably will be first by the electronics software of setting the chessman on the chessboard according to the chess manual, music score be manually converted into electronic document.The use software of setting the chessman on the chessboard according to the chess manual not only will possess certain music professional knowledge, but also needs the ancillary cost time to grasp complicated operational order and experience skill; In addition, music score Input Process is complicated, uninteresting, and inefficiency has been hit the enthusiasm that music-lovers use area of computer aided music learning and creation greatly.
On the other hand, flourish along with digital library, also quietly rise in digital music library.The digitizing of collection papery music score resource has become the task of top priority of building digital music library.The music score that music library hides is ten hundreds of, and so great Digitization Project, if merely by traditional manual entry, will be very long and hard work, not only time-consuming but also expensive.Therefore,, in the digitized process of papery music score, the music information input of low speed and the contradiction between high speed information processing have inevitably been produced.
Summary of the invention
Technical matters to be solved by this invention is to provide a kind of music score recognition methods, the problem of inefficiency when solution is entered in computing machine by music score.
For solving the problems of the technologies described above, the embodiment of the present invention provides a kind of music score recognition methods, comprising:
A. input musical score image, obtain the bianry image of described musical score image;
B. use cross correlation function to carry out level correction to each region of described bianry image, obtain horizontal image;
C. described horizontal image is carried out to spectral line location, and delete described spectral line, obtain the image of deleting spectral line;
D. in the image of described deletion spectral line, finger URL is dry, obtains the coordinate data of symbol butt unit, and the dry image of cancellation mark;
E. in the dry image of described cancellation mark, locate docking bridge, obtain the coordinate data of docking bridge primitive, and delete the image of docking bridge;
F. finger URL head in the image of described deletion docking bridge, obtains the coordinate data of a symbol primitive;
G. the data of primitive symbol is dry, docking bridge, symbol head are mated, and integrate Part, duration and sound pitch, generate musicXML file and preserve.
Further, described step a specifically comprises:
A1. scan music score and obtain musical score image;
A2. described musical score image is carried out to binaryzation, the sliding filtering processing of figure image intensifying peace, obtain bianry image.
Further, described step b specifically comprises:
Utilize cross correlation function to carry out level correction to described bianry image, obtain horizontal image;
Wherein, cross correlation function is
g (x, y) represent that on described bianry image, horizontal ordinate is x, ordinate is some pixel A of y, g (x+d, y+ μ) represent that on described bianry image, horizontal ordinate is x+d, ordinate is the one other pixel point B of y+ μ, and d represents the horizontal range between A and B, μ represents the vertical range between A and B, C
(x, μ)represent the correlativity between A and B; 0≤x≤W, 0≤y≤H, W represents the width of described bianry image, H represents the height of described bianry image.
Further, described step c specifically comprises:
C1. described horizontal image is carried out to horizontal projection, on statistics differing heights, the number of horizontal projection queue black picture element obtains horizontal projection array, and in described horizontal projection array, the position at peak value place is position of spectral line;
C2. the pixel at the two ends up and down of the black picture element of spectral line position is judged, if the pixel on both sides is all white, and the height of this black picture element is less than or equal to the height of spectral line expection, changes this black picture element into white, obtain the image of deleting spectral line.
Further, described steps d specifically comprises:
D1. the image of described deletion spectral line is carried out, after Gaussian Blur processing, it being carried out to skeletonizing operation;
D2. create array VLTemp[] for preserving the ordinate of upper extreme point of vertical curve of the image of described deletion spectral line, VLTemp[i] represent the ordinate of the upper extreme point of the vertical curve that horizontal ordinate is x=i; And initialization VLTemp[i]=-1(i=0 ..., W-1);
For the corresponding vertical curve of i:
According to ordinate order from big to small, detect the color of each pixel on described vertical curve and left and right sides pixel thereof, if this pixel color is black, its left and right sides pixel color is white, represent white pixel with 0,1 represents black picture element, and Pixel arrangement shape is as " 010 " pattern, and VLTemp[i] be-1 o'clock, by VLTemp[i] change the ordinate y in current traversal into
1if current traversal coordinate does not meet " 010 " pattern, VLTemp[i] be not-1 o'clock again, judge current traversal ordinate and VLTemp[i] between difference, if difference is greater than length threshold values t
1, t
1be two pixels, current traversal ordinate is the lower extreme point ordinate y of described vertical curve
2;
By the upper extreme point ordinate y of described vertical curve
1, lower extreme point ordinate y
2, horizontal ordinate x is saved in chained list C1, again gives VLTemp[i] and initialize-1;
D3. described chained list C1 is carried out to two minor sorts, for the first time by the horizontal ordinate x sequence of described vertical curve, for the second time by the ordinate y of described vertical curve
2sort, and with array vSet, record the position coordinates of every a line article one vertical curve;
D4. travel through the horizontal ordinate of vertical curve in described chained list C1, and judge the difference of the horizontal ordinate x of vertical curve, if occur, the difference of the horizontal ordinate x of two vertical curves is less than threshold values t
2, t
2be two pixels, judge the ordinate of described two vertical curves, if described two vertical curves upper extreme point ordinate y of wherein
1lower extreme point ordinate y with other one
2difference be also less than threshold values t
2, now described two vertical curves being judged to be to the vertical curve being truncated, the merging formula of described two vertical curves that are truncated is:
During the situation of the vertical curve that ordinate is larger in deleting described two vertical curves that are truncated:
During the situation of the vertical curve that ordinate is less in deleting described two vertical curves that are truncated:
Wherein,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is less,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is larger;
Reset the array vSet that records every a line article one vertical line;
D5. the vertical curve that the difference of the ordinate of the end points up and down of the vertical curve recording in described chained list C1 is surpassed to 1.5*4* λ is deleted, and wherein λ is separation of spectra;
D6. by the dry white pixel that changes into of the corresponding symbol of coordinate of depositing in described chained list C1, obtain the dry image of cancellation mark.
Further, described step e specifically comprises:
E1. extract the bulk connected domain in the dry image of described cancellation mark:
E2. create the duplicate pictures of the dry image of described cancellation mark;
Travel through described duplicate pictures, length is less than to threshold values t
3level and vertically the distance of swimming change white pixel into, wherein, t
3equal λ+2, and area is less than to λ
2* the connected domain that π/8, or boundary rectangle height is greater than H/2 changes white pixel into, the height that wherein H is described bianry image;
E3. first round docking bridge identification:
The linearity Lin of the upper lower limb of the connected domain in the described duplicate pictures that judgement is processed through e1, wherein, the span of linearity Lin is (0,1], Lin more approaches 1, and the tortuous degree of edge contour is lower, the shape that represents the upper lower limb of connected domain more approaches straight line, if the linearity Lin at any edge up and down of described connected domain approaches 1, judge that this connected domain is as docking bridge, obtain the thickness sample of docking bridge connected domain;
E4. second take turns docking bridge identification:
In the described duplicate pictures of processing through e1, the length l on the judgement less limit of connected domain boundary rectangle, if when l equals or approaches the thickness sample of described docking bridge connected domain, judges that this connected domain is docking bridge;
The position coordinates of described docking bridge is left in chained list C2;
E5. travel through described chained list C2, generate array tSet and record first docking bridge of every a line; And change the docking bridge in the dry image of the corresponding above-mentioned cancellation mark of the coordinate of depositing in described chained list C2 into white pixel, obtain deleting the image of docking bridge.
Further, described step f specifically comprises:
F1. the cutting to horizontal adhesion symbol head:
To deleting the horizontal width of the boundary rectangle of the connected domain in the image of docking bridge described in step e, judge, the horizontal width of getting boundary rectangle surpasses the transverse and longitudinal coordinate of the connected domain β of 1.5 λ, and wherein λ is separation of spectra;
Then on the music score at described connected domain β place is capable, search for the horizontal ordinate position place of left and right end of the boundary rectangle of described connected domain β, vertical curve through described connected domain β, and along this vertical curve, described connected domain β is cut, the height of cutting is the height of described connected domain β boundary rectangle;
F2. the cutting to vertical adhesion symbol head:
The connected domain of deleting described in step e in the image of docking bridge is cut according to music score spacing;
The screening of f3 symbol head:
By what obtain after f1, f2 step cutting, the boundary rectangle in the image of described deletion docking bridge tall and big in λ, the ratio of connected domain area and boundary rectangle area is greater than 0.65 connected domain and is judged as symbol head, and wherein λ is separation of spectra;
F4 leaves a symbol position coordinates in chained list C3 in.
Further, described step g specifically comprises:
G1 is according to the Part of the length 1.5*4* λ judgement music score of the spacing λ of spectral line and bar line;
G2, according to the dry position relationship with according with the coordinate of head of symbol, mates two corresponding chained list C1, C3 according to order from small to large;
G3, according to the position relationship that accords with the coordinate of dry and docking bridge, mates two corresponding chained list C1, C2 according to order from small to large;
G4 judges each duration according to the result of mating in g2 and g3;
G5 is according to the pitch of each note of position judgment of spectral line;
The position of the comprehensive Part of g6, note duration, pitch and other music score symbols, generates musicXML file.
Implement the embodiment of the present invention, there is following beneficial effect: by using this method that music score is entered in computing machine, people's problems such as software is complicated, uninteresting by time in the manual input computer of music score, inefficiency of setting the chessman on the chessboard according to the chess manual by electronics have been solved, realized music score quickly and efficiently in input computer, has been alleviated to the contradiction between the music information input of low speed and the information processing of high speed.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Fig. 2 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Fig. 3 is the schematic diagram of an embodiment of music score recognition methods provided by the invention;
Fig. 4 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Fig. 5 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Fig. 6 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Fig. 7 is the schematic flow sheet of an embodiment of music score recognition methods provided by the invention;
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only a part of embodiment of the present invention, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Referring to Fig. 1, be the schematic flow sheet of an embodiment of music score recognition methods provided by the invention, the method comprises the following steps:
S11, inputs musical score image, obtains the bianry image of described musical score image;
S12, is used cross correlation function to carry out level correction to each region of described bianry image, obtains horizontal image;
S13, carries out spectral line location to described horizontal image, and deletes described spectral line, obtains the image of deleting spectral line;
S14, in the image of described deletion spectral line, finger URL is dry, obtains the coordinate data of symbol butt unit, and the dry image of cancellation mark;
S15 locates docking bridge in the dry image of described cancellation mark, obtains the coordinate data of docking bridge primitive, and deletes the image of docking bridge;
S16, finger URL head in the image of described deletion docking bridge, obtain symbol a primitive coordinate data;
S17, the data of primitive symbol is dry, docking bridge, symbol head are mated, and integrate Part, duration and sound pitch, generate musicXML file and preserve.
Referring to Fig. 2, in one embodiment, step S11 comprises:
S11-1, scanning music score obtains musical score image;
S11-2, carries out binaryzation, the sliding filtering processing of figure image intensifying peace to musical score image, obtains bianry image.For example, in embodiment as shown in Figure 2, utilize scanner that music score 100 is scanned, obtain musical score image 101, musical score image 101 is carried out to binaryzation, the sliding filtering processing of figure image intensifying peace, obtain bianry image 102.
Referring to Fig. 3, in one embodiment, step S12 utilizes cross correlation function to carry out level correction to above-mentioned bianry image, obtains horizontal image.
Particularly, cross correlation function is
wherein, g (x, y) represents that on described bianry image, horizontal ordinate is x, ordinate is some pixel A of y, and g (x+d, y+ μ) represents that on described bianry image, horizontal ordinate is x+d, ordinate is the one other pixel point B of y+ μ, d represents the horizontal range between A and B, and μ represents the vertical range between A and B, and C represents the correlativity between A and B, 0≤x≤W, 0≤y≤H, W represents the width of described bianry image, H represents the height of described bianry image.
For example, as shown in Figure 3 in embodiment, the vertical straight line l of g (i, y) mark
1(x=i) group of certain on 103 pixel 104, g (i+d, y+ μ) mark and straight line l
1the 103 vertical straight line l at a distance of d
2(x=i+d) group of certain on 105 pixel 107, horizontal modifying factor μ 106 mark straight line l
2on pixel groups 107 with respect to straight line l
1on the offset of vertical amount of pixel groups 104,
be the cross correlation function of two groups of pixel g (i, y) and g (i+d, y+ μ); According to the definition of cross correlation function, with respect to the offset of vertical amount μ 106 of pixel groups 106 more hour, their cross correlation function is larger for pixel groups 107.So, the value of change offset of vertical amount μ 106, when cross correlation function reaches maximal value, the value of μ 106 should be just in time the offset of vertical amount of above-mentioned bianry image.Utilize the value of μ 106 to carry out level correction to above-mentioned bianry image, can obtain horizontal image.
More specifically, in order to reduce noise and other music score marks to calculating the impact of cross correlation function, vertical line in above-mentioned example is expanded to the strip region with certain width, g (x, y) with the horizontal projection size on the relevant position on strip region, replace, its specific algorithm is as follows:
S12-1, is divided into by above-mentioned bianry image the strip region that n width is w, calculates the horizontal projection array in each region, obtains the array P[n of two-dimensional projection] [H].Wherein k region horizontal projection size on height j is:
Wherein,
S12-2, ask for side-play amount array offset[n]: the horizontal projection array P[k to each region], make side-play amount μ change in certain scope, calculate successively each region with respect to previous region P[k-1] cross correlation function C (k, μ), and corresponding μ value during Selection of Function peak value, be saved in array offset[n] in.Wherein the formula of cross correlation function is as follows:
offset[k]=μ
k+offset[k-1]
S12-3, proofreaies and correct above-mentioned bianry image for level according to the result of offset: in the subregion that is w at each width, to pixel g (i, j), correction formula is as follows:
g'(i,j)=g(i,j-delay)
While calculating corrected parameter delay in the present embodiment, the side-play amount of coordinate (i, j) is by offset[i/w] and offset[i/w+1] jointly determine.The value of i%w is larger, shows that coordinate is the closer to next strip region, at this moment offset[i/w+1] weight also larger.This correcting mode has avoided revising the phenomenon of the straight line appearance " tomography " in later image, has guaranteed that revised straight line can be level and smooth.
In another embodiment, step S13 comprises:
S13-1, carries out horizontal projection to horizontal image, and on statistics differing heights, the number of horizontal projection queue black picture element obtains horizontal projection array, and in described horizontal projection array, the position at peak value place is position of spectral line;
S13-2, pixel to the two ends up and down of the black picture element of spectral line position judges, if the pixel on both sides is all white, and the height of this black picture element is less than or equal to the height of spectral line expection, change this black picture element into white, obtain the image of deleting spectral line.
Referring to Fig. 4, one preferred embodiment in, step S14 comprises:
S14-1, carries out, after Gaussian Blur processing, it being carried out to skeletonizing operation to the image 103 of above-mentioned deletion spectral line;
S14-2, creates array VLTemp[], preserve the ordinate of the upper extreme point of the vertical curve in the image 103 of above-mentioned deletion spectral line.For example, VLTemp[i] represent the ordinate of the upper extreme point of the vertical curve that horizontal ordinate is x=i.Initialization VLTemp[i]=-1(i=0 ..., W-1);
For the corresponding vertical curve of i:
According to ordinate order from big to small, detect the color of each pixel on described vertical curve and left and right sides pixel thereof, if this pixel color is black, its left and right sides pixel color is white, represent white pixel with 0,1 represents black picture element, and Pixel arrangement shape is as " 010 " pattern, and VLTemp[i] be-1 o'clock, by VLTemp[i] change the ordinate y in current traversal into
1if current traversal coordinate does not meet " 010 " pattern, VLTemp[i] be not-1 o'clock again, judge current traversal ordinate and VLTemp[i] between difference, if difference is greater than length threshold values t
1, t
1be two pixels, current traversal ordinate is the lower extreme point ordinate y of described vertical curve
2;
By the upper extreme point ordinate y of described vertical curve
1, lower extreme point ordinate y
2, horizontal ordinate x is saved in chained list C1, again gives VLTemp[i] and initialize-1;
S14-3, carries out two minor sorts to above-mentioned chained list C1, for the first time by the horizontal ordinate x sequence of described vertical curve, for the second time by the ordinate y of described vertical curve
2sort, and with array vSet, record the position coordinates of every a line article one vertical curve;
S14-4, travels through the horizontal ordinate of vertical curve in described chained list C1, and judges the difference of the horizontal ordinate x of vertical curve, if occur, the difference of the horizontal ordinate x of two vertical curves is less than threshold values t
2, t
2be two pixels, judge the ordinate of described two vertical curves, if described two vertical curves upper extreme point ordinate y of wherein
1lower extreme point ordinate y with other one
2difference be also less than threshold values t
2, now described two vertical curves being judged to be to the vertical curve being truncated, the merging formula of described two vertical curves that are truncated is:
During the situation of the vertical curve that ordinate is larger in deleting described two vertical curves that are truncated:
During the situation of the vertical curve that ordinate is less in deleting described two vertical curves that are truncated:
Wherein,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is less,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is larger;
Reset the array vSet that records every a line article one vertical line;
S14-5, the vertical curve that the difference of the ordinate of the end points up and down of the vertical curve recording in described chained list C1 is surpassed to 1.5*4* λ is deleted, and wherein λ is separation of spectra;
S14-6, the dry white pixel that changes into of the corresponding symbol of coordinate by depositing in described chained list C1, obtains the dry image of cancellation mark 104.
Referring to Fig. 5, in one embodiment, step S15 comprises:
S15-1, creates the duplicate pictures of the dry image 104 of above-mentioned cancellation mark;
S15-2, travels through described duplicate pictures, and length is less than to threshold values t
3level and vertically the distance of swimming change white pixel into, wherein, t
3equal λ+2, and area is less than to λ
2* the connected domain that π/8, or boundary rectangle height is greater than H/2 changes white pixel into, the height that wherein H is described bianry image;
S15-3, the linearity Lin of the upper lower limb of the connected domain in the described duplicate pictures that judgement is processed through e1, wherein, the span of linearity Lin be (0,1], Lin more approaches 1, the tortuous degree of edge contour is lower, represents that the shape of the upper lower limb of connected domain more approaches straight line, if the linearity Lin at any edge up and down of described connected domain approaches 1, judge that this connected domain is as docking bridge, obtain the thickness sample of docking bridge connected domain;
S15-4, in the described duplicate pictures of processing through e1, the length l on the judgement less limit of connected domain boundary rectangle, if when l equals or approaches the thickness sample of described docking bridge connected domain, judges that this connected domain is docking bridge;
The position coordinates of described docking bridge is left in chained list C2;
S15-5, travels through described chained list C2, generates array tSet and records first docking bridge of every a line; And change the docking bridge in the dry image 104 of the corresponding above-mentioned cancellation mark of the coordinate of depositing in described chained list C2 into white pixel, obtain deleting the image 105 of docking bridge.
Referring to Fig. 6, in one embodiment, step S16 comprises:
S16-1, judges to deleting the horizontal width of boundary rectangle of connected domain of 105 li of the images of docking bridge described in above-mentioned steps S15, the horizontal width of getting boundary rectangle surpasses the transverse and longitudinal coordinate of the connected domain β of 1.5 λ, and wherein λ is separation of spectra;
Then on the music score at described connected domain β place is capable, search for the horizontal ordinate position place of left and right end of the boundary rectangle of described connected domain β, vertical curve through described connected domain β, and along this vertical curve, described connected domain β is cut, the height of cutting is the height of described connected domain β boundary rectangle;
S16-2, cuts according to music score spacing deleting the connected domain of 105 li of the images of docking bridge described in above-mentioned steps e;
S16-3, by what obtain after S16-1, S16-2 step cutting, the boundary rectangle that the image of above-mentioned deletion docking bridge is 105 li tall and big in λ, the ratio of connected domain area and boundary rectangle area is greater than 0.65 connected domain and is judged as symbol head, and wherein λ is separation of spectra;
S16-4, leaves a symbol position coordinates in chained list C3 in.
Referring to Fig. 7, in one embodiment, step S17 comprises:
S17-1, according to the Part of the length 1.5*4* λ judgement music score of the spacing λ of spectral line and bar line;
S17-2, according to the dry position relationship with according with the coordinate of head of symbol, mates two corresponding chained list C1, C3 according to order from small to large;
S17-3, the position relationship according to according with the coordinate of dry and docking bridge, mates two corresponding chained list C1, C2 according to order from small to large;
S17-4, judges each duration according to the result of mating in above-mentioned steps S17-2 and S17-3;
S17-5, according to the pitch of each note of position judgment of spectral line;
S17-6, the position of comprehensive Part, note duration, pitch and other music score symbols, generates musicXML file 106.
The music score recognition methods that the embodiment of the present invention provides, may be used on computing machine music score identification field, by using this method that music score is entered in computing machine, people's problems such as software is complicated, uninteresting by time in the manual input computer of music score, inefficiency of setting the chessman on the chessboard according to the chess manual by electronics have been solved, realized music score quickly and efficiently in input computer, has been alleviated to the contradiction between the music information input of low speed and the information processing of high speed.
The above is the preferred embodiment of the present invention; it should be pointed out that for those skilled in the art, under the premise without departing from the principles of the invention; can also make some improvements and modifications, these improvements and modifications are also considered as protection scope of the present invention.
Claims (8)
1. a music score recognition methods, is characterized in that, comprising:
A. input musical score image, obtain the bianry image of described musical score image;
B. use cross correlation function to carry out level correction to each region of described bianry image, obtain horizontal image;
C. described horizontal image is carried out to spectral line location, and delete described spectral line, obtain the image of deleting spectral line;
D. in the image of described deletion spectral line, finger URL is dry, obtains the coordinate data of symbol butt unit, and the dry image of cancellation mark;
E. in the dry image of described cancellation mark, locate docking bridge, obtain the coordinate data of docking bridge primitive, and delete the image of docking bridge;
F. finger URL head in the image of described deletion docking bridge, obtains the coordinate data of a symbol primitive;
G. the data of primitive symbol is dry, docking bridge, symbol head are mated, and integrate Part, duration and sound pitch, generate musicXML file.
2. music score recognition methods according to claim 1, is characterized in that, described step a specifically comprises:
A1. scan music score and obtain musical score image;
A2. described musical score image is carried out to binaryzation, the sliding filtering processing of figure image intensifying peace, obtain bianry image.
3. music score recognition methods according to claim 1, is characterized in that, described step b specifically comprises:
Utilize cross correlation function to carry out level correction to described bianry image, obtain horizontal image;
Wherein, cross correlation function is
g (x, y) represent that on described bianry image, horizontal ordinate is x, ordinate is some pixel A of y, g (x+d, y+ μ) represent that on described bianry image, horizontal ordinate is x+d, ordinate is the one other pixel point B of y+ μ, and d represents the horizontal range between A and B, μ represents the vertical range between A and B, C
(x, μ)represent the correlativity between A and B; 0≤x≤W, 0≤y≤H, W represents the width of described bianry image, H represents the height of described bianry image.
4. music score recognition methods according to claim 1, is characterized in that, described step c specifically comprises:
C1. described horizontal image is carried out to horizontal projection, on statistics differing heights, the number of horizontal projection queue black picture element obtains horizontal projection array, and in described horizontal projection array, the position at peak value place is position of spectral line;
C2. the pixel at the two ends up and down of spectral line position black picture element is judged, if the pixel on both sides is all white, and the height of this black picture element is less than or equal to the height of spectral line expection, changes this black picture element into white, obtain the image of deleting spectral line.
5. music score recognition methods according to claim 1, is characterized in that, described steps d specifically comprises:
D1. the image of described deletion spectral line is carried out, after Gaussian Blur processing, it being carried out to skeletonizing operation;
D2. create array VLTemp[] for preserving the ordinate of upper extreme point of vertical curve of the image of described deletion spectral line, VLTemp[i] represent the ordinate of the upper extreme point of the vertical curve that horizontal ordinate is x=i; And initialization VLTemp[i]=-1(i=0 ..., W-1);
For the corresponding vertical curve of i:
According to ordinate order from big to small, detect the color of each pixel on described vertical curve and left and right sides pixel thereof, if this pixel color is black, its left and right sides pixel color is white, represent white pixel with 0,1 represents black picture element, and Pixel arrangement shape is as " 010 " pattern, and VLTemp[i] be-1 o'clock, by VLTemp[i] change the ordinate y in current traversal into
1if current traversal coordinate does not meet " 010 " pattern, VLTemp[i] be not-1 o'clock again, judge current traversal ordinate and VLTemp[i] between difference, if difference is greater than length threshold values t
1, t
1be two pixels, current traversal ordinate is the lower extreme point ordinate y of described vertical curve
2;
By the upper extreme point ordinate y of described vertical curve
1, lower extreme point ordinate y
2, horizontal ordinate x is saved in chained list C1, again gives VLTemp[i] and initialize-1;
D3. described chained list C1 is carried out to two minor sorts, for the first time by the horizontal ordinate x sequence of described vertical curve, for the second time by the ordinate y of described vertical curve
2sort, and with array vSet, record the position coordinates of every a line article one vertical curve;
D4. travel through the horizontal ordinate of vertical curve in described chained list C1, and judge the difference of the horizontal ordinate x of vertical curve, if occur, the difference of the horizontal ordinate x of two vertical curves is less than threshold values t
2, t
2be two pixels, judge the ordinate of described two vertical curves, if described two vertical curves upper extreme point ordinate y of wherein
1lower extreme point ordinate y with other one
2difference be also less than threshold values t
2, now described two vertical curves being judged to be to the vertical curve being truncated, the merging formula of described two vertical curves that are truncated is:
During the situation of the vertical curve that ordinate is larger in deleting described two vertical curves that are truncated:
During the situation of the vertical curve that ordinate is less in deleting described two vertical curves that are truncated:
Wherein,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is less,
the upper extreme point, the lower extreme point ordinate that represent that vertical curve that in described two vertical curves that are truncated, ordinate is larger;
Reset the array vSet that records every a line article one vertical line;
D5. the vertical curve that the difference of the ordinate of the end points up and down of the vertical curve recording in described chained list C1 is surpassed to 1.5*4* λ is deleted, and wherein λ is separation of spectra;
D6. by the dry white pixel that changes into of the corresponding symbol of coordinate of depositing in described chained list C1, obtain the dry image of cancellation mark.
6. music score recognition methods according to claim 1, is characterized in that, described step e specifically comprises:
E1. extract the bulk connected domain in the dry image of described cancellation mark:
Create the duplicate pictures of the dry image of described cancellation mark;
Travel through described duplicate pictures, length is less than to threshold values t
3level and vertically the distance of swimming change white pixel into, wherein, t
3equal λ+2, and area is less than to λ
2* the connected domain that π/8, or boundary rectangle height is greater than H/2 changes white pixel into, the height that wherein H is described bianry image;
E2. first round docking bridge identification:
The linearity Lin of the upper lower limb of the connected domain in the described duplicate pictures that judgement is processed through e1, wherein, the span of linearity Lin is (0,1], Lin more approaches 1, and the tortuous degree of edge contour is lower, the shape that represents the upper lower limb of connected domain more approaches straight line, if the linearity Lin at any edge up and down of described connected domain approaches 1, judge that this connected domain is as docking bridge, obtain the thickness sample of docking bridge connected domain;
E3. second take turns docking bridge identification:
In the described duplicate pictures of processing through e1, the length l on the judgement less limit of connected domain boundary rectangle, if when l equals or approaches the thickness sample of described docking bridge connected domain, judges that this connected domain is docking bridge;
The position coordinates of described docking bridge is left in chained list C2;
E4. travel through described chained list C2, generate array tSet and record first docking bridge of every a line; And change the docking bridge in the dry image of the corresponding above-mentioned cancellation mark of the coordinate of depositing in described chained list C2 into white pixel, obtain deleting the image of docking bridge.
7. music score recognition methods according to claim 1, is characterized in that, described step f specifically comprises:
F1. the cutting to horizontal adhesion symbol head:
To deleting the horizontal width of the boundary rectangle of the connected domain in the image of docking bridge described in step e, judge, the horizontal width of getting boundary rectangle surpasses the transverse and longitudinal coordinate of the connected domain β of 1.5 λ, and wherein λ is separation of spectra;
Then on the music score at described connected domain β place is capable, search for the horizontal ordinate position place of left and right end of the boundary rectangle of described connected domain β, vertical curve through described connected domain β, and along this vertical curve, described connected domain β is cut, the height of cutting is the height of described connected domain β boundary rectangle;
F2. the cutting to vertical adhesion symbol head:
The connected domain of deleting described in step e in the image of docking bridge is cut according to music score spacing;
The screening of f3 symbol head:
By what obtain after f1, f2 step cutting, the boundary rectangle in the image of described deletion docking bridge tall and big in λ, the ratio of connected domain area and boundary rectangle area is greater than 0.65 connected domain and is judged as symbol head, and wherein λ is separation of spectra;
F4 leaves a symbol position coordinates in chained list C3 in.
8. music score recognition methods according to claim 1, is characterized in that, described step g specifically comprises:
G1 is according to the Part of the length 1.5*4* λ judgement music score of the spacing λ of spectral line and bar line;
G2, according to the dry position relationship with according with the coordinate of head of symbol, mates two corresponding chained list C1, C3 according to order from small to large;
G3, according to the position relationship that accords with the coordinate of dry and docking bridge, mates two corresponding chained list C1, C2 according to order from small to large;
G4 judges each duration according to the result of mating in g2 and g3;
G5 is according to the pitch of each note of position judgment of spectral line;
The position of the comprehensive Part of g6, note duration, pitch and other music score symbols, generates musicXML file.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310445379.2A CN103646247B (en) | 2013-09-26 | 2013-09-26 | A kind of music score recognition method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310445379.2A CN103646247B (en) | 2013-09-26 | 2013-09-26 | A kind of music score recognition method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103646247A true CN103646247A (en) | 2014-03-19 |
CN103646247B CN103646247B (en) | 2016-11-23 |
Family
ID=50251458
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310445379.2A Expired - Fee Related CN103646247B (en) | 2013-09-26 | 2013-09-26 | A kind of music score recognition method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103646247B (en) |
Cited By (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104217731A (en) * | 2014-08-28 | 2014-12-17 | 东南大学 | Quick solo music score recognizing method |
CN105022993A (en) * | 2015-06-30 | 2015-11-04 | 北京邮电大学 | Stave playing system based on image recognition technology |
CN106097830A (en) * | 2016-08-17 | 2016-11-09 | 广州视睿电子科技有限公司 | A kind of music score recognition method and device |
CN106203225A (en) * | 2015-05-29 | 2016-12-07 | Ncr公司 | Pictorial element based on the degree of depth is deleted |
CN106297755A (en) * | 2016-09-28 | 2017-01-04 | 北京邮电大学 | A kind of electronic equipment for musical score image identification and recognition methods |
CN106446952A (en) * | 2016-09-28 | 2017-02-22 | 北京邮电大学 | Method and apparatus for recognizing score image |
CN106548168A (en) * | 2016-10-25 | 2017-03-29 | 天津大学 | A kind of detection of staff spectral line and delet method based on low-rank structure |
CN106570508A (en) * | 2016-11-05 | 2017-04-19 | 天津大学 | Music score line detecting and deleting method based on local binary pattern |
CN110147765A (en) * | 2019-05-21 | 2019-08-20 | 新华三信息安全技术有限公司 | A kind of image processing method and device |
CN110544411A (en) * | 2019-09-03 | 2019-12-06 | 玖月音乐科技(北京)有限公司 | staff fingering quick marking method and system |
CN111274891A (en) * | 2020-01-14 | 2020-06-12 | 成都嗨翻屋科技有限公司 | Method and system for extracting pitches and corresponding lyrics for numbered musical notation images |
CN111968452A (en) * | 2020-08-21 | 2020-11-20 | 江苏师范大学 | Harmony learning method and device and electronic equipment |
CN112133264A (en) * | 2020-08-31 | 2020-12-25 | 广东工业大学 | Music score recognition method and device |
CN112204562A (en) * | 2018-03-28 | 2021-01-08 | 恩科达有限公司 | Music character system |
CN116343720A (en) * | 2023-04-10 | 2023-06-27 | 广州感音科技有限公司 | Multi-sound part music score note grouping method, system, medium and computer |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090202106A1 (en) * | 2008-02-12 | 2009-08-13 | Tae-Hwa Hong | Method for recognizing music score image with automatic accompaniment in mobile device |
CN103106403A (en) * | 2013-01-08 | 2013-05-15 | 沈阳理工大学 | Note element division method based on image processing and note knowledge |
-
2013
- 2013-09-26 CN CN201310445379.2A patent/CN103646247B/en not_active Expired - Fee Related
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20090202106A1 (en) * | 2008-02-12 | 2009-08-13 | Tae-Hwa Hong | Method for recognizing music score image with automatic accompaniment in mobile device |
CN103106403A (en) * | 2013-01-08 | 2013-05-15 | 沈阳理工大学 | Note element division method based on image processing and note knowledge |
Non-Patent Citations (1)
Title |
---|
刘晓翔: "光学乐谱识别技术研究与实现", 《中国博士学位论文全文数据库 信息科技辑》 * |
Cited By (24)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104217731A (en) * | 2014-08-28 | 2014-12-17 | 东南大学 | Quick solo music score recognizing method |
CN106203225B (en) * | 2015-05-29 | 2019-06-07 | Ncr公司 | Pictorial element based on depth is deleted |
CN106203225A (en) * | 2015-05-29 | 2016-12-07 | Ncr公司 | Pictorial element based on the degree of depth is deleted |
CN105022993B (en) * | 2015-06-30 | 2018-02-06 | 北京邮电大学 | A kind of staff player method based on image recognition technology |
CN105022993A (en) * | 2015-06-30 | 2015-11-04 | 北京邮电大学 | Stave playing system based on image recognition technology |
CN106097830B (en) * | 2016-08-17 | 2018-12-07 | 广州视睿电子科技有限公司 | A kind of music score recognition method and device |
CN106097830A (en) * | 2016-08-17 | 2016-11-09 | 广州视睿电子科技有限公司 | A kind of music score recognition method and device |
CN106446952A (en) * | 2016-09-28 | 2017-02-22 | 北京邮电大学 | Method and apparatus for recognizing score image |
CN106297755A (en) * | 2016-09-28 | 2017-01-04 | 北京邮电大学 | A kind of electronic equipment for musical score image identification and recognition methods |
CN106446952B (en) * | 2016-09-28 | 2019-08-16 | 北京邮电大学 | A kind of musical score image recognition methods and device |
CN106297755B (en) * | 2016-09-28 | 2023-06-13 | 北京邮电大学 | Electronic equipment and identification method for music score image identification |
CN106548168A (en) * | 2016-10-25 | 2017-03-29 | 天津大学 | A kind of detection of staff spectral line and delet method based on low-rank structure |
CN106548168B (en) * | 2016-10-25 | 2019-10-18 | 天津大学 | A kind of detection of staff spectral line and delet method based on low-rank structure |
CN106570508A (en) * | 2016-11-05 | 2017-04-19 | 天津大学 | Music score line detecting and deleting method based on local binary pattern |
CN112204562A (en) * | 2018-03-28 | 2021-01-08 | 恩科达有限公司 | Music character system |
CN110147765B (en) * | 2019-05-21 | 2021-05-28 | 新华三信息安全技术有限公司 | Image processing method and device |
CN110147765A (en) * | 2019-05-21 | 2019-08-20 | 新华三信息安全技术有限公司 | A kind of image processing method and device |
CN110544411A (en) * | 2019-09-03 | 2019-12-06 | 玖月音乐科技(北京)有限公司 | staff fingering quick marking method and system |
CN111274891A (en) * | 2020-01-14 | 2020-06-12 | 成都嗨翻屋科技有限公司 | Method and system for extracting pitches and corresponding lyrics for numbered musical notation images |
CN111968452A (en) * | 2020-08-21 | 2020-11-20 | 江苏师范大学 | Harmony learning method and device and electronic equipment |
CN112133264A (en) * | 2020-08-31 | 2020-12-25 | 广东工业大学 | Music score recognition method and device |
CN112133264B (en) * | 2020-08-31 | 2023-09-22 | 广东工业大学 | Music score recognition method and device |
CN116343720A (en) * | 2023-04-10 | 2023-06-27 | 广州感音科技有限公司 | Multi-sound part music score note grouping method, system, medium and computer |
CN116343720B (en) * | 2023-04-10 | 2023-11-21 | 广州感音科技有限公司 | Multi-sound part music score note grouping method, system, medium and computer |
Also Published As
Publication number | Publication date |
---|---|
CN103646247B (en) | 2016-11-23 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103646247A (en) | Music score recognition method | |
CN111814722B (en) | Method and device for identifying table in image, electronic equipment and storage medium | |
CN106156761B (en) | Image table detection and identification method for mobile terminal shooting | |
CN110032938B (en) | Tibetan recognition method and device and electronic equipment | |
CN104573731B (en) | Fast target detection method based on convolutional neural networks | |
CN110738207A (en) | character detection method for fusing character area edge information in character image | |
CN107563379B (en) | Method for positioning text in natural scene image | |
CN105426890B (en) | A kind of graphical verification code recognition methods of character distortion adhesion | |
CN110180186A (en) | A kind of topographic map conversion method and system | |
CN104137119B (en) | Image processing apparatus and image processing method | |
CN112712273B (en) | Handwriting Chinese character aesthetic degree judging method based on skeleton similarity | |
CN110598581B (en) | Optical music score recognition method based on convolutional neural network | |
CN113096121B (en) | Pavement crack detection method and system based on cross fracture mechanics and image processing | |
CN101866418A (en) | Method and equipment for determining file reading sequences | |
CN110659644A (en) | Automatic extraction method for strokes of calligraphy single characters | |
CN109409378A (en) | A kind of digitalized processing method of Nahsi Dongba Confucian classics | |
Van Phan et al. | Development of Nom character segmentation for collecting patterns from historical document pages | |
CN106326872A (en) | Method for extracting gesture contour in augmented reality system | |
CN116229265A (en) | Method for automatically and nondestructively extracting phenotype of soybean plants | |
CN116052105A (en) | Pavement crack identification classification and area calculation method, system, equipment and terminal | |
CN101944180A (en) | Music note primitive segmentation method based on music note knowledge and double projection method | |
CN103927533B (en) | The intelligent processing method of graph text information in a kind of scanned document for earlier patents | |
Valy et al. | Line segmentation for grayscale text images of khmer palm leaf manuscripts | |
CN105069766B (en) | A kind of an inscription on a tablet restorative procedure based on the description of Chinese character image contour feature | |
CN113041578B (en) | Robot automatic ball picking method based on morphological characteristics and monocular measurement |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right | ||
TR01 | Transfer of patent right |
Effective date of registration: 20170405 Address after: Goose Ridge Road 516001 in Guangdong province Huizhou city Huicheng District No. 16 building 101 room nineteenth Pinnacle hills Patentee after: HUIZHOU WEITENG ELECTRONIC TECHNOLOGY CO.,LTD. Address before: 516007 Huicheng City, Guangdong Province, the main road, No. 46, No. Patentee before: HUIZHOU University |
|
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20161123 |