Resolution Tests

This page explores the effects that scanning at various resolutions and bit-depths have on the localization accuracy of piano-roll punch holes. The test roll is a Duo-Art 5696 (Nov. 1915): Samson and Delilah Improvisation composed by Camille Saint-SaĆ«ns and performed by the composer. The sample region, shown on the right, starts 71 inches into the roll from the first note. This section was chosen since it had a range of punch lengths from 1 to 8 holes. The region represents 14 separate notes using 40 individual punches. The physical size of the region is 48.345 × 47.202 mm, or 1142 × 1115 pixels at 600 dpi.

Test scans

Click on the icons in the following table to view the sample images scanned at different resolutions and bit-depths. An Epson GT-1500 flatbed scanner was used to scan the roll. However, each resolution level had slightly different physical offsets, so the color and greyscale images in the table are instead down-sampled versions of the 600 dpi color scan, and the 150 and 300 dpi 2-color images are down-samples of the 600 dpi 2-color scans. The 1200 dpi 2-color images are directly from the scanner; however, the native resolution of the scanner is 600 × 1200 dpi, so one axis is interpolated.
24 bit 8 bit 1 bit
150 dpi    
300 dpi    
600 dpi    
1200 dpi    

For 2-color images, the roll was scanned at three threshold values of 20, 40 and 60. The lower threshold values generate smaller apparent diameters for the holes. The usable threshold range for the sample roll was from 20 to 70. Less than 20 will start to drop out holes, and thresholding above 70 will cause significant regions of the paper to be given the same color as the holes.

The following figure shows histograms for the pixel colors in the scan. Two peaks can be seen: a small one on the left which represents the color of the holes, and the larger peak to the right which is the color of the paper. For this test, a black background was used behind the paper to color the holes (also the lid of the scanner can be removed to generate a black background, although flattening the paper is more difficult in that case).

Ground truth

The figure shown below is an interactive overlay of circles covering hole punches in the 600 dpi 24-bit scan, manually placed using Adobe Illustrator. The assigned diameter of all punch holes are the same and are defined by hole #22.

Select various scan resolutions and bit depths to display underneath the manually identified punch locations. This is useful to examine how lower-resolution images and thresholding may affect punch hole identification (diameter and positioning). Also, adjust the overlay opacity and image zoom with the slides on the right. Note that zoomed image pixels are interpolated by the web browser, and may be done using different methods in different browsers.

Zoom: Overlay opacity:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40

Each of the 40 punches are numbered. The diameter of hole #22 was measured to be 1.692 mm, which is a diameter of 10.0 pixels at 150 dpi, 20.0 pixels at 300 dpi, 40.0 pixels at 600 dpi, and 79.9 pixels at 1200 dpi. At 10-feet per minute, the diameter of a hole is 33.3 milliseconds.

The separation between overlapping holes #20 and #21 is 1.196 mm (theoretically 1.191 mm for 1/256th of an inch). This is 7.1 pixels at 150 dpi, 14.1 pixels at 300 dpi, 28.3 pixels at 600 dpi, and 56.5 pixels at 1200 dpi. The duration of this distance is 23.5 milliseconds. The 1.196 mm spacing of punch holes is equivalent to 21.24 punches per inch.

Pixel durations (assuming 10 feet per minute): 3.33 ms at 150 dpi, 1.67 ms at 300 dpi, 0.833 ms at 600 dpi, and 0.417 ms at 1200 dpi. As a comparison, Standard MIDI note timing resolutions are 1 millsecond (0.9 ms).

Rows of punches are spaced 9 to the inch. The vertical distance between holes 16 and 3 is measured to be 2.974 mm (0.110 in) which is close to the theoretical value of 0.1111 inches, and represents a half-step. The vertical distance between holes 30 and 31 is 5.608 mm (0.221 in) which is close to the theoretical distance of 0.2222 inches and represents a whole-step. The distance between holes 3 and 33 is 33.671 mm (1.326 in) which represents an octave (theoretically spaced 1.3333 inches apart).

Physical coordinates of punches

The following table gives the coordinates for the centers of each punch hole in the example images, based on the hand-aligned SVG image created in Adobe Photoshop. The units are in millimeters with the origin at the top left corner of the image. For example, the first point is 38.428 mm from the left margin, and 2.651 mm from the top margin.

1 38.428 2.651
2 39.712 2.651
3   9.853 8.120
4 11.060 8.120
5 12.284 8.120
6 13.474 8.120
7 15.872 8.120
8 17.008 8.120
9 14.648 8.147
10 18.298 8.147
11 25.232 8.169
12 26.456 8.169
13 27.784 8.169
14 28.983 8.169
15 30.157 8.169
16   3.867 10.914
17   5.085 10.914
18   3.795 22.187
19   5.008 22.187
20 15.795 22.231
21 16.991 22.231
22 28.975 22.247
23 44.061 22.346
24 45.125 22.308
25   9.811 30.576
26 10.997 30.576
27 21.649 30.598
28 22.884 30.598
29 33.561 30.642
30 34.785 30.642
31 38.249 36.250
32 39.511 36.250
33 12.132 41.791
34 13.378 41.791
35 14.536 41.791
36 15.688 41.791
37 16.900 41.758
38 18.190 41.791
39 28.853 41.849
40 30.052 41.849

It would be useful to process each of the test images in various piano-roll reading software systems (or sub-components of such systems) to see how accurately they match to the positions in the above table which are measured by hand in the 600-dpi image.