Image chromatography preprocessing method, image forming device, electronic equipment and storage medium
By performing image recognition processing and color registration preprocessing on the image, using the reference color to determine the area to be processed and performing color channel conversion, the problem of low image white gap and ghost processing efficiency in the existing technology is solved, and more efficient image processing is achieved. and resource utilization.
Patent Information
- Application Number
- CN202411017163.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-10-08
- Estimated Expiration
- 2044-07-26
AI Technical Summary
The existing technology is not fully functional in the process of removing white gaps and ghosts from images, resulting in low computing efficiency and excessive consumption of hardware resources.
By performing image recognition processing on the image to be processed before printing, the image data containing the pixel position information and the processable area are obtained, the area to be processed is determined based on the specified reference color, and color registration preprocessing is performed, including color channel conversion and reassignment. To reduce redundant computing and hardware resource consumption.
It shortens the image color registration preprocessing time, reduces program redundancy and hardware resource consumption, optimizes the execution process of color registration preprocessing, and improves processing efficiency and user experience.
Smart Images

Figure CN118748700A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a color preprocessing method for an image, an image forming device, an electronic device and a storage medium. Background Art
[0002] During the operation of the image forming device, especially during color printing, it is easy to cause problems such as image white gaps and ghosting due to color misregistration. However, in the prior art, in the process of removing white gaps or ghosting of images, some functions are still not perfect. Summary of the invention
[0003] In view of this, the present application provides a color preprocessing method for an image, an image forming device, an electronic device and a storage medium, so as to solve the problem of imperfect white gap removal and / or ghosting process in an image.
[0004] In a first aspect, an embodiment of the present application provides a method for preprocessing color of an image, which is applied to an image forming device, comprising:
[0005] Acquire image data of an image to be processed and a specified reference color, wherein the image data includes position information of each pixel on the image to be processed and information of at least one processable area; the processable area is an image composed of pixels whose colors are consistent with at least one of the reference colors; the image data is data obtained when image recognition processing is performed on the image to be processed before printing;
[0006] Determine, according to the image data and the specified reference color, a region to be processed from at least one processable region, and a position of each pixel point in the region to be processed on the image to be processed;
[0007] According to the position of each pixel point in the area to be processed on the image to be processed, color preprocessing is performed on the area to be processed.
[0008] In a possible implementation, the image data further includes information of an unprocessable area; identification information of each pixel in the unprocessable area is different from identification information of each pixel in the processable area;
[0009] The processable area can be obtained as follows:
[0010] Each pixel on the image to be processed is traversed in sequence according to the image data, and at least one processable area is obtained based on the identification information of each pixel in the unprocessable area and the identification information of each pixel in the processable area.
[0011] In a possible implementation, color preprocessing is performed on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed, and the process also includes:
[0012] After the to-be-processed area is determined, the identification information of each pixel in the other processable areas is updated to change the processable areas to the unprocessable areas.
[0013] In a possible implementation, determining a to-be-processed area from at least one processable area according to the image data and a specified reference color includes:
[0014] According to a specified reference color, a corresponding first preset color threshold is obtained;
[0015] Comparing the color threshold of each pixel in the processable area with the first preset color threshold;
[0016] The area to be processed is determined according to the comparison result.
[0017] In a possible implementation, obtaining a specified reference color includes:
[0018] A color preprocessing instruction is obtained, wherein the color preprocessing instruction includes a specified reference color, wherein the specified reference color is any one of cyan, magenta, yellow and black.
[0019] In a possible implementation, performing color preprocessing on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed includes:
[0020] Obtain the color of each pixel in the area to be processed in the RGB channel;
[0021] Replace the color of each pixel in the RGB channel of the to-be-processed area with the background color of the RGB channel;
[0022] Performing color channel conversion on each pixel in the to-be-processed area to obtain the color of each pixel in the to-be-processed area in the CMYK four-channel;
[0023] According to the first color setting value, the color values of the other three channels except the channel where the specified reference color is located for each pixel point in the area to be processed are reassigned, and according to the second color setting value, the color value of the channel where the specified reference color is located for each pixel point in the area to be processed is reassigned.
[0024] In a possible implementation, the reassignment then includes:
[0025] Taking any pixel point in the area to be processed as the center point;
[0026] Determine whether a preset number of pixel points around the center point are all pixel points in the area to be processed;
[0027] If yes, the color value of the channel where the center point is located in the specified reference color is assigned to 0.
[0028] In a second aspect, an embodiment of the present application provides an image forming device, including:
[0029] An acquisition unit is used to acquire image data of an image to be processed and a specified reference color, wherein the image data includes position information of each pixel on the image to be processed and information of at least one processable area; the processable area is an image composed of pixels whose colors are consistent with at least one of the reference colors; the image data is data obtained when image recognition processing is performed on the image to be processed before printing;
[0030] a determination unit, configured to determine, from at least one of the processable regions, a region to be processed and a position of each pixel point in the region to be processed on the image to be processed according to the image data and a specified reference color;
[0031] The color preprocessing unit is used to perform color preprocessing on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed.
[0032] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0033] processor;
[0034] Memory;
[0035] A computer program is stored in the memory, and when the computer program is executed, the electronic device executes any one of the methods described in the first aspect.
[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any method described in the first aspect.
[0037] The color preprocessing method, device and electronic device of an image provided by the embodiments of the present application have at least the following technical effects:
[0038] The present application implements a method, device and electronic device for color preprocessing of an image, which determines the area to be processed based on the acquired image data of the image to be processed and a specified reference color, so as to perform color preprocessing based on the position of each pixel point in the area to be processed on the image to be processed. The image processing data is the data obtained when performing image recognition on the image to be processed before printing, and contains the position information of the pixel points and the information of the processable area, so that the information in the image data can be fully utilized to complete the color preprocessing, help shorten the processing time, reduce program redundancy, and reduce the consumption of hardware resources, and help further optimize the execution process of the color preprocessing. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0041] Figure 2 A schematic diagram of color misregistration of an image forming device provided in an embodiment of the present application;
[0042] Figure 3 A schematic diagram of a flow chart of a color preprocessing method for an image provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of identification information of a pixel provided in an embodiment of the present application;
[0044] Figure 5 A schematic diagram of an image information table provided in an embodiment of the present application;
[0045] Figure 6 A schematic flow chart of another method for color preprocessing of an image provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of removing white gaps and / or ghosting of an image provided by an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the structure of an image forming device provided in an embodiment of the present application;
[0048] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0050] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0051] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0052] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0053] See also Figure 1 , is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, the application scenario includes: a control device 110 and an image forming device 120, wherein the control device 110 and the image forming device 120 are interconnected through a wired or wireless communication network to transmit information. During the image forming process, the control device 110 converts the print data into a printer language, and sends the printer language to the image forming device 120, and the image forming device 120 performs the image forming operation.
[0054] The communication network between the control device 110 and the image forming device 120 may be a local area network or a wide area network transferred through a relay device. When the communication network is a local area network, exemplarily, the communication network may be a short-distance communication network such as a wifi hotspot network, a wifi P2P network, a Bluetooth network, a zigbee network or a near field communication (NFC) network. When the communication network is a wide area network, exemplarily, the communication network may be a third-generation wireless telephone technology (3G) network, a fourth-generation mobile communication technology (4G) network, a fifth-generation mobile communication technology (5G) network, a future-evolved public land mobile network (PLMN) or the Internet.
[0055] It should be pointed out that Figure 1 This is only an exemplary description and should not be used as a limitation on the scope of protection of this application. For example, the image forming device 120 includes but is not limited to a printer, a copier, a fax machine, a multi-function image making and copying device, an electrostatic printing device, and any other similar electronic device. The control device 110 includes but is not limited to a computer, a mobile phone, a tablet computer, an internal server of an enterprise, a cloud server, and other electronic devices that can communicate with the image forming device 120. In some possible implementations, the control device 110 may also be referred to as a host computer, a host, and the like.
[0056] In the working process of image forming equipment, especially in color printing, it is easy to cause problems such as image white gaps and ghosting due to color misregistration. Figure 2 As shown. In order to remove white gaps and / or ghosting in an image, in the prior art, a window of, for example, 3x3 or 5x5 is usually used to search for image pixels. However, window search requires 3 or 5 rows of data to be cached in advance, which results in a longer search time for image pixels and more consumption of hardware resources. In addition, in the process of using a sliding window to search for image pixels, each pixel may be searched more than once, and there will be a problem of repeated pixel search, that is, the data needs to be repeatedly calculated multiple times, which may result in low computational efficiency in some cases. In addition, the size of the window needs to be selected according to the characteristics of the specific task and input data. If it is not selected properly, it may result in information loss or excessive computation.
[0057] In response to the above problems, the embodiments of the present application provide a method for color preprocessing of an image, an image forming device, an electronic device and a storage medium. The embodiments of the present application perform color preprocessing on the image by performing image recognition processing on the image data obtained before printing the image to be processed. This can shorten the time for image color preprocessing, reduce program redundancy, and reduce the consumption of hardware resources, thereby helping to further optimize the execution process of color preprocessing.
[0058] A detailed description is given below with reference to the accompanying drawings.
[0059] See also Figure 3 , is a flow chart of a method for preprocessing color of an image provided in an embodiment of the present application. The method can be applied to Figure 1 In the application scenario shown, Figure 3 As shown, it mainly includes the following steps.
[0060] S201: Acquire image data of an image to be processed and a specified reference color.
[0061] In the embodiment of the present application, the image data of the image to be processed can be directly obtained by performing image recognition processing on the image to be processed before the image to be processed is printed, wherein the image to be processed before printing refers to the image to be processed before being transferred to the transfer belt. The image data of the image to be processed includes the position information of each pixel on the image to be processed and the information of at least one processable area.
[0062] In a specific implementation, the image data can be obtained through the following image processing and recognition methods.
[0063] In the scanning and copying mode, edge detection and line pair detection can be performed on the image to be processed based on the image and text segmentation algorithm to mark the position information of elements such as text, lines, blocks, background, etc. in the image to be processed, and the position information of each pixel point is obtained, as well as the corresponding relationship between the identification information of each pixel point and the position information of each pixel point.
[0064] By using the PCL language or PS language of the print driver, the components of the image to be processed, including text, lines, blocks, background and other elements, can be obtained based on the page description language, such as the print data formed by the PCL language, and the imaging mode of the PCL language will use the width and height of the entire image to be processed as the maximum X and Y coordinates, (0,0) as the minimum coordinate, and record the coordinates of the components of the image to be processed in the image to be processed. Based on these coordinates, the position information of the text, lines, blocks and / or background in the image to be processed is marked to obtain the position information of each pixel and the corresponding relationship between the identification information of each pixel and the position information of each pixel.
[0065] After obtaining the corresponding relationship between the identification information of each pixel and the position information of each pixel, the identification information of each pixel can be stored in sequence according to the position of each pixel on the image to be processed to obtain an image information table, and the information of at least one processable area can be obtained based on the image information table.
[0066] Specifically, since the image information table records the identification information of each pixel on the image to be processed, and the identification information of each pixel is stored in the image information table according to the position of each pixel on the image to be processed, that is, the identification information of each pixel in the image information table has a mapping relationship with each pixel on the image to be processed, by searching the image information table, the pixel whose identification information meets the requirements is obtained, and the information of at least one processable area on the image to be processed can be obtained according to the mapping relationship, and the information of the processable area includes the position information of each pixel in the processable area.
[0067] After obtaining the position information of each pixel in the image to be processed and the information of at least one processable area, image data including the position information of each pixel in the image to be processed and the information of at least one processable area is output.
[0068] The above-mentioned image data including the position information of each pixel point on the image to be processed and the information of at least one processable area is actually obtained when the image to be processed is subjected to image recognition processing (such as color correction, image modification or enhancement) before printing, that is, the image data can be used in other image processing processes. That is, the embodiment of the present application can directly use the image data obtained by performing image recognition processing before printing the image to be processed, without having to perform additional image recognition processing on the image to be processed to regenerate another copy of image data, which saves image processing time and helps reduce hardware resource consumption.
[0069] In a possible implementation, the image data may also include information of an unprocessable area, wherein the identification information of each pixel in the unprocessable area is different from the identification information of each pixel in the processable area. Based on this, the processable area may also be obtained in the following manner: traverse each pixel on the image to be processed in turn according to the image data, and obtain at least one processable area based on the identification information of each pixel in the unprocessable area and the identification information of each pixel in the processable area.
[0070] The above traversal means that in this embodiment, each time the image to be processed is read, each pixel on it is accessed once and only once. Specifically, when the image data includes an image information table, that is, when the image data includes information of an unprocessable area, each pixel on the image to be processed can be traversed in sequence according to the image information table, and the area composed of the pixels on the image to be processed whose identification information meets the requirements is taken as a processable area, and the area composed of the pixels on the image to be processed whose identification information does not meet the requirements is taken as an unprocessable area, thereby obtaining information of the processable area.
[0071] In a specific implementation, when traversing each pixel point on the image to be processed in sequence according to the image information table, it is generally necessary to traverse from the first row of pixels of the image to be processed to the last row of pixels of the image to be processed, and for each row of pixels, it is performed in order from left to right. While traversing each pixel point on the image to be processed, the identification information of the corresponding pixel point in the image information table is read, and the identification information is judged. If the identification information meets the requirements, it is determined that the current pixel point is a pixel point in the processable area. If the identification information does not meet the requirements, it is determined that the current pixel point is a pixel point in the non-processable area.
[0072] It can also be seen from this that in the embodiment of the present application, the image to be processed has its own storage address, and each data in the image information table also has its own storage address. The two storage addresses have a corresponding relationship. When traversing each pixel point in the image to be processed according to the storage address of the image to be processed, the set step size, such as the step size of 1, can be used. At the same time, the identification information of each pixel point in the image information table can be searched according to the storage address of the image information table, that is, when searching for a pixel point in the image to be processed, the corresponding identification information can be read in the image information table, thereby synchronously determining whether the pixel point is a pixel point in the processable area. Of course, in actual applications, the mapping search between the image to be processed and the image information table can also be realized by other methods, such as first searching for the identification information of each pixel point in the image information table according to the storage address of the image information table, and when a pixel point whose identification information meets the requirements is found, then according to the corresponding relationship of the storage address, the position information of the pixel point on the image to be processed is obtained, thereby obtaining the information of the processable area. The embodiment of the present application does not make specific requirements for this.
[0073] In an embodiment of the present application, each data on the image to be processed is traversed in sequence according to the image information table, which can prevent the problem of repeated search of pixel points, thereby avoiding repeated calculation of pixel points, improving the processing efficiency of the image to be processed, and enhancing the user experience.
[0074] In actual applications, the image forming device is provided with four printing colors, namely cyan (C), magenta (M), yellow (Y), and black (K), which are used to form toner images of four colors, namely cyan (C), magenta (M), yellow (Y), and black (K), respectively, and a color image is formed by superimposing toner images of different colors. Therefore, the color inaccuracy of the image forming device is mainly due to the problem of superimposing toner images of different colors, which leads to color inaccuracy problems such as white gaps and / or ghosting on the image output by the image forming device.
[0075] Based on this, the embodiment of the present application can use cyan (C), magenta (M), yellow (Y), and black (K) as the reference colors of the image forming device. When the image content formed by the reference colors in the image output by the image forming device produces a color misregistration problem, the user can use the reference color of the image content that produces the problem as a designated reference color. For example, if the color of the image content that produces the problem is cyan (C), cyan (C) is used as a designated reference color. Because in the color printing process, even if an image of cyan (C) is formed, it will be formed by the superposition of toner images of four reference colors. In actual applications, according to the different colors of the image content that produces the color misregistration, the designated color can be any one of C, M, Y, and K. Specifically, the embodiment of the present application can add a reference color selection option on the setting page of the image forming device or the control device. The user can select the reference color through the panel of the image forming device or through the control device, and the selected reference color is the designated reference color. After the user has selected the reference color, the image forming device or control device will generate a color preprocessing instruction based on a specified reference color, so that after the image forming device obtains the color preprocessing instruction, it performs color preprocessing on the image to be processed according to the color preprocessing instruction. Color preprocessing refers to the preprocessing of the image before it is transferred to the transfer belt during the printing process, such as white gap removal, halo removal, ghosting removal, etc., so as to prevent the problem of color inaccuracy after the image is transferred to the transfer belt.
[0076] In a possible implementation, the processable area is an image composed of pixels whose colors are consistent with at least one reference color, so the processable area can be determined based on the reference color. Specifically, when performing image recognition processing on the image to be processed, the identification information of the pixels whose colors are consistent with the reference color in the image to be processed can be set as preset identification information, and the identification information of the pixels whose colors are inconsistent with the reference color in the image to be processed can be set as other identification information, thereby obtaining an image information table, and determining the processable area based on whether the identification information of the pixels in the image information table is the preset identification information.
[0077] In a specific implementation, the information of each pixel point may include an 8-bit data, wherein the eighth bit of data is the identification information of the pixel point, and if the bit is 1, it indicates that the pixel point has the preset identification information, and if the bit is 0, it indicates that the pixel point does not have the preset identification information, and the other bits do not need to be considered in the embodiment of the present application. Of course, in a specific operation, it is also possible that when the bit is 0, it indicates that the pixel point has the preset identification information, and when the bit is 1, it indicates that the pixel point does not have the preset identification information, and the embodiment of the present application does not make specific requirements for this, such as Figure 4 As shown, Figure 4 The BOP bit in is the eighth bit. Therefore, the obtained image information table is an image information table storing information with values of 0 and 1. When confirming whether the pixel of the image to be processed is a pixel of the processable area according to the image information table, it can be judged based on the values of 0 and 1. When the corresponding identification information of the pixel of the image to be processed in the image information table is 1, it is confirmed that the pixel is a pixel of the processable area. When the corresponding identification information of the pixel of the image to be processed in the image information table is 0, it is confirmed that the pixel is a pixel of the non-processable area.
[0078] For example, taking the text in the image to be processed as an example, if the text color is consistent with the reference color, the mark information of the corresponding value in the image information table is 1, otherwise it is marked as 0, such as Figure 5 As shown in FIG. 1 , (a) is the image to be processed, and the image information table at the black box in FIG. (a), that is, the BOP Bit is shown in FIG. (b). The processable area can be obtained through FIG. (b).
[0079] The image information table in the embodiment of the present application records the identification information of each pixel on the image to be processed through the values 0 and 1. The recording method is simple and is conducive to the judgment and acquisition of the area to be processed.
[0080] S202: Determine, from at least one processable area, a region to be processed and a position of each pixel point in the region to be processed on the image to be processed according to the image data and a specified reference color.
[0081] In the embodiment of the present application, since the processable area in the obtained image data may include multiple reference colors, and the embodiment of the present application only performs color preprocessing on an image of one reference color in one color preprocessing, it is necessary to determine the area to be processed from the processable area based on a specified reference color. Specifically, according to the specified reference color, a corresponding first preset color threshold is obtained, the color threshold of each pixel in the processable area is compared with the first preset color threshold, and the area to be processed is determined according to the comparison result.
[0082] In a specific implementation, the area to be processed is determined based on the comparison results, specifically including: obtaining pixel points in the processable area whose color threshold is consistent with the first preset color threshold based on the comparison results, determining the area composed of these pixel points as the area to be processed, and obtaining the position of each pixel point in the area to be processed on the image to be processed based on the positions of these pixel points in the image data in the image to be processed.
[0083] In a possible implementation, in order to facilitate the subsequent color preprocessing of the image to be processed, the identification information of the pixel points of the non-to-be-processed image in the image information table can be updated. Specifically, after the area to be processed is determined, the identification information of each pixel point of other non-to-be-processed areas in the processable area is updated, such as changing the identification information from 1 to 0, thereby changing other non-to-be-processed areas from processable areas to non-processable areas.
[0084] The identification information of each pixel point in other non-processed areas of the processable area is updated, so that in subsequent color preprocessing, the pixel points with identification information of 1 can be directly calculated and processed, and other pixel points with identification information of 0 can be ignored, thereby helping to save processing time.
[0085] Of course, in practical applications, only the identification information of the pixel points in the area to be processed may be retained in the image information table, while the identification information of the pixel points in other areas not to be processed may not be retained in the image information table.
[0086] S203: performing color preprocessing on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed.
[0087] In an embodiment of the present application, after determining the area to be processed and the position of each pixel in the area to be processed on the image to be processed, color preprocessing can be performed on the area to be processed according to the position of each pixel in the area to be processed on the image to be processed.
[0088] Specifically, the color of each pixel in the area to be processed in the RGB channel is obtained, the color of each pixel in the area to be processed in the RGB channel is replaced with the background color of the RGB channel, the color channel conversion is performed on each pixel in the area to be processed to obtain the color of each pixel in the area to be processed in the four CMYK channels, the color values of the other three channels except the channel where a specified reference color is located are reassigned to each pixel in the area to be processed according to the first color setting value, and the color value of the channel where a specified reference color is located is reassigned to each pixel in the area to be processed according to the second color setting value. The first color setting value is 0.
[0089] In a possible implementation, after replacing the color of each pixel in the RGB channel in the area to be processed with the background color of the RGB channel, the color of each pixel in the area to be processed can be converted from the RGB channel to the CMYK channel according to the image information table, and then the color of the channel where a specified reference color is located is reassigned to 255, and the colors of the channels where other reference colors are located are reassigned to 0, so as to avoid visual defects caused by color inaccuracy such as white gaps and ghosting near the image of the area to be processed.
[0090] Exemplarily, a designated reference color is C. After the color of each pixel in the area to be processed is converted from RGB channels to CMYK channels, the color value of the C channel can be assigned to 255, and the color values of the M, Y, and K channels can be assigned to 0, so that the image formed by the C reference color will not produce white gaps or ghosting.
[0091] It should be noted that the conversion of the color of each pixel in the area to be processed from the RGB channel to the CMYK channel can refer to the relevant technology. For the sake of brevity, the embodiments of the present application will not be described in detail here.
[0092] It should be noted that the embodiment of the present application is suitable for processing image formation data of CMYK 8-bit data.
[0093] The embodiment of the present application utilizes an image information table to sequentially traverse each pixel point in the image to be processed, so that the embodiment of the present application does not need to perform additional data caching, thereby reducing hardware resource consumption. At the same time, the embodiment of the present application also performs color preprocessing on each pixel point in the area to be processed through the image information table, so that the positioning time of each pixel point in the area to be processed is short, thereby improving the efficiency of image color preprocessing.
[0094] See also Figure 6 , is a flow chart of another method for color preprocessing of an image provided by an embodiment of the present application. The method can be applied to Figure 1 In the application scenario shown, Figure 6 As shown, it mainly includes the following steps.
[0095] S601: Select a designated reference color.
[0096] S602: Input the image to be processed.
[0097] S603: Acquire image data of the image to be processed by PS / PCL language, or, S604: Acquire image data of the image to be processed by image-text segmentation.
[0098] The image data includes the position of each pixel on the image to be processed and an image information table.
[0099] S605: Acquire the positions of the pixels in the area to be processed according to the image data of the image to be processed;
[0100] S606: Update the image information table to obtain the image information table of the area to be processed, where only the information of the pixels of the area to be processed is retained in the image information table;
[0101] S607: Replace the color of each pixel in the area to be processed in the RGB channel with the background color of the RGB channel.
[0102] S608: Perform color channel conversion on each pixel in the area to be processed to obtain the color of each pixel in the area to be processed in the four CMYK channels.
[0103] S609: Determine whether the identification information of the pixel in the image information is 1.
[0104] If it is equal to 1, it means that the position of the pixel point is the position of the image of the area to be processed; if it is not equal to 1, enter S613.
[0105] S610: assigning a color value of 255 to each pixel in the area to be processed in a channel corresponding to a specified reference color, and assigning color values of the other three channels to 0;
[0106] The specific content of S601-S610 can refer to the content description of S301-S303. For the sake of brevity, this application will not go into details here.
[0107] S611: Determine whether the surrounding pixels of each pixel in the area to be processed are all pixels in the area to be processed, that is, whether the BOP bits are all equal to 1. If so, proceed to S612, otherwise proceed to S613.
[0108] S612: The color value of the channel corresponding to a specified reference color is 0, and the BOP bit is assigned a value of 0.
[0109] In a possible implementation, any pixel in the area to be processed can be taken as the center point to determine whether the surrounding pixels of the center point are all pixels in the area to be processed. When the surrounding pixels of the center pixel are all pixels in the area to be processed, the channel where a reference color specified by the center point in the four CMYK channels is located is determined, and the color value of the channel where the specified reference color is located is assigned to 0. Specifically, when the BOP bit in the image information table is displayed as 1, the corresponding pixel is regarded as the center pixel, and the BOP bit of the 8 pixels around the center pixel is determined again by the BOP bit in the image information table. Whether it is 1, if all are equal to 1, the channel where a reference color specified by the center pixel in the four CMYK channels is located is determined, and the color value of the channel where the specified reference color is located is assigned to 0, thereby achieving the punching processing of the center pixel, and then achieving the effect of saving ink. At the same time, when the image color of the channel where a reference color specified by the center pixel in the four CMYK channels is assigned to 0, the BOP bit of the center pixel in the image information table is also assigned to 0 to prevent further judgment.
[0110] In a specific implementation, if the BOP bits of the eight pixels around the central pixel are not all 1, ink saving processing is not performed.
[0111] S613: Output image.
[0112] See also Figure 7 , is a schematic diagram of a color preprocessing of an image provided in an embodiment of the present application. Figure 7 As shown, for the non-background image in Figure (a), i.e., the area to be processed, the image information table (OTmap) can be obtained through the PS / PCL printer language. The OT map includes the BOP position of each pixel point, and then the color of each pixel point in the area to be processed in the RGB channel is replaced with the background color of the RGB channel based on the OT map. The processing result is shown in Figure (b). The color value of each pixel point in the area to be processed in the RGB channel is converted to the color value of the CMYK channel. The converted result is shown in Figure (c). Then, the color preprocessing of color value assignment as described in S609-S612 is performed on the image to be processed. The processing result is shown in Figure (d). Finally, an image (e) consistent with the image to be processed is output.
[0113] The embodiment of the present application not only does not need to repeatedly search for pixel points and consumes less hardware resources, but also can achieve intelligent ink saving during the image formation process.
[0114] Corresponding to the above-mentioned embodiment, the embodiment of the present application further provides a structural schematic diagram of an image forming device.
[0115] See also Figure 8, is a schematic diagram of the structure of an image forming device provided in an embodiment of the present application. Figure 8 As shown, the image forming device 800 includes:
[0116] The acquisition unit 801 is used to acquire image data of the image to be processed and a specified reference color, wherein the image data includes position information of each pixel on the image to be processed and information of at least one processable area; the processable area is an image composed of pixels whose colors are consistent with at least one reference color; the image data is data obtained when image recognition processing is performed on the image to be processed before printing.
[0117] The determination unit 802 is used to determine a to-be-processed area and a position of each pixel point in the to-be-processed area on the to-be-processed image from at least one processable area according to the image data and a specified reference color.
[0118] The color preprocessing unit 803 is used to perform color preprocessing on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed.
[0119] The specific contents of the embodiments of the present application can be found in the description of the above method embodiments, which will not be repeated here for the sake of brevity.
[0120] Corresponding to the above embodiments, the present application also provides an electronic device.
[0121] See also Fig. 9 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, and the electronic device 900 may include: a processor 910, a memory 920, and a communication unit 930. These components communicate through one or more buses. Those skilled in the art can understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of the present invention. It can be a bus structure or a star structure, and can also include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0122] The communication unit 930 is used to establish a communication channel so that the electronic device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0123] The processor 910 is the control center of the electronic device. It uses various interfaces and lines to connect various parts of the entire electronic device. It runs or executes software programs, instructions, and / or modules stored in the memory 920, and calls data stored in the memory to perform various functions of the electronic device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of a plurality of packaged ICs with the same or different functions. For example, the processor 910 can include only a central processing unit (CPU). In the embodiment of the present application, the CPU can be a single computing core or multiple computing cores.
[0124] The memory 920 is used to store the execution instructions of the processor 910. The memory 920 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0125] When the execution instructions in the memory 720 are executed by the processor 910, the electronic device 900 can execute Figure 2 Some or all of the steps in the illustrated embodiments.
[0126] It should be noted that the electronic device 900 may also be an image forming device.
[0127] In a specific implementation, the present application further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the image processing method provided by the present invention. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0128] In a specific implementation, the present application also provides a computer program product, wherein the computer program product includes executable instructions, and when the executable instructions are executed on a computer, the computer executes part or all of the steps in each embodiment of the image processing method provided in the present application.
[0129] Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the technical solutions in the embodiments of the present application are essentially or the part that contributes to the prior art can be embodied in the form of a software product, which can be stored in a storage medium such as ROM / RAM, a disk, an optical disk, etc., including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application or some parts of the embodiments.
[0130] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A color preprocessing method for an image, It is characterized in that Applicable to image forming equipment, including: Acquire image data of an image to be processed and a specified reference color, wherein the image data includes position information of each pixel on the image to be processed and information of at least one processable area; the processable area is an image composed of pixels whose colors are consistent with at least one of the reference colors; the image data is data obtained when image recognition processing is performed on the image to be processed before printing; Determine, according to the image data and the specified reference color, a region to be processed from at least one processable region, and a position of each pixel point in the region to be processed on the image to be processed; According to the position of each pixel point in the area to be processed on the image to be processed, color preprocessing is performed on the area to be processed.
2. The method according to claim 1, It is characterized in that The image data also includes information of an unprocessable area; identification information of each pixel in the unprocessable area is different from identification information of each pixel in the processable area; The processable area can be obtained as follows: Each pixel on the image to be processed is traversed in sequence according to the image data, and at least one processable area is obtained based on the identification information of each pixel in the unprocessable area and the identification information of each pixel in the processable area.
3. The method according to claim 2, It is characterized in that According to the position of each pixel point in the to-be-processed area on the to-be-processed image, the to-be-processed area is subjected to color preprocessing, which also includes: After the to-be-processed area is determined, the identification information of each pixel in the other processable areas is updated to change the processable areas to the unprocessable areas.
4. The method according to claim 1, It is characterized in that Determining a to-be-processed area from at least one of the processable areas according to the image data and a specified reference color, comprising: According to a specified reference color, a corresponding first preset color threshold is obtained; Comparing the color threshold of each pixel in the processable area with the first preset color threshold; The area to be processed is determined according to the comparison result.
5. The method according to claim 1, It is characterized in that Get a specified base color, including: A color preprocessing instruction is obtained, wherein the color preprocessing instruction includes a specified reference color, wherein the specified reference color is any one of cyan, magenta, yellow and black.
6. The method according to claim 1, It is characterized in that According to the position of each pixel point in the area to be processed on the image to be processed, the area to be processed is subjected to color preprocessing, including: Obtain the color of each pixel in the area to be processed in the RGB channel; Replace the color of each pixel in the RGB channel of the to-be-processed area with the background color of the RGB channel; Performing color channel conversion on each pixel in the to-be-processed area to obtain the color of each pixel in the to-be-processed area in the CMYK four-channel; According to the first color setting value, the color values of the other three channels except the channel where the specified reference color is located for each pixel point in the area to be processed are reassigned, and according to the second color setting value, the color value of the channel where the specified reference color is located for each pixel point in the area to be processed is reassigned.
7. The method according to claim 6, It is characterized in that The reassignment then includes: Taking any pixel point in the area to be processed as the center point; Determine whether a preset number of pixel points around the center point are all pixel points in the area to be processed; If yes, the color value of the channel where the center point is located in the specified reference color is assigned to 0.
8. An image forming device, It is characterized in that include: An acquisition unit is used to acquire image data of an image to be processed and a specified reference color, wherein the image data includes position information of each pixel on the image to be processed and information of at least one processable area; the processable area is an image composed of pixels whose colors are consistent with at least one of the reference colors; the image data is data obtained when image recognition processing is performed on the image to be processed before printing; a determination unit, configured to determine, from at least one of the processable regions, a region to be processed and a position of each pixel point in the region to be processed on the image to be processed according to the image data and a specified reference color; The color preprocessing unit is used to perform color preprocessing on the area to be processed according to the position of each pixel point in the area to be processed on the image to be processed.
9. An electronic device, It is characterized in that include: processor; Memory; A computer program is stored in the memory, and when the computer program is executed, the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and apparatus, and storage medium
CN108550101A
Image processing method and device, electronic device and computer readable storage medium
CN109636753A
Image segmentation method and device, electronic equipment and storage medium
CN111784703A
Image processing method and device, computer device and storage medium
CN113436284A
Image watermark adding method and device and electronic equipment
CN113947514A
