This application is based on and claims priority under 35 USC 119 from Japanese Patent Application No. 2020-157134 filed on Sep. 18, 2020.
The present disclosure relates to an information processing apparatus and a non-transitory computer readable medium storing a program.
There is a technique to convert a raster image to a vector image. For instance, Japanese Unexamined Patent Application Publication No. 2007-109177 describes a technique that determines a representative color based on the appearance color in a predetermined area image having a predetermined attribute included in an original image, extracts the outline of each color image having the determined representative color and the edge images in the predetermined area image, corrects the extracted outline based on the extracted edge images, and generates vector data of the predetermined area image using the corrected outline.
However, even with the technique of Japanese Unexamined Patent Application Publication No. 2007-109177, a gap occurs between the outline of an area shown in a vector image and the outline of the same area shown in a raster image. Even when a vector image is expanded or contracted, the image quality is maintained. However, for instance, when a gap is present in an original vector image and the vector image is expanded, the gap is increased and revealed.
Thus, aspects of non-limiting embodiments of the present disclosure relate to an information processing apparatus that, when the outline of an area in a raster image is represented by a vector image, reduces the gap between the outlines represented by both images.
Aspects of certain non-limiting embodiments of the present disclosure address the above advantages and/or other advantages not described above. However, aspects of the non-limiting embodiments are not required to address the advantages described above, and aspects of the non-limiting embodiments of the present disclosure may not address advantages described above.
According to an aspect of the present disclosure, there is provided an information processing apparatus including a processor configured to extract, for each of a plurality of ranges, an outline of each of areas having a common range of color information from an original image in a raster format, generate, for each area, an image in a vector format showing the extracted outline, generate intermediate images in the raster format using the outline shown by the generated image in the vector format, and when a defect occurs in the area after the generated intermediate images are integrated, generate an image as the original image, the image having undergone interpolation of the defect and integration of the intermediate images.
Exemplary embodiments of the present disclosure will be described in detail based on the following figures, wherein:
For instance, the processor 11 has an arithmetic unit such as a central processing unit (CPU), a register and a peripheral circuit. The memory 12 is a recording medium readable by the processor 11, and includes a random access memory (RAM) and a read only memory (ROM).
The storage 13 is a recording medium readable by the processor 11, and includes, for instance, a hard disk drive or a flash memory. The processor 11 controls the operation of each hardware by executing the programs stored in the ROM and the storage 13 using the RAM as a work area. The communication device 14 is a communication unit that has an antenna and a communication circuit, and performs communication via a communication line 2.
The UI device 15 is an interface provided to a user who utilizes the device. The UI device 15 has, for instance, a display which is a display unit, and a touch screen having a touch panel provided on the surface of the display, and displays an image as well as receives an operation from the user. In addition, the UI device 15 has an operation device such as a keyboard, other than the touch screen, and receives an operation to the device.
The image reading device 16 is hardware (so-called scanner) that reads an image on a medium such as paper, and also an image reading unit that reads an image from a medium set to the device. The image forming device 17 is a so-called printer that forms an image on a medium such as paper, and is specifically an image forming unit that forms an image on a medium by transferring and fixing the image onto the medium, for instance, by an electrophotographic system while transporting the medium set to the device.
The functions described below are implemented by the processor 11 executing a program to control each unit. The operation performed by each function is also represented as the operation performed by the processor 11 that implements the function.
The original image storage 101 stores an original raster image to be converted to a vector image, as an original image. The original image storage 101 stores a raster image generated by the apparatus or a raster image transmitted from an external device as an original image.
The pre-processor 102 preprocesses an original image in a raster format stored in the original image storage 101. For instance, the pre-processor 102 performs edge preservation and noise reduction processing, subtractive color processing, color division processing, and color layer division processing as the pre-processing. The edge preservation and noise reduction processing are processing of removing noise as well as preserving edges so that the edges do not become smooth due to the effect of the noise reduction.
The subtractive color processing is processing of reducing the number of colors in an original image. In general, the subtractive color processing is known as a K-means method or a median cut method. The color division processing herein divides the original image into pixel areas having a common range of color information such as hue and brightness. The color information represents the characteristics of the color components of a pixel, specifically, hue, brightness, chroma, and luminance.
For instance, the pre-processor 102 divides the value of an angle indicating a hue into a predetermined number of ranges in a hue circle (for instance, divides the value into 36 ranges every 10 degrees), and divides the original image into pixel areas in which the hue value is included in a corresponding range. The color layer division processing generates a color layer for each hue range, the color layer representing an area obtained by division by the color division processing. In the exemplary embodiment, a description is given by using the hue as the color information for performing the color division processing. However, the color division may be performed using other information, such as chroma, brightness or luminance, which indicates the characteristics of the color of a pixel.
The original image which has undergone the preprocessing by the pre-processor 102 is referred to as a “preprocessed image”. The pre-processor 102 supplies the preprocessed image to the outline extractor 103. The outline extractor 103 extracts the outline of each area shown in color layers included in the supplied preprocessed image, thereby extracting the outline of each area having a common hue range from the original image in a raster format for multiple hue ranges.
In addition, the outline extractor 103 extracts points at characteristic positions on an extracted outline.
The outline extractor 103 supplies outline data to the vector image generator 104, the outline data indicating the outline of each area in each extracted hue range and the points. The vector image generator 104 generates a vector image for each area, the vector image showing the outline indicated by the supplied outline data, in other words, the outline extracted by the outline extractor 103. Using a well-known technique to generate a vector image from a raster image, the vector image generator 104 generates a vector image showing the extracted outline for each area in each hue range.
The vector image generator 104 supplies the generated vector image to the intermediate image generator 105. The intermediate image generator 105 generates an intermediate image in a raster format using the outline shown by the supplied vector image, in other words, by the vector image generated by the vector image generator 104. Using a well-known technique to generate a raster image from a vector image, the intermediate image generator 105 generates a raster image as the intermediate image from the supplied vector image for each hue range.
The defect determining unit 106 integrates the supplied raster images, in other words, the intermediate images generated by the intermediate image generator 105, and determines whether any area in each hue range has a defect.
In the integrated image G1, a defect E1 occurs between the intermediate image D1 and the intermediate image D2. For instance, when the integrated image G1 and the original image G1 are overlapped and no pixel with different pixel values is present, the defect determining unit 106 determines that no defect has occurred, and when a pixel with different pixel values is present, the defect determining unit 106 determines that a defect has occurred. When the defect determining unit 106 determines that a defect has occurred, and the size of the occurred defect is greater than a predetermined size, a defect image showing the defect is supplied to the defect interpolator 107 along with each intermediate image.
The image integrator 108 generates an image obtained by integrating the intermediate images based on the intermediate image supplied from the intermediate image generator 105 and the intermediate image after being interpolated supplied from the defect interpolator 107. For interpolated intermediate images, the image integrator 108 integrates the intermediate images after being interpolated, and for not interpolated intermediate images, the image integrator 108 integrates the intermediate images supplied from the intermediate image generator 105. When integration including the intermediate images after being interpolated is performed, the image integrator 108 supplies the generated integrated image to the original image storage 101.
The original image storage 101 stores a supplied integrated image as the original image. Like this, when integration of the generated intermediate images causes a defect in a hue area, the image integrator 108 generates an image obtained by interpolating the defect and the integrating the intermediate images, as the original image. Similarly to the above-described original image, the preprocessing by the pre-processor 102 and the determination of defect by the defect determining unit 106 are performed on the integrated image stored in the original image storage 101 as the original image.
When determining that a defect has not occurred, the defect determining unit 106 notifies the vector image generator 104 of the determination. The vector image generator 104 outputs the original vector image of the integrated image determined to be free of defect to a destination specified, for instance, as the storage location of the vector image converted by the apparatus. No defect occurs in thus stored vector image, even when converted to a raster image.
As described above, when a defect still occurs in the image after being interpolated, the units from the original image storage 101 to the image integrator 108 repeatedly perform interpolation and integration until the defect is reduced to be less than the above-mentioned predetermined size. The image processing apparatus 10 performs processing of converting a raster image to a vector image based on the above-described configuration.
Next, the image processing apparatus 10 (the vector image generator 104) generates a vector image showing the extracted outline for each area (step S14). Subsequently, the image processing apparatus 10 (the intermediate image generator 105) generates an intermediate image in a raster format using the outline shown by the generated vector image (step S15). Next, the image processing apparatus 10 (the defect determining unit 106) integrates the generated intermediate images, and determines whether any defect is greater than a predetermined size (step S16).
When it is determined that there is a greater defect in step S17, the image processing apparatus 10 (the defect interpolator 107) performs interpolation processing for interpolating the defect (step S17). Next, based on the intermediate image generated in step S15 and the intermediate image interpolated in step S18, the image processing apparatus 10 (the image integrator 108) generates an integrated image obtained by integrating those intermediate images (step S18).
After step S19, the image processing apparatus 10 returns to step S11 and performs its operation. When it is determined that there is no greater defect in step S17, the image processing apparatus 10 (the vector image generator 104) outputs the original vector image of the integrated image determined to be free of greater defect to a destination specified, for instance, as the storage location of the vector image converted by the apparatus (step S19).
In the exemplary embodiment, the outline of each area in a raster image is represented by a vector image by converting the raster image to the vector image. By interpolating a defect as described above, the gap between the outlines represented in both images is reduced, as compared with when the defect is not interpolated. In addition, in the exemplary embodiment, the defect is reliably reduced to be less than the predetermined size by repeatedly performing the interpolation and integration as described above. Additionally, in the exemplary embodiment, the intermediate image in contact with a portion where a defect has occurred is expanded, thus the boundary between the interpolated defect and the intermediate image is unlikely to be recognized.
The above-described exemplary embodiment is merely an example of the present disclosure, and may be modified as follows. Alternatively, the exemplary embodiment and each modification may be implemented in a combination as needed.
The defect interpolator 107 may interpolate a defect by a method different from the method in the exemplary embodiment. For instance, since the difference area between the image of a hue area extracted by the outline extractor 103 and an intermediate image is a defect area, the defect interpolator 107 identifies the difference area, and interpolates the defect with a color determined based on the color of the portion corresponding to the difference area in the hue area.
It is to be noted that when a defect occurs between an intermediate image and an image in a hue area, the defect interpolator 107 may interpolate the defect with the color of a hue area corresponding to the area of the defect portion. Alternatively, the defect interpolator 107 may interpolate the defect with a color determined based on the color of the intermediate image in contact with a portion where the defect has occurred. In that case, for instance, when a defect has occurred between two or more intermediate images, the defect interpolator 107 interpolates the defect using the intermediate color between the colors of the two or more intermediate images.
Alternatively, when a defect occurs between two intermediate images, as the color for the defect, the defect interpolator 107 may determine a color which changes stepwise from the color of one intermediate image to the color of the other intermediate image. Alternatively, the defect interpolator 107 may simply determine that the color of each pixel in the defect is the same as the color of the intermediate image closer to the pixel.
Alternatively, the defect interpolator 107 may interpolate the defect by thickening the outline of a vector image in contact with a portion where the defect has occurred. In this case, the defect interpolator 107 requests the vector image to the vector image generator 104, and receives the vector image. The defect interpolator 107 then performs processing of thickening the outline of the received vector image, and supplies the vector image having the thickened outline to the intermediate image generator 105.
The intermediate image generator 105 generates an intermediate image in a raster format using the thickened outline shown by the supplied vector image. Because thus generated intermediate image has the outline thicker than that of the intermediate image before the interpolation, the defect is interpolated accordingly. Consequently, in the same manner as in the exemplary embodiment, the boundary between the interpolated defect and the intermediate image is unlikely to be recognized.
Alternatively, the defect interpolator 107 may interpolate the defect by integrating the intermediate image as well as an image obtained by expanding the portion where the defect has occurred.
The defect interpolator 107 sets the color of an expanded image C11, for instance, the color of an image in a hue area corresponding to the defect E1 to the color of the intermediate image. The defect interpolator 107 supplies the generated defect image G12 to the image integrator 108. The image integrator 108 generates an integrated image obtained by integrating the expanded image C11 included in the supplied defect image G12 and other intermediate images. Specifically, the image integrator 108 superimposes and integrates the intermediate images in contact with the portion, on the image obtained by expanding the portion where the defect has occurred.
For instance, when the defect image G12 is integrated as it is, a gap may further occur between the defect image G12 and an intermediate image. However, as described above, such a gap is unlikely to occur by expanding the defect image G12, as compared with when the defect image G12 is not expanded. In addition, a vector image closer to the original image is generated by superimposing the intermediate images over the expanded image C11, as compared with when the intermediate images are superimposed under the expanded image C11.
Although the pre-processor 102 divides the original image into areas in a predetermined number of hue ranges in the exemplary embodiment, the number of hue ranges for division may be changed. For instance, the pre-processor 102 changes the number of multiple hue ranges according to the degree of deviation of the color of the original image. For instance, the pre-processor 102 first sets the initial value of the number of hue ranges, and divides the original image into areas in the number of hue ranges.
The pre-processor 102 calculates the ratio of the number of pixels of each area in each hue range, and determines the color deviation based on the calculated ratio. For instance, the pre-processor 102 determines the color deviation to be higher for a greater maximum value of the ratio, and sets a higher number of hue ranges for greater color deviation. In that case, the pre-processor 102 uses a hue range table which associates the range of maximum value of the ratio, the color deviation, and the number of hue ranges with each other.
When the maximum value R1 of the calculated ratio is higher than or equal to Th2, the color deviation is “high”, thus the pre-processor 102 determines the number of hue ranges to be increased to “12”. In this manner, in the example of
It is to be noted that in the example of
Because the same original image is divided into a greater number of areas for a greater number of hue ranges, a vector image showing more outlines is generated. However, an area with a deviating color tends to be larger for a greater color deviation, and a large defect is likely to occur for a greater area in a hue range. In the example described above, for a greater color deviation, the areas in the hue ranges are generally reduced by increasing the number of hue ranges, thus a large defect is unlikely to occur, as compared with when the number of hue ranges is constant.
It is to be noted that the pre-processor 102 may set a lower number of multiple hue ranges for greater deviation of the color of the original image. In that case, the pre-processor 102 uses the hue range table shown in
In
An extremely small area in a hue range is likely to occur for greater deviation of the color, and pixels to show an outline is reduced in number for a smaller area in a hue range, thus the accuracy of the vector image generated by the vector image generator 104 is reduced. In the example of
The configuration of the functions implemented by the image processing apparatus 10 is not limited to what is shown in
Alternatively, for instance, the operations performed by the defect determining unit 106 and the defect interpolator 107 may be implemented by a single functional unit. Alternatively, the functions achieved by the image processing apparatus 10 may be implemented by two of more information processing apparatuses or computer resources provided by a cloud service. In short, as long as the functions shown in
In the embodiments above, the term “processor” refers to hardware in a broad sense. Examples of the processor include general processors (e.g., CPU: Central Processing Unit) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, and programmable logic device).
In the embodiments above, the term “processor” is broad enough to encompass one processor or plural processors in collaboration which are located physically apart from each other but may work cooperatively. The order of operations of the processor is not limited to one described in the embodiments above, and may be changed.
Not only as the information processing apparatus referred to as the image processing apparatus 10, the present disclosure may also be embodied as an information processing method to implement the processing performed by the information processing apparatus, and may also be embodied as a program which causes a computer to function, the computer being configure to control the information processing apparatus. The program may be provided in the form of a recording medium, such as an optical disc, on which the program is recorded or may be downloaded to a computer via a communication line such as the Internet, and provided in the form of installation to utilize the program.
The foregoing description of the exemplary embodiments of the present disclosure has been provided for the purposes of illustration and description. It is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Obviously, many modifications and variations will be apparent to practitioners skilled in the art. The embodiments were chosen and described in order to best explain the principles of the disclosure and its practical applications, thereby enabling others skilled in the art to understand the disclosure for various embodiments and with the various modifications as are suited to the particular use contemplated. It is intended that the scope of the disclosure be defined by the following claims and their equivalents.
Number | Date | Country | Kind |
---|---|---|---|
2020-157134 | Sep 2020 | JP | national |