WO1999034352A1 - Procede de reconnaissance de la musique et support d'enregistrement lisible par un ordinateur sur lequel est enregistre un programme de reconnaissance de la musique - Google Patents

Procede de reconnaissance de la musique et support d'enregistrement lisible par un ordinateur sur lequel est enregistre un programme de reconnaissance de la musique Download PDF

Info

Publication number
WO1999034352A1
WO1999034352A1 PCT/JP1998/002895 JP9802895W WO9934352A1 WO 1999034352 A1 WO1999034352 A1 WO 1999034352A1 JP 9802895 W JP9802895 W JP 9802895W WO 9934352 A1 WO9934352 A1 WO 9934352A1
Authority
WO
WIPO (PCT)
Prior art keywords
score
image
staff
threshold
music
Prior art date
Application number
PCT/JP1998/002895
Other languages
English (en)
French (fr)
Inventor
Seiji Nakano
Original Assignee
Kabushiki Kaisha Kawai Gakki Seisakusho
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 Kabushiki Kaisha Kawai Gakki Seisakusho filed Critical Kabushiki Kaisha Kawai Gakki Seisakusho
Priority to US09/380,225 priority Critical patent/US6580805B1/en
Publication of WO1999034352A1 publication Critical patent/WO1999034352A1/ja

Links

Classifications

    • GPHYSICS
    • G10MUSICAL INSTRUMENTS; ACOUSTICS
    • G10GREPRESENTATION OF MUSIC; RECORDING MUSIC IN NOTATION FORM; ACCESSORIES FOR MUSIC OR MUSICAL INSTRUMENTS NOT OTHERWISE PROVIDED FOR, e.g. SUPPORTS
    • G10G3/00Recording music in notation form, e.g. recording the mechanical operation of a musical instrument
    • G10G3/04Recording music in notation form, e.g. recording the mechanical operation of a musical instrument using electrical means
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/28Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V30/00Character recognition; Recognising digital ink; Document-oriented image-based pattern recognition
    • G06V30/10Character recognition
    • G06V30/30Character recognition based on the type of data
    • G06V30/304Music notations

Definitions

  • the present invention relates to a music score recognition method and a computer-readable recording medium storing a music score recognition program.
  • the binarization threshold depends on the recognition algorithm, so if the recognition algorithm is not known, It is difficult to set the optimum value. Also, depending on the display resolution, it is often not possible to check the binarization state sufficiently visually.
  • the threshold value of the binarization manually set is not appropriate, and the recognition performance often cannot be sufficiently obtained.
  • the present invention has been made in view of the above-described problems of the prior art, and automatically sets a threshold value of image binarization that has a significant effect on a recognition rate to an optimal value for recognition. It is intended to provide a configuration that can perform such operations.
  • Claim 1 is to read a score image, recognize the music symbol, and create a data for performance and Z or score display.
  • the basic feature is that the binarization threshold is set and the score image is captured as a binarized image.
  • the structure of Claim 4 provides the above procedure as a recording medium, and the specific structure is to read a musical score image, recognize the musical symbol, and perform the performance and / or display the musical score.
  • a computer-readable recording medium that stores a music score recognition program that creates the original data, an information reading step that reads the music score information, and a threshold setting that sets the binarization threshold based on the read music score information
  • the basic feature is that it includes a program for executing a step and a binary image capturing step for capturing a score image as a binary image based on the set binary threshold.
  • the binarization threshold is set based on the musical score information, the setting by the operator by trial and error is not necessary, and the threshold is automatically set to the optimum threshold and recognition is performed. As a result, the overall recognition rate can be improved.
  • the staff interval H and the staff line width t may be obtained as the musical score information, and a threshold value at which this ratio is optimal may be detected. The reason will be described below.
  • the binarization threshold changes, the density of the binary image changes and the line thickness changes. Therefore, the line width of the staff of the musical score image changes according to the binarization threshold.
  • Various musical scores are captured as gradation images, binarized with various thresholds, and the one that provides the highest recognition rate is obtained by normalizing the staff line width by the staff interval ( If the ratio of the line width of the staff to the line spacing) takes a substantially constant value, a binary score image can be created with a nearly reasonable recognition rate by setting the binarization threshold so that it approaches this value. Can be created.
  • the ratio of the staff line width to the staff interval at the optimal threshold changes depending on the resolution etc. (If the resolution is low, the ratio of the staff line width to the staff interval is higher. If the recognition rate is high and the resolution is high and vice versa, then the target value may be changed for the staff interval by a linear function or table conversion.
  • Claim 2 is to divide an image into a plurality of blocks (for example, each paragraph, each part, or each staff, and further horizontally), and to use each piece of music information for each block.
  • the binarization threshold is set, and the score image is captured as a binarized image.
  • the configuration of claim 5 provides the above procedure as a computer-readable recording medium on which a musical score recognition program is recorded, and the specific configuration is an image reading step of reading an image, An image dividing step for dividing the read image into a plurality of blocks, an information reading step for reading the score information for each block, and a binarization for each block based on the read score information.
  • the music score recognizing program is included in the recording medium. Also in this configuration, it is needless to say that the staff interval and staff line width are suitable as the musical score information.
  • FIG. 1 is an explanatory diagram showing staff line widths and staff intervals
  • FIG. 2 is a computer-readable recording medium having a score recognition program according to claim 4 read by an external storage device.
  • FIG. 3 is a flowchart showing main processing of the CPU
  • FIG. 4 is a flowchart showing main processing steps of automatic binarization processing
  • FIG. The figure is a flowchart showing the threshold detection procedure using the bisection method.
  • Figure 6 is used to determine which part of the band of T ⁇ K should be used as the threshold when the threshold judgment ends with T-OK.
  • Bandwidth detection in case of Fig. 7 is a flowchart showing the processing flow of the threshold value judgment.
  • Fig. 7 is a flowchart showing the processing flow of the threshold value judgment.
  • FIG. 8 is a diagram that scans the score in the vertical direction to determine whether the background is larger or smaller than the threshold.
  • Fig. 9 is a graph showing histograms of the run lengths of the line width and staff interval on the staff, and
  • Fig. 10 is a graph showing the vertical scanning of the image at a certain interval.
  • Fig. 11 is an explanatory diagram showing a setting state of a rectangle surrounding a staff set for performing threshold determination, and
  • Fig. 12 is a threshold determining judgment.
  • FIG. 13 is an explanatory diagram showing an example of a strip type set as an area.
  • FIG. 13 is an explanatory diagram showing an example of binarization processing in threshold value determination.
  • FIG. 2 shows a computer-readable recording medium on which the musical score recognition program according to claim 4 is recorded by an external storage device (or a CD-ROM drive or the like) such as a flexible disk drive FDD 5 to be described later.
  • an external storage device or a CD-ROM drive or the like
  • FDD 5 flexible disk drive
  • the CRT 6 displays video information output from the CRT interface circuit 7 based on the control of the CPU 1, and the information input from the keyboard 8 is transmitted to the CPU via the keyboard interface circuit 9. Incorporated in 1.
  • the printer 10 prints print information output from the printer interface circuit 11 under the control of the CPU 1.
  • Scanner 12 optically scans (printed) music, for example, -It converts a color or color image into data with a single color gradation (however, it can also capture a binary image), and any type of scanner, such as a flatbed type, handy type, or feeder type, can be used.
  • the image information read by the scanner 12 is taken into the RAM 3 or the HDD 4 via the scanner interface circuit 13.
  • the MIDI interface circuit 14 is a circuit for transmitting and receiving MIDI data to and from an external MIDI device such as a tone generator module.
  • the bus 15 connects each circuit in the musical score recognition device and exchanges various data, programs, addresses, and the like.
  • a pointing device such as a mouse or a serial interface circuit such as RS232C may be provided.
  • FIG. 3 is a flowchart showing the main processing of CPU1.
  • the image of the musical score (the staff line width and the staff interval are also captured as musical score information) are loaded into the RAM 3 by the scanner 12.
  • Images are captured as images with single color gradation.
  • an image file stored in a hard disk or the like in such a format may be read.
  • it can be converted to an image with a single color gradation by processing according to the image format.
  • the image imported from the scanner or read as a file is a binary image, automatic binarization is not possible, so the ability to recognize it as it is ⁇ Import it again as an image with gradation to perform automatic binarization.
  • the images can be partially stored in the RAM 3 and then processed sequentially.
  • 8 bits per pixel and 256 gradations are captured, but the number of bits is not limited to this. The gradation will be described below assuming that a large numerical value is white and a small numerical value is black.
  • step SII automatic binarization processing (threshold setting processing) is performed. This automatic binarization processing will be described later. Then, in step SIII, the captured gradation image is binarized based on the set binarization threshold, and the musical score image is captured as a binarized image.
  • FIG. 4 shows the main processing steps of the automatic binarization processing.
  • a threshold (thres) is detected by the bisection method. It is also possible to detect the staff line width and staff interval in all 2 5 6 steps and find the target threshold, Since there was a problem with the execution speed, we decided on the optimal threshold by the bisection method. This processing will be described later.
  • the desired threshold value can be obtained in about 8 loops of the bisection method.
  • the staff interval and the staff line width are obtained as integers, so that the ratio of the staff line width to the staff interval changes stepwise, and eight times.
  • the target threshold value can be detected with less than the threshold value. In this state, the threshold detection process for automatic binarization may be terminated, but if the band with the same value as the target ratio is wide, it is more accurate to set the threshold at the midpoint of the band. Threshold can be obtained.
  • step S3 if there is a band whose ratio is equal to the target value, the upper and lower limits of the band are obtained, and the midpoint is set as the threshold (thres). .
  • Step S2 is a process performed in order to determine whether or not there is a band whose ratio is equal to the target value.
  • the value of the threshold determination process (ret) is a threshold. It is determined whether or not the value judgment end code [T—OK (target value DE ST—value when the value becomes equal to PER)] is reached.
  • Step S3 is a process of obtaining the upper and lower limits of the band and setting the midpoint of the upper and lower limits as the threshold value (thres) as described above.
  • step S30 the band upper limit (thres 2) is detected, and in step S31, the band lower limit (thres 3) is detected, and in step S32, the upper limit (thres 2) and the lower limit (thres 3 Find the midpoint of) and set it as the threshold.
  • the detection of the upper limit and the lower limit can also be performed by the dichotomy as described later. If the line width and the staff interval are detected by real numbers and the ratio is changed sufficiently continuously, the detection processing of the upper and lower limits of the band becomes unnecessary.
  • step SIII the captured gradation image is binarized based on the set binarization threshold, and the score image is captured as a binarized image.
  • FIG. 5 shows a procedure for detecting the threshold (thres) by the bisection method in step S1.
  • step S100 initial settings are made. That is, the maximum threshold value (thres Max) is set to the maximum gradation value of 255, and the minimum threshold value (thresM in) is set to the minimum gradation value of 0. If you set 256 to the counter (ct) that counts the number of repetitions of In both cases, the maximum staff value (re tMa X) and the minimum (re tM in) of the threshold judgment result are shown as the staff interval 'T-N ⁇ indicating that the staff line width could not be detected. Set T.
  • step S101 an intermediate value between the above-mentioned thre max and thre min is set as a threshold value (thre s).
  • step S102 the threshold value (thres) is subjected to a later-described determination process, and the result is set as ret.
  • the judgment processing results include T—OK (the output result when the threshold value is determined to be equal to the target ratio DE ST PER), T—TH IN (the threshold value is the target If the value is determined to be smaller than DE ST PER, that is, if the staff line is determined to be thin, T— TH I CK (threshold is greater than the desired ratio DE ST— PER) If it is judged to be a value, that is, the output result when the staff line width is determined to be thick), T—NOT (output result when it is judged that the staff line width and the staff line width cannot be detected) There is.
  • step S103 it is determined whether or not the determination processing result (ret) is T-NOT. If it is determined that the result is not T_NOT, that is, if the staff interval and the line width of the staff can be detected, step S103 is performed. In S104, it is determined whether or not the determination result (ret) is T-OK. If this processing result (ret) is T- ⁇ K, the process exits the loop and terminates the threshold value detection process by the bisection method (that is, the determination in step S2 in FIG. 4 is YES, and the determination in step S3 is YES). Processing).
  • step S105 it is determined whether the processing result (ret) is T-THICK. If the result of this processing is T—THICK (when the line width of the staff is thick), in step S107, the threshold (thres) is set to the maximum threshold (thre sMax), and the calculation in step S101 is performed. Allows the maximum threshold (thres Max) to be changed to a smaller value when recalculating the threshold in the formula. (Set the threshold so that the staff line width is closer to the thinner side. Do it again).
  • the threshold is set to the minimum threshold (thres sM in).
  • the minimum threshold thres sM in.
  • increase the minimum threshold value thres sM in.
  • the threshold can be changed to a higher side (reset the threshold so that the staff width is closer to the thick side).
  • step S103 when it is determined that the above determination result (ret) is T-NOT, that is, when the staff interval and staff line width cannot be detected, the threshold value is on the dark side or the light side.
  • the threshold value overflow of step S109 and the following steps is used to determine which of the two methods has been used, and based on this, the process of the dichotomy is performed.
  • the threshold overflow check requires high processing cost, so the threshold judgment results at both ends are stored as the minimum value (re tM in) and the maximum value (re tMax) of the results. Keep it.
  • step S108 it is determined whether or not retMax and retMin are T—NOT.
  • step S109 an overflow check of the threshold is performed in step S109. Is made. Then, in step S 110, it is determined whether the threshold value has shifted to the dark side or the light side. If the threshold value has overflowed to the black side, the threshold value (thres ) Is set to its maximum value (thres Ma X), and the maximum value (retMa X) of the threshold judgment result is T—NOT. On the other hand, if it overflows on the white side, in step S111, the threshold value (thres) is set to its minimum value (thresMin), and the minimum value of the threshold judgment result is set. (Ret M in) becomes T—NOT.
  • step S108 If it is determined in step S108 that either ret Max or ret Min is not T—NOT, two minutes so as to approach the non-T—NOT side in step S113 or less. By performing the legal processing, the number of calls of the threshold overflow check can be reduced.
  • step S113 it is determined which of re tMa X and re tM in is not T—NOT. If re tMax is not T—NOT, in step S114, a threshold (thres) is set. Is set to its minimum value (thresMin), and the minimum value (retMin) of the threshold judgment result is T—NOT.
  • step S115 the threshold (thres) is set to its maximum value (thresMax), and the maximum value of the threshold judgment result (retMax) is set. x) becomes T—NOT.
  • the force is applied in step S117.
  • the number of counters (ct) is reduced by half, and the above processing is repeated in a loop until the number of counters (ct) becomes 1 (step S1 16). In this way, the starting band is changed from thre sM in to thre sMax, the area is narrowed by the bisection method, and the result determined last is the binarization threshold (thres) (see reference step S 1). ).
  • FIG. 6 shows a procedure for detecting the upper limit of the bandwidth (thres 2) in step S30 when making such a determination.
  • step S300 initialization is performed. That is, the above maximum threshold value (thres Max) is used as it is as the maximum threshold value (thres Max 2) in this processing, and the threshold value (thres) obtained by the above processing is set to the minimum value in this processing.
  • the threshold (thre sMa X 2) is set as the threshold (thres sM i ⁇ 2), and the counter (ct), which counts the number of repetitions of the threshold detection loop by the bisection method, is reduced from the maximum threshold (thre sMa X 2). Set the value + 1 after subtracting the threshold (thresM in 2).
  • step S301 an intermediate value between the above-mentioned thresMax2 and thresMin2 is set as a threshold value (thres2).
  • step S302 a determination process for the threshold value (thres2) described below is performed, and the result is set as ret.
  • the judgment processing results include T—OK (the output result when the threshold value is determined to be equal to the target ratio DEST—PER), T—TH IN (the threshold value is If the value is judged to be smaller than the value of DE ST—PER, that is, if the line width of the staff is determined to be thin), T— TH I CK (the threshold value is the desired ratio DE ST—PER If the value is determined to be larger, that is, the output result when the staff line width is determined to be thick), T—NOT (the staff interval and the staff line width when it is determined that the staff line width cannot be detected) Output results).
  • T—OK the output result when the threshold value is determined to be equal to the target ratio DEST—PER
  • T—TH IN the threshold value is If the value is judged to be smaller than the value of DE ST—PER, that is, if the line width of the staff is determined to be thin
  • T— TH I CK the threshold value is the desired ratio DE ST—PER If the value is determined to be larger, that is, the output result when
  • step S303 it is determined whether or not the determination result (ret) is T—OK. If it is determined that T—OK, that is, the determination result (ret) is In step S305, the value of the threshold (thres 2) is set as the minimum threshold (thresMin 2) in step S305. If it is determined in step S303 that the above determination result (ret) is not T ⁇ K, the value of the threshold (thres 2) is set as the maximum threshold (thres Ma X 2). Thereafter, in step S307, the number of counters (ct) is reduced by half, and the above processing is repeated in a loop until the number of counters (ct) becomes 1 (step S306).
  • the search from thres to thres Min is performed by the bisection method, and the boundary between the T-OK region and the non-T-OK region is detected.
  • the processing procedure is the same as that for detecting the upper limit of the above band. Therefore, it is omitted.
  • step S32 the midpoint of thres 2 and thres 3 obtained as described above is set as the threshold (thres).
  • FIG. 7 shows a processing flow of the threshold value determination in step S102 in FIG. 5 and step S302 in FIG.
  • step S1020 the staff interval (b 1 ank) and the staff line width (thick) are detected. That is, as shown in FIG. 8, scan the music longitudinally separates the background and FIG on whether the threshold (thres, th ⁇ es 2, thres 3) if the value is large or small than, FIG. 9 As shown in (1), a histogram of the run length of each of the background and the figure is created.
  • the center of gravity of the background, the figure, the suffix having the maximum value of each histogram, or the value of a certain band near the suffix having the maximum value is determined by the staff interval (b 1 ank) and the staff line width (thick). ). Since b 1 ank is actually the run length of the background, when calculating the ratio of the staff line width to the staff interval, (blan k + thick) is applied as the staff interval (both ends of blank) Plus thick 2). Also Vertical scanning of the image need not be performed at all positions on the abscissa X. In order to improve the processing speed, it may be performed at a certain interval as shown in FIG.
  • step S 1022 the ratio (p er) of the staff line width (t h i k) to the staff interval (b 1 an k + t h i k k) is determined.
  • the above ratio (p er) may be obtained by a mathematical formula different from the flow.
  • step S 1023 it is determined whether or not this ratio (per) is equal to the target ratio (D EST ⁇ PER). If it is determined that they are equal, in step S 1027, the determination is made. The result (ret) is set to T ⁇ K.
  • step S1025 the determination result (ret) is set to T—THICK, and further If it is determined that the value is smaller than the value, the determination result (ret) is set to T-THIN in step S1062, and the determination is terminated.
  • the threshold overflow check in step S109 in FIG. 5 refers to judging a state in which, when the threshold value is binarized, it becomes substantially black or white. Therefore, the check may be performed by counting the values of the pixel that are larger and smaller than the threshold value, and determining the number. Of course, it is not necessary to measure all the pixels of the image, and it is sufficient to check at the X position at the time of detecting the staff interval and the staff line width. Since accuracy is not required, the X position may be further reduced for speeding up. O At the time of the overflow check, it is determined that overflow has occurred in either black or white.
  • the staff interval and the staff line width detected in the entire image are used as the reference values for determining the threshold, but this does not reflect the run length of the part other than the staff.
  • the peaks of the histogram are deviated from the correct staff interval and staff line width due to the effects of titles, pictures, music score fold shadows, etc., and the staff interval when only the staff part is detected And the line width of the staff may be different. Therefore, the staff is recognized once for the image that has been binarized with the rough threshold value, and the threshold detection process of the dichotomy is limited to the vicinity of the staff.
  • an image with a single color gradation (stored in an 8-bit format per pixel) stored in RAM 3 is binarized with an appropriate binarization threshold value in the same manner as in the above embodiment. Since staff recognition is not so affected by the binarization threshold, the temporary threshold is simply set to the center value of the gradation.
  • the staff interval and staff line width are detected with this threshold, and if this is within the allowable range of staff recognition, staff detection is performed with this threshold. That is, the image of the staff portion is scanned in the vertical direction, and divided into a line portion and a blank portion depending on whether or not the image is larger than the threshold value, and each histogram is created. Based on these histograms, the staff interval and staff line width are recognized.
  • a value that falls within the allowable range may be further searched for by the bisection method.However, the staff recognition is stopped, and the staff interval and staff are set in the entire image as in the above embodiment. The line width may be detected, and the method may be switched to a method of setting a threshold value.
  • the staff recognition may be performed on a temporary binary image created separately from the gradation image area during the RAM 3. That is, the image of the staff portion is scanned in the vertical direction, and is divided into the line portion and the blank portion according to 0 or 1, and each histogram is created. Based on these histograms, the staff interval and staff line width are recognized. However, in order to reduce the storage area, a temporary binary image may be overwritten on the least significant bit of the gradation image without creating another area. Changing bits does not significantly affect threshold detection).
  • the staff may be directly recognized from the gradation image based on the obtained temporary binarization threshold. Further, when one staff is detected, even if the recognition process is terminated, good. As shown in Fig. 11, a rectangle (dotted line) surrounding the detected staff is set. The left and right ends are the ends of the staff. The line is often written as a line slightly thicker than the staff, and the width between the lines is often wider than the staff. Therefore, the area above and below the rectangle may be a region not including the line.
  • the binarized threshold value is detected in the same manner as in the first embodiment.
  • the processing area is limited to the above rectangle.
  • more accurate staff spacing and staff line width can be obtained, and the rectangle is small, so that the number of subsequent processing steps is reduced.
  • the staff interval has been detected at this point.In the bisection method processing, if only the line width of the staff is detected, the speed will be further increased. it can.
  • the threshold value for provisional binarization may be determined using a threshold value selection method which is a normal image processing method such as a mode method or a differential histogram.
  • the threshold determination area may be a parallelogram area connecting the start and end positions of the staff instead of a rectangle (rectangle), or may be detected by staff recognition as shown in FIG. Alternatively, a strip-shaped area in consideration of the staff shift amount may be used.
  • a threshold value selection method is a normal image processing method such as a mode method or a differential histogram.
  • the threshold determination area may be a parallelogram area connecting the start and end positions of the staff instead of a rectangle (rectangle), or may be detected by staff recognition as shown in FIG. Alternatively, a strip-shaped area in consideration of the staff shift amount may be used.
  • a strip-shaped area in consideration of the staff shift amount may be used.
  • in order to accurately detect the staff line width when detecting the threshold by the bisection method, not only the staff interval and staff line width are detected, but also the staff detected
  • Determining one binarization threshold in a score image is sufficient in most cases. However, this may not be enough.
  • a particularly striking example is when there are staves with different widths. In such a case, if binarization is performed using the same threshold, the threshold and the value of the staff that did not become the standard deviate from the optimal value, and the recognition rate decreases. For this reason, in the present embodiment, the staffs are detected in the same manner as in the above-described embodiment (all the staffs are detected), and the rectangle surrounding each staff is detected. Square brackets are also recognized, and a rectangle may be formed for each part as shown in FIG. 13 (b).
  • rectangles are rectangles for determining a threshold value, and within this rectangle, respective binarization thresholds are determined by means similar to the first embodiment.
  • the inside of the rectangle is binarized by the threshold value, but between the rectangles, as shown in Fig. 13 (a),
  • Binarization is performed by such a method.
  • FIG. 13 shows an example of binarization in determining a threshold value.
  • FIG. 3B shows the read score image, in which the dotted rectangle is the threshold value determination rectangle.
  • FIG. 11A shows the state of the determined threshold.
  • the threshold determined in each rectangle is used, and the end of the image of a and c is used.
  • the same threshold as that of the section of b is used, for the section of e, the same threshold as that of the section of f is used, and for the section of d, each threshold of the two regions is used. Is used after linear interpolation.
  • the threshold value it is possible to cope with partial blurring of printing or the like. This can be realized by dividing into a plurality of rectangles instead of using only one rectangle in the horizontal direction (same threshold value in the horizontal direction) as shown in Fig. 13.
  • the threshold judgment area is not a rectangle (rectangle) but may be a parallelogram area connecting the start and end positions of the staff, as described above, or the deviation of the staff detected by the staff recognition.
  • a strip-shaped area in consideration may be used.
  • the score recognizing method and the configuration of the computer-readable recording medium storing the score recognizing program according to the present invention are useful for mechanically recognizing the score. It is suitable for creating data for use in recording, or for performing part of a machine performance instead of human performance in studio recording or live performance.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Acoustics & Sound (AREA)
  • Character Discrimination (AREA)
  • Auxiliary Devices For Music (AREA)
  • Electrophonic Musical Instruments (AREA)
  • Image Analysis (AREA)

Description

明 細 書 楽譜認識方法及び楽譜認識プログラムを記録したコンピュータ読み取り可能な記 録媒体
技術分野
本発明は、 楽譜認識方法及び楽譜認識プログラムを記録したコンピュータ読み 取り可能な記録媒体に関する。
背景技術
画像をスキャナ等で入力してこれらに含まれる文字や記号を認識させるには、 認識率に重大な影響を及ぼす原稿の傾きの調整等と共に、 取り込む画像の解像度 を調整することが行われ、 更に 2値化画像の取り込みの場合は、 2値化しきい値 の設定を行って、 2値画像の判定を行う必要がある。
原稿の傾きや取り込み解像度については、 最適な状態にすることは比較的容易 であるが、 2値化しきい値については、認識アルゴリズムに依存する部分なので、 認識アルゴリズムが知らされていない場合には、 最適な値への設定が難しい。 ま た表示の解像度によっては、 2値化の状態を充分に目視でチェックできない場合 も多い。
従って手動で設定した 2値化のしきい値が適当でないために、 認識性能が充分 に引き出せないということが多い。
更に認識が行われた後、 認識率の低い原因が 2値化しきい値であることが判明 した場合、 もう一度画像の取り込みからやり直すと、 結局処理工数が増え、 処理 に時間が掛かるといった問題を生ずる。
本発明は従来技術の以上のような問題に鑑み創案されたもので、 認識率に重大 な影響を及ぼす画像 2値化のしきい値設定を、 認識に最適な値に自動で設定する ことができる構成を提供せんとするものである。
発明の開示
そのため請求の範囲 1の構成は、 楽譜イメージを読み取って、 その音楽記号を 認識し、 演奏及び Z又は楽譜表示のためのデータを作成する楽譜認識方法におレ、 て、 楽譜情報を用いて、 2値化しきい値の設定を行い、 楽譜イメージを 2値化画 像として取り込むことを基本的特徴としている。
請求の範囲 4の構成は、 上記手順を、 記録媒体として提供するものであって、 その具体的構成は、 楽譜イメージを読み取って、 その音楽記号を認識し、 演奏及 び/又は楽譜表示のためのデータを作成する楽譜認識プログラムを記録したコン ピュータ読み取り可能な記録媒体において、 楽譜情報を読み込む情報読み込みス テツプと、 読み込まれた楽譜情報に基づき 2値化しきい値の設定を行うしきい値 設定ステップと、 設定された 2値化しきい値に基づいて、 楽譜イメージを 2値化 画像として取り込む 2値化画像取り込みステップとを実行させるプログラムを含 んでいることを基本的特徴としている。
これらの構成では、 2値化しきい値の設定を楽譜情報に基づいて行うため、 操 作者の試行錯誤による設定が必要なくなり、自動的に最適なしきい値に設定され、 認識がなされる。 それによつて全体的な認識率の向上も図れることになる。 その 場合、楽譜情報として、第 1図に示すように、五線間隔 Hと五線の線幅 tを求め、 この割合が最適になるしきい値を検出すると良い。 その理由を以下に説明する。 2値化しきい値が替わると 2値画像の濃さが変わり、線の太さが変わる。よって、 2値化しきい値によって、 楽譜画像の五線の線幅が変化する。 様々な楽譜を階調 画像として取り込み、 これを様々なしきい値で 2値化し、 最も高い認識率が得ら れるものに対して、 五線の線幅を五線間隔によって正規化した値 (五線間隔に対 する五線の線幅の割合) が略一定の値をとる場合、 この値に近づくように 2値化 しきい値を設定すれば、略妥当な認識率で 2値楽譜画像を作成することができる。 解像度等によって、 最適なしきい値における五線間隔に対する五線の線幅の割合 が変化する場合 (解像度が低いと、 五線間隔に対する五線の線幅の割合が高い方 が認識率が高く、 逆に解像度が高いと、 その反対となるような場合) には、 五線 間隔に対して、 線形関数やテーブル変換などにより、 目標値を変えるようにすれ ば良い。
更に五線の線幅や間隔が段落毎或いはパ一ト毎に違う等の場合には、 単に五線 の間隔と五線の線幅を求めただけでは、 結局適切なしきい値の設定はできないこ とになる。 そこで請求の範囲 2の構成は、 画像を複数のブロックに分割 (例えば 段落毎やパート毎、或いは五線毎に、更には横方向に分割) し、各ブロック毎に、 楽譜情報を用いて 2値化しきい値の設定を行い、 楽譜イメージを 2値化画像とし て取り込む構成としている。
同様に請求の範囲 5の構成は、 上記手順を、 楽譜認識プログラムを記録したコ ンピュータ読み取り可能な記録媒体として提供するものであって、 その具体的構 成は、 画像を読み込む画像読み込みステップと、 読み込まれた画像を複数のプロ ックに分割する画像分割ステップと、 各ブロック毎に楽譜情報を読み込む情報読 み込みステップと、 読み込まれた楽譜情報に基づき、 各ブロック毎の 2値化しき い値の設定を行うしきい値設定ステップと、 各ブロック毎に設定された 2値化し きい値に基づいて、 楽譜イメージを 2値化画像として取り込む 2値化画像取り込 みステップとを実行させるための楽譜認識プログラムを、 上記記録媒体に含む構 成である。 この構成の場合も、 前記楽譜情報として、 五線間隔と五線の線幅が適 していることは言うまでもなレ、。
図面の簡単な説明
第 1図は、 五線の線幅と五線間隔を示す説明図、 第 2図は、 請求の範囲 4に係 る楽譜認識プログラムを記録したコンピュータ読み取り可能な記録媒体を外部記 憶装置で読み込ませて稼動する楽譜認識装置の実施形態構成を示すプロック図、 第 3図は、 C P Uのメイン処理を示すフローチャート、 第 4図は、 自動 2値化処 理のメイン処理ステップを示すフローチャート、 第 5図は、 2分法によるしきい 値の検出手順を示すフローチャート、 第 6図は、 しきい値判定が T— O Kで終了 した際 T 〇Kの帯域のどこをしきい値とするか決定する場合の帯域上限の検出 手順を示すフローチャート、 第 7図は、 しきい値判定の処理フローを示すフロ一 チャート、 第 8図は、 楽譜を縦方向に走査してしきい値より値が大きいか小さい かで背景と図を分離する状態を示す説明図、 第 9図は、 五線に線幅及び五線間隔 の夫々のラン長のヒストグラムを示すグラフ、 第 10図は、 画像の縦方向の走査 を或る間隔をおいて行う状態を示す説明図、 第 1 1図は、 しきい値判定を行うた めに設定された五線を囲む矩形の設定状態を示す説明図、 第 1 2図は、 しきい値 判定領域として設定された短冊型の例を示す説明図、 第 1 3図は、 しきい値決定 における 2値化処理の例を示す説明図である。
発明を実施するための最良の形態
(実施形態 1 )
以下本発明の一実施形態を添付図面に基づき説明する。 第 2図は請求の範囲 4 に係る楽譜認識プログラムを記録したコンピュータ読み取り可能な記録媒体を後 述するフレキシブルディスク ドライブ FDD 5等の外部記憶装置 (或いは CD— ROMドライブ等) で読み込ませて稼動する楽譜認識装置の実施形態構成を示す ブロック図である。 この装置は、 パソコンなどの電子計算機の構成に、 スキャナ や M I D Iインタ一フェース回路を付加したものである。 CPU 1は、 ROM2 或いは R AM 3に格納されるプログラムに基づき、 楽譜認識装置全体の制御を行 う中央演算処理装置である。 また予め設定された所定の周期で CPU 1に割り込 みをかけるタイマ回路を内蔵している。 RAM3はプログラムエリアの他、 画像 データバッファ、 ワークエリア等として使用される。 ハードディスク装置 HDD
4及びフレキシブルディスク ドライブ FDD 5は、 プログラム及び画像データ、 演奏データ等を格納する。 CRT 6は CPU 1の制御に基づき、 CRTインタ一 フエ一ス回路 7から出力される映像情報を表示し、 キーボード 8カゝら入力された 情報は、 キーボードインターフエ一ス回路 9を経て C PU 1に取り込まれる。 プ リンタ 1 0は、 CPU 1の制御に基づき、 プリンタインタ一フェース回路 1 1か ら出力される印字情報を印字する。
スキャナ 1 2は、 例えば (印刷された) 楽譜を光学的に走査して、 グレースケ —ル或いはカラーの画像を単色階調付データに変換するもの (但し 2値画像も取 り込める) であり、 フラットベッド型、 ハンディ型、 フィーダ型等任意のタイプ のスキャナを使用できる。 スキャナ 1 2によって読み取られた画像情報は、 スキ ャナインターフェース回路 1 3を介して、 R AM 3或いは H D D 4に取り込まれ る。 M I D Iインターフェース回路 1 4は、 音源モジュール等の外部の M I D I 機器との間で M I D Iデータの送受信を行う回路である。 バス 1 5は、 本楽譜認 識装置内の各回路を接続し、 各種データ、 プログラム、 ア ドレス等をやり取りさ せている。 なお、 この他にマウスなどのポインティングデバイスや R S 2 3 2 C 等のシリアルインタ一フェース回路等を備えていても良い。
第 3図は C P U 1のメイン処理を示すフロ一チヤ一トである。 ステップ S Iに おいては、 スキャナ 1 2によって楽譜のィメ一ジ (この中には五線の線幅及び五 線間隔も楽譜情報として取り込まれる) を R AM 3に取り込む。 画像は単色階調 付イメージとして取り込む。 もちろんそのような形式でハ一ドディスク等に保存 されたイメージファイルを読み込んでも良い。 カラ一画像の場合には、 その画像 形式に応じた処理によって、 単色階調付画像に変換することができる。 スキャナ から取り込んだりファイルとして読み込んだ画像が 2値画像であった場合には、 自動 2値化はできないので、 そのまま認識する力 \ 自動 2値化を行うために階調 付画像として取り込みをやり直す。 楽譜イメージを取り込んだ R AM 3の記憶容 量が足りない場合には、 画像を部分的に R AM 3に格納した上で、 順次処理する こともできる。 尚、 本構成では 1画素 8ビット 2 5 6階調で取り込んでいるが、 このビット数に限定されるわけではない。 また階調は、 数値の大きいものが白、 数値の小さいものが黒として、 以下説明される。
ステップ S II において、 自動 2値化処理 (しきい値設定処理) が行われる。 この自動 2値化処理については、 後述する。 そしてステップ S III において、 取 り込まれた階調画像を、 設定された 2値化しきい値に基づいて 2値化し、 楽譜ィ メージを 2値化画像として取り込む。
第 4図は、 上記自動 2値化処理のメイン処理ステップを示している。 まずステ ップ S 1において、 2分法によるしきい値 ( t h r e s ) の検出を行う。 2 5 6 段階全てで五線の線幅と五線間隔を検出し、 目標のしきい値を求めても良いが、 実行速度に問題が出てきてしまうので、 2分法で最適しきい値を求めることにし た。 この処理については、 後述する。
前述のように、 256階調程度あれば、 2分法のループ 8回程度で目的のしき い値が得られる。 しカゝし、 本実施形態では、 五線間隔及び五線の線幅を整数で求 めているため、 五線間隔に対する五線の線幅の割合が段階的に変化しており、 8 回未満で目的のしきい値を検出できる場合もある。 この状態で自動 2値化のしき い値検出処理を終了しても良いが、 目的の割合と同値の帯域が広い場合は、 しき い値をその帯域の中点とした方が、 より正確なしきい値を得ることができる。 そ こで、 ステップ S 3において、 割合が目標値と同じ値になる帯域が存在する場合 には、 その帯域の上限と下限を求め、 その中点をしきい値 (t h r e s) とする ようにした。 ステップ S 2は、 その際、 割合が目標値と同じ値になる帯域が存在 するか否かを判断するために行われる処理であり、 しきい値判定処理の結果 (r e t ) の値がしきい値判定終了コード [T— OK (目的の割合 DE ST— PER と等しい値となった場合の値)] になったか否かが判定される。 ステップ S 3は、 上述のように、 帯域の上限と下限を求め、 その中点をしきい値 (t h r e s) と する処理である。 即ちステップ S 30において、 帯域上限 (t h r e s 2) を検 出し、 ステップ S 3 1において、 帯域下限 ( t h r e s 3) を検出して、 ステツ プ S 32において、 この上限 ( t h r e s 2) と下限 ( t h r e s 3) の中点を 求め、 しきい値 (t h r e s) として設定する。 この上限及び下限の検出につい ても、 後述するように、 2分法によって行うことができる。 尚、 五線の線幅及び 五線間隔を実数で検出する等して、 割合が充分連続的に変化するようにすれば、 帯域の上限及び下限の検出処理は不要となる。 この後、 上述したように、 ステツ プ S III において、 取り込まれた階調画像を、 設定された 2値化しきい値に基づ いて 2値化し、 楽譜イメージが 2値化画像として取り込まれる。
第 5図は、 上記ステップ S 1における 2分法によるしきい値 ( t h r e s ) の 検出手順を示している。 ステップ S 100において、 初期設定を行う。 即ち最大 しきい値 ( t h r e s Ma X ) に階調最大値 255を、 また最小しきい値 ( t h r e sM i n) に階調最小値 0をセッ トし、 更に 2分法によるしきい値検出処理 ループの繰り返し回数をカウントするカウンタ (c t) に 256をセットすると 共に、 しきい値判定処理結果の最大値 (r e tMa X) 及び同結果の最小値 (r e tM i n) に、 五線間隔 '五線の線幅が検出できなかったことを示す T—N〇 Tをセットする。
次にステップ S 1 01において、 前記 t h r e sMa xと t h r e s M i nの 中間の値をしきい値 (t h r e s) とする。 ステップ S 1 02において、 このし きい値 ( t h r e s ) の後述する判定処理を行ってその結果を r e tとする。 そ の判定処理結果とは、 後述するように、 T— OK (しきい値が目的の割合 DE S T PERと等しい値と判定された場合の出力結果)、 T— TH I N (しきい値 が目的の割合 DE ST PERより小さい値と判定された場合、 即ち五線の線 が細いと判定された場合の出力結果)、 T— TH I CK (しきい値が目的の割合 DE ST— PERより大きい値と判定された場合、 即ち五線の線幅が太いと判定 された場合の出力結果)、 T— NOT (五線間隔、 五線の線幅が検出できないと 判断された場合の出力結果) がある。
ステップ S 103において、 上記判定処理結果 (r e t) が T— NOTである か否かが判断され、 T_NOTでないと判断された場合、 即ち五線間隔及び五線 の線幅が検出できる場合は、ステップ S 1 04に移行して、上記判定処理結果(r e t ) が T— OKか否かが判定される。 この処理結果 (r e t) が T—〇Kなら ば、 ループから抜け出し、 2分法によるしきい値の検出処理を終了する (即ち第 4図のステップ S 2における判定が YESとなり、ステップ S 3の処理に移る)。 他方、 該処理結果 (r e t) が T— OKでないならば、 ステップ S 1 05に移行 し、 該処理結果 (r e t) が T— TH I CKか否かが判定される。 この処理結果 が T— TH I CKならば(五線の線幅が太い場合)、 ステップ S 107において、 しきい値 ( t h r e s ) を最大しきい値 (t h r e sMa x) とし、 ステップ S 101の計算式においてしきい値を再計算する際に、 最大しきい値 (t h r e s Ma x) をより小さい側に変更できるようにする (五線の線幅が細い側寄りにな るようにしきい値を設定し直す)。 一方前記処理結果が T— TH I CKでないな らば (五線の線幅が細い場合)、 ステップ S 1 06において、 しきい値 (t h r e s ) を最小しきい値 ( t h r e sM i n) とし、 ステップ S 1 01の計算式に おいてしきい値を再計算する際に、 最小しきい値 ( t h r e sM i n) をより大 きい側に変更できるようにする (五線の線幅が太い側寄りになるようにしきい値 を設定し直す)。
ステップ S 1 03において、 上記判定処理結果 (r e t) が T— NOTである と判断された場合、 即ち五線間隔及び五線の線幅が検出できない場合は、 しきい 値が濃い側或いは薄い側のどちらに振れているかを、 ステップ S 109以下のし きい値オーバ一フロ一チヱックで判定し、 これに基づいて 2分法の処理を行う。 但ししきい値ォ一バーフローチェックは処理コス卜の高い処理になるので、 両端 のしきい値判定結果を、 同結果の最小値 (r e tM i n) 及びその最大値 (r e tMa x) として保存しておく。 そしてステップ S 1 08で、 r e tMa x並び に r e tM i nが T— NOTか否かが判定され、 両方が T— NOTの場合、 ステ ップ S 1 09でしきい値のォ一バーフローチェックがなされる。 そしてステップ S 1 1 0において、 しきい値が濃い側或いは薄い側のどちらに振れているかが判 定され、 黒側にオーバーフローしている場合は、 ステップ S 1 1 2において、 し きい値 ( t h r e s ) をその最大値 ( t h r e s Ma X) にセットし、 しきい値 判定結果の最大値 (r e tMa X) が T— NOTとなる。 逆に白側にオーバーフ 口一している場合は、 ステップ S 1 1 1において、 しきい ί直 ( t h r e s ) をそ の最小値 ( t h r e s M i n) にセットし、 しきい値判定結果の最小値 (r e t M i n) が T— NOTとなる。
上記のステップ S 1 08において、 r e t Ma x或いは r e t M i nのうちの 一方が T— NOTでないと判定された場合は、 ステップ S 1 1 3以下で T— NO Tでない側に近づくように 2分法処理を行うことで、 しきい値オーバーフローチ エックの呼び出し回数を減らすことができる。 該ステップ S 1 1 3において、 r e tMa Xと r e tM i nのどちらが T— NO Tでないかが判定され、 r e tM a xが T— NOTでない場合はステップ S 1 1 4で、 しきい値 (t h r e s) を その最小値 (t h r e sM i n) にセットし、 しきい値判定結果の最小値 (r e t M i n) が T— NOTとなる。 r e tM i nが T— NOTでない場合はステツ プ S 1 1 5で、 しきい値 (t h r e s) をその最大値 ( t h r e s Ma x) にセ ットし、 しきい値判定結果の最大値 (r e tMa x) が T— NOTとなる。 しきい値判定結果 (r e t) が T OKの場合以外は、 ステップ S 1 1 7で力 ゥンタ (c t) の数を半分に減らして、 以上の処理をカウンタ (c t) の数が 1 になる (ステップ S 1 1 6) までループで繰り返す。 このように、 開始帯域を t h r e sM i nから t h r e sMa xとし、 2分法により、 領域を狭めていき、 最後に判定された結果が、 2値化しきい値 (t h r e s) となる (参照ステップ S 1 )。
以上のようにして 2値化しきい値が検出された後、 上述のように、 ステップ S 2において、 しきい値判定が r e t =T— OKで終了した場合には、 ステップ S 3で、 Τ—ΟΚの帯域のどこをしきい値とするか決定する必要がある。 第 6図は そのような決定を行う場合の、ステップ S 30における帯域上限( t h r e s 2) の検出手順を示している。
まずステップ S 300において、初期設定を行う。即ち上記の最大しきい値( t h r e sMa x)をそのまま本処理における最大しきい値( t h r e s Ma x 2) とし、 また上記処理によって求められたしきい値 (t h r e s) を本処理におけ る最小しきい値 (t h r e sM i η 2) としてセッ卜すると共に、 2分法による しきい値検出処理ループの繰り返し回数をカウントするカウンタ (c t) に上記 最大しきい値 ( t h r e sMa X 2) から最小しきい値 ( t h r e sM i n 2) を引いた値 + 1をセッ卜する。
次にステップ S 30 1において、 前記 t h r e sMa x 2と t h r e sM i n 2の中間の値をしきい値 ( t h r e s 2) とする。 ステップ S 302において、 このしきい値 ( t h r e s 2) の後述する判定処理を行ってその結果を r e tと する。 その判定処理結果とは、 後述するように、 T— OK (しきい値が目的の割 合 DEST— PERと等しい値と判定された場合の出力結果)、 T— TH I N (し きい値が目的の割合 DE ST— PERより小さい値と判定された場合、 即ち五線 の線幅が細いと判定された場合の出力結果)、 T— TH I CK (しきい値が目的 の割合 DE ST— PERより大きい値と判定された場合、 即ち五線の線幅が太い と判定された場合の出力結果)、 T— NOT (五線間隔、 五線の線幅が検出でき ないと判断された場合の出力結果) がある。
ステップ S 303において、 上記判定結果 (r e t) が T— OKであるか否か が判断され、 T —OKであると判断された場合、 即ち判定結果 (r e t) が目的 の割合 (D E ST— PER) と等しい値になった場合は、 ステップ S 305で、 前記しきい値 ( t h r e s 2 ) の値を最小しきい値 (t h r e sM i n 2) とし てセットする。 ステップ S 303において、 上記判定結果 (r e t) が T—〇K でないと判断された場合は、 しきい値 (t h r e s 2) の値を最大しきい値 (t h r e s Ma X 2) としてセットする。 その後ステップ S 307でカウンタ (c t ) の数を半分に減らして、 以上の処理をカウンタ (c t) の数が 1になる (ス テツプ S 306) までループで繰り返す。 このように、 五線の線幅の五線間隔に 対する割合が或る帯域を持った場合の帯域上限の検出フローは、 t h r e s =T —OKとなった時点での、 t h r e sから t h r e sMa xまでを 2分法で検索 し、 T— OKである領域とそうでない領域の境界を検出する。 即ち開始帯域を t h r e sM i n 2から t h r e sMa x 2とし、 2分法により、 領域を狭めてい く。 最後に判定された結果が、 t h r e s 2となる (参照ステップ S 30)。 ステップ S 3 1の帯域の下限の検出も同様のフローで行い、 下限の結果は t h r e s 3となる。 これについては、 t h r e sから t h r e s M i nまでを 2分 法で検索し、 T—OKである領域とそうでない領域の境界を検出することになり、 処理手順は上記帯域の上限の検出と同様になるので、 省略する。 そして、 上述の ように、 ステップ S 32において、 以上のようにして求められた t h r e s 2と t h r e s 3の中点をしきい値 ( t h r e s ) とする。
第 7図は第 5図のステップ S 1 02及ぴ第 6図のステップ S 302におけるし きい値判定の処理フローを示している。 まずステップ S 1020において、 五線 間隔 (b 1 a n k) 及び五線の線幅 ( t h i c k) の検出を行う。 即ち第 8図に 示すように、楽譜を縦方向に走査し、上記しきい値( t h r e s、 t h Γ e s 2、 t h r e s 3) より値が大きいか小さいかで背景と図を分離し、 第 9図に示すよ うに、 背景及び図の夫々のラン長のヒストグラムを作成する。 そして背景、 図、 夫々のヒストグラムの最大値を持つ添字、 或いは最大値を持つ添字付近の或る帯 域の値の重心位置を、 五線間隔 (b 1 a n k) 及び五線の線幅 (t h i c k) と する。 実際は上記 b 1 a n kは、 背景のラン長であるので、 五線間隔に対する五 線の線幅の割合を計算する際には、五線間隔として、 (b l a n k+ t h i c k) を充当する (b l a n kの両端に t h i c k 2を足したものとする)。 また画 像の縦方向の走査は、 横座標 Xの全ての位置において行う必要はない。 処理速度 の向上のため、 第 1 0図に示すように、 或る間隔をおいて行えば良い。
この検出時点で b 1 a n k = 0となった場合 (ステップ S 1 02 1)、 五線間 隔の検出に失敗している (真っ黒か真っ白の何れかで検出できない) ので、 ステ ップ S 1 028で判定結果 (r e t) を T— N O Tとして処理を終了する。 五線 間隔や五線の線幅の検出失敗は、 この他にも、 t h i c 1^ = 0の場合ゃ1 h i c k > b 1 a n kとなった場合や、 t h i c kや b 1 a n kが或る範囲を超えた場 合を追加しても良い。
この判定後ステップ S 1 022において、五線間隔(b 1 a n k + t h i c k) に対する五線の線幅 (t h i c k) の割合 (p e r) を求める。 もちろんより正 確な値を得たり、 認識率との対応をより良好にしたりするために、 フローとは異 なる数式により上記割合 (p e r) を求めても良い。 次にステップ S 1 023に おいて、 この割合 (p e r) が目的の割合 (D EST— PER) と等しいか否か が判定され、 等しいと判定された場合は、 ステップ S 1 027において、 判定結 果 (r e t) を、 T—〇Kとし、 ステップ S 1 024において、 それより大きい と判定された場合は、 ステップ S 1 025において、 判定結果 (r e t) を、 T — TH I CKとし、 更にそれより小さいと判定された場合は、 ステップ S 1 02 6において、 判定結果 (r e t) を、 T— TH I Nとして判定を終了する。
第 5図におけるステップ S 1 09のしきい値オーバ一フローチェックとは、 そ のしきい値で 2値化した場合、 略真っ黒或いは真っ白になる状態を判定すること を言う。 よってそのチェックは、 画素の値がしきい値より大きいものと小さいも のをカウントし、 この数を判定すれば良い。 もちろん画像全ての画素を計測する 必要はなく、 前記五線間隔や五線の線幅検出時の X位置でチェックすれば良い。 正確さは要求されないので、 高速化のために、 更に X位置を削減しても良い。 ォ 一バーフローチェック時は、 黒か白どちらかにオーバーフローしているとして、 黒のカウント数がチェック画素数 (オーバーフローチェックを行う X位置での画 素合計) の半分以上になった時点で黒にオーバーフロ一したと判定して処理を終 了し、 黒のカウント数がチェック画素数の半分に満たなかった場合には白にォー バーフローしたと判定しても良い。 (実施形態 2 )
上記実施形態 1では、 画像全体で検出した五線間隔と五線の線幅をしきい値決 定の基準値としているが、 これは、 五線以外の部分のラン長も反映されたものな ので、 表題や絵、 楽譜の折り目の影等の影響を受け、 ヒストグラムの山が正しい 五線間隔や五線の線幅よりもずれてしまい、 五線の部分のみで検出した場合の五 線間隔や五線の線幅とは異なつてしまう場合がある。 よつて一旦大まかなしきい 値で 2値化した画像について五線認識を行い、 その後の 2分法のしきい値検出処 理を、 この五線周辺に限定する。
本構成においても、 前記実施形態と同様にして R AM 3に格納された単色階調 付き画像 (1画素 8ビッ ト形式で格納) を適当な 2値化しきい値で 2値化する。 五線認識は、 2値化しきい値にさほど影響を受けないので、 単純に仮のしきい値 を階調の中央の値とする。 このしきい値で五線間隔と五線の線幅の検出を行い、 これが五線認識の許容範囲内であれば、 このしきい値で五線検出を行う。 即ち、 五線部分の画像を縦方向に走査して、 しきい値より大きいか否かで線部分とブラ ンクの部分とに分け、 夫々のヒス トグラムを作成する。 これらのヒストグラムを 元に、 五線間隔と五線の線幅の認識を行う。 許容範囲内でない場合は、 更に 2分 法により許容範囲になる値を探しても良いが、 五線認識を行うのをやめ、 前記実 施形態と同様に、 画像全体で五線間隔と五線の線幅の検出を行い、 しきい値を設 定する方法に切り替えても良い。
五線認識は、 R AM 3中に、 階調画像領域とは別に作成した仮の 2値化画像に 対して行うようにしても良い。 即ち、 五線部分の画像を縦方向に走査して、 0か 1かで線部分とブランクの部分とに分け、 夫々のヒストグラムを作成する。 これ らのヒストグラムを元に、 五線間隔と五線の線幅の認識を行う。 但し、 記憶領域 削減のために、 別の領域を作らず、 仮の 2値化画像を階調付き画像の最下位ビッ 卜に上書きしても良い (2 5 6階調程度あれば、 最下位ビッ トの変更はしきい値 の検出にあまり影響を与えないため)。
また求められた仮の 2値化しきい値に基づいて、 階調付き画像から直接五線を 認識しても良い。 更に五線が 1本検出できた時点で、 その認識処理を終了しても 良い。第 1 1図に示すように、検出した五線を囲む矩形(点線部分) を設定する。 左右端は五線の端点とする。加線は五線よりも少し太い線で書かれることが多く、 また加線の間幅も五線より広い場合が多いので、 前記矩形の上下は、 加線を含ま ない領域としても良い。
上記実施形態 1と同様な方法で、 2値化したしきい値を検出する。 但し処理領 域を、 上記の矩形に限定する。 これによつてより正確な五線間隔及び五線の線幅 が得られ、 且つ矩形が小さいため、 以降の処理工数は低減される。 また五線認識 が既に行われているので、 この時点で五線間隔は検出されており、 2分法処理時 には、 五線の線幅の検出だけを行うようにすれば、 更に高速化できる。
本実施形態において、 仮の 2値化のための 2値化しきい値の決定を、 モード法 や微分ヒストグラム等の通常の画像処理方式であるしきい値選択法を用いても良 レ、。 また上記しきい値判定領域は、 矩形 (長方形) ではなく、 五線の開始及び終 了位置を結んだ平行四辺形領域でも良いし、 第 1 2図に示すような五線認識で検 出された五線ずらし量を考慮した短冊型領域でも良い。 更に五線の線幅の検出を 正確に行うために、 2分法によるしきい値検出時、 五線間隔及び五線の線幅の検 出だけでなく、 最初に検出されている五線に沿って、 そのしきい値で 2値化され た画像の図を上下に走査し、 五線であるのが確実な部分のラン長の平均値を取る 処理を追加することもできる。
(実施形態 3 )
1つの楽譜画像の中で 1つの 2値化しきい値を決定すれば、 殆どの場合それで 充分である。 しかし、 これでは不十分な場合がある。 特に顕著な例は、 幅が違う 五線が存在する場合である。 このような時には、 同じしきい値で 2値化すると、 基準とならなかった五線のしきレ、値が最適値からずれてしまい、 認識率が低下す る。 そのため本実施形態では、 前記実施形態と同様な方法で五線を検出し (全て の五線を検出する)、夫々の五線を囲む矩形を検出する。 大かっこの認識も行い、 第 1 3図(b )に示すように、 パート毎の矩形としても良い。 これらの矩形はしき い値決定のための矩形であり、 この矩形内で、 最初の実施形態 1と同様な手段に より、 夫々の 2値化しきい値を決定する。 しきい値決定後の 2値化処理は、 矩形内はそのしきい値で 2値化するが、 矩形 間は、 第 1 3図(a )に示されるように、
① 上下の矩形領域のしきい値の中間値で 2値化した場合に、 2つの領域の中点 から図が存在しない箇所を探索し、 検出された位置で分離する。
② 同様に 2値化した場合に、 図が存在しない領域を求め、 最も広い領域にわた つている箇所で分離する。
③ 2つの矩形領域の中間のしきい値を、 様々な方法で補間する。
④ 2つの矩形領域の真ん中で 2つのしきい値の領域を分離する。
等の方法で 2値化する。
第 1 3図は、しきい値決定における 2値化の例を示している。そのうち同図(b ) は、 読み取られた楽譜画像であり、 点線の矩形がしきい値決定矩形である。 また 同図(a )は、 決定されたしきい値の状態を示しており、 b及び f の区間は、 各矩 形内で決定されたしきい値が用いられ、 a及び cの画像の端の区間は、 前記 bの 区間と同じしきい値が用いられ、 eの区間は、 前記 f の区間と同じしきい値が用 いられ、 更に dの区間は、 2つの領域の各しきい値を線形補間して用いる。
またしきい値を変動させることにより、 部分的な印刷のかすれ等に対応するこ ともできる。 これは、 第 1 3図のように横方向に 1つの矩形だけとする (横方向 には同じしきい値) のではなく、 複数の矩形に分割することによって、 実現可能 である。
上記しきい値判定領域は、 矩形 (長方形) ではなく、 前述と同様、 五線の開始 及び終了位置を結んだ平行四辺形領域でも良いし、 五線認識で検出された五線ず らし量を考慮した短冊型領域でも良い。 以上詳述した本発明の構成によれば、 楽譜情報を利用して、 認識に最適な 2値 化画像を得ることができ、 認識率を向上せしめることが可能となる。 また画像ス キャン時に最適なしきい値への設定の手間がなくなり、 作業効率が改善されるこ とになる。 産業上の利用可能性
以上のように、 本発明にかかる楽譜認識方法及び楽譜認識プログラムを記録し たコンピュータ読み取り可能な記録媒体の構成は、 楽譜を機械的に認識させる場 合に有用であり、 特に楽譜からカラオケ演奏のためのデータを作成したり、 スタ ジォ録音やライブ演奏で、 人による演奏に代わってその一部を機械演奏させる場 合などに適している。

Claims

請 求 の 範 囲
1 . 楽譜イメージを読み取って、 その音楽記号を認識し、 演奏及び Z又は楽譜 表示のためのデータを作成する楽譜認識方法において、 楽譜情報を用いて、 2値 化しきレ、値の設定を行レ、、 楽譜ィメージを 2値化画像として取り込むことを特徴 とする楽譜認識方法。
2 . 楽譜イメージを読み取って、 その音楽記号を認識し、 演奏及び Z又は楽譜 表示のためのデータを作成する楽譜認識方法において、 画像を複数のプロックに 分割し、 各ブロック毎に、 楽譜情報を用いて 2値化しきい値の設定を行い、 楽譜 イメージを 2値化画像として取り込むことを特徴とする楽譜認識方法。
3 . 請求の範囲 1乃至 2記載の楽譜認識方法において、 前記楽譜情報は、 五線 間隔と五線の線幅であることを特徴とする請求の範囲 1乃至 2記載の楽譜認識方 法。
4 . 楽譜イメージを読み取って、 その音楽記号を認識し、 演奏及びノ又は楽譜 表示のためのデータを作成する楽譜認識プログラムを記録したコンピュータ読み 取り可能な記録媒体において、 楽譜情報を読み込む情報読み込みステップと、 読 み込まれた楽譜情報に基づき 2値化しきい値の設定を行うしきい値設定ステップ と、 設定された 2値化しきい値に基づいて、 楽譜イメージを 2値化画像として取 り込む 2値化画像取り込みステップとを実行させるための楽譜認識プログラムを 記録したコンピュータ読み取り可能な記録媒体。
5 . 楽譜イメージを読み取って、 その音楽記号を認識し、 演奏及び Z又は楽譜 表示のためのデータを作成する楽譜認識プログラムを記録したコンピュータ読み 取り可能な記録媒体において、 画像を読み込む画像読み込みステップと、 読み込 まれた画像を複数のプロックに分割する画像分割ステップと、 各プロック毎に楽 譜情報を読み込む情報読み込みステップと、 読み込まれた楽譜情報に基づき、 各 ブロック毎の 2値化しきい値の設定を行うしきい値設定ステップと、 各ブロック 毎に設定された 2値化しきい値に基づいて、 楽譜イメージを 2値化画像として取 り込む 2値化画像取り込みステップとを実行させるための楽譜認識プログラムを 記録したコンピュータ読み取り可能な記録媒体。
6 . 請求の範囲 4乃至 5記載の楽譜認識プログラムを記録したコンピュータ読 み取り可能な記録媒体において、 前記楽譜情報は、 五線間隔と五線の線幅である ことを特徴とする請求の範囲 4乃至 5記載の楽譜認識プログラムを記録したコン ピュータ読み取り可能な記録媒体。
PCT/JP1998/002895 1997-12-26 1998-06-29 Procede de reconnaissance de la musique et support d'enregistrement lisible par un ordinateur sur lequel est enregistre un programme de reconnaissance de la musique WO1999034352A1 (fr)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US09/380,225 US6580805B1 (en) 1997-12-26 1998-06-29 Method and recognizing music and computer-readable recording medium having music-recognizing program recorded therein

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP9/366878 1997-12-26
JP36687897A JP3607065B2 (ja) 1997-12-26 1997-12-26 楽譜認識方法及び楽譜認識プログラムを記録したコンピュータ読み取り可能な記録媒体

Publications (1)

Publication Number Publication Date
WO1999034352A1 true WO1999034352A1 (fr) 1999-07-08

Family

ID=18487918

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP1998/002895 WO1999034352A1 (fr) 1997-12-26 1998-06-29 Procede de reconnaissance de la musique et support d'enregistrement lisible par un ordinateur sur lequel est enregistre un programme de reconnaissance de la musique

Country Status (3)

Country Link
US (1) US6580805B1 (ja)
JP (1) JP3607065B2 (ja)
WO (1) WO1999034352A1 (ja)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009153067A (ja) * 2007-12-21 2009-07-09 Canon Inc 画像処理方法及び画像処理装置
KR101459766B1 (ko) * 2008-02-12 2014-11-10 삼성전자주식회사 휴대 단말에서 자동반주 악보를 인식하는 방법
JP2012138009A (ja) * 2010-12-27 2012-07-19 Kawai Musical Instr Mfg Co Ltd 楽譜認識装置、及びコンピュータプログラム
JP5765848B2 (ja) * 2011-03-31 2015-08-19 株式会社河合楽器製作所 音再生プログラム及び音再生装置
US9378654B2 (en) * 2014-06-23 2016-06-28 D2L Corporation System and method for rendering music

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01304497A (ja) * 1988-06-02 1989-12-08 Casio Comput Co Ltd 楽譜認識方法及び装置
JPH0287776A (ja) * 1988-09-26 1990-03-28 Toshiba Corp 画像処理装置
JPH0785245A (ja) * 1993-09-10 1995-03-31 Mitsubishi Electric Corp 視覚センサ

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0535924A (ja) * 1991-07-31 1993-02-12 Yamaha Corp 楽譜自動認識装置
TW250558B (en) * 1993-10-20 1995-07-01 Yamaha Corp Sheet music recognition device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH01304497A (ja) * 1988-06-02 1989-12-08 Casio Comput Co Ltd 楽譜認識方法及び装置
JPH0287776A (ja) * 1988-09-26 1990-03-28 Toshiba Corp 画像処理装置
JPH0785245A (ja) * 1993-09-10 1995-03-31 Mitsubishi Electric Corp 視覚センサ

Also Published As

Publication number Publication date
JP3607065B2 (ja) 2005-01-05
JPH11194762A (ja) 1999-07-21
US6580805B1 (en) 2003-06-17

Similar Documents

Publication Publication Date Title
US6801636B2 (en) Image processing apparatus and method, and storage medium
US7623727B2 (en) Image binarization apparatus, image binarization method, image pickup apparatus, image pickup method, and a computer product
US6956587B1 (en) Method of automatically cropping and adjusting scanned images
JP2595158B2 (ja) 画像情報の絵/文字自動分離装置及びその方式
JP5241631B2 (ja) 画像処理方法、画像処理装置及びプログラム
US20090109502A1 (en) Image processing apparatus, image scanning apparatus, and image processing method
US7483176B2 (en) Image processing apparatus and method
US7957576B2 (en) Image processing apparatus, image processing method, and image processing program
US6807301B1 (en) Image production controlling device, image producing device, image production controlling method, and a storage medium
WO1999034352A1 (fr) Procede de reconnaissance de la musique et support d'enregistrement lisible par un ordinateur sur lequel est enregistre un programme de reconnaissance de la musique
JP4105539B2 (ja) 画像処理装置およびそれを備えた画像形成装置ならびに画像処理方法、画像処理プログラムおよび記録媒体
US20090148003A1 (en) Block-based noise detection and reduction method with pixel level classification granularity
EP1156444A1 (en) Detection of circular pattern in digital image
JP5222126B2 (ja) 画像処理方法、画像処理装置及びプログラム
US20100165421A1 (en) Image processing apparatus, image processing method, and program
JP3384208B2 (ja) 画像読み取り装置
JPH05244413A (ja) 画像処理装置
JP3613356B2 (ja) 楽譜認識装置
JP4254008B2 (ja) パターン検出装置及び方法
JP3358133B2 (ja) 画像処理装置
JP3451490B2 (ja) 画情報の処理方法
JP3971347B2 (ja) 光学的情報読み取り方法
JP5875551B2 (ja) 画像処理装置、画像処理方法、および画像処理プログラム
JP3382247B2 (ja) 画像処理システム
JP2003187186A (ja) 楽譜認識装置

Legal Events

Date Code Title Description
AK Designated states

Kind code of ref document: A1

Designated state(s): DE US

WWE Wipo information: entry into national phase

Ref document number: 09380225

Country of ref document: US

REG Reference to national code

Ref country code: DE

Ref legal event code: 8642