1. A method for compressing images comprising:
- precompressing a first representation of an image, said first representation based on pixels of a first type and a second type, to generate a precompressed representation of said image,
- identifying symbols in said precompressed representation of said image,
- comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
2. The method of claim 1 wherein said first representation of an image is precompressed by rim-length encoding.
3. The method of claim 2 wherein said first representation is based on rows and columns of pixels, and symbols are identified by associating runs of said first type of pixel in adjacent rows of said precompressed representation which have at least one pixel of said first type in the same column or in the same or adjacent columns.
4. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, wherein said library is augmented during image compression by storing in said library symbols for which no matching template is found as new templates, and wherein each template is defined by a representation determined by a plurality of the symbols which match, wherein each template is defined by a unique spatial distribution of pixels, said distribution determined by the distributions of pixels of a plurality of the symbols which match said template, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
5. The method of claim 4 wherein the distribution of pixels defining a template is determined by averaging the distributions of pixels of a plurality of the symbols which match said template.
6. The method of claim 4 wherein the distribution of pixels defining a template is determined by taking one symbol matching the template and changing a pixel in that symbol only if more than a predetermined fraction of the other symbols matching the template disagree with that pixel.
7. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error locations, performing at least one test on said error locations and on other global features of the symbol and the template, and declaring a match between a symbol and a template only if all of the tests in at least one of a set of predetermined groups of tests are passed, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
8. The method of claim 7 wherein said first representation is based on rows and columns of pixels of a first type and a second type, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations and other global features of the symbol and the template, a match between a symbol and a template being declared only if all of the tests in at least one of a set of predetermined groups of tests are passed.
9. The method of claim 8 wherein said error locations are run-length encoded.
10. The method of claim 8 wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the first type in the template or symbol having a pixel of the second type at the error pixel location is less than a predetermined value.
11. The method of claim 8 wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the second type in the template or symbol having a pixel of the first type at the error pixel location is less than a predetermined value.
12. The method of claim 8 wherein one of said at least one test depends on the sizes, shapes, and orientations of contiguous groups of error pixels in some error map.
13. The method of claim 12 wherein one of said at least one test is passed if all contiguous groups of error pixel locations are smaller than predetermined patterns of pixels.
14. The method of claim 7 wherein one of said at least one test is passed if inferred shifts of the symbol relative to the template are consistent.
15. The method of claim 14 wherein shifts are inferred from the sizes, shapes, and orientations of contiguous groups of error pixel locations and their relation to adjacent pixels.
16. The method of claim 15 wherein shifts are inferred from triangles of pixels in the template and symbol error maps such that the inferred shift is towards or away from the fourth pixel in the square bounding the triangle depending on whether said fourth pixel has the same or different parity, respectively, as the triangle pixels in the template.
17. The method of claim 8 wherein one of said at least one test is passed if the difference in heights between a template and a symbol is less than a predetermined value.
18. The method of claim 8 wherein one of said at least one test is passed if the difference in widths between a template and a symbol is less than a predetermined value.
19. The method of claim 8 wherein one of said at least one test is passed if the ratio of the number of pixels of the first type in the symbol and the number of pixels of the first type in the template is within a redetermined range.
20. The method of claim 8 wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value.
21. The method of claim 8 wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type adjacent to a pixel of said second type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value.
22. The method of claims 7 or 8 wherein at least one of said at least one test depends on symbol size.
23. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, wherein each said template is defined by a representation based on a spatial distribution of pixels of a first type, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image, wherein the representation of a plurality of said templates is a representation of the boundary of the spatial distribution of pixels of the first type for the templates.
24. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image, wherein the representation of a plurality of said templates comprises a reference to a frame template for defining an outer boundary of said template and a list of hole templates with associated positions within said frame template for defining any inner boundaries of said template.
25. The method of claim 24 wherein said frame templates and hole templates are represented by representations of the boundary of said frame templates and hole templates.
26. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, wherein the templates are indexed in said library according to template features, and wherein said step of comparing proceeds according to the index, whereby those templates more likely, based on features, to match a symbol are compared to the symbol before templates less likely to match, and those templates whose indexed features indicate that the likelihood of a match falls below a predetermined threshold are not compared, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
27. The method of claims 1, 2, or 3 wherein each template is defined by a unique spatial distribution of pixels, said distribution determined by the distributions of pixels of a plurality of the symbols which match said template.
28. The method of claim 4 wherein said comparing step includes identifying error locations, performing at least one test on said error locations and on other global features of the symbol and the template, and declaring a match between a symbol and a template only if all of the tests in at least one of a set of predetermined groups of tests are passed.
29. The method of claims 1, 2, or 3 wherein said comparing step includes identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations and on other global features of the symbol and the template, a match between a symbol and a template being declared only if all of the tests in at least one of a set of predetermined groups of tests are passed.
30. The method of claims 1, 2, 3, 4, 7 or 8 wherein said first representation is based on pixels of a first type and a second type, and the representation of a plurality of said templates is a representation of the boundary of the spatial distribution of pixels of the first type for the template.
31. The method of claims 1, 2, 3, 4, 7 or 8 wherein the representation of each said template comprises a reference to a frame template for defining an outer boundary of said template and a list of hole templates with associated positions within said frame template for defining any inner boundaries of said template.
32. The method of claims 1, 2, 3, 4, 7, 8, 23 or 24 wherein the templates are indexed in said library according to template features, and wherein said step of comparing proceeds according to the index, whereby those templates more likely, based on features, to match a symbol are compared to the symbol before templates less likely to match, and those templates whose indexed features indicate that the likelihood of a match falls below a predetermined threshold are not compared.
33. The method of claims 1, 2, 3, 4, 7, 8, 23, 24, or 26 further comprising reducing the resolution of the representation of a plurality of templates.
34. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 wherein said compressed representation of said image includes a plurality of data streams, and wherein at least one of said streams is further compressed.
35. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 wherein said compressed representation of said image includes a template stream, a template reference stream, and row and column position streams, and wherein at least one of said streams is further compressed.
36. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 further comprising splitting templates comprising a region smaller than a predetermined pattern of pixels into more than one template.
37. The method of claim 36 further comprising comparing templates formed by splits to other templates and merging templates formed by splits which match another template with that template.
38. The method of any of claims 1, 2, 3, 4, 7, 8, 25, 24 or 26 further comprising eliminating symbols smaller than predetermined patterns of pixels.
39. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 wherein the indications of locations for symbols in said image are represented by the difference between the actual offset between a given symbol and a preceding symbol and a standard offset for the symbol pair defined by said given symbol and preceding symbol.
40. The method of claim 39 wherein said standard offset is the offset last seen for the symbol pair.
41. The method of claim 39 wherein said standard offset is the most frequently seen offset for the symbol pair.
42. The method of claim 39 wherein the difference between the standard offset and the actual offset is determined at a lower resolution than the resolution of the first representation of said image.
43. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 further comprising determining approximate reading order of said symbols and generating said compressed representation of said image according to said reading order.
44. The method of claim 43 wherein said reading order is determined by locating symbols on a single line and sorting the symbols.
45. The method of claim 44 wherein the symbols on a line are determined by using a beam to search along the line, the size of said beam varying according to the size of one or more adjacent symbols.
46. The method of claim 45 wherein bounds on the size of the beam are imposed.
47. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 applied to an image transmission system.
48. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 applied to a facsimile transmission system.
49. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 applied to an image enhancement system.
50. The method of any of claims 1, 2, 3, 4, 7, 8, 23, 24 or 26 applied to an image storage system.
51. Apparatus for compressing images comprising:
- input means for accepting a first representation of an image, and
- processing means for
- a) precompressing said first representation of said image to generate a precompressed representation of said image,
- b) identifying symbols in said precompressed representation of said image,
- c) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, and
- d) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image.
52. Apparatus for compressing images comprising:
- input means for accepting a, first representation of an image, and
- processing means for
- a) identifying symbols in said first representation of said image,
- b) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, wherein said library is augmented during image compression by storing in said library symbols for which no matching template is found as new templates, and wherein each template is defined by representations determined by a plurality of the symbols which match, wherein each template is defined by a unique spatial distribution of pixels, said distribution determined by the distributions of pixels of a plurality of the symbols which match said template, and
- c) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image.
53. Apparatus for compressing images comprising:
- input means for accepting a first representation of an image, and
- processing means for
- a) identifying symbols in said first presentation of said image,
- b) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, said comparing step including identifying error locations, performing at least one test on said error locations and on other global features of the symbol and the template, and declaring a match between a symbol and a template only if all of the tests in at least one of a set of predetermined groups of tests are passed, and
- c) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image.
54. Apparatus for compressing images comprising:
- input means for accepting a first representation of an image, and
- processing means for
- a) identifying symbols in said first representation of said image,
- b) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, wherein each said template is defined by a representation based on a spatial distribution of pixels of a first type, and
- c) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image, wherein the representation of a plurality of said templates is a representation of the boundary of the spatial distribution of pixels of the first type for the templates.
55. Apparatus for compressing images comprising:
- input means for accepting a first representation of an image, and processing means for
- a) identifying symbols in said first representation of said image,
- b) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, and
- c) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image, wherein the representations of a plurality of said templates comprise a reference to a frame template for defining an outer boundary of the template and a list of hole templates with associated positions within said frame template for defining any inner boundaries of said template.
56. Apparatus for compressing images comprising:
- input means for accepting a first representation of an image, and processing means for
- a) identifying symbols in said first representation of said image,
- b) comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, wherein the templates are indexed in said library according to template features, and wherein said step of comparing proceeds according to the index, whereby those templates more likely, based on features, to match a symbol are compared to the symbol before templates less likely to match, and those templates whose indexed features would preclude a match are not compared, and
- c) generating a compressed representation of said image including a representation of templates, and an indication of a location and a template corresponding to symbols in said image.
57. The apparatus as in any of claims 51-56 further comprising output means for providing said compressed representation of said image.
58. The apparatus as in any of claims 51-56 wherein said input means is a scanner.
59. The apparatus of claim 55 wherein said output means is a modem.
60. A method for compressing images comprising:
- precompressing a first representation of an image, said first representation based on pixels of a first type and a second type, to generate a precompressed representation of said image,
- identifying symbols in said precompressed representation of said image,
- comparing a plurality of identified symbols to each of at least one template from a library of templates to match identified symbols to templates, and
- generating a compressed representation of said image including an indication of a location and a template for symbols in said image.
61. The method of claim 60 wherein said first representation of an image is precompressed by run-length encoding.
62. The method of claim 61 wherein said first representation is based on rows and columns of pixels, and symbols are identified by associating runs of said first type of pixel in adjacent rows of said precompressed representation which have at least one pixel of said first type in the same column or in the same or adjacent columns.
63. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error locations, performing at least one test on said error locations and on other global features of the symbol and the template, and declaring a match between a symbol and a template only if all of the tests in at least one of a set of predetermined groups of tests are passed, and
- generating a compressed representation of said image including an indication of a location and a template for symbols in said image.
64. The method of claim 63 wherein said first representation is based on rows and columns of pixels of a first type and a second type, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations and other global features of the symbol and the template, a match between a symbol and a template being declared only if all of the tests in at least one of a set of predetermined groups of tests are passed.
65. The method of claim 64 wherein said error locations are run-length encoded.
66. The method of claim 64 wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the first type in the template or symbol having a pixel of the second type at the error pixel location is less than a predetermined value.
67. The method of claim 64 wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the second type in the template or symbol having a pixel of the first type at the error pixel location is less than a predetermined value.
68. The method of claim 64 wherein one of said at least one test depends on the sizes, shapes, and orientations of contiguous groups of error pixels in some error map.
69. The method of claim 68 wherein one of said at least one test is passed if all contiguous groups of error pixel locations are smaller than predetermined patterns of pixels.
70. The method of claim 68 wherein one of said at least one test is passed if inferred shifts of the symbol relative to the template are consistent.
71. The method of claim 70 wherein shifts are inferred from the sizes, shapes, and orientations of contiguous groups of error pixel locations and their relation to adjacent pixels.
72. The method of claim 71 wherein shifts are inferred from triangles of pixels in the template and symbol error maps such that the inferred shift is towards or away from the fourth pixel in the square bounding the triangle depending on whether said fourth pixel has the same or different parity, respectively, as the triangle pixels in the template.
73. The method of claim 64 wherein one of said at least one test is passed if the difference in heights between a template and a symbol is less than a predetermined value.
74. The method of claim 64 wherein one of said at least one test is passed if the difference in widths between a template and a symbol is less than a predetermined value.
75. The method of claim 64 wherein one of said at least one test is passed if the ratio of the number of pixels of the first type in the symbol and the number of pixels of the first type in the template is within a predetermined range.
76. The method of claim 64 wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value.
77. The method of claim 64 wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type adjacent to a pixel of said second type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value.
78. The method of claims 63 or 64 wherein at least one of said at least one test depends on symbol size.
79. A method for compressing images comprising:
- identifying symbols in a first representation of an image,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, wherein the templates are indexed in said library according to template features, and wherein said step of comparing proceeds according to the index, whereby those templates more likely, based on features, to match a symbol are compared to the symbol before templates less likely to match, and those templates whose indexed features indicate that the likelihood of a match falls below a predetermined threshold are not compared, and
- generating a compressed representation of said image including an indication of a location and a template for symbols in said image.
80. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the first type in the template or symbol having a pixel of the second type at the error pixel location is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
81. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the distance between each error pixel location and the nearest pixel of the second type in the template or symbol having a pixel of the first type at the error pixel location is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
82. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test depends on the sizes, shapes and orientations of contiguous groups of error pixel locations in some error map other than an error map consisting of all error pixel locations, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
83. The method of claim 82 wherein one of said at least one test is passed if all of said contiguous groups of error pixel locations are smaller than predetermined patterns of pixels.
84. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if inferred shifts of the symbol relative to the template are consistent, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
85. The method of claim 84 wherein shifts are inferred from the sizes, shapes, and orientations of contiguous groups of error pixel locations and their relation to adjacent pixels.
86. The method of claim 85 wherein shifts are inferred from triangles of pixels in the template and symbol error maps such that the inferred shift is towards or away from the fourth pixel in the square bounding the triangle depending on whether said fourth pixel has the same or different parity, respectively, as the triangle pixels in the template.
87. The method of claim 85 wherein shifts are inferred from single error pixels such that the inferred shift is towards or away from some pixel adjacent to said single error pixel depending on whether said adjacent pixel has the same or different parity, respectively, as said error pixel in the template.
88. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the difference in width between the template and the symbol is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
89. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the difference in height between the template and the symbol is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
90. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the ratio of the number of pixels of the first type in the symbol and the number of pixels of the first type in the template is within a predetermined range, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
91. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template, but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.
92. A method for compressing images comprising:
- identifying symbols in a first representation of an image, said first representation based on rows and columns of pixels of a first type and a second type,
- comparing a plurality of identified symbols to each of at least one template in a library of templates to match identified symbols to templates, said comparing step including identifying error pixel locations which have a pixel of said first type in only said symbol or said template but not both, and performing at least one test on said error pixel locations, wherein one of said at least one test is passed if the ratio of the number of error pixel locations to the number of pixels of the first type adjacent to a pixel of said second type in said template or said symbol, or the minimum or maximum of the two, is less than a predetermined value, and
- generating a compressed representation of said image including a representation of templates, and an indication of a location and a template for symbols in said image.