An image enhancement method based on dish grease reflection and light combined guidance
Patent Information
- Application Number
- CN202611025684.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-10
- Publication Date
- 2026-09-25
- Estimated Expiration
- 2046-07-10
AI Technical Summary
[0002]随着网络订餐平台、智能餐饮系统以及菜品识别技术的快速发展,菜品图像已广泛应用于菜品展示、菜品分类、营养分析、智能推荐以及餐饮数字化管理等场景;高质量的菜品图像不仅能够提升用户视觉体验,而且对后续的图像识别、特征提取和智能分析任务具有重要影响;然而,在实际拍摄过程中,由于拍摄设备差异、环境光照复杂、拍摄角度变化以及菜品自身材质特性等因素影响,获取的菜品图像往往存在颜色失真、纹理细节缺失、局部过曝、阴影区域明显以及视觉层次不足等问题;其中,菜品表面的油脂反射现象与复杂光照条件相互叠加,容易导致局部区域出现高亮反射、亮度分布不均以及纹理信息被掩盖等情况,从而降低菜品图像的视觉质量和真实性
[0025]本发明通过构建约束增强基础特征图、菜品表面油脂反射可信度分布图、菜品前景光照分布图以及油脂反射光照联合引导图,实现了菜品颜色、纹理、油润感和光照状态的协同增强;该方法能够有效区分真实油脂反射、普通光照和背景干扰,避免现有方法中容易出现的颜色失真、过度增强、背景误增强和油亮区域丢失等问题,使增强后的菜品图像在保持真实色泽的同时,具有更清晰的纹理细节、更自然的光照层次和更突出的油润质感,从而提升菜品图像的整体真实感。
Smart Images

Figure CN122573767B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of image processing, and specifically relates to an image enhancement method based on the combined guidance of food oil reflection and illumination. Background Technology
[0002] With the rapid development of online food ordering platforms, intelligent catering systems, and food recognition technology, food images have been widely used in scenarios such as food display, food classification, nutritional analysis, intelligent recommendation, and digital management of catering. High-quality food images not only enhance the user's visual experience but also have a significant impact on subsequent image recognition, feature extraction, and intelligent analysis tasks. However, in actual shooting processes, due to factors such as differences in shooting equipment, complex ambient lighting, changes in shooting angles, and the material characteristics of the food itself, the acquired food images often suffer from problems such as color distortion, loss of texture details, local overexposure, obvious shadow areas, and insufficient visual hierarchy. In particular, the oil reflection phenomenon on the surface of the food, combined with complex lighting conditions, can easily lead to local bright reflections, uneven brightness distribution, and the masking of texture information, thereby reducing the visual quality and realism of the food image.
[0003] Currently, existing image enhancement methods mainly include those based on histogram equalization, Retinex theory, color correction, and deep learning networks. These methods typically adjust overall brightness, enhance contrast, and restore texture for natural scene images or low-light images. While they can improve the visual effect of images to some extent, most methods lack the ability to model the unique attributes of food images, making it difficult to fully consider the differences between food areas and background areas, and also difficult to effectively distinguish between the real oil reflection on the surface of the food and changes in ambient light. In addition, most existing methods treat color enhancement and texture enhancement as independent processes, lacking a unified control mechanism for their synergistic relationship. When the enhancement intensity is too high, it can easily cause color oversaturation, texture distortion, or loss of oily texture; when the enhancement intensity is insufficient, it is difficult to fully restore the detailed information and visual hierarchy of the food. Therefore, how to effectively correct areas affected by complex lighting while maintaining the true color and oily texture of the food, and synergistically improve color performance and texture detail quality, has become a pressing technical problem to be solved in the field of food image enhancement. Summary of the Invention
[0004] This invention proposes an image enhancement method based on the joint guidance of oil reflection and illumination in food images. By introducing food attribute constraint information, a confidence distribution map of oil reflection on the food surface, a lighting distribution map of the food foreground, and a joint guidance map of oil reflection and illumination, and combining color and texture collaborative enhancement, oily texture preservation, and adaptive iterative update mechanisms, it achieves differentiated control of uneven lighting areas, oil reflection areas, and detailed texture areas in food images. This improves the color authenticity, texture clarity, and visual hierarchy of food images, while maintaining the oily texture of the food surface and the overall structural stability.
[0005] This invention provides an image enhancement method based on the combined guidance of food oil reflection and illumination, comprising the following steps:
[0006] S1. Acquire the image of the dish to be processed and perform preprocessing. Extract features from the preprocessed image. Reduce the redundant correlation between features at different levels by orthogonal projection constraint of hierarchical features. Perform difference compensation fusion and color fidelity adaptive injection on the hierarchical features after orthogonal constraint to obtain an enhanced basic feature map. Construct an exponential dish attribute consistency weight based on the dish attribute deviation. Apply feature layer regularization constraint to the enhanced basic feature map using the exponential dish attribute consistency weight to obtain a constrained enhanced basic feature map.
[0007] S2. Based on foreground saliency information and constraint-enhanced basic feature maps, construct a confidence distribution map of oil reflection on the surface of dishes;
[0008] S3. Based on the brightness channel, local neighborhood brightness difference, foreground saliency information, and constraint-enhanced basic feature map of the dish image to be processed, construct the foreground illumination distribution map of the dish;
[0009] S4. Extract dish recognition features based on the constraint-enhanced basic feature map or the current round of enhanced image, and generate guided update weights based on the dish recognition features; obtain the joint guided map of oil reflection and illumination based on the dish surface oil reflection confidence distribution map and the dish foreground illumination distribution map;
[0010] S5. Based on the joint guidance map of grease reflection illumination, color enhancement features and texture enhancement features are obtained;
[0011] S6. Based on the joint guidance map of oil reflection and illumination, color enhancement features and texture enhancement features are fused to generate the enhanced image of the current round, and iteratively updated until the preset stopping condition is met, and the final dish image is output.
[0012] Preferably, in step S1, the basic feature map of constraint enhancement is constructed. The steps include: extracting features from the preprocessed image of the dish to be processed. The multi-layer feature extraction network is a Swin Transformer network. The Swin Transformer network includes a Patch Embedding module and Stage1, Stage2, Stage3 and Stage4 connected in sequence. Taken from the output of Stage 1 Taken from the output of Stage2 Taken from the output of Stage 3; using mid-level features The spatial scale is the target scale, for shallow features Downsampling is performed to obtain scale-aligned shallow features. and characteristics of high-level personnel Upsampling is performed to obtain scale-aligned high-level features. Shallow features after scale alignment Mid-layer characteristics High-level features after scale alignment The hierarchical feature matrix is obtained by flattening and normalizing the matrix. , and : ,in, , Indicates the flattening operation. This represents the normalization operation; a hierarchical feature orthogonal projection constraint function is constructed to weaken the redundant projection components of shallow and high-level features that are related to mid-level features; where the related projection components of shallow features relative to mid-level features are represented as: The correlation projection components of high-level features relative to mid-level features are represented as follows: Based on the relevant projection components, the shallow and high-level feature matrices after orthogonal constraints are obtained respectively: , ,in, As a stable term, It is the identity matrix. and The projection weakening coefficient is used to transform the shallow feature matrix after orthogonal constraints. and high-level feature matrix Restored to a spatial feature map, yielding shallow features after orthogonal constraints. High-level features after orthogonal constraints and middle layer features The shallow features and high-level features, after orthogonal constraints, are used together for subsequent feature fusion; the difference compensation features between shallow and mid-level features, and between high-level and mid-level features, are calculated: , ,in, This represents the convolution mapping operation. This represents element-wise absolute value operation; it also represents the shallow features after orthogonal constraints. Mid-layer characteristics High-level characteristics after orthogonal constraints Shallow differential compensation characteristics Features of compensation for differences between high-level and low-level personnel The initial basic feature map is obtained by splicing and fusion. : ,in, This represents the feature concatenation operation along the channel dimension; it applies to shallow features after orthogonal constraints. conduct Convolutional mapping yields color-fidelity features. : Based on the initial basic feature map With color fidelity features The differences between them are used to construct color fidelity offset perceptual features. : ; Color fidelity features Perceptual features of color fidelity offset Channel splicing is performed to obtain color-fidelity splicing features. : ; Color-fidelity splicing features conduct Convolutional mapping and through Activation function processing yields color-fidelity adaptive injection weights. : ,in, express Activation function; color-fidelity-based adaptive weight injection Color fidelity features Inject initial basic feature map The enhanced basic feature map is obtained. : ,in, This represents element-wise multiplication; a foreground saliency response is constructed based on the image of the dish to be processed and the high-level features after orthogonal constraints. Among them, the local color contrast response is calculated separately. Texture local contrast response Semantic probability response of dishes : , , ,in, Given the binary classification probabilities of the dish's foreground and background, the foreground probability of the dish is taken as the semantic probability response of the dish: , This indicates the pixel position of the food image to be processed. The color vector at that location, Indicated by The color mean of the neighborhood centered on the center. Representing image gradients; generating foreground saliency responses based on local color contrast response, local texture contrast response, and semantic probability response of the dish: ,in, For fusion weights; calculate the average confidence level of the foreground significance response: ,in, The total number of spatial locations in the image; when the average confidence level... Greater than or equal to the preset threshold At that time, the foreground weighted statistical color is calculated based on the foreground saliency response. : ,in, To prevent constants with a denominator of zero; when the average confidence level Less than the preset threshold When using the image of the dish to be processed, the global color mean is used as the backtracking statistical color. Based on foreground statistical color Calculate color deviation : The semantic probability response of the dish is used as the feature map for dish recognition: Based on color deviation Prospect significance response Feature mapping for food identification Constructing dish attribute deviation : ,in, These are weighting coefficients; adaptive adjustment parameters are generated based on the global mean of the deviation of dish attributes. : According to the deviation of dish attributes and adaptive adjustment parameters Construct an exponential consistency weight for dish attributes : ; Index-based consistency weight of dish attributes Enhanced basic feature map Apply feature layer regularization constraints to obtain the constraint-enhanced basic feature map. : ,in, This is the constraint enhancement coefficient.
[0013] This step is used to generate the basic features for subsequent enhancement processing. First, different levels of features such as color, texture, and semantics are extracted from the dish image, and duplicate features are weakened. Then, combined with color fidelity constraints and dish attribute consistency judgment, the main area of the dish is preserved and enhanced, resulting in a more stable and accurate constraint-enhanced basic feature map. This produces a basic feature map of the dish with more realistic colors, clearer textures, and more prominent main features, providing a more stable input for subsequent oil reflection, lighting guidance, and color and texture enhancement, while reducing background interference, color shift, and feature redundancy.
[0014] Preferably, in step S2, the confidence distribution map of oil reflection on the surface of the dish is constructed, which includes: acquiring the brightness channel of the image of the dish to be processed. and saturation channel And construct a normalized luminance response based on the luminance channel. : ,in, and These represent the minimum and maximum values in the luminance channel, respectively. The stability constant is used; based on the difference between the normalized brightness response and the local neighborhood brightness mean, a local brightness abrupt change response is constructed. : ,in, Represented by pixel position Normalized mean brightness response within a local neighborhood centered on the saturation channel; constructing oil color retention response based on the saturation channel. : ,in, and These represent the minimum and maximum values in the saturation channel, respectively. Based on the normalized brightness response, local brightness abrupt change response, foreground saliency response, and non-food white strong light interference response, initial high-brightness candidate responses are constructed. : ,in, Indicates a salient response. This indicates a normalization operation. The response to strong white light interference from non-food items is calculated as follows: Based on the luminance channel, color vector, foreground saliency response, and initial highlight candidate response, a diffuse reflection estimation map of the dish's foreground perception is constructed. : ,in, Represented by pixel position The local neighborhood centered on, Indicates the pixel position within a local neighborhood. Indicates pixel position The brightness value at that location, Indicates the diffuse reflection estimation weight; diffuse reflection estimation weight The criteria for determining the candidate are spatial proximity, color similarity, foreground support, and highlight candidate suppression. ,in, , , Represents spatial proximity weights. Indicates the weight of color similarity. and Representing pixel positions and The color vector at that location, and To adjust parameters; based on the brightness channel Diffuse reflection estimation map of foreground perception of food The difference between them is used to construct the specular reflection residual response. : ,in, Indicates pixel position The specular reflection residual relative to the diffuse reflection component of the food surface is obtained; the specular reflection residual response is normalized to obtain the normalized specular reflection residual response. : ,in, and Let represent the minimum and maximum values in the specular reflection residual response, respectively; based on the local continuity of the normalized specular reflection residual response, an oil film continuity response is constructed. : ,in, Represented by pixel position The mean of the normalized specular reflection residual response in the local neighborhood centered on the sphere. Parameters were adjusted to account for local variations in specular reflection residuals; a smooth response for grease reflection boundaries was constructed based on the gradient response of the brightness channel. : ,in, Indicates the position of the luminance channel at the pixel. gradient at, The brightness gradient adjustment parameters are used; based on the foreground saliency response, normalized specular reflection residual response, oil color retention response, oil film continuity response, oil reflection boundary softening response, and non-food white strong light interference response, a confidence distribution map of oil reflection on the food surface is constructed. : .
[0015] By using information such as brightness, saturation, and foreground salience, areas that may contain oil highlights are screened out. Then, through diffuse reflection estimation and specular reflection residual analysis, oil reflection is separated from the overall brightness. Furthermore, by combining the color retention characteristics of oil, oil film continuity, and edge softness features, the detection results are optimized, and interference areas such as plates, backgrounds, and strong white reflections are suppressed. Finally, an oil reflection confidence distribution map that can accurately reflect the distribution and intensity of oil on the surface of the dish is obtained, providing a reliable basis for subsequent oil-light-guided enhancement. This allows the enhancement process to highlight the oiliness, luster, and appealing texture of the food, while avoiding mistaking background reflections or ordinary lighting for oil areas.
[0016] Preferably, the step of constructing the foreground lighting distribution map of the dish in step S3 includes: based on the normalized brightness response Calculate the pixel position respectively Local neighborhood brightness difference response in multiple preset directions : ,in, , Indicates the number of preset directions. Indicates pixel position In the The normalized mean brightness response within each directional neighborhood is used to construct the directional illumination shift intensity based on the local neighborhood brightness difference response in multiple directions. : And determine the direction of the main illumination shift. : Among them, the directional illumination offset intensity is used to represent the pixel position. Compared to the degree of illumination unevenness in multiple directional neighborhoods, the main illumination offset direction is used to represent the direction in which the illumination offset is most significant at that location; based on the normalized brightness response and the average brightness of the neighborhood corresponding to the main illumination offset direction, a local overbrightness response is constructed. and local shadow response : , ,in, Indicates pixel position The degree of local overbrightness relative to the neighborhood of the main illumination offset direction, Indicates pixel position Local shading intensity relative to the neighborhood of the main illumination offset direction; constrained enhancement of basic feature map Constructing Light Type Adjustment Weights : ,in, express Activation function Indicates to Make a Convolutional mapping; adjusting weights based on local overbrightness response, local shadow response, and illumination type to construct a bidirectional illumination offset response. : Based on the local feature gradients of the constrained enhancement base feature map, a response for suppressing the texture edges of dishes is constructed. : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic gradient at that location, The feature gradient adjustment parameter is used to reduce the probability that the edges of the food texture are misidentified as uneven lighting regions. Based on the directional lighting offset intensity and the local neighborhood brightness difference response in multiple directions, a main direction confidence response is constructed. : Based on the foreground saliency response, directional illumination shift intensity, bidirectional illumination shift response, food texture edge suppression response, and principal direction confidence response, a foreground illumination distribution map of the food is constructed. : ,in, Indicates a salient response. This indicates a normalization operation. Indicates pixel position The response intensity is located in the area of uneven lighting in the foreground of the dish.
[0017] By analyzing local brightness differences in multiple directions, the most significant directions and intensities of illumination changes are determined. Then, information on locally overbright and locally shadowed areas is extracted, and the influence of different types of illumination is adaptively adjusted in conjunction with the features of the main dish area. At the same time, a texture edge suppression mechanism is used to avoid misjudging dish textures as illumination changes, and directional consistency analysis is used to enhance the response of real illumination shift areas. Finally, a foreground illumination distribution map that accurately describes the illumination distribution, illumination shift direction, and illumination unevenness of the dish surface is generated, providing a basis for subsequent collaborative modeling of oil reflection and illumination information. This enables the enhancement process to more accurately distinguish illumination effects from real texture structures, thereby improving the layering, three-dimensionality, and visual naturalness of the dish image.
[0018] Preferably, the step of constructing the joint guidance map of oil reflection and illumination in step S4 includes: based on the confidence distribution map of oil reflection on the surface of the dish. Light distribution map of the foreground of the dishes , build oil-based responsive Oils inhibit photoresponse Combined response of oil and light : , , Oil and light combined response This was used to characterize food regions exhibiting both oil reflectivity and uneven illumination characteristics; the oil retention response was calculated separately. Oils inhibit photoresponse Combined response of oil and light Global statistical strength: , , ,in, This represents the total number of spatial locations in the response graph; grease retention weights are generated based on global statistical strength. Illumination correction weights Combined weighting of oil and light : Constructing an oil retention gating system based on oil retention response and oil-light joint response : ,in, Used to control the participation intensity of the foreground lighting distribution map of dishes in the joint guidance map; based on foreground saliency response and constrained augmentation of basic feature maps Constructing a reliable gating system : ,in, for Function; Based on grease retention gating, illumination correction gating, the confidence distribution map of grease reflection on the food surface, the illumination distribution map of the foreground of the food, and the guidance reliability gating, construct a joint guidance map of grease reflection and illumination. : ,in, This indicates a normalization operation.
[0019] Based on the oil reflection confidence distribution map and the foreground illumination distribution map, the region is divided into oil-dominated regions, illumination-dominated regions, and regions where oil and illumination work together. Then, the proportion and intensity of each type of region in the whole image are statistically analyzed, and oil preservation weight, illumination correction weight, and oil-illumination joint weight are adaptively generated. Furthermore, a reliability gating mechanism is constructed by combining the saliency information of the main dish and the enhancement basic features, and different guidance strategies are adopted for different regions to achieve a dynamic balance between oil information and illumination information. Finally, an oil reflection illumination joint guidance map is generated, which enables the subsequent enhancement process to reasonably correct the effects of uneven illumination while preserving the oiliness, luster, and true color of the dish, avoiding over-enhancement or false enhancement, thereby improving the naturalness of the dish image.
[0020] Preferably, the steps of constructing color enhancement features and texture enhancement features in step S5 include: obtaining the luminance channel of the image of the dish to be processed. And convert the food images to be processed to Color space, obtaining chroma channels: ,in, and They represent Two chromaticity components in a color space; constructing a local color shift response based on the chromaticity channels. : ,in, Represented by pixel position The mean chromaticity value within a local neighborhood centered on the value. Representing L2 norm operations; constructing gradient texture responses based on the brightness channel. and local high-frequency texture response : , ,in, Indicates the position of the luminance channel at the pixel. gradient at, Represented by pixel position Mean brightness within a local neighborhood centered on the target; constrained enhancement of the basic feature map chroma channel and local color shift response Construct initial color branch features : ,in, Represents the concatenation operation along the channel dimension; constrained enhancement of the basic feature map. Gradient texture response and local high-frequency texture response Construct initial texture branch features : Constraint-enhanced basic feature maps 1. Reliability distribution map of oil reflection on food surface Combined guidance diagram of oil reflection and light illumination and normalized specular reflection residual response Constructing initial glossy texture branch features : ;Guided by combined guidance map based on oil reflection light Credibility distribution map of oil reflection on food surface Construct a color-fidelity gating system : ,in, and Adjust parameters to ensure color fidelity; based on the foreground lighting distribution map of the dish. Combined guidance diagram with oil and grease reflection light Constructing a texture recovery gating system : ,in, and Adjust parameters for texture restoration; based on the confidence distribution map of oil reflection on the surface of the dish. Building a glossy finish and maintaining gate control : ,in, and The parameters for adjusting the glossy texture are as follows: The initial color branch characteristics are adjusted based on the color fidelity gating to obtain the color fidelity adjustment characteristics. : ,in, This is the color adjustment factor. This represents element-wise multiplication; the initial texture branch features are adjusted according to the texture restoration gating to obtain the texture restoration adjustment features. : ,in, Texture adjustment coefficient; based on the joint guidance map of oil reflection and illumination, the confidence distribution map of oil reflection on the surface of the dish, and the illumination distribution map of the foreground of the dish, a color, texture, and gloss texture synergistic balance factor is constructed. : Based on the color, texture, and gloss balance factor, color fidelity adjustment features, texture restoration adjustment features, and gloss adjustment features are synergistically compensated to obtain color enhancement features. and texture enhancement features : , ,in, and These are the collaborative compensation coefficients for glossy texture on color enhancement features and texture enhancement features, respectively. Indicates color enhancement features, This indicates a texture enhancement feature.
[0021] We constructed color, texture, and glossy texture branches to extract the color distribution, texture details, and glossy features of the dishes. Then, based on the oil reflection confidence distribution map, foreground lighting distribution map, and oil reflection lighting joint guidance map, we established color fidelity gating, texture restoration gating, and glossy texture preservation gating to adaptively adjust different features. Furthermore, we utilized a color, texture, and glossy texture collaborative balance mechanism to simultaneously compensate for glossy texture information in the color enhancement branch and texture enhancement branch, achieving coordinated optimization of the three types of features. Finally, we obtained color enhancement features and texture enhancement features that can maintain the true color of the dishes while enhancing texture levels and glossy texture, providing support for the subsequent generation of high-quality enhanced dish images, thereby improving the vibrancy of the dish images.
[0022] Preferably, in step S6, the final dish image is output: a combined guiding image based on oil reflection and illumination. Enhanced color features and texture enhancement features Guided fusion is performed to obtain joint color and texture enhancement features. : ,in, Represents element-wise multiplication; based on the confidence distribution map of oil reflection on the surface of dishes. Light distribution map of the foreground of the dishes Constructing a residual gating system for oil protection : Let the preprocessed image of the dish to be processed be the initial enhanced image. In the In the round of iteration, the enhanced image of the previous round is represented as ; Color and texture joint enhancement features Constraint-enhanced basic feature map Compared to the previous round of image enhancement Construct the enhanced residual features for the current round : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic response at that location, This indicates the pixel location of the image from the previous enhancement round. The pixel value at that location; based on the current iteration round. Constructing an enhanced step size decay coefficient : ,in, Indicates the initial enhancement step size. This represents the step size decay adjustment parameter; it generates the residual image for the current round based on the enhanced residual characteristics of the current round. : ,in, Represents a hyperbolic tangent nonlinear mapping; based on the image enhancement from the previous round. Enhance step size decay coefficient and the residual image of the current round Generate the enhanced image for the current round. : , among which, when At that time, let the initial enhanced image The image shows the preprocessed food image to be processed; the iterative update stops when any of the following preset stopping conditions are met: ,in, This indicates the threshold for stabilizing image changes, or ,in, Indicates the maximum number of iterations; the enhanced image of the current round obtained when the preset stopping condition is met. The final enhanced image of the dish .
[0023] The contributions of color enhancement and texture enhancement are dynamically balanced based on the oil reflection and light distribution to generate joint color and texture enhancement features. Then, enhancement residuals are constructed by combining the constrained enhancement basic features and the current enhancement results. Image details, color and hierarchical information are gradually adjusted through residual learning. At the same time, a step size decay mechanism is introduced to make the enhancement process gradually converge from coarse to fine, avoiding over-sharpening, color distortion or local over-enhancement caused by one-time enhancement. Finally, the enhancement result is output after the stability condition is met or the maximum number of iterations is reached, so that the texture details of the dish image are further improved while maintaining the realistic color and natural appearance.
[0024] Compared with the prior art, the present invention has the following technical effects:
[0025] This invention achieves synergistic enhancement of the color, texture, oiliness, and lighting conditions of dishes by constructing a constrained enhancement basic feature map, a credibility distribution map of oil reflection on the surface of the dish, a foreground lighting distribution map of the dish, and a joint guidance map of oil reflection and lighting. This method can effectively distinguish between real oil reflection, ordinary lighting, and background interference, avoiding problems such as color distortion, over-enhancement, false background enhancement, and loss of glossy areas that are easily encountered in existing methods. As a result, the enhanced dish image retains its true color while having clearer texture details, more natural lighting levels, and a more prominent oily texture, thereby improving the overall realism of the dish image. Attached Figure Description
[0026] Figure 1 This is an overall flowchart of the method for enhancing dish images based on the perception of dish attributes and guided by oil and light.
[0027] Figure 2 This is a flowchart of the constraint-enhanced basic feature map generation process of the present invention.
[0028] Figure 3 This is a flowchart of the process for generating a reliable distribution map of oil reflection on the surface of dishes according to the present invention.
[0029] Figure 4 This is a flowchart of the process for generating the foreground lighting distribution map of the dish according to the present invention.
[0030] Figure 5 This is a flowchart of the process for generating the combined guide image of oil reflection and illumination according to the present invention.
[0031] Figure 6 This is a flowchart of the color enhancement feature and texture enhancement feature generation process of the present invention.
[0032] Figure 7 This is a flowchart of the enhanced food image generation process of the present invention. Detailed Implementation
[0033] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other implementations obtained by those skilled in the art without creative effort are within the protection scope of the present invention.
[0034] This invention proposes an image enhancement method based on the joint guidance of oil reflection and illumination in food images. By introducing food attribute constraint information, a confidence distribution map of oil reflection on the food surface, a lighting distribution map of the food foreground, and a joint guidance map of oil reflection and illumination, and combining color and texture collaborative enhancement, oily texture preservation, and adaptive iterative update mechanisms, it achieves differentiated control of uneven lighting areas, oil reflection areas, and detailed texture areas in food images. This improves the color authenticity, texture clarity, and visual hierarchy of food images, while maintaining the oily texture of the food surface and the overall structural stability.
[0035] Please see Figures 1 to 7 This application provides an image enhancement method based on the joint guidance of oil reflection and illumination in food images. It aims to address issues such as color distortion, loss of texture detail, uneven illumination, and insufficient oil highlight representation in food images captured under complex shooting environments. The method collaboratively models multi-layer semantic features, color attribute features, texture structure features, and oil reflection and illumination distribution information of the food image. This constructs a food attribute consistency constraint feature, a food surface oil reflection credibility distribution map, a food foreground illumination distribution map, and a joint guidance map of oil reflection and illumination. Based on this, it achieves collaborative optimization and adaptive fusion of color enhancement branches, texture enhancement branches, and oil gloss preservation branches. Simultaneously, an iterative enhancement mechanism under guided constraints progressively updates and optimizes the enhancement results, thereby improving the color realism, texture clarity, and oil gloss representation of the food image, enhancing the visual appeal of the main food area, suppressing background interference and illumination artifacts, and maintaining the structural stability, detail realism, and overall visual naturalness of the food.
[0036] S1. Acquire the image of the dish to be processed and perform preprocessing. Extract features from the preprocessed image. Reduce the redundant correlation between features at different levels by orthogonal projection constraint of hierarchical features. Perform difference compensation fusion and color fidelity adaptive injection on the hierarchical features after orthogonal constraint to obtain an enhanced basic feature map. Construct an exponential dish attribute consistency weight based on the dish attribute deviation. Apply feature layer regularization constraint to the enhanced basic feature map using the exponential dish attribute consistency weight to obtain a constrained enhanced basic feature map.
[0037] Furthermore, in step S1, a constrained augmentation base feature map is constructed. The specific steps include:
[0038] Feature extraction is performed on the preprocessed food images. The multi-layer feature extraction network is the Swin Transformer network, which includes a Patch Embedding module and Stage 1, Stage 2, Stage 3 and Stage 4 connected in sequence. Taken from the output of Stage 1 Taken from the output of Stage2 Taken from the output of Stage 3; using mid-level features The spatial scale is the target scale, for shallow features Downsampling is performed to obtain scale-aligned shallow features. and characteristics of high-level personnel Upsampling is performed to obtain scale-aligned high-level features. Shallow features after scale alignment Mid-layer characteristics High-level features after scale alignment The hierarchical feature matrix is obtained by flattening and normalizing the matrix. , and : ,in, , Indicates the flattening operation. This represents the normalization operation; a hierarchical feature orthogonal projection constraint function is constructed to weaken the redundant projection components of shallow and high-level features that are related to mid-level features; where the related projection components of shallow features relative to mid-level features are represented as: ,in, , As a stable term, The identity matrix is used; the correlation projection components of high-level features relative to mid-level features are represented as: ,in, Based on the relevant projection components, the shallow and high-level feature matrices after orthogonal constraints are obtained respectively: , ,in, , , and The projection weakening coefficient is used to transform the shallow feature matrix after orthogonal constraints. and high-level feature matrix Restored to a spatial feature map, yielding shallow features after orthogonal constraints. High-level features after orthogonal constraints and middle layer features The shallow features and high-level features, after orthogonal constraints, are used together for subsequent feature fusion; the difference compensation features between shallow and mid-level features, and between high-level and mid-level features, are calculated: , ,in, This represents the convolution mapping operation. This represents element-wise absolute value operation; it also represents the shallow features after orthogonal constraints. Mid-layer characteristics High-level characteristics after orthogonal constraints Shallow differential compensation characteristics Features of compensation for differences between high-level and low-level personnel The initial basic feature map is obtained by splicing and fusion. : ,in, This represents the feature concatenation operation along the channel dimension; it applies to shallow features after orthogonal constraints. conduct Convolutional mapping yields color-fidelity features. : Based on the initial basic feature map With color fidelity features The differences between them are used to construct color fidelity offset perceptual features. : ; Color fidelity features Perceptual features of color fidelity offset Channel splicing is performed to obtain color-fidelity splicing features. : ; Color-fidelity splicing features conduct Convolutional mapping and through Live function processing yields color-fidelity adaptive injection weights. : ; Adaptive weight injection using color fidelity Color fidelity features Inject initial basic feature map The enhanced basic feature map is obtained. : ,in, This represents element-wise multiplication; a foreground saliency response is constructed based on the image of the dish to be processed and the high-level features after orthogonal constraints. Among them, the local color contrast response is calculated separately. Texture local contrast response Semantic probability response of dishes : , , ,in, Given the binary classification probabilities of the dish's foreground and background, the foreground probability of the dish is taken as the semantic probability response of the dish: , This indicates the pixel position of the food image to be processed. The color vector at that location, Indicated by The color mean of the neighborhood centered on the center. Representing image gradients; generating foreground saliency responses based on local color contrast response, local texture contrast response, and semantic probability response of the dish: ,in, , , , For fusion weights; calculate the average confidence level of the foreground significance response: ,in, The total number of spatial locations in the image; when the average confidence level... Greater than or equal to the preset threshold At that time, the foreground weighted statistical color is calculated based on the foreground saliency response. : ,in, , To prevent constants with a denominator of zero; when the average confidence level Less than the preset threshold When using the image of the dish to be processed, the global color mean is used as the backtracking statistical color. Based on foreground statistical color Calculate color deviation : The semantic probability response of the dish is used as the feature map for dish recognition: Based on color deviation Prospect significance response Feature mapping for food identification Constructing dish attribute deviation : ,in, , , , These are weighting coefficients; adaptive adjustment parameters are generated based on the global mean of the deviation of dish attributes. : According to the deviation of dish attributes and adaptive adjustment parameters Construct an exponential consistency weight for dish attributes : ;Utilizing exponential consistency weights for dish attributes Enhanced basic feature map Apply feature layer regularization constraints to obtain the constraint-enhanced basic feature map. : ,in, , This is the constraint enhancement coefficient.
[0039] S2. Based on foreground saliency information and constraint-enhanced basic feature maps, construct a confidence distribution map of oil reflection on the surface of dishes;
[0040] Furthermore, in step S2, a confidence distribution map of the oil reflection on the surface of the dish is constructed. Specific steps include:
[0041] Obtain the brightness channel of the image of the dish to be processed. and saturation channel And construct a normalized luminance response based on the luminance channel. : ,in, and These represent the minimum and maximum values in the luminance channel, respectively. , The stability constant is used; based on the difference between the normalized brightness response and the local neighborhood brightness mean, a local brightness abrupt change response is constructed. : ,in, Represented by pixel position Normalized mean brightness response within a local neighborhood centered on the saturation channel; constructing oil color retention response based on the saturation channel. : ,in, and These represent the minimum and maximum values in the saturation channel, respectively. , As a stability constant; based on the normalized brightness response, local brightness abrupt change response, foreground saliency response, and non-food white strong light interference response, an initial high-brightness candidate response is constructed. : ,in, Indicates a salient response. This indicates a normalization operation. The response to strong white light interference from non-food items is calculated as follows: Based on the luminance channel, color vector, foreground saliency response, and initial highlight candidate response, a diffuse reflection estimation map of the dish's foreground perception is constructed. : ,in, Represented by pixel position The local neighborhood centered on, Indicates the pixel position within a local neighborhood. Indicates pixel position The brightness value at that location, Indicates the weights for diffuse reflection estimation. , The stability constant; diffuse reflection estimation weights The criteria for determining the candidate are spatial proximity, color similarity, foreground support, and highlight candidate suppression. ,in, , , Represents spatial proximity weights. Indicates the weight of color similarity. and Representing pixel positions and The color vector at that location, , , and To adjust parameters; based on the brightness channel Diffuse reflection estimation map of foreground perception of food The difference between them is used to construct the specular reflection residual response. : ,in, Indicates pixel position The specular reflection residual relative to the diffuse reflection component of the food surface is obtained; the specular reflection residual response is normalized to obtain the normalized specular reflection residual response. : ,in, and Let represent the minimum and maximum values in the specular reflection residual response, respectively; based on the local continuity of the normalized specular reflection residual response, an oil film continuity response is constructed. : ,in, Represented by pixel position The mean of the normalized specular reflection residual response in the local neighborhood centered on the sphere. , Parameters were adjusted to account for local variations in specular reflection residuals; a smooth response for grease reflection boundaries was constructed based on the gradient response of the brightness channel. : ,in, Indicates the position of the luminance channel at the pixel. gradient at, , These are the parameters for adjusting the brightness gradient. , The stability constant is used as the basis for constructing a confidence distribution map of oil reflection on the surface of a dish, based on the foreground saliency response, normalized specular reflection residual response, oil color retention response, oil film continuity response, oil reflection boundary softening response, and non-dish white strong light interference response. : .
[0042] S3. Based on the brightness channel, local neighborhood brightness difference, foreground saliency information, and constraint-enhanced basic feature map of the dish image to be processed, construct the foreground illumination distribution map of the dish;
[0043] Based on normalized brightness response Calculate the pixel position respectively Local neighborhood brightness difference response in multiple preset directions : ,in, , , Indicates the number of preset directions. Indicates pixel position In the The normalized mean brightness response within each directional neighborhood is used to construct the directional illumination shift intensity based on the local neighborhood brightness difference response in multiple directions. : And determine the direction of the main illumination shift. : Among them, the directional illumination offset intensity is used to represent the pixel position. Compared to the degree of illumination unevenness in multiple directional neighborhoods, the main illumination offset direction is used to represent the direction in which the illumination offset is most significant at that location; based on the normalized brightness response and the average brightness of the neighborhood corresponding to the main illumination offset direction, a local overbrightness response is constructed. and local shadow response : , ,in, Indicates pixel position The degree of local overbrightness relative to the neighborhood of the main illumination offset direction, Indicates pixel position Local shading intensity relative to the neighborhood of the main illumination offset direction; constrained enhancement of basic feature map Constructing Light Type Adjustment Weights : ,in, express Activation function Indicates to Make a Convolutional mapping; adjusting weights based on local overbrightness response, local shadow response, and illumination type to construct a bidirectional illumination offset response. : Based on the local feature gradients of the constrained enhancement base feature map, a response for suppressing the texture edges of dishes is constructed. : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic gradient at that location, , The feature gradient adjustment parameter is used to reduce the probability that the edges of the food texture are misidentified as uneven lighting regions. Based on the directional lighting offset intensity and the local neighborhood brightness difference response in multiple directions, a main direction confidence response is constructed. : ,in, , The stability constant is used; based on the foreground saliency response, directional illumination shift intensity, bidirectional illumination shift response, food texture edge suppression response, and principal direction confidence response, a foreground illumination distribution map of the food is constructed. : ,in, Indicates a salient response. This indicates a normalization operation. Indicates pixel position The response intensity is located in the area of uneven lighting in the foreground of the dish.
[0044] S4. Extract dish recognition features based on the constraint-enhanced basic feature map or the current round of enhanced image, and generate guided update weights based on the dish recognition features; obtain the joint guided map of oil reflection and illumination based on the dish surface oil reflection confidence distribution map and the dish foreground illumination distribution map;
[0045] Furthermore, in step S4, a joint guidance map of oil reflection and illumination is constructed. Specific steps include: based on the confidence distribution map of oil reflection on the food surface. Light distribution map of the foreground of the dishes , build oil-based responsive Oils inhibit photoresponse Combined response of oil and light : , , Oil and light combined response This was used to characterize food regions exhibiting both oil reflectivity and uneven illumination characteristics; the oil retention response was calculated separately. Oils inhibit photoresponse Combined response of oil and light Global statistical strength: , , ,in, This represents the total number of spatial locations in the response graph; grease retention weights are generated based on global statistical strength. Illumination correction weights Combined weighting of oil and light : Constructing an oil retention gating system based on oil retention response and oil-light joint response : ,in, Used to control the participation intensity of the foreground lighting distribution map of dishes in the joint guidance map; based on foreground saliency response and constrained augmentation of basic feature maps Constructing a reliable gating system : ,in, for Function; Based on grease retention gating, illumination correction gating, the confidence distribution map of grease reflection on the food surface, the illumination distribution map of the foreground of the food, and the guidance reliability gating, construct a joint guidance map of grease reflection and illumination. : ,in, This indicates a normalization operation.
[0046] S5. Based on the joint guidance map of grease reflection illumination, color enhancement features and texture enhancement features are obtained;
[0047] Furthermore, in step S5, color enhancement features and texture enhancement features are obtained based on the joint guided map of oil reflection illumination. Specific steps include: based on the luminance channel of the image of the dish to be processed. And convert the food images to be processed to Color space, obtaining chroma channels: ,in, and They represent Two chromaticity components in a color space; constructing a local color shift response based on the chromaticity channels. : ,in, Represented by pixel position The mean chromaticity value within a local neighborhood centered on the value. Representing L2 norm operations; constructing gradient texture responses based on the brightness channel. and local high-frequency texture response : , ,in, Indicates the position of the luminance channel at the pixel. gradient at, Represented by pixel position Mean brightness within a local neighborhood centered on the target; constrained enhancement of the basic feature map chroma channel and local color shift response Construct initial color branch features : ,in, Represents the concatenation operation along the channel dimension; constrained enhancement of the basic feature map. Gradient texture response and local high-frequency texture response Construct initial texture branch features : Constraint-enhanced basic feature maps 1. Reliability distribution map of oil reflection on food surface Combined guidance diagram of oil reflection and light illumination and normalized specular reflection residual response Constructing initial glossy texture branch features : ;Guided by combined guidance map based on oil reflection light Credibility distribution map of oil reflection on food surface Construct a color-fidelity gating system : ,in, , , and Adjust parameters to ensure color fidelity; based on the foreground lighting distribution map of the dish. Combined guidance diagram with oil and grease reflection light Constructing a texture recovery gating system : ,in, , , and Adjust parameters for texture restoration; based on the confidence distribution map of oil reflection on the surface of the dish. Building a glossy finish and maintaining gate control : ,in, , , and The parameters for adjusting the glossy texture are as follows: The initial color branch characteristics are adjusted based on the color fidelity gating to obtain the color fidelity adjustment characteristics. : ,in, , This is the color adjustment factor. This represents element-wise multiplication; the initial texture branch features are adjusted according to the texture restoration gating to obtain the texture restoration adjustment features. : ,in, , Texture adjustment coefficient; based on the joint guidance map of oil reflection and illumination, the confidence distribution map of oil reflection on the surface of the dish, and the illumination distribution map of the foreground of the dish, a color, texture, and gloss texture synergistic balance factor is constructed. : Based on the color, texture, and gloss balance factor, color fidelity adjustment features, texture restoration adjustment features, and gloss adjustment features are synergistically compensated to obtain color enhancement features. and texture enhancement features : , ,in, , , and These are the collaborative compensation coefficients for glossy texture on color enhancement features and texture enhancement features, respectively. Indicates color enhancement features, This indicates a texture enhancement feature.
[0048] S6. Based on the joint guidance map of oil reflection and illumination, color enhancement features are fused to generate the enhanced image of the current round, and iteratively updated until the preset stopping condition is met, and the final dish image is output.
[0049] Furthermore, in step S4, a joint guidance map of grease reflection and illumination is constructed. The specific steps include: based on the joint guidance map of grease reflection and illumination... Enhanced color features and texture enhancement features Guided fusion is performed to obtain joint color and texture enhancement features. : ,in, Represents element-wise multiplication; based on the confidence distribution map of oil reflection on the surface of dishes. Light distribution map of the foreground of the dishes Constructing a residual gating system for oil protection : Let the preprocessed image of the dish to be processed be the initial enhanced image. In the In the round of iteration, the enhanced image of the previous round is represented as ; Color and texture joint enhancement features Constraint-enhanced basic feature map Compared to the previous round of image enhancement Construct the enhanced residual features for the current round : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic response at that location, This indicates the pixel location of the image from the previous enhancement round. The pixel value at that location; based on the current iteration round. Constructing an enhanced step size decay coefficient : ,in, , Indicates the initial enhancement step size. , This represents the step size decay adjustment parameter; it generates the residual image for the current round based on the enhanced residual characteristics of the current round. : ,in, Represents a hyperbolic tangent nonlinear mapping; based on the image enhancement from the previous round. Enhance step size decay coefficient and the residual image of the current round Generate the enhanced image for the current round. : , among which, when At that time, let the initial enhanced image The image shows the preprocessed food image to be processed; the iterative update stops when any of the following preset stopping conditions are met: ,in, , This indicates the threshold for stabilizing image changes, or ,in, , Indicates the maximum number of iterations; the enhanced image of the current round obtained when the preset stopping condition is met. The final enhanced image of the dish .
[0050] The above are merely preferred embodiments of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the inventive concept of the present invention, and these all fall within the protection scope of the present invention.
Claims
1. An image enhancement method based on the combined guidance of food oil reflection and illumination, characterized in that, Includes the following steps: S1. Obtain the image of the dish to be processed and perform preprocessing. Extract features from the preprocessed image. Reduce the redundant correlation between features at different levels by using hierarchical feature orthogonal projection constraints. The hierarchical features after orthogonal constraints are subjected to difference compensation fusion and color fidelity adaptive injection to obtain an enhanced basic feature map; an exponential dish attribute consistency weight is constructed based on the dish attribute deviation, and the exponential dish attribute consistency weight is used to apply feature layer regularization constraints to the enhanced basic feature map to obtain a constrained enhanced basic feature map. S2. Based on foreground saliency information and constraint-enhanced basic feature maps, construct a confidence distribution map of oil reflection on the surface of dishes; S3. Based on the brightness channel, local neighborhood brightness difference, foreground saliency information, and constraint-enhanced basic feature map of the dish image to be processed, construct the foreground illumination distribution map of the dish; S4. Based on the constraint-enhanced basic feature map, and generate guided update weights according to the dish recognition features; Based on the confidence distribution map of oil reflection on the surface of the dish and the illumination distribution map of the foreground of the dish, a joint guidance map of oil reflection illumination is obtained; The method of combined guidance mapping based on oil reflection and illumination includes: a confidence distribution map of oil reflection on the surface of the dish. Light distribution map of the foreground of the dishes , build oil-based responsive Oils inhibit photoresponse Combined response of oil and light : , , Oil and light combined response This was used to characterize food regions exhibiting both oil reflectivity and uneven illumination characteristics; the oil retention response was calculated separately. Oils inhibit photoresponse Combined response of oil and light Global statistical strength: , , ,in, This represents the total number of spatial locations in the response graph; grease retention weights are generated based on global statistical strength. Illumination correction weights Combined weighting of oil and light : Constructing an oil retention gating system based on oil retention response and oil-light joint response : ,in, Used to control the participation intensity of the foreground lighting distribution map of dishes in the joint guidance map; based on foreground saliency response and constrained augmentation of basic feature maps Constructing a reliable gating system : ,in, for Function; Based on grease retention gating, illumination correction gating, the confidence distribution map of grease reflection on the food surface, the illumination distribution map of the foreground of the food, and the guidance reliability gating, construct a joint guidance map of grease reflection and illumination. : ,in, This indicates a normalization operation; S5. Based on the joint guidance map of grease reflection illumination, color enhancement features and texture enhancement features are obtained; S6. Based on the joint guidance map of oil reflection and illumination, color enhancement features and texture enhancement features are fused to generate the enhanced image of the current round, and iteratively updated until the preset stopping condition is met, and the final dish image is output.
2. The image enhancement method based on the combined guidance of food oil reflection and illumination as described in claim 1, characterized in that, The method for obtaining the constraint-enhanced basic feature map in step S1 includes: extracting features from the preprocessed image of the dish to be processed. The multi-layer feature extraction network is a Swin Transformer network, which includes a Patch Embedding module and Stage1, Stage2, Stage3 and Stage4 connected in sequence. Taken from the output of Stage 1 Taken from the output of Stage2 Taken from the output of Stage 3; using mid-level features The spatial scale is the target scale, for shallow features Downsampling is performed to obtain scale-aligned shallow features. and characteristics of high-level personnel Upsampling is performed to obtain scale-aligned high-level features. Shallow features after scale alignment Mid-layer characteristics High-level features after scale alignment The hierarchical feature matrix is obtained by flattening and normalizing the matrix. , and : ,in, , Indicates the flattening operation. This represents the normalization operation; a hierarchical feature orthogonal projection constraint function is constructed to weaken the redundant projection components of shallow and high-level features that are related to mid-level features; where the related projection components of shallow features relative to mid-level features are represented as: The correlation projection components of high-level features relative to mid-level features are represented as follows: Based on the relevant projection components, the shallow and high-level feature matrices after orthogonal constraints are obtained respectively: , ,in, As a stable term, It is the identity matrix. and The projection weakening coefficient is used to transform the shallow feature matrix after orthogonal constraints. and high-level feature matrix Restored to a spatial feature map, yielding shallow features after orthogonal constraints. High-level features after orthogonal constraints and middle layer features The shallow features and high-level features, after orthogonal constraints, are used together for subsequent feature fusion; the difference compensation features between shallow and mid-level features, and between high-level and mid-level features, are calculated: , ,in, This represents the convolution mapping operation. This represents element-wise absolute value operation; it also represents the shallow features after orthogonal constraints. Mid-layer characteristics High-level characteristics after orthogonal constraints Shallow differential compensation characteristics Features of compensation for differences between high-level and low-level personnel The initial basic feature map is obtained by splicing and fusion. : ,in, This represents the feature concatenation operation along the channel dimension; it applies to shallow features after orthogonal constraints. conduct Convolutional mapping yields color-fidelity features. : Based on the initial basic feature map With color fidelity features The differences between them are used to construct color fidelity offset perceptual features. : ; Color fidelity features Perceptual features of color fidelity offset Channel splicing is performed to obtain color-fidelity splicing features. : ; Color-fidelity splicing features conduct Convolutional mapping and through Activation function processing yields color-fidelity adaptive injection weights. : ,in, express Activation function; color-fidelity-based adaptive weight injection Color fidelity features Inject initial basic feature map The enhanced basic feature map is obtained. : ,in, This represents element-wise multiplication; a foreground saliency response is constructed based on the image of the dish to be processed and the high-level features after orthogonal constraints. Among them, the local color contrast response is calculated separately. Texture local contrast response Semantic probability response of dishes : , , ,in, Given the binary classification probabilities of the dish's foreground and background, the foreground probability of the dish is taken as the semantic probability response of the dish: , This indicates the pixel position of the food image to be processed. The color vector at that location, Indicated by The color mean of the neighborhood centered on the center. Representing image gradients; generating foreground saliency responses based on local color contrast response, local texture contrast response, and semantic probability response of the dish: ,in, For fusion weights; calculate the average confidence level of the foreground significance response: ,in, The total number of spatial locations in the image; when the average confidence level... Greater than or equal to the preset threshold At that time, the foreground weighted statistical color is calculated based on the foreground saliency response. : ,in, To prevent constants with a denominator of zero; when the average confidence level Less than the preset threshold When using the image of the dish to be processed, the global color mean is used as the backtracking statistical color. Based on foreground statistical color Calculate color deviation : The semantic probability response of the dish is used as the feature map for dish recognition: Based on color deviation Prospect significance response Feature mapping for food identification Constructing dish attribute deviation : ,in, These are weighting coefficients; adaptive adjustment parameters are generated based on the global mean of the deviation of dish attributes. : According to the deviation of dish attributes and adaptive adjustment parameters Construct an exponential consistency weight for dish attributes : ; Index-based consistency weight of dish attributes Enhanced basic feature map Apply feature layer regularization constraints to obtain the constraint-enhanced basic feature map. : ,in, This is the constraint enhancement coefficient.
3. The image enhancement method based on the combined guidance of food oil reflection and illumination as described in claim 1, characterized in that, The method for constructing the confidence distribution map of oil reflection on the surface of the dish in step S2 includes: obtaining the brightness channel of the image of the dish to be processed. and saturation channel And construct a normalized luminance response based on the luminance channel. : ,in, and These represent the minimum and maximum values in the luminance channel, respectively. To prevent constants with zero denominators, a local brightness abrupt response is constructed based on the difference between the normalized brightness response and the local neighborhood brightness mean. : ,in, Represented by pixel position Normalized mean brightness response within a local neighborhood centered on the saturation channel; constructing oil color retention response based on the saturation channel. : ,in, and These represent the minimum and maximum values in the saturation channel, respectively. Based on the normalized brightness response, local brightness abrupt change response, foreground saliency response, and non-food white strong light interference response, initial high-brightness candidate responses are constructed. : ,in, Indicates a salient response. This indicates a normalization operation. The response to strong white light interference, which does not refer to food items, is calculated as follows: Based on the luminance channel, color vector, foreground saliency response, and initial highlight candidate response, a diffuse reflection estimation map of the dish's foreground perception is constructed. : ,in, Represented by pixel position The local neighborhood centered on, Indicates the pixel position within a local neighborhood. Indicates pixel position The brightness value at that location, Indicates the diffuse reflection estimation weight; diffuse reflection estimation weight The criteria for determining the candidate are spatial proximity, color similarity, foreground support, and highlight candidate suppression. ,in, , , Represents spatial proximity weights. Indicates the weight of color similarity. and Representing pixel positions and The color vector at that location, and To adjust parameters; based on the brightness channel Diffuse reflection estimation map of foreground perception of food The difference between them is used to construct the specular reflection residual response. : ,in, Indicates pixel position The specular reflection residual relative to the diffuse reflection component of the food surface is obtained; the specular reflection residual response is normalized to obtain the normalized specular reflection residual response. : ,in, and Let represent the minimum and maximum values in the specular reflection residual response, respectively; based on the local continuity of the normalized specular reflection residual response, an oil film continuity response is constructed. : ,in, Represented by pixel position The mean of the normalized specular reflection residual response within the local neighborhood centered on the sphere. Parameters were adjusted to account for local variations in specular reflection residuals; a smooth response for grease reflection boundaries was constructed based on the gradient response of the brightness channel. : ,in, Indicates the position of the luminance channel at the pixel. gradient at, The brightness gradient adjustment parameters are used; based on the foreground saliency response, normalized specular reflection residual response, oil color retention response, oil film continuity response, oil reflection boundary softening response, and non-food white strong light interference response, a confidence distribution map of oil reflection on the food surface is constructed. : .
4. The image enhancement method based on the combined guidance of food oil reflection and illumination as described in claim 1, characterized in that, The method for constructing the foreground lighting distribution map of the dish in step S3 includes: based on normalized brightness response. Calculate the pixel position respectively Local neighborhood brightness difference response in multiple preset directions : ,in, , Indicates the number of preset directions. Indicates pixel position In the The normalized mean brightness response within each directional neighborhood is used to construct the directional illumination shift intensity based on the local neighborhood brightness difference response in multiple directions. : And determine the direction of the main illumination shift. : Among them, the directional illumination offset intensity is used to represent the pixel position. Compared to the degree of illumination unevenness in multiple directional neighborhoods, the main illumination offset direction is used to represent the direction in which the illumination offset is most significant at that location; based on the normalized brightness response and the average brightness of the neighborhood corresponding to the main illumination offset direction, a local overbrightness response is constructed. and local shadow response : , ,in, Indicates pixel position The degree of local overbrightness relative to the neighborhood of the main illumination offset direction, Indicates pixel position Local shading intensity relative to the neighborhood of the main illumination offset direction; constrained enhancement of basic feature map Constructing Light Type Adjustment Weights : ,in, express Activation function Indicates to Make a Convolutional mapping; adjusting weights based on local overbrightness response, local shadow response, and illumination type to construct a bidirectional illumination offset response. : Based on the local feature gradients of the constrained enhancement base feature map, a response for suppressing the texture edges of dishes is constructed. : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic gradient at that location, To prevent constants with a denominator of zero, The feature gradient adjustment parameter is used to reduce the probability that the edges of the food texture are misidentified as uneven lighting regions. Based on the directional lighting offset intensity and the local neighborhood brightness difference response in multiple directions, a main direction confidence response is constructed. : Based on the foreground saliency response, directional illumination shift intensity, bidirectional illumination shift response, food texture edge suppression response, and principal direction confidence response, a foreground illumination distribution map of the food is constructed. : ,in, Indicates a salient response. This indicates a normalization operation. Indicates pixel position The response intensity is located in the area of uneven lighting in the foreground of the dish.
5. The image enhancement method based on the combined guidance of food oil reflection and illumination as described in claim 1, characterized in that, The methods for obtaining color enhancement features and texture enhancement features in step S5 include: based on the luminance channel of the image of the dish to be processed. And convert the food images to be processed to Color space, obtaining chroma channels: ,in, and They represent Two chromaticity components in a color space; constructing a local color shift response based on the chromaticity channels. : ,in, Represented by pixel position The mean chromaticity value within a local neighborhood centered on the value. Representing L2 norm operations; constructing gradient texture responses based on the brightness channel. and local high-frequency texture response : , ,in, Indicates the position of the luminance channel at the pixel. gradient at, Represented by pixel position Mean brightness within a local neighborhood centered on the target; constrained enhancement of the basic feature map chroma channel and local color shift response Construct initial color branch features : ,in, Represents the concatenation operation along the channel dimension; constrained enhancement of the basic feature map. Gradient texture response and local high-frequency texture response Construct initial texture branch features : Constraint-enhanced basic feature maps 1. Reliability distribution map of oil reflection on food surface Combined guidance diagram of oil reflection and light illumination and normalized specular reflection residual response Constructing initial glossy texture branch features : ;Guided by combined guidance map based on oil reflection light Credibility distribution map of oil reflection on food surface Construct a color-fidelity gating system : ,in, and Adjust parameters to ensure color fidelity; based on the foreground lighting distribution map of the dish. Combined guidance diagram with oil and grease reflection light Constructing a texture recovery gating system : ,in, and Adjust parameters for texture restoration; based on the confidence distribution map of oil reflection on the surface of the dish. Building a glossy finish and maintaining gate control : ,in, and The parameters for adjusting the glossy texture are as follows: The initial color branch characteristics are adjusted based on the color fidelity gating to obtain the color fidelity adjustment characteristics. : ,in, This is the color adjustment factor. This represents element-wise multiplication; the initial texture branch features are adjusted according to the texture restoration gating to obtain the texture restoration adjustment features. : ,in, The texture adjustment coefficient is used; based on the joint guidance map of oil reflection and illumination, the confidence distribution map of oil reflection on the surface of the dish, and the illumination distribution map of the foreground of the dish, a color, texture, and glossy texture synergistic balance factor is constructed. : Based on the color, texture, and gloss balance factor, color fidelity adjustment features, texture restoration adjustment features, and gloss adjustment features are synergistically compensated to obtain color enhancement features. and texture enhancement features : , ,in, and These are the collaborative compensation coefficients for glossy texture on color enhancement features and texture enhancement features, respectively. Indicates color enhancement features, This indicates a texture enhancement feature.
6. The image enhancement method based on the combined guidance of food oil reflection and illumination as described in claim 1, characterized in that, In step S6, the enhancement image for the current round is generated by fusing color enhancement features, texture enhancement features, and constraint enhancement base feature maps based on the joint guidance map of oil reflection and illumination, and iteratively updated until a preset stopping condition is met, outputting the final enhanced dish image. This process includes: using the joint guidance map of oil reflection and illumination. Enhanced color features and texture enhancement features Guided fusion is performed to obtain joint color and texture enhancement features. : ,in, Represents element-wise multiplication; based on the confidence distribution map of oil reflection on the surface of dishes. Light distribution map of the foreground of the dishes Constructing a residual gating system for oil protection : Let the preprocessed image of the dish to be processed be the initial enhanced image. In the In the round of iteration, the enhanced image of the previous round is represented as ; Color and texture joint enhancement features Constraint-enhanced basic feature map Compared to the previous round of image enhancement Construct the enhanced residual features for the current round : ,in, This indicates that the constraint-enhanced basic feature map is located at the pixel position. The characteristic response at that location, This indicates the pixel location of the image from the previous enhancement round. The pixel value at that location; based on the current iteration round. Constructing an enhanced step size decay coefficient : ,in, Indicates the initial enhancement step size. This represents the step size decay adjustment parameter; it generates the residual image for the current round based on the enhanced residual characteristics of the current round. : ,in, Represents a hyperbolic tangent nonlinear mapping; based on the image enhancement from the previous round. Enhance step size decay coefficient and the residual image of the current round Generate the enhanced image for the current round. : , among which, when At that time, let the initial enhanced image The image shows the preprocessed food image to be processed; the iterative update stops when any of the following preset stopping conditions are met: ,in, This represents the threshold for stabilizing image changes, or ,in, Indicates the maximum number of iterations; the enhanced image of the current round obtained when the preset stopping condition is met. The final enhanced image of the dish .
Citation Information
Patent Citations
High-precision image processing method and system based on illumination adaptive compensation
CN121032846A
Low-illumination image enhancement method based on illumination-reflection decomposition and multiple discriminators
CN122115224A