Image intelligent processing method and device and electronic equipment
Patent Information
- Application Number
- CN202611055242.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-15
- Publication Date
- 2026-10-09
AI Technical Summary
[0003]有鉴于此,本申请提供一种画像智能处理方法、装置及电子设备,以利于解决现有技术中因画像源数据存在底灰或颜色偏差导致打印画质不佳,以及用户手动解决时操作繁琐、体验差的问题
[0015]采用本申请实施例所提供的方案,获取画像问题描述文本,并基于预设关键词确定画像问题类型;输出用于解决画像问题类型的操作指引信息,以指示用户调节图像形成设备的配置参数;若根据操作指引信息调节后画像问题未能解决,则获取画像问题对应的原始画像,并调用画像问题类型对应的画像处理模型对原始画像进行第一处理,第一处理的流程由所述画像问题类型确定;输出处理完成后的目标图像。本申请通过智能体交互引导用户优先调整设备参数,仅在参数调整无效时自动调用轻量化图像处理模型进行底灰或颜色修复,显著降低了用户操作门槛与问题排查成本,提升了打印画像质量和用户体验。
Smart Images

Figure CN122884419A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically to a method, apparatus, and electronic device for intelligent image processing. Background Technology
[0002] In current inkjet printing scenarios, end users typically can only print directly from source data or use preset templates in applications (such as fun printing or smart ID photos) for portrait printing, resulting in a limited range of printing methods. However, this approach has significant drawbacks: if the source image data itself has background graying or color deviations, the print quality will inevitably be affected. Furthermore, the quality of the printed image is also limited by the printer's performance across various parameters, including resolution, grayscale, color gradation, saturation, and color temperature. In addition, when image quality issues arise, users often need to manually consult repair manuals or rely on real-time after-sales guidance to locate and resolve the problem, a cumbersome and time-consuming process that severely impacts the user experience. Summary of the Invention
[0003] In view of this, this application provides a method, apparatus and electronic device for intelligent image processing, in order to solve the problems in the prior art where poor print quality is caused by background gray or color deviation in the image source data, and the cumbersome operation and poor user experience when users manually solve the problem.
[0004] In a first aspect, embodiments of this application provide a portrait intelligent processing method, including: Obtain the description text of the profile problem and determine the profile problem type based on preset keywords; Output operation guidance information to resolve the portrait problem type, instructing the user to adjust the configuration parameters of the image forming device; If the portrait problem cannot be resolved after adjustment according to the operation guidance information, the original portrait corresponding to the portrait problem is obtained, and the portrait processing model corresponding to the portrait problem type is called to perform the first processing on the original portrait. The process of the first processing is determined by the portrait problem type. Output the processed target image.
[0005] In one optional embodiment, the step of invoking the corresponding image processing model to perform a first processing on the original image includes: When the image problem type is a background gray problem, the background gray removal model is invoked to remove the background gray from the original image. When the image problem type is a color problem, the color restoration model is invoked to perform color restoration processing on the original image.
[0006] In one optional embodiment, when the image problem type is a background gray problem, a background gray removal model is invoked to perform background gray removal processing on the original image, including: The original image is preprocessed to obtain a preprocessed grayscale image; The text features and / or background gray features of the preprocessed grayscale image are extracted based on the lightweight U-Net model to output a background grayscale prediction image, which contains the background grayscale prediction value corresponding to each pixel in the original image. Based on the background grayscale prediction image, the preprocessed grayscale image is subjected to threshold optimization to obtain a binary image. The binary image is then subjected to detail restoration processing to obtain the target image.
[0007] In one optional embodiment, the preprocessed grayscale image is subjected to threshold optimization processing based on the background grayscale prediction image to obtain a binary image, including: Calculate the difference image between the preprocessed grayscale image and the predicted background grayscale image; The difference map is binarized using a threshold segmentation method to obtain the binary map.
[0008] In one optional embodiment, detail restoration processing is performed on the binary image to obtain the target image, including: Perform connected component analysis on the binary graph to identify isolated noise points with an area smaller than a preset threshold; A morphological opening operation is performed on the binary image to eliminate isolated noise points; And / or, The binary image is used to identify fracture types, distinguishing between repairable minor fractures and irreparable severe fractures. A morphological closing operation is performed on the binary image to repair the minor fracture.
[0009] In one optional embodiment, the step of the color restoration model performing a first processing on the original image includes: Initialize the original image by extracting features to obtain a basic feature map; The basic feature map is input into at least one residual dense block for feature enhancement to obtain an enhanced feature map; The enhanced feature map is fused globally using an attention mechanism, and the fused features are upsampled to the size of the original image to obtain global correction features. High-frequency information is extracted from the original image, and the high-frequency information is spliced and fused with the global correction features to generate a preliminary correction result; The preliminary correction result is added to the pixel-by-pixel residual of the original image to obtain the target image.
[0010] In an optional embodiment, after outputting the operation guidance information, the method further includes: When a user reports that the profile issue has not been resolved, or when a user performs a preset completion operation according to the operation guidance information but reports the same problem again, it is determined that the profile issue has not been resolved.
[0011] Secondly, embodiments of this application provide a portrait intelligent processing device, comprising: The matching module is used to obtain the description text of the profile problem and determine the profile problem type based on preset keywords; The output module is used to output operation guidance information for resolving the portrait problem type, instructing the user to adjust the configuration parameters of the image forming device; The processing module is used to obtain the original portrait corresponding to the portrait problem if the portrait problem cannot be resolved after adjustment according to the operation guidance information, and call the portrait processing model corresponding to the portrait problem type to perform a first processing on the original portrait, wherein the process of the first processing is determined by the portrait problem type. The output module is also used to output the target image after processing.
[0012] Thirdly, embodiments of this application provide an electronic device, including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method described in any of the first aspects above.
[0013] Fourthly, embodiments of this application provide a computer-readable storage medium including a stored program, wherein, when the program is executed, it controls the device where the computer-readable storage medium is located to perform the method described in any of the first aspects.
[0014] Fifthly, embodiments of this application provide a computer program product comprising executable instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.
[0015] The solution provided in this application obtains a description of the portrait problem and determines the portrait problem type based on preset keywords. It outputs operation guidance information to resolve the portrait problem type, instructing the user to adjust the configuration parameters of the image forming device. If the portrait problem cannot be resolved after adjusting according to the operation guidance information, the original portrait corresponding to the portrait problem is obtained, and the portrait processing model corresponding to the portrait problem type is called to perform a first processing on the original portrait. The process of the first processing is determined by the portrait problem type. The processed target image is then output. This application guides users to prioritize adjusting device parameters through intelligent agent interaction, and automatically calls a lightweight image processing model for background graying or color restoration only when parameter adjustment is ineffective. This significantly reduces the user's operational threshold and problem-solving costs, improving the quality of printed portraits and the user experience. Attached Figure Description
[0016] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 A flowchart illustrating an intelligent portrait processing method provided in an embodiment of this application; Figure 2 A flowchart illustrating another intelligent portrait processing method provided in this application embodiment; Figure 3 A flowchart illustrating another intelligent portrait processing method provided in this application embodiment; Figure 4 This is an example schematic diagram of an intelligent portrait processing method provided in an embodiment of this application; Figure 5 A flowchart illustrating another intelligent portrait processing method provided in this application embodiment; Figure 6 This is an example schematic diagram of another intelligent portrait processing method provided in the embodiments of this application; Figure 7 This is an example schematic diagram of another intelligent portrait processing method provided in the embodiments of this application; Figure 8 This is an example schematic diagram of another intelligent portrait processing method provided in the embodiments of this application; Figure 9 This is a schematic diagram of the structure of an intelligent image processing device provided in an embodiment of this application; Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0018] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0019] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0020] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0021] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0022] The intelligent image processing method provided in this application embodiment can be applied to electronic devices, which may include: smartphones, tablets, personal computers, smart printer control panels, or cloud servers. Figure 1 This is a flowchart illustrating an intelligent portrait processing method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method may include: Step 101: Obtain the profile problem description text and determine the profile problem type based on preset keywords.
[0023] Users input a description of the portrait problem via text or voice through an intelligent agent dialogue window in an application (APP) or mini-program running on their electronic devices. Examples of such descriptions include "the printed photo has a gray background" or "the color is too yellow." After receiving the description, the electronic device's system uses natural language processing technology to perform pre-defined keyword matching. For example, matching keywords like "gray background," "hazy," and "dirty background" determines the portrait problem type as "gray background problem," while matching keywords like "color cast," "color anomaly," "too yellow," and "too blue" determines the portrait problem type as "color problem." The portrait problem type can be pre-set as a gray background problem, a color problem, or other expandable types.
[0024] Step 102: Output operation guidance information for resolving portrait problem types, instructing the user to adjust the configuration parameters of the image forming device.
[0025] Based on the identified image problem type, the system retrieves the corresponding solution from a pre-built knowledge base or maintenance manual and generates operation guidance information. This guidance information can be in the form of text, images, voice, or video, and is output to the user through an intelligent agent dialogue window or device interface. For example, for a background graying problem, the guidance information may include: "Is the background graying occurring in a scanning, printing, or copying scenario?", "Is it full-page background graying or partial background graying?", "Please try adjusting the printer's Gamma setting or density parameters and observe the effect," etc. The user then manually adjusts the configuration parameters (such as Gamma value, brightness contrast, color balance, etc.) of the image forming device (such as printer, copier, scanner) according to the guidance.
[0026] Step 103: If the portrait problem cannot be resolved after adjusting according to the operation guide information, obtain the original portrait corresponding to the portrait problem, and call the portrait processing model corresponding to the portrait problem type to perform the first processing on the original portrait. The process of the first processing is determined by the portrait problem type.
[0027] After outputting operation guidance information, the system waits for user feedback. Users can provide feedback through interface buttons (such as "Resolved" or "Unresolved") or natural language replies (such as "Okay" or "No"). If the user reports that the problem has been resolved, the entire process ends, and no further image processing is performed. If the user reports that the problem has not been resolved, the system prompts the user to upload the original image (e.g., by taking a photo, selecting from the album, or directly reading a scanned file). After obtaining the original image, the system automatically calls the corresponding image processing model for the first processing based on the image problem type determined in step 101. For example, if it is a background gray problem, the background gray removal model is called; if it is a color problem, the color restoration model is called. The specific process of the first processing (such as grayscale conversion, background prediction, differencing, binarization, etc. for background gray removal, or feature extraction, residual dense block enhancement, attention fusion, etc. for color restoration) is determined by the image problem type.
[0028] Step 104: Output the processed target image.
[0029] After the first processing step is complete, the system obtains the repaired target image (e.g., a black-and-white binary image after removing the background gray, or a color image after color correction). This target image is presented to the user through the electronic device's display screen and can be saved, printed, or further edited by the user. The user can confirm the final result, and if satisfied, the entire portrait problem-solving process is complete.
[0030] This application embodiment prioritizes guiding users to manually adjust device parameters or trigger automatic device parameter adjustment through intelligent interaction. When parameter adjustment is ineffective, the corresponding profile processing model is automatically invoked for repair, which significantly reduces the user's operation threshold and problem-solving costs, and improves the efficiency of profile problem solving and the final output quality.
[0031] In one optional embodiment, when the portrait problem type is a gray background problem, the system can invoke a gray background removal model to perform gray background removal processing. Specifically, if the keywords matched in step 101 are "gray background," "haze," "dirty background," or "uneven background color," then the current portrait problem type is determined to be a gray background problem. The system automatically invokes a pre-trained or configured gray background removal model to perform gray background removal processing on the original portrait uploaded by the user. This processing flow aims to transform images with grayscale backgrounds (such as the light gray texture of scanned documents or the dark haze of photos) into binary images with clean backgrounds and clear text or foregrounds.
[0032] Reference Figure 2 The system's process for removing background gray from the original image may include: Step 201: Preprocess the original image to obtain a preprocessed grayscale image.
[0033] The system first acquires the original image uploaded by the user (which can be a color or grayscale image). Preprocessing includes: if the original image is a color image, converting it to grayscale; normalizing the size of the grayscale image to reduce computation; performing Gaussian filtering for noise reduction to eliminate minor noise introduced by the sensor or scanning; and finally, normalizing the pixel values for subsequent neural network processing. After these operations, the system obtains a preprocessed grayscale image.
[0034] Step 202: Extract text features and / or background gray features from the preprocessed grayscale image based on the lightweight U-Net model to output the background grayscale prediction image.
[0035] The system inputs a pre-processed grayscale image into a pre-trained lightweight U-Net model. This model employs a lightweight design (e.g., reducing the number of channels in convolutional layers and using depthwise separable convolutions) to significantly reduce the number of parameters and computational cost while maintaining feature extraction capabilities. The lightweight U-Net, through an encoder-decoder structure combined with skip connections, effectively extracts text features (such as edges, textures, and high-frequency details) and background gray features (such as smooth, large-area low-frequency backgrounds) from the image. The model's output is a background grayscale prediction map of the same size as the input grayscale image. The value of each pixel in the map represents the background grayscale value that should exist at that location if there is no text or foreground. For example, in blank areas of a document image, the predicted background grayscale is close to the actual background grayscale brightness; in areas with text strokes, the predicted background grayscale is estimated based on the surrounding background.
[0036] Step 203: Perform threshold optimization on the preprocessed grayscale image based on the background grayscale prediction image to obtain a binary image.
[0037] After obtaining the background grayscale prediction image, the system combines it with the original preprocessed grayscale image for threshold optimization. This step aims to completely separate the text (or foreground) in the image from the background grayscale, generating a binary image (white background, black text). Specifically, this can be achieved by: calculating the difference between the preprocessed grayscale image and the background grayscale prediction image to amplify the difference between the text and the background grayscale; then using an adaptive thresholding method (e.g., Otsu thresholding) to binarize the difference image, thus obtaining a preliminary binary image. This process effectively handles non-uniform background grayscale, making thresholding more accurate.
[0038] Step 204: Perform detail restoration on the binary image to obtain the target image.
[0039] Since the binary image obtained after threshold optimization may contain minor noise (isolated white or black pixels) and small breaks in text strokes, the system can further perform detail restoration processing. This processing may include: connected component analysis to remove isolated noise pixels with excessively small areas; morphological operations (such as opening operations to remove noise and closing operations to fill breaks); and identification and repair of text break types. The final output is a high-quality binary image with background gray removed, continuous strokes, and no noise, which serves as the target image after background gray removal model processing.
[0040] For example, at a pixel location within a text area, the original grayscale value is 140 (the text is relatively dark), while the predicted value for the same location in the background image is 175 (if there were no text there, the background would be light gray). Therefore, the difference value is |140. 175|=35. This value is relatively large, indicating that the pixel is highly likely to belong to text. In a clean background area, for example, with an original grayscale value of 240, a predicted background value of 238, and a difference value of |240, the difference is... 238|=2, close to zero, indicating that the pixel belongs to the background. By calculating pixel by pixel, a difference image is obtained, in which the values of the text area are significantly higher than those of the background area, and the histogram shows a bimodal distribution.
[0041] After obtaining the difference image, the system can set a suitable Otsu threshold, such as threshold T=30. For each pixel, binarization is performed based on the relationship between the difference value and the threshold T: if the difference value > 30, it is determined to be text and set to 0 (black); if the difference value ≤ 30, it is determined to be background and set to 255 (white). After pixel-by-pixel judgment, a binary image with a pure white background and pure black text is obtained.
[0042] Through the above process, this application can accurately predict the background gray level using a lightweight U-Net model for the problem of gray background images. Then, through threshold optimization and detail restoration, it can efficiently convert the original image with gray background into a clean and clear black and white binary image with low computational cost, making it suitable for real-time operation on mobile terminals or embedded devices.
[0043] In one optional embodiment, the system's detailed restoration processing of the binary image may include: isolated noise removal and text break repair. For isolated noise, the system can perform connected component labeling on the binary image, calculate the area of each connected component, and identify connected components with areas smaller than a preset threshold as isolated noise. Then, the system can use morphological opening operations (erosion followed by dilation) to remove these noise points while maintaining the normal text area essentially unchanged. For text breaks, the system can detect gaps in the text strokes. If the gap width is less than or equal to a set threshold (e.g., ≤2 pixels), and the stroke direction and thickness on both sides of the break are consistent, it is determined to be a repairable minor break; if the gap is too large (e.g., ≥5 pixels) or the structure is discontinuous, it is determined to be an unrepairable severe break and will not be repaired. For repairable minor breaks, the system can perform morphological closing operations (dilation followed by erosion), using structuring elements to connect the two sides of the break, filling the gap and restoring the continuity of the text strokes. Finally, the repaired target image is output.
[0044] Through the above steps, the system can effectively remove isolated noise points, repair broken text, and obtain a binary image with a clean background and complete strokes.
[0045] In one optional embodiment, when the portrait problem type is determined to be a color problem and the user reports that manually adjusting the parameters is ineffective, the system can invoke a color restoration model to perform color restoration processing on the original portrait uploaded by the user. For example... Figure 3 As shown, the color restoration process may include: Step 301: Initialize feature extraction on the original image to obtain the basic feature map.
[0046] The system acquires the original image uploaded by the user and first performs shallow feature extraction. This operation maps the original RGB pixels to a high-dimensional feature space and performs basic normalization to initially correct the overall brightness baseline. For example, for the cloud region (original RGB values (117,128,132)) and the pink flower region (original RGB values (46,44,46)) in a dark image, after initial feature extraction, the cloud region transitions to (145,156,160) and the pink flower region transitions to (85,82,86), significantly improving brightness. This step outputs a basic feature map of the same size as the input image (or its downsampled size).
[0047] Step 302: Input the basic feature map into at least one residual dense block for feature enhancement to obtain an enhanced feature map.
[0048] The system feeds the base feature map into one or more Residual Dense Blocks (RDBs), each of which contains multiple layers of convolutions, dense connections, and residual connections. By stacking multiple RDBs, the network strengthens the non-linear relationships between color channels, compensates for color degradation caused by lighting or device limitations, and enhances saturation and brightness levels. Continuing the previous example, the cloud transitions from (145, 156, 160) to (186, 198, 203), with a significant enhancement in the blue channel; the pink flower transitions from (85, 82, 86) to (136, 124, 138), with a relative increase in the red channel and higher saturation. This step outputs an enhanced feature map.
[0049] Step 303: Use the attention mechanism to perform global feature fusion on the enhanced feature map, and upsample the fused features to the size of the original image to obtain the global correction features.
[0050] For the enhanced feature map, the system first performs global average pooling, and then generates channel attention weights (between 0 and 1) through two fully connected layers. The system multiplies the attention weights with the original enhanced feature map channel by channel to achieve channel attention weighting. Afterwards, the system upsamples the feature map back to RGB space to obtain global correction features. This step automatically focuses on areas of color aberration, globally calibrates the RGB channel ratio, and expands the dynamic range. For example, clouds transition from (186,198,203) to (210,222,226), making the blue of the sky purer; pink flowers transition from (136,124,138) to (185,173,187), making the pink more vibrant and saturated. This step outputs global correction features, but at this point, image details (such as edge textures) may become blurred due to multiple convolutions.
[0051] Step 304: Extract high-frequency information from the original image and merge the high-frequency information with the global correction features to generate preliminary correction results.
[0052] In parallel with the aforementioned steps, the system directly extracts high-frequency information from the original image (i.e., the user-uploaded, unprocessed original image). High-frequency extraction methods can employ the Laplacian operator, Difference of Gaussians (DoG), or Sobel edge detection to obtain single-channel or multi-channel high-frequency feature maps containing details such as edges and textures. The system then concatenates this high-frequency information with the global correction features output in step 303 along the channel dimension, outputting the correction residual Δ. Each pixel value of Δ represents the amount of RGB adjustment (positive or negative) that needs to be applied to the original image at that location. For example, in the cloud example above, Δ≈(100,101,100); for the pink flower, Δ≈(148,137,149).
[0053] Step 305: Add the preliminary correction result to the pixel-by-pixel residual of the original image to obtain the target image.
[0054] Finally, the system adds the correction residual Δ generated in step 304 to the original input image pixel by pixel: target image = original image + Δ, and the final output is the color-restored target image. For example, adding Δ(100,101,100) to the original cloud image (117,128,132) results in (217,229,232), which appears as a bright light blue; adding Δ(148,137,149) to the original pink flower image (46,44,46) results in (194,181,195), which appears as a vibrant pink with clear edge texture and no color banding or overexposure. Figure 4 The images show a comparison after color restoration. The left side is the original image (which has issues such as color cast, low saturation, and overall darkness), while the right side is the image after color restoration. It can be seen that the right image has more natural and saturated colors, the color cast problem has been effectively corrected, and the details and textures have been fully preserved.
[0055] Through the steps 301 to 305 above, this application can perform global color correction for color-related image problems by using residual dense blocks and attention mechanisms, while preserving details by adding high-frequency branches to the residuals, and finally outputting a color image with natural colors and clear details.
[0056] In one optional embodiment, the system determines that the profiling problem has not been resolved when it receives user feedback that the profiling issue remains unresolved, or when the user performs a preset completion operation according to the operation guidance information but reports the same problem again. The user feedback methods may include: (1) Receive confirmation information input by the user.
[0057] After outputting operation guidance information, the system provides clear interactive buttons in the intelligent agent dialogue window or device interface, such as "Resolved" and "Unresolved". When the user clicks the "Resolved" button, the system directly receives the confirmation information, determines that the problem is resolved, and ends the current process. The user can also input natural language such as "Okay", "Resolved", or "It's working" via text, and the system will also determine it as resolved after keyword matching and recognition. When the user clicks the "Unresolved" button, or when the user inputs natural language such as "Unresolved", "Not resolved", or "Problem still exists", the system can directly determine that the profile problem has not been resolved.
[0058] (2) Monitor whether the user has performed the preset completion operation and has not reported the same problem again.
[0059] After outputting operation guidance information, the system continuously monitors the user's actions on the image forming device. For example, the operation guidance information instructs the user to "adjust the Gamma value and then print the test page." If the system detects that the user has executed the print test page operation and does not report the same portrait problem again through the dialog window within the next preset time window (e.g., 5 minutes), the system automatically determines that the problem has been resolved and ends the process. However, if the user reports the same problem within the preset time window, it can be determined that the portrait problem has not been resolved. This method reduces the number of steps required for user confirmation and improves the smoothness of interaction.
[0060] (3) Ask "Has the problem been solved?" through the intelligent agent dialogue window, and make a judgment based on the keywords in the user's reply.
[0061] After outputting operation guidance information and waiting for a period of time (e.g., 30 seconds), the system proactively sends a query message to the user through the intelligent agent dialogue window, such as "After following the instructions, has the profile issue been resolved?" When the user replies with affirmative keywords such as "yes," "resolved," or "normal," the system determines that the problem has been resolved. When the user replies with negative keywords such as "no," "still doesn't work," or "still yellowish," the system determines that the problem has not been resolved and continues with the subsequent steps of obtaining the original profile and calling the model. For ambiguous replies (such as "more or less"), the system can either confirm again or default to treating it as unresolved.
[0062] The above-mentioned multiple judgment methods can be flexibly selected or combined according to the application scenario. Once the problem is determined to be solved, the entire intelligent portrait processing process will terminate without the need for subsequent image model processing, thereby saving computing resources and responding quickly to user needs.
[0063] Figure 5 A flowchart illustrating another intelligent portrait processing method provided in this application embodiment is shown below. Figure 5 As shown, the method may include: Step 501: The user inputs a description of the profile problem.
[0064] Users can input descriptions of profile problems via text or voice through the intelligent agent dialogue window in the application or mini-program, such as "the printed photo has a gray background", "the color is yellowish", "the text is blurry", etc.
[0065] Step 502: Check if the agent problem matching is successful. If successful, proceed to step 503; otherwise, proceed to step 509.
[0066] The intelligent agent in this embodiment is an artificial intelligence-based interactive module used to understand the user's description of a portrait problem, output operation guidance, determine whether the problem has been resolved, and automatically call an image processing model for repair when necessary. The intelligent agent performs preset keyword matching on the user's input description to determine whether it can identify the corresponding portrait problem type (such as background graying problem, color problem, etc.). If the matching fails (i.e., the problem type cannot be identified), it proceeds to step 509 (intelligent agent update); if the matching is successful, it proceeds to step 503, where the intelligent agent further guides the user to provide more detailed information.
[0067] Step 503: Output operation guidance information.
[0068] When a problem fails to match, the agent outputs operational guidance information, directing the user to manually adjust the configuration parameters of the image forming device, or requesting the user to provide more details about the portrait problem (such as "Please describe whether the problem occurred during scanning, printing, or copying?"). This guidance information is presented in text, image, or voice format.
[0069] Reference Figure 6 The user inputs "The portrait has a gray background issue" through the intelligent agent dialogue window. The intelligent agent can then ask the user for specific details about the portrait issue, such as "Is it a full-page gray background?" The human-computer interaction can include multiple rounds of question-and-answer sessions, with the intelligent agent matching corresponding operation guidance information based on the user's description.
[0070] Step 504: Has the portrait problem been resolved? If so, proceed to step 508; otherwise, proceed to step 505.
[0071] Step 505: The user uploads the original portrait.
[0072] Reference Figure 7 When user actions fail to resolve the issue, the original image can be uploaded via the dialog box indicated by arrow 701.
[0073] Step 506: Call the image processing model to repair the original image.
[0074] Based on the identified portrait problem type, the agent invokes the background gray processing model to perform background gray repair processing.
[0075] Step 507: Has the portrait problem been resolved? If so, proceed to step 508; otherwise, proceed to step 509.
[0076] Step 508: Print the target image.
[0077] Reference Figure 8The image on the left is the original image, where the background graying is quite noticeable. The image on the right is the one after the background graying has been removed, resulting in a clean background. The intelligent agent sends the final target image to an image forming device (such as a printer) for printing, completing the entire image processing workflow.
[0078] Step 509, Agent Update.
[0079] When the matching fails in step 502 and is not successfully resolved subsequently, or when the feedback from step 507 still indicates an unresolved issue, the agent triggers an update mechanism. The agent uploads information such as the user's problem description, operation feedback, and repair failure information obtained during this interaction to a cloud-based knowledge base. This information is used to subsequently optimize the keyword library, operation guidance content, or image processing model parameters, thereby continuously improving the agent's problem recognition capabilities and resolution rate.
[0080] Figure 9 This is a schematic diagram of the structure of an intelligent image processing device provided in an embodiment of this application. Figure 9 As shown, the device may include: The matching module 910 is used to obtain the user's input description of the profile problem and determine the profile problem type based on preset keyword matching.
[0081] The output module 920 is used to output operation guidance information for resolving the portrait problem type, instructing the user to manually adjust the configuration parameters of the image forming device.
[0082] The processing module 930 is used to end the process if the user reports that the problem has been resolved; otherwise, it obtains the original portrait uploaded by the user and calls the corresponding portrait processing model to perform a first processing on the original portrait. The process of the first processing is determined by the portrait problem type.
[0083] The output module 920 is also used to output the processed target image.
[0084] Corresponding to the above embodiments, this application also provides an electronic device. Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device 1000 may include a processor 1001, a memory 1002, and a communication unit 1003. These components communicate through one or more buses. Those skilled in the art will understand that the structure of the electronic device shown in the figure does not constitute a limitation on the embodiment of this application. It may be a bus topology or a star topology, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.
[0085] The communication unit 1003 is used to establish a communication channel, enabling the electronic device to communicate with other devices. It can receive user data sent by other devices or send user data to other devices.
[0086] The processor 1001 serves as the control center of the electronic device, connecting various parts of the device via various interfaces and lines. It executes software programs, instructions, and / or modules stored in the memory 1002, and calls data stored in the memory to perform various functions and / or process data. The processor may be composed of integrated circuits (ICs), such as a single packaged IC or multiple packaged ICs with the same or different functions connected together. For example, the processor 1001 may consist only of a central processing unit (CPU). In this embodiment, the CPU may have a single processing core or include multiple processing cores.
[0087] The memory 1002 is used to store the execution instructions of the processor 1001. The memory 1002 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 storage, flash memory, magnetic disk or optical disk.
[0088] When the execution instructions in memory 1002 are executed by processor 1001, the electronic device 1000 is able to perform some or all of the steps in the above embodiments.
[0089] In a specific implementation, this application also provides a computer storage medium, wherein the computer storage medium may store a program, which, when executed, may include some or all of the steps of the portrait intelligent processing method provided in this application. The storage medium may be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0090] In a specific implementation, this application also provides a computer program product, wherein the computer program product includes executable instructions, which, when executed on a computer, cause the computer to perform some or all of the steps in various embodiments of the portrait intelligent processing method provided in this application.
[0091] This application also provides a non-transitory computer-readable storage medium that stores computer instructions, which cause the computer to execute the portrait intelligent processing method provided in this application.
[0092] The aforementioned non-transitory computer-readable storage medium may be any combination of one or more computer-readable media. A computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in connection with an instruction execution system, apparatus, or device.
[0093] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including—but not limited to—electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0094] The program code contained on a computer-readable medium may be transmitted using any suitable medium, including—but not limited to—wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0095] Those skilled in the art will clearly understand that the techniques in the embodiments of this application can be implemented using software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solutions in the embodiments of this application, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application or some parts of the embodiments.
[0096] The same or similar parts between the various embodiments in this specification can be referred to mutually. In particular, the device embodiments and terminal embodiments are basically similar to the method embodiments, so the description is relatively simple, and the relevant parts can be referred to the description in the method embodiments.
Claims
1. A method for intelligent image processing, characterized in that, include: Obtain the description text of the profile problem and determine the profile problem type based on preset keywords; Output operation guidance information to resolve the portrait problem type, instructing the user to adjust the configuration parameters of the image forming device; If the portrait problem cannot be resolved after adjustment according to the operation guidance information, the original portrait corresponding to the portrait problem is obtained, and the portrait processing model corresponding to the portrait problem type is called to perform the first processing on the original portrait. The process of the first processing is determined by the portrait problem type. Output the processed target image.
2. The method according to claim 1, characterized in that, The first processing of the original image by calling the corresponding image processing model includes: When the image problem type is a background gray problem, the background gray removal model is invoked to remove the background gray from the original image. When the image problem type is a color problem, the color restoration model is invoked to perform color restoration processing on the original image.
3. The method according to claim 2, characterized in that, When the image problem type is a background gray problem, the background gray removal model is invoked to perform background gray removal processing on the original image, including: The original image is preprocessed to obtain a preprocessed grayscale image; The text features and / or background gray features of the preprocessed grayscale image are extracted based on the lightweight U-Net model to output a background grayscale prediction image, which contains the background grayscale prediction value corresponding to each pixel in the original image. Based on the background grayscale prediction image, the preprocessed grayscale image is subjected to threshold optimization to obtain a binary image; The binary image is then subjected to detail restoration processing to obtain the target image.
4. The method according to claim 3, characterized in that, Based on the background grayscale prediction image, the preprocessed grayscale image is subjected to threshold optimization processing to obtain a binary image, including: Calculate the difference image between the preprocessed grayscale image and the predicted background grayscale image; The difference map is binarized using a threshold segmentation method to obtain the binary map.
5. The method according to claim 3, characterized in that, The target image is obtained by performing detail restoration processing on the binary image, including: Perform connected component analysis on the binary graph to identify isolated noise points with an area smaller than a preset threshold; A morphological opening operation is performed on the binary image to eliminate isolated noise points; And / or, The binary image is used to identify fracture types, distinguishing between repairable minor fractures and irreparable severe fractures. A morphological closing operation is performed on the binary image to repair the minor fracture.
6. The method according to claim 2, characterized in that, The color restoration model performs the following steps in the first processing of the original image: Initialize the original image by extracting features to obtain a basic feature map; The basic feature map is input into at least one residual dense block for feature enhancement to obtain an enhanced feature map; The enhanced feature map is fused globally using an attention mechanism, and the fused features are upsampled to the size of the original image to obtain global correction features. High-frequency information is extracted from the original image, and the high-frequency information is spliced and fused with the global correction features to generate a preliminary correction result; The preliminary correction result is added to the pixel-by-pixel residual of the original image to obtain the target image.
7. The method according to claim 1, characterized in that, After outputting the operation guidance information, the method further includes: When a user reports that the profile issue has not been resolved, or when a user performs a preset completion operation according to the operation guidance information but reports the same problem again, it is determined that the profile issue has not been resolved.
8. A portrait intelligent processing device, characterized in that, include: The matching module is used to obtain the description text of the profile problem and determine the profile problem type based on preset keywords; The output module is used to output operation guidance information for resolving the portrait problem type, instructing the user to adjust the configuration parameters of the image forming device; The processing module is used to obtain the original portrait corresponding to the portrait problem if the portrait problem cannot be resolved after adjustment according to the operation guidance information, and call the portrait processing model corresponding to the portrait problem type to perform a first processing on the original portrait, wherein the process of the first processing is determined by the portrait problem type. The output module is also used to output the target image after processing.
9. An electronic device, characterized in that, The device includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein, when the program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 7.