Disclosure of Invention
In view of this, the present application provides a color modifying method, an image forming apparatus, an electronic device, and a storage medium, so as to solve the problems that in the prior art, the number of colors preset by manufacturers is limited, and the erasing requirements of users on all colors in various scenes are not satisfied, so that the users may not erase the colors that the users want to erase, and thus the copied images cannot satisfy the requirements of the users, which affects the user experience and wastes paper.
In a first aspect, an embodiment of the present application provides an image processing method, including:
converting the color of the scanned image into an HSV color space, and acquiring the scanned image converted into the HSV color space;
acquiring HSV data corresponding to a color to be erased, wherein the color to be erased is a color expected to be erased by a user;
Comparing the HSV data corresponding to the scanned image converted to the HSV color space with the HSV data corresponding to the color to be erased;
and replacing the color of the mask area with a preset color to obtain a processed image, wherein HSV data corresponding to the color of the pixel points in the mask area is HSV data corresponding to the color to be erased.
In the embodiment of the application, the colors of the scanned image are converted into the HSV color space, and because the color distribution of the HSV color space has intuitiveness, a user can almost select any color as a color erasing object, so that the method provided by the embodiment of the application can be suitable for color erasing requirements in various scenes, and the practicability of the product and the experience of the user are improved. In addition, the colors of the mask area are replaced by the preset colors, so that the colors of the mask area and the surrounding colors can be fused naturally as much as possible, abrupt sense of the boundary of the mask area is avoided, and the sense of the user is ensured.
In one possible implementation manner, the HSV data corresponding to the color to be erased includes:
HSV data corresponding to the color to be erased in a preset error range.
In the embodiment of the application, the HSV data corresponding to the color to be erased can be the HSV data corresponding to the color to be erased in the preset error range, the HSV data corresponding to the color to be erased in the preset error range is set as the mask area, the HSV data in one threshold is selected as the mask instead of setting the accurate HSV data as the mask area, the mask area is in a reasonable range in practice, the subsequent erasing work is facilitated, the color which is expected to be erased by the user can be more cleanly and thoroughly, and the user expectation is met.
In one possible implementation, before the comparing the HSV data corresponding to the scanned image converted to the HSV color space with the HSV data corresponding to the color to be erased, the method further includes:
calculating hue and saturation gradients in the HSV color space;
using a first processing algorithm for regions of the hue and saturation gradient below a first gradient threshold, the first processing algorithm for enhancing edges;
Using a second processing algorithm for the region with the hue and saturation gradient higher than a second gradient threshold, wherein the second processing algorithm is used for reducing sharpening strength;
Wherein the first gradient threshold is less than the second gradient threshold.
In the embodiment of the application, the edge is enhanced by using a first processing algorithm for the region (fuzzy region) with lower hue and saturation gradient, and the sharpening strength is reduced by using a second processing algorithm for the region (clear region) with higher hue and saturation gradient, so that the condition that the fuzzy region and the clear region are excessively compared to cause visual abrupt is avoided, and the appearance of a user is ensured. And the blurring process is carried out on the clear area in advance, so that the step of reserving the miscellaneous points of the clear area to HSV data corresponding to the contrast scanning image and HSV data corresponding to the color to be erased is avoided, the influence of the miscellaneous points on the performance of the color to be erased is avoided, and the processing performance of the color to be erased is improved.
In one possible implementation, before the replacing the color of the mask area with the preset color, obtaining the processed image, the method further includes:
And calculating a color histogram in a preset range around the mask area, and setting the color with the highest occurrence frequency in the color histogram as a preset color.
In the embodiment of the application, the preset colors required to be filled in the mask area are accurately calculated through the color histogram around the mask area, so that the color filling is natural, and the visual abrupt caused by the color filling is greatly reduced.
In one possible implementation manner, the replacing the color of the mask area with the preset color to obtain the processed image includes:
And carrying out a third processing algorithm on the mask region, wherein the third processing algorithm is used for repairing the edge of the mask region, and carrying out color filling on the mask region by using a preset color to obtain a processed image.
In the embodiment of the application, the edges of the filled region are repaired by processing the mask region by using a third processing algorithm, so that the edges of the filled region and the original image region are prevented from being broken, and the look and feel of a user is ensured.
In one possible implementation manner, the acquiring HSV data corresponding to the color to be erased includes:
acquiring a main color selected by a user on a hue;
And obtaining k adjacent colors corresponding to the main color through a fourth processing algorithm, wherein the main color and the k adjacent colors are used as colors to be erased, and the fourth processing algorithm is used for automatically dividing data into a plurality of groups.
In the embodiment of the application, various similar colors can be erased at one time, and various colors in the image are clustered accurately through the fourth processing algorithm, so that accurate erasure of adjacent colors is realized, the user is not required to erase the colors for many times, the operation of the user is simplified, and the user experience is improved.
In one possible implementation manner, before the obtaining, by the fourth processing algorithm, k adjacent colors corresponding to the main color, and taking the main color and the k adjacent colors as the colors to be erased, the method further includes:
Judging whether a one-key erasing adjacent color function is selected;
If the color is selected, executing the step of obtaining k adjacent colors corresponding to the main color through a fourth processing algorithm, and taking the main color and the k adjacent colors as colors to be erased;
and if not, taking the main color as the color to be erased, neglecting the step of obtaining k adjacent colors corresponding to the main color through a fourth processing algorithm, and taking the main color and the k adjacent colors as the step of executing the color to be erased.
In the embodiment of the application, the user can select whether to start the function of 'one-key erasing adjacent color' while selecting the main color, if the user selects to start, the main color and the adjacent color are erased, and if the user selects not to start, only the main color selected by the user is erased. It can be understood that by setting an option, a user can select whether the function is started according to own requirements, so that an image processing result meets the user expectations, and the user experience is improved.
In one possible implementation, before the converting the color of the scanned image to the HSV color space, the method further includes:
The scanned image is preprocessed, and the preprocessing is used for suppressing high-frequency noise of the scanned image.
In the embodiment of the application, the scanned image is preprocessed before being processed, namely the scanned image is preprocessed, so that the edge of the scanned image is reserved, high-frequency noise is restrained, and the accuracy of subsequent color recognition is improved.
In a second aspect, an embodiment of the present application provides an image forming apparatus including:
The color conversion module is used for converting the color of the scanned image into an HSV color space and acquiring the scanned image converted into the HSV color space;
The color to be erased obtaining module is used for obtaining HSV data corresponding to the color to be erased, wherein the color to be erased is the color expected to be erased by a user;
The comparison module is used for comparing the HSV data corresponding to the scanning image converted to the HSV color space with the HSV data corresponding to the color to be erased;
the color processing module is used for replacing the color of the mask area with a preset color to obtain a processed image, and the HSV data corresponding to the color of the pixel point in the mask area is the HSV data corresponding to the color to be erased.
In a third aspect, an embodiment of the present application provides an electronic device, including:
A processor;
a memory;
And a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions that, when executed by the processor, cause the electronic device to perform the method of any of the first aspects.
In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, where the computer readable storage medium includes a stored program, where the program when executed controls a device in which the computer readable storage medium is located to perform the method of any one of the first aspects.
It is to be understood that an image forming apparatus provided in the second aspect, an electronic device provided in the third aspect, and a computer-readable storage medium provided in the fourth aspect described above are used to execute the method provided in the present application. Therefore, the advantages achieved by the method can be referred to as the advantages of the corresponding method, and will not be described herein.
Detailed Description
For a better understanding of the technical solution of the present application, the following detailed description of the embodiments of the present application refers to the accompanying drawings.
It should be understood that the described embodiments are merely some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or b, and may mean that a single first exists while a single first and a single second exist. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
For ease of understanding, a specific application scenario will be first described by way of example.
Referring to fig. 1, a schematic view of an application scenario is provided in an embodiment of the present application. As shown in fig. 1, a part of the structure of the image forming apparatus is shown in this application scene, and specifically includes a scan area 101, a display area 102, and a control panel 103. When a user needs to copy a document, the document to be copied may be placed on the scan area 101, and some copy parameters may be set through the display area 102, and the copy job may be controlled to be started in the control panel 103, so that the content of the document to be copied may be presented on the recording medium.
It should be noted that the image forming apparatus shown in fig. 1 is only an exemplary description and should not be taken as a limitation of the scope of the present application, and the image forming apparatus may be any apparatus having a copy function. And the layout of the respective areas of the image forming apparatus (i.e., the scan area 101, the display area 102, and the control panel 103 shown in fig. 1) is merely an exemplary illustration, and should not be taken as a limitation on the scope of the present application.
The image forming apparatus partially having the copy function has a function of modifying colors. In the related art, the image forming apparatus may perform color erasing on several colors preset by a manufacturer, and when a user needs to erase a certain color in a copy document, it needs to search whether a color desired to be erased exists in a preset color category, if so, it directly selects, and if not, it cannot be erased.
It can be understood that the number of colors preset by manufacturers is limited, and the erasing requirements of users on all colors in various scenes are not met, so that the users can not erase the colors which the users want to erase, and further the copied portrait can not meet the requirements of the users, and the experience of the users is influenced and paper is wasted.
Aiming at the problems, the embodiment of the application provides a color modification method for converting the colors of a scanned image into an HSV color space, and because the color distribution of the HSV color space is intuitive, a user can almost select any color as an object for color erasing, so that the method provided by the embodiment of the application can be suitable for color erasing requirements in various scenes, and the practicability of products and the experience of the user are improved. In addition, the colors of the mask area are replaced by the preset colors, so that the colors of the mask area and the surrounding colors can be fused naturally as much as possible, abrupt sense of the boundary of the mask area is avoided, and the sense of the user is ensured. The details are set forth in the accompanying drawings and the description below.
Referring to fig. 2, a flow chart of a color modification method according to an embodiment of the present application is shown. As shown in fig. 2, it mainly includes the following steps.
Step S201, converting the color of the scanned image into an HSV color space, and acquiring the scanned image converted into the HSV color space.
Specifically, when the user turns on the copy function, the image forming apparatus scans the document to be copied to obtain a scanned image, but the scanned image is an RGB color space, and the RGB color space is based on three basic colors of Red (Red, R), green (Green, G), and Blue (Blue, B), and performs superposition to different degrees to generate other colors. It can be appreciated that the RGB color space is a characteristic that represents colors using a combination of linear components of three colors, so that the RGB color space is not intuitive in an application scene in which colors are continuously transformed. Therefore, in order to more accurately recognize colors and adjust the colors, the image forming apparatus in the embodiment of the present application converts the colors of the scanned image into the HSV color space, and acquires the scanned image converted into the HSV color space. The HSV color space refers to a visible light subset in a three-dimensional color space of Hue (Hue, H), saturation (S), and brightness (Value, V), and includes all colors of a certain color gamut.
For ease of understanding, embodiments of the present application provide a parametric schematic diagram of an HSV color space.
Referring to fig. 3, a schematic diagram of parameters of an HSV color space according to an embodiment of the present application is provided. As shown in FIG. 3, hue is colors at different positions on a cylindrical top view in the drawing, different color basic tones are arranged at different positions, saturation is represented by color purity, the same radius corresponds to the same color basic tone when the cylindrical top view is observed, the transition from pure white to pure color is from inside to outside along the radial direction, the Saturation corresponding to the circle center is 0, the Saturation corresponding to the circular arc is 100, brightness Value is also called brightness, the same high line corresponds to the same color basic tone when the cylindrical side view is observed, and brightness is higher and higher from bottom to top along the high line direction.
For ease of understanding, embodiments of the present application provide a schematic view of cross-section data of an HSV color space.
Referring to fig. 4, a schematic diagram of cross-section data of an HSV color space according to an embodiment of the present application is provided. As shown in fig. 4, the hue adjustment region 401 includes hues corresponding to different colors, and the saturation and brightness adjustment region 402 includes saturation and brightness corresponding to different colors. The left side in fig. 4 is a preview interface of hue, saturation and brightness of different colors, and the right side is RGB numerical data and HSV numerical data corresponding to different colors. The image forming apparatus may convert RGB data corresponding to each color into corresponding HSV data to facilitate subsequent erasure of the color.
In addition, in one possible implementation, the scanned image is preprocessed prior to converting the colors of the scanned image to HSV color space, wherein the preprocessing is used to suppress high frequency noise of the scanned image. It can be understood that the scanned image is preprocessed before the scanned image is processed, so that high-frequency noise can be restrained while the edge of the scanned image is maintained, and the accuracy of subsequent color recognition is improved.
In one possible implementation, the preprocessing includes gaussian filtering, and those skilled in the art will understand that, before processing the scanned image, the scanned image is subjected to gaussian filtering, so that high-frequency noise can be suppressed while the edges of the scanned image are maintained, and the accuracy of subsequent color recognition is improved.
In practical application, the hue and saturation of different areas of the same scanned image may be different, and part of the areas are clearer and part of the areas are more fuzzy. In order to solve the problem, after the color of a scanned image is converted into an HSV color space, hue and saturation gradients are calculated in the HSV color space before HSV data corresponding to the scanned image converted into the HSV color space is compared with HSV data corresponding to a color to be erased, a first processing algorithm is used for areas with hue and saturation gradients lower than a first gradient threshold value, a second processing algorithm is used for areas with hue and saturation gradients higher than a second gradient threshold value, and the first gradient threshold value is smaller than the second gradient threshold value.
In one possible implementation, the first processing algorithm is the Laplace Operator, which is an important tool in image processing for detecting second-order changes in regions, especially for detecting regional features such as edges, blobs, etc. in images, which is the acceleration describing the pixel intensity change in the spatial domain based on the second derivative of the image. It should be noted that the first processing algorithm may be other algorithms for enhancing edges, which is not particularly limited in the present application.
In one possible implementation, the second processing algorithm is blur filtering, and the core idea of the blur filtering is local pixel averaging or weighted averaging, and it should be noted that the second processing algorithm may also be other algorithms for reducing sharpening strength, which is not particularly limited in the present application.
In one possible implementation, the blur filtering includes gaussian blur, median blur and bilateral filter, and it should be noted that the blur filtering may be other algorithms for reducing the sharpening strength, which is not particularly limited by the present application.
It can be understood that the first processing algorithm is used for enhancing the edge of the region with lower hue and saturation gradient (blurred region), the blurring filtering is used for reducing the sharpening strength of the region with higher hue and saturation gradient (clear region), so that after the color to be erased is erased later, the transition region can be prevented from being abrupt, thereby the transition part of the region with erased color and the region without erased color is more natural, the quality of the image after the color to be erased is improved, the look and feel of the user is ensured, in addition, if the blurring filtering is not used for reducing the sharpening strength of the region with higher hue and saturation gradient (clear region) before the HSV data corresponding to the scanned image converted into HSV color space and the HSV data corresponding to the color to be erased are compared, the clutter in the scanned image can be counted into the mask region, that is, when the color is erased later, the impurity points need to be considered, but the more the counted areas are, the more the pixels to be processed are, the longer the algorithm time is, and the performance is reduced, so that the embodiment of the application uses the first processing algorithm to enhance the edge of the area (the fuzzy area) with lower hue and saturation gradient before comparing the HSV data corresponding to the scanning image converted into the HSV color space with the HSV data corresponding to the color to be erased, uses the fuzzy filtering to reduce the sharpening strength of the area (the clear area) with higher hue and saturation gradient, carries out the fuzzy processing on the clear area in advance, avoids the step of reserving the impurity points of the clear area to the HSV data corresponding to the scanning image and the HSV data corresponding to the color to be erased, avoids the impurity points from influencing the performance of the color to be erased, thereby improving the processing performance of the color to be erased, it should be noted that, in the embodiment of the present application, the enhancement of the edge using the first processing algorithm for the region (blurred region) with low hue and saturation gradient generally does not increase the clutter, so that the enhancement of the edge using the first processing algorithm for the blurred region does not affect the performance of the subsequent processing.
Step S202, acquiring HSV data corresponding to the color to be erased.
Specifically, the image forming device outputs the interactive interface through the display area, and the user can select the color which the user desires to erase on the interactive interface, so that the image forming device can obtain HSV data corresponding to the color to be erased.
For easy understanding, the embodiment of the application provides an interactive interface schematic diagram.
Referring to fig. 5, a schematic diagram of an interactive interface is provided in an embodiment of the present application. As shown in fig. 5, the user can select the hue of the main color on the hue circle 501, and select the saturation and the brightness of the main color in the saturation and brightness selection area 502 corresponding to the hue. Also included in the interactive interface is a data adjustment area 503, where the user may also select corresponding hue, saturation, and brightness values in the data adjustment area 503.
In practical application, the main color described in fig. 5 is the color to be erased, so that a user can only erase one color at a time, and when the user wants to erase multiple similar colors, the user needs to erase multiple times, which is cumbersome to operate and cannot meet the requirements of the user, resulting in poor user experience. In view of this problem, in the embodiment of the present application, the main color selected by the user on the hue circle and k adjacent colors corresponding to the color may be directly erased.
Specifically, the image forming apparatus acquires a main color selected by a user on a hue circle, obtains k adjacent colors corresponding to the main color by a fourth processing algorithm, and uses the main color and the k adjacent colors as colors to be erased, wherein the fourth processing algorithm is used for automatically dividing data into a plurality of groups.
In one possible implementation, the fourth processing algorithm is a clustering algorithm, which broadly refers to all unsupervised grouping methods, with the goal of partitioning natural clusters by data similarity.
In one possible implementation, the clustering algorithm is a K-means clustering algorithm (K-means clustering algorithm, KMA), which is an iteratively solved clustering analysis algorithm that includes the steps of dividing data into K groups, randomly selecting K objects as initial cluster centers, then calculating the distance between each object and each cluster center, and assigning each object to its nearest cluster center. The cluster centers and the objects assigned to them represent a cluster. For each sample assigned, the cluster center of the cluster is recalculated based on the existing objects in the cluster. This process will repeat until a certain termination condition is met. The termination condition may be that no (or a minimum number of) objects are reassigned to different clusters, no (or a minimum number of) cluster centers are changed again, and the sum of squares of errors is locally minimum. The type k of the adjacent colors can be preset by a developer, and the number of the adjacent colors can be changed according to the needs, so that the number of the adjacent colors meets the needs of users.
For example, if the main color selected by the user is red and 2 adjacent colors, the image forming apparatus may extract hue, saturation, and brightness values of three colors of red, dark red, and bright red as hue, saturation, and brightness values of the color to be erased, and use the hue, saturation, and brightness values of the color to be erased as a threshold value for the next image segmentation.
To confirm whether the adjacent color is erased, after the image forming apparatus erases the main color and the adjacent color, a user or developer may analyze the color histogram of the erased area using a professional image processing tool (e.g., photoshop), and if the peak values of the main color and the adjacent color are significantly reduced, it is indicated that the main color and the adjacent color are successfully erased. It is noted that in the color histogram, the more a certain color, the higher the histogram corresponding to that color, the more a histogram area that visually looks like a mountain that is convex is called a peak. Before erasing a color, the main color of the erasing area is the main color and the adjacent color, so in the color histogram corresponding to the erasing area, the histogram corresponding to the main color and the adjacent color is the peak value, and if erasing is successful, the main color and the adjacent color should be greatly reduced in the erasing area, so the histogram corresponding to the main color and the adjacent color in the color histogram (peak value) should also be significantly reduced.
Of course, to ensure the user's use experience, the user may choose whether to turn on the one-touch erase neighbor function. The image forming device judges whether a one-key erasing adjacent color function is selected or not, executes a step of obtaining k adjacent colors corresponding to a main color through a fourth processing algorithm if the one-key erasing adjacent color function is selected, takes the main color and the k adjacent colors as colors to be erased, and executes a step of taking the main color as the colors to be erased and omitting the k adjacent colors corresponding to the main color through the fourth processing algorithm if the one-key erasing adjacent color function is not selected.
It can be understood that by setting an option, a user can select whether the function is started according to own requirements, so that an image processing result meets the user expectations, and the user experience is improved.
Step S203, comparing the HSV data corresponding to the scanned image converted to the HSV color space with the HSV data corresponding to the color to be erased.
Specifically, the HSV data corresponding to the scanned image converted to the HSV color space is compared with the HSV data corresponding to the color to be erased by an image forming device or other terminal equipment, so that a mask area is conveniently obtained, and further subsequent steps are conveniently executed.
Step S204, replacing the color of the mask area with the preset color to obtain a processed image.
Specifically, the color of the mask area is replaced by a preset color, and a processed image is obtained, wherein HSV data corresponding to the color of the pixel point in the mask area is HSV data corresponding to the color to be erased. Because the image forming device obtains the color to be erased, the HSV data corresponding to the color of each pixel point is compared with the HSV data corresponding to the color to be erased, the pixel points which are the same as the HSV data corresponding to the color to be erased are marked, and the area formed by the marked pixel points is a mask area.
In one possible implementation manner, the HSV data corresponding to the color to be erased includes HSV data corresponding to the color to be erased within a preset error range. Specifically, the pixels with the difference value within the preset error range are marked, and the area formed by the marked pixels is the mask area. For example, if the HSV value of the color to be erased set or selected by the user is H60 °, S70% and V60% (the meaning of H, S, V is described above and will not be repeated herein), and the preset error range set by the user is that the error of H is 1 ° or less, the error of S is 2% or less and the error of V is 2% or less, the HSV data finally set as the mask area is that the HSV data of H59 ° -61 ° and S68% -72% and V58% -62% are set as the mask area. Those skilled in the art can understand that H is 60 ° and H is 59 ° are easily classified into the same color under the observation of naked eyes, if only data with H of 60 ° is erased, data with H of 59 ° is not erased, in fact, users may consider that the erasure is not clean, and user experience is affected.
The preset error range is a preset range, and a person skilled in the art can set the preset error range to any value according to actual needs, which is not particularly limited in the embodiment of the present application.
In one possible implementation, the preset color is calculated by the image forming apparatus according to the color around the mask area. Specifically, a color histogram in a preset range around the mask region is calculated, and a color with the highest occurrence frequency in the color histogram is set as a preset color. The preset range around the mask area is a 5*5 pixel range around the mask area. Of course, this preset range is merely an exemplary illustration, and one skilled in the art may set the preset range to an arbitrary range according to actual needs, and the embodiment of the present application is not limited thereto.
When the color of the mask area is replaced by the preset color, the mask area is processed by a third processing algorithm, and the mask area is filled with the preset color.
In one possible implementation, the third processing algorithm is a morphological closing operation, where the morphological closing operation is a process of sequentially performing expansion and corrosion processing on the image, so as to connect edges broken after erasing the color, thereby ensuring the look and feel of the user.
Finally, a processed image is obtained and output to the image forming apparatus so that the image forming apparatus performs image formation.
Corresponding to the above embodiments, the embodiment of the present application also provides another color modification method.
Referring to fig. 6, a flowchart of another color modification method according to an embodiment of the present application is shown. As shown in fig. 6, it mainly includes the following steps.
Step S601, receiving a color erasing instruction and a scanned image input by a user.
Step S602, acquiring the main color selected by the user.
Step S603, preprocessing the image.
Specifically, the image preprocessing is the step of preprocessing the scanned image as described above.
Step S604, judging whether the user selects a one-touch erase adjacent color function.
Specifically, if yes, step S605 is executed, and if not, step S606 is executed.
Step S605, calculating adjacent colors through a fourth processing algorithm, and taking the main color and the adjacent colors as colors to be erased.
And step S606, taking the main color as the color to be erased.
Step S607, image post-processing.
Specifically, the image post-processing includes erasing the mask portion, and performing edge compensation, that is, performing a third processing algorithm on the mask portion, and performing adjacent color filling, that is, performing adjacent color, that is, color having the highest occurrence frequency in a color histogram within a preset range around the mask region.
Step S608, outputting the processed image.
The details of the embodiments of the present application may be referred to the description of the embodiment shown in fig. 2, and for brevity, the description is omitted.
In one possible implementation, the embodiments shown in steps S201 to S204 or the embodiments shown in steps S601 to S608 may be performed by the image forming apparatus or may be performed by another terminal device, where the terminal device is communicatively connected to the image forming apparatus. Specifically, if steps S201 to S204 or steps S601 to S608 are performed by the terminal device, before step S201 or step S601, the method further includes the step that the terminal device receives an original image obtained by scanning sent by the image forming device, after steps S201 to S204 or steps S601 to S608 are completed by the terminal device, the terminal device sends the obtained processed image to the image forming device, and then the image forming device performs an image forming operation according to the received processed image.
The terminal device may be a mobile phone, a tablet computer, a portable personal computer (Personal Computer, abbreviated as PC), etc., which is not particularly limited in the present application.
Corresponding to the above embodiment, the present application also provides an image forming apparatus.
Referring to fig. 7, a schematic structural diagram of an image forming apparatus according to an embodiment of the present application is provided. As shown in fig. 7, the image forming apparatus may include a color conversion module 701, a color to be erased acquisition module 702, a contrast module 703, and a color processing module 704. The components may communicate via one or more buses, and it will be appreciated by those skilled in the art that the configuration of the electronic device shown in the drawings is not limiting of the embodiments of the application, as it may be a bus-like structure, a star-like structure, or include more or fewer components than shown, or may be a combination of certain components or a different arrangement of components.
The color conversion module 701 is configured to convert the color of the scanned image into an HSV color space, and obtain the scanned image converted into the HSV color space;
The to-be-erased color acquisition module 702 is configured to acquire HSV data corresponding to a to-be-erased color, where the to-be-erased color is a color that a user desires to erase;
a comparing module 703, configured to compare the HSV data corresponding to the scanned image converted to the HSV color space with the HSV data corresponding to the color to be erased;
The color processing module 704 is configured to replace the color of the mask area with a preset color to obtain a processed image, where the HSV data corresponding to the color of the pixel point in the mask area is HSV data corresponding to the color to be erased.
Corresponding to the embodiment, the application also provides electronic equipment.
Referring to fig. 8, a schematic structural diagram of an electronic device according to an embodiment of the present application is provided. As shown in fig. 8, the electronic device 800 may include a processor 801, a memory 802, and a communication unit 803. The components may communicate via one or more buses, and it will be appreciated by those skilled in the art that the configuration of the electronic device shown in the drawings is not limiting of the embodiments of the application, as it may be a bus-like structure, a star-like structure, or include more or fewer components than shown, or may be a combination of certain components or a different arrangement of components.
Wherein the communication unit 803 is configured to establish a communication channel, so that the electronic device may communicate with other devices. Receiving user data sent by other devices or sending user data to other devices.
The processor 801, which is a control center of the electronic device, connects various parts of the entire electronic device using various interfaces and lines, performs various functions of the electronic device and/or processes data by running or executing software programs, instructions, and/or modules stored in the memory 802, and invoking data stored in the memory. The processor may be comprised of integrated circuits (INTEGRATED CIRCUIT, ICs), such as a single packaged IC, or may be comprised of packaged ICs that connect multiple identical or different functions. For example, the processor 801 may include only a central processing unit (central processing unit, CPU). In the embodiment of the application, the CPU can be a single operation core or can comprise multiple operation cores.
The memory 802, for storing instructions for execution by the processor 801, the memory 802 may be implemented by any type of volatile or non-volatile memory device, or 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.
The execution of the instructions in memory 802, when executed by processor 801, enables electronic device 800 to perform some or all of the steps in the embodiment shown in fig. 2.
In a specific implementation, an embodiment of the present application further provides a computer storage medium, where the computer storage medium may store a program, where the program may include some or all of the steps in each embodiment of the method for generating a simulation scene provided by the embodiment of the present application when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random-access memory (random access memory, RAM), or the like.
In a specific implementation, an embodiment of the present application further provides a computer program product, where the computer program product contains executable instructions, where the executable instructions when executed on a computer cause the computer to execute some or all of the steps in each embodiment of the method for generating a simulation scene provided by the embodiment of the present application.
In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "and/or", describes an association relation of association objects, and indicates that there may be three kinds of relations, for example, a and/or B, and may indicate that a alone exists, a and B together, and B alone exists. Wherein A, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of the following" and the like means any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c may represent a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
Those of ordinary skill in the art will appreciate that the various elements and algorithm steps described in the embodiments disclosed herein can be implemented as a combination of electronic hardware, computer software, and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In several embodiments provided by the present application, any of the functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory RAM), a magnetic disk, or an optical disk.
The same or similar parts between the various embodiments in this specification are referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are substantially similar to the method embodiment, the description is relatively simple, and reference should be made to the description in the method embodiment for relevant points.