Area cropping method and device for photographed picture
Patent Information
- Application Number
- CN202511442065.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-10
- Publication Date
- 2026-10-13
AI Technical Summary
[0002]随着科技的发展,拍摄设备用于拍摄目标物体,并输出已拍摄图片,该已拍摄图片含有目标物体和对应的场景,在现有技术中,根据已拍摄图片的识别而确定图片内容,同时,补光灯对该已拍摄图片会形成高亮区域,沿着该高亮区域的外边缘进行裁剪,忽略了亮影响因素和高亮区域的RGB数据组合,导致区域裁剪部分的精准性较低,影响了区域裁剪部分的精细管控
在本发明实施例中,通过本发明实施例中的方法,基于高亮区域的区域形态和已拍摄图片的场景内容确定对应的高亮影响因素,根据高亮影响因素、补光灯与拍照设备之间的协同拍摄数据组合和高亮区域的RGB数据组合预测区域裁剪部分,引入了已拍摄图片的场景内容,兼容了亮影响因素、补光灯与拍照设备之间的协同拍摄数据组合和高亮区域的RGB数据组合的整体考虑,提高了区域裁剪部分的精准性。
Smart Images

Figure CN122906360A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of region cropping methods, and more particularly to a method and apparatus for cropping regions of already captured images. Background Technology
[0002] With the development of technology, shooting devices are used to capture target objects and output captured images. These captured images contain the target object and the corresponding scene. In existing technologies, the image content is determined based on the recognition of the captured image. At the same time, the supplementary light will form a bright area in the captured image, and cropping is performed along the outer edge of the bright area. However, the brightness influencing factors and the RGB data combination of the bright area are ignored, resulting in low accuracy of the area cropping and affecting the fine control of the area cropping. Summary of the Invention
[0003] The purpose of this invention is to overcome the shortcomings of the prior art. This invention provides a method and apparatus for cropping regions of captured images.
[0004] This invention provides a method for cropping a region of a captured image, comprising: The camera takes pictures with the help of a fill light, and determines the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; Based on the identification of the scene area of the photographed object, the features of the photographed object and multiple scene features are determined. Based on the features of the photographed object, multiple scene features and the image form of the photographed image, the scene content of the photographed image is determined. Based on the regional shape of the highlighted area and the scene content of the captured image, the corresponding highlight influencing factors are determined. Based on the highlight influencing factors, the combination of collaborative shooting data between the fill light and the shooting device, and the combination of RGB data of the highlighted area, the area to be cropped is predicted. Multiple sub-cropping regions are determined based on the identification of the cropped portion of the region. The cropping level of the sub-cropping region is determined based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region. The region cropping process table is determined based on the cropping level of each sub-cropping region and the overall shape of the region cropping part. Based on the identification of the region cropping process table, multiple region cropping items and corresponding region cropping sequences are determined. The final cropping region and highly correlated retention region are determined based on the multiple region cropping items, the corresponding region cropping sequences and the characteristics of the photographed object.
[0005] This invention provides a region cropping device for a captured image, which is applied to the aforementioned region cropping method for captured images. The region cropping device for the captured image includes: The area module is used by the camera device to take pictures with the help of the fill light, and to determine the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; The scene module is used to determine the features of the photographed object and multiple scene features based on the recognition of the scene area of the photographed object, and to determine the scene content of the photographed image based on the features of the photographed object, multiple scene features and the image form of the photographed image; The prediction module is used to determine the corresponding highlight influencing factors based on the region shape of the highlight area and the scene content of the captured image. It predicts the region to be cropped based on the highlight influencing factors, the combined shooting data between the fill light and the camera, and the RGB data combination of the highlight area. The cropping level module is used to determine multiple sub-cropping regions based on the identification of the cropped portion of the region. The cropping level of the sub-cropping region is determined based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region. The final cropping area module is used to determine the cropping process table based on the cropping level of each sub-cropping area and the overall shape of the cropped area. Based on the recognition of the cropping process table, multiple cropping items and corresponding cropping sequences are determined. The final cropping area and highly relevant retention area are determined based on the multiple cropping items, the corresponding cropping sequences, and the characteristics of the photographed object.
[0006] Compared with the prior art, the beneficial effects of the present invention are: In this embodiment of the invention, the method determines the corresponding highlight influencing factors based on the region shape of the highlight area and the scene content of the captured image. The region cropping part is predicted based on the highlight influencing factors, the collaborative shooting data combination between the fill light and the shooting device, and the RGB data combination of the highlight area. The scene content of the captured image is introduced, which is compatible with the overall consideration of the highlight influencing factors, the collaborative shooting data combination between the fill light and the shooting device, and the RGB data combination of the highlight area, thus improving the accuracy of the region cropping part.
[0007] Therefore, multiple sub-cropping regions are identified based on the recognition of the cropped area. The cropping level of each sub-cropping region is determined based on the RGB data combination of each sub-cropping region, the RGB data variation between two adjacent sub-cropping regions, and the regional shape of the sub-cropping region. A regional cropping process table is determined based on the cropping level of each sub-cropping region and the overall shape of the cropped area. Multiple regional cropping items and their corresponding cropping sequences are determined based on the recognition of the regional cropping process table. The final cropped area and highly correlated retention area are determined based on the multiple regional cropping items, their corresponding cropping sequences, and the characteristics of the photographed object. By introducing the cropping level and regional cropping process table of the sub-cropping region, the overall consideration of multiple regional cropping items, their corresponding cropping sequences, and the characteristics of the photographed object is achieved, improving the accuracy of the final cropped area and the highly correlated retention area, and realizing fine control of the regional cropping part. Attached Figure Description
[0008] Figure 1 This is a flowchart illustrating the method for cropping regions of captured images in an embodiment of the present invention. Figure 2 This is a flowchart illustrating step S11 of the method for cropping regions of captured images in an embodiment of the present invention. Figure 3 This is a flowchart illustrating step S12 in the method for cropping regions of captured images in an embodiment of the present invention. Figure 4 This is a flowchart illustrating step S13 of the method for cropping regions of captured images in an embodiment of the present invention. Figure 5 This is a flowchart illustrating step S14 of the method for cropping regions of captured images in an embodiment of the present invention. Figure 6 This is a flowchart illustrating step S15 of the method for cropping regions of captured images in an embodiment of the present invention. Figure 7 This is a schematic diagram of the structural composition of the region cropping device for captured images in an embodiment of the present invention. Detailed Implementation
[0009] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
[0010] Please see Figures 1 to 7 A method for cropping regions of already captured images, applied to region cropping scenarios; the method for cropping regions of already captured images includes: Step S11: The camera takes a picture with the help of a fill light, and determines the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; Step S12: Based on the identification of the scene area of the photographed object, determine the features of the photographed object and multiple scene features, and determine the scene content of the photographed image based on the features of the photographed object, multiple scene features and the image form of the photographed image; Step S13: Based on the region shape of the highlighted area and the scene content of the captured image, determine the corresponding highlight influencing factors, and predict the region to be cropped based on the highlight influencing factors, the combined shooting data between the fill light and the camera, and the RGB data combination of the highlighted area. Step S14: Based on the identification of the cropped portion of the region, determine multiple sub-cropping regions, and determine the cropping level of the sub-cropping region based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region; Step S15: Determine the region cropping process table based on the cropping level of each sub-cropping region and the overall shape of the region cropping part. Based on the identification of the region cropping process table, determine multiple region cropping items and corresponding region cropping sequences. Based on the multiple region cropping items, corresponding region cropping sequences, and the characteristics of the photographed object, determine the final cropping region and the highly correlated retention region.
[0011] refer to Figure 2 In step S11, the specific steps are as follows: S111: The fill light provides supplementary lighting to the location captured by the camera, the camera takes a picture of the location, and outputs the corresponding captured image. The corresponding area division mode is determined based on the captured image, the fill light data, and the environmental scene of the location captured by the camera. S112: Determine the region division path and corresponding division content based on the detection of the region division mode. Determine multiple sub-regions based on the region division path and the captured images. Determine the corresponding highlight area and the scene area of the captured object based on the region position, corresponding region shape and division content of each sub-region.
[0012] In the embodiments of this application, the fill light provides supplementary lighting to the location captured by the camera, the camera takes a picture of the location, and outputs the corresponding captured image. The corresponding area division mode is determined based on the captured image, the fill light data, and the environmental scene of the location captured by the camera. This takes into account the overall consideration of the captured image, the fill light data, and the environmental scene of the location captured by the camera, ensuring the accuracy of the corresponding area division mode.
[0013] At this time, the fill light adjusts the light intensity, angle, and color temperature according to preset parameters or real-time ambient light detection results; the fill light strategy can be uniform fill light, directional fill light, or dynamic adjustment fill light; there is a synchronization mechanism between the fill light and the shooting device to ensure that the timing of fill light and shooting is matched; at the same time, the shooting device adjusts the exposure parameters (shutter speed, aperture, ISO) according to the fill light conditions; multi-frame shooting technology, such as HDR (high dynamic range) synthesis, may be used; the output image contains the original image data and related shooting metadata.
[0014] Based on the captured images, supplementary lighting data, and the environmental scene at the location captured by the camera, the corresponding region division mode is determined. The captured images are analyzed, including feature extraction such as image brightness distribution, contrast, and edge density. Supplementary lighting data is analyzed, including supplementary lighting intensity distribution, illumination uniformity, and color temperature consistency. Scene type is identified through image content (such as industrial products, natural scenes, documents, etc.). Based on the above analysis, the most suitable division mode is selected from a variety of preset modes.
[0015] Furthermore, based on the detection of the region division pattern, the region division path and corresponding division content are determined. Multiple sub-regions are determined based on the region division path and the captured images. Based on the region position, corresponding region shape and division content of each sub-region, the corresponding highlight area and the scene area of the captured object are determined. This takes into account the overall consideration of the region position, corresponding region shape and division content of each sub-region, ensuring the accuracy of the corresponding highlight area and scene area of the captured object.
[0016] At this point, the region partitioning path refers to the geometric path of image segmentation, which can be a straight line, a curve, or a polygonal boundary; the partitioning content defines the image feature types and attributes that each region should contain; the path generation algorithm considers features such as image gradient, texture, and color distribution; the partitioning content may include classifications such as "highly reflective regions," "densely textured regions," and "uniform regions"; simultaneously, the sub-region determination process applies the partitioning path to the actual image to generate specific region segments; image segmentation algorithms are used, such as the watershed algorithm, region growing, or graph cut algorithm; each sub-region has a unique identifier and boundary coordinates; there may be overlaps or gaps between sub-regions, requiring further processing.
[0017] Based on the location, shape, and content of each sub-region, the corresponding highlight region and the scene region are determined. The location analysis considers the relative position and absolute coordinates of the sub-region in the image; the shape analysis includes geometric features such as shape complexity, area, perimeter, and circularity; the content of the division and the shape features are combined to determine whether the region meets the definition of a highlight region or a scene region; a machine learning classifier is used to perform the final classification of the region.
[0018] refer to Figure 3 In step S12, the specific steps are as follows: S121: Collect the scene area of the object being photographed, determine multiple parts to be identified based on the detection of the scene area of the object being photographed, determine the object features and multiple scene features based on the position, corresponding shape and regional content of the scene area of the object being photographed. At this time, the object features are located at the center of the multiple scene features, and the multiple scene features are arranged around the object features in different directions. S122: Determine the scene transition part based on the characteristics of the photographed object and the image form of the photographed image. Based on the scene transition part and the feature positions of multiple scene features, determine the scene-related content of multiple scene features. Based on the scene-related content of multiple scene features, the feature forms of multiple scene features, and the image form of the photographed image, determine the scene content of the photographed image.
[0019] In the embodiments of this application, a scene area of the photographed object is collected, and multiple parts to be identified are determined based on the detection of the scene area of the photographed object. The photographed object features and multiple scene features are determined based on the position, corresponding shape, and regional content of the scene area of the photographed object. At this time, the photographed object features are located at the center of the multiple scene features, and the multiple scene features are arranged around the photographed object features along different directions. This takes into account the overall consideration of the position, corresponding shape, and regional content of the multiple parts to be identified and ensures the accuracy of the photographed object features and multiple scene features.
[0020] At this point, the scene area of the photographed object is acquired, and pixel data is extracted from the scene area of the photographed object determined in step S112; the extracted area is subjected to noise reduction, enhancement, and standardization processing; the area boundary is precisely adjusted to ensure that all relevant content is included; the content within the area is preliminarily classified to prepare for subsequent analysis; simultaneously, the area segmentation algorithm is used: watershed, watershed, or deep learning-based segmentation algorithm is employed; key feature points and interest points within the area are identified; pixel connectivity is analyzed to determine independent parts; and the boundary of each part to be identified is precisely determined.
[0021] Based on the location, corresponding shape, and regional content of the scene area of the multiple parts to be identified, the features of the photographed object and multiple scene features are determined. The centroid position and relative positional relationship of each part to be identified are calculated. The shape features of each part are extracted, including area, perimeter, roundness, and rectangularity. The functional attributes and semantic content of each part are analyzed. Feature classification: Based on the analysis results of position, shape, and content, the parts to be identified are classified into features of the photographed object and features of the scene.
[0022] Verify whether the features of the photographed object are indeed located at the center of the scene features; analyze the spatial distribution of scene features relative to the features of the photographed object; calculate the directional angle of each scene feature relative to the features of the photographed object; identify the spatial distribution pattern of scene features, such as radial, circular, grid-like, etc.
[0023] Furthermore, the scene transition section is determined based on the characteristics of the subject and the image form of the captured image. Based on the scene transition section and the feature positions of multiple scene features, the scene-related content of multiple scene features is determined. Based on the scene-related content of multiple scene features, the feature forms of multiple scene features, and the image form of the captured image, the scene content of the captured image is determined. This comprehensive consideration of the scene-related content of multiple scene features, the feature forms of multiple scene features, and the image form of the captured image ensures the accuracy of the scene content of the captured image.
[0024] At this point, the overall image's shape, proportions, composition, and visual center of gravity are analyzed; the boundary contours of the photographed object's features are accurately identified; transition areas between the photographed object's features and the surrounding scene are detected; the gradation characteristics, texture changes, and color transitions of the transition areas are analyzed; simultaneously, based on the transition parts of the scene and the feature positions of multiple scene features, the scene association content of multiple scene features is determined, and the positions of the scene features in the image coordinate system are accurately mapped; the relationship type between each scene feature and the transition part is analyzed; the association strength between the scene features and the photographed object's features is calculated; and specific association content is defined according to the association strength and relationship type.
[0025] The process involves integrating and classifying the associated content of all scene features; fusing the morphological features of each scene feature to form an overall morphological description; matching and verifying the fused features with the overall image morphology; and generating a complete scene content description, including structural and functional relationships.
[0026] refer to Figure 4 In step S13, the specific steps are as follows: S131: Collect the highlighted area, and determine the corresponding area shape based on the identification of the highlighted area. Based on the area location of the highlighted area, the corresponding area shape, and the scene content of the captured image, determine the scene influence combination. Based on the scene influence combination, the feature shape of the photographed object, and the image shape of the captured image, determine the corresponding highlight influencing factors. S132: Based on the tracing of the captured images, determine the collaborative shooting data combination between the fill light and the camera, and determine the first area cropping combination according to the high brightness influencing factors and the collaborative shooting data combination between the fill light and the camera. S133: Simultaneously, based on the brightness detection of the bright area, the RGB data combination of the bright area is collected, and the second region clipping combination is determined according to the RGB data combination of the bright area and the bright area influencing factors; the first region clipping combination, the second region clipping combination and the predicted bright area are used to clip the part.
[0027] In the embodiments of this application, a highlighted area is collected, and the corresponding area shape is determined based on the identification of the highlighted area. A scene influence combination is determined based on the area location of the highlighted area, the corresponding area shape, and the scene content of the captured image. The corresponding highlight influencing factors are determined based on the scene influence combination, the feature shape of the photographed object, and the image shape of the captured image. This approach takes into account the overall consideration of the scene influence combination, the feature shape of the photographed object, and the image shape of the captured image, ensuring the accuracy of the corresponding highlight influencing factors.
[0028] At this point, pixel data is extracted from the highlighted areas identified in step S112; threshold segmentation, edge detection, or machine learning algorithms are used to identify the highlighted areas; morphological operations (such as erosion and dilation) are applied to optimize the region boundaries; morphological parameters such as area, perimeter, circularity, and rectangularity of the regions are calculated; simultaneously, the relative positions and distances between highlighted areas are calculated; the morphological similarity and consistency of multiple highlighted areas are evaluated; the highlighted areas are associated with semantic information in the scene content; and the weights of each influencing factor are calculated based on position, shape, and scene content.
[0029] Analyze the shape, size, orientation, and other characteristics of the photographed object; analyze the composition, proportion, visual center of gravity, and other characteristics of the overall image; combine scene influences with the characteristics of the photographed object and the image shape for comprehensive calculation; and generate a set of highlight influencing factors parameters containing multiple dimensions.
[0030] Furthermore, based on the tracing of already captured images, the collaborative shooting data combination between the fill light and the camera is determined. The first area cropping combination is determined according to the high brightness influencing factors and the collaborative shooting data combination between the fill light and the camera, which takes into account the overall consideration of the high brightness influencing factors and the collaborative shooting data combination between the fill light and the camera, ensuring the accuracy of the first area cropping combination.
[0031] At this point, shooting parameters are extracted from the EXIF information of the captured images; communication records between the fill light and the camera are queried; the timing relationship between fill light flash and camera shutter triggering is analyzed; based on the above data, collaborative shooting parameters are calculated, including light intensity, angle, timing, etc.; simultaneously, weights are assigned to different parameters according to highlight influencing factors; collaborative shooting data is mapped to the cropping parameter space; cropping parameters are calculated based on the influencing factor weights and collaborative data mapping; and a combination containing parameters such as cropping position, size, and shape is generated.
[0032] Therefore, simultaneously, based on the brightness detection of the bright areas, RGB data combinations of the bright areas are collected, and a second region cropping combination is determined according to the RGB data combinations of the bright areas and the factors affecting brightness. Based on the first region cropping combination, the second region cropping combination, and the predicted region cropping part of the bright areas, the overall consideration of the RGB data combinations of the bright areas and the factors affecting brightness is taken into account, ensuring the accuracy of the second region cropping combination. At the same time, the scene content of the captured images is introduced, taking into account the overall consideration of brightness influencing factors, the collaborative shooting data combination between the fill light and the shooting device, and the RGB data combination of the bright areas, thus improving the accuracy of the region cropping part.
[0033] At this point, a brightness thresholding method or an adaptive brightness segmentation algorithm is used to identify the bright areas; the R, G, and B channel values of each pixel within the bright area are extracted; statistical features such as the average, standard deviation, maximum, and minimum values of the RGB channels are calculated; these statistical features are combined into a multi-dimensional data vector to form an RGB data combination; simultaneously, weights are assigned to different RGB features based on the factors influencing brightness; the RGB data is converted to a color space more suitable for analysis (such as HSV or Lab); clipping parameters are calculated based on the RGB feature weights and color space analysis; and a second region clipping combination containing parameters such as shape, size, and position is generated.
[0034] Based on the first region cropping combination, the second region cropping combination, and the cropping portion of the highlighted region prediction, weights are assigned to the first and second cropping combinations; the two sets of parameters are fused using methods such as weighted averaging, decision trees, or neural networks; the boundary definition of the highlighted region is optimized based on the fusion result; and the final region cropping prediction result is generated.
[0035] refer to Figure 5 In step S14, the specific steps are as follows: S141: In the cropping region, multiple sub-cropping regions are determined based on the identification of the cropping region, and the RGB data combination of each sub-cropping region is determined based on the detection of each sub-cropping region; S142: Collect the cropping path of the cropped area and arrange the region order of each sub-cropping region along the cropping path. Determine the RGB data change of two adjacent sub-cropping regions based on the region order of each sub-cropping region, the adjacency of two adjacent sub-cropping regions, and the RGB data combination of each sub-cropping region. S143: Determine the first cropping level coefficient based on the RGB data variation of two adjacent sub-cropping regions and the region shape of the sub-cropping regions; determine the second cropping level coefficient based on the RGB data combination of each sub-cropping region and the region shape of the sub-cropping regions; and determine the cropping level of the sub-cropping region based on the region shape of the sub-cropping region, the first cropping level coefficient, and the second cropping level coefficient.
[0036] In the embodiments of this application, in the region cropping part, multiple sub-cropping regions are determined based on the identification of the region cropping part, and the RGB data combination of each sub-cropping region is determined according to the detection of each sub-cropping region. This takes into account the overall consideration of the detection of each sub-cropping region and ensures the accuracy of the RGB data combination of each sub-cropping region.
[0037] At this point, edge detection, threshold segmentation, or deep learning semantic segmentation are used to identify the boundaries of the cropped region; grid partitioning, adaptive partitioning, or content-based partitioning methods are selected according to application requirements; the cropped region is uniformly divided into rectangular grids of fixed size; the size and shape of the sub-regions are dynamically adjusted according to the image feature density; clustering is performed based on the similarity of image content; morphological operations or edge smoothing algorithms are applied to ensure that the boundaries of the sub-regions conform to the actual image features; and a unique identifier is assigned to each sub-cropped region for easy subsequent processing and tracking.
[0038] The algorithm iterates through all pixels within each sub-cropping region, extracting the RGB three-channel values. It then normalizes the original RGB data to eliminate the influence of light intensity. Statistical characteristics of the RGB channels for each sub-region are calculated, including: mean (reflecting the overall color tendency of the region); standard deviation (reflecting the dispersion of color distribution); maximum / minimum value (reflecting the range of color variation); median (reflecting the central tendency of the color); quantiles (e.g., 25th and 75th quantiles, reflecting color distribution characteristics); and skewness / kurtosis (reflecting the shape characteristics of the color distribution). These statistical characteristics are combined into a multi-dimensional data vector to form RGB data combinations. The RGB data combinations from different sub-regions are then standardized for easier comparison and analysis.
[0039] Furthermore, the cropping path of the cropped area is collected, and the region order of each sub-cropping region is arranged along the cropping path. The RGB data change of two adjacent sub-cropping regions is determined based on the region order of each sub-cropping region, the adjacency of two adjacent sub-cropping regions, and the RGB data combination of each sub-cropping region. This comprehensive consideration of the region order of each sub-cropping region, the adjacency of two adjacent sub-cropping regions, and the RGB data combination of each sub-cropping region ensures the accuracy of the RGB data change of two adjacent sub-cropping regions.
[0040] At this point, the clipping path of the clipped area is collected. The clipping path refers to the trajectory of the system traversing the sub-clipping areas in a specific order during area clipping. A suitable path type is selected based on application requirements, such as a serpentine path, spiral path, zigzag path, or radial path. The starting point, direction, step size, and turning rules of the path are determined. An optimization algorithm is applied to ensure that the path covers all sub-areas and the total path length is minimized. Path information, including coordinate sequences and direction changes, is stored using an array or linked list data structure.
[0041] Simultaneously, a sequential index is assigned to each sub-clipping region based on the clipping path; a sequential mapping table is created to record the correspondence between sub-region IDs and sequential indices; the sequential arrangement is checked to ensure that all sub-regions are covered and there are no duplicates; the order is adjusted according to application requirements, such as prioritizing important or similar regions; and a sequence diagram is generated to visually display the processing order of sub-regions.
[0042] The RGB data variation between adjacent sub-cropping regions is determined based on the region order of each sub-cropping region, the adjacency of two adjacent sub-cropping regions, and the RGB data combination of each sub-cropping region. Which sub-regions are adjacent are determined based on their spatial location. Adjacency relationships are categorized into horizontal, vertical, and diagonal adjacency. The RGB data variation between adjacent sub-regions is calculated using methods such as Euclidean distance, Manhattan distance, or cosine similarity. The calculated variation is normalized for comparison and analysis. A variation threshold is set to determine whether the variation between adjacent regions is significant.
[0043] Therefore, the first cropping level coefficient is determined based on the RGB data variation of two adjacent sub-cropping regions and the region shape of the sub-cropping region. The second cropping level coefficient is determined based on the RGB data combination of each sub-cropping region and the region shape of the sub-cropping region. The cropping level of the sub-cropping region is determined based on the region shape of the sub-cropping region, the first cropping level coefficient, and the second cropping level coefficient. This approach takes into account the overall consideration of the region shape of the sub-cropping region, the first cropping level coefficient, and the second cropping level coefficient, ensuring the accuracy of the cropping level of the sub-cropping region.
[0044] At this point, the first cropping level coefficient is determined based on the RGB data changes of two adjacent sub-cropping regions and the regional shape of the sub-cropping regions. The calculated RGB data changes are normalized to fall within the [0,1] interval. The morphological features of the sub-cropping regions, such as area, perimeter, roundness, aspect ratio, and complexity, are extracted. Weights are assigned to different morphological features to reflect their influence on the cropping level. The formula for calculating the first cropping level coefficient is: First cropping level coefficient = w1 × normalized RGB changes + w2 × morphological feature comprehensive value; where w1 and w2 are weight coefficients, and w1 + w2 = 1. Coefficient range adjustment: The calculation results are adjusted to a suitable numerical range, such as [0,10] or [0,100].
[0045] The second cropping level coefficient is determined based on the RGB data combination of each sub-cropping region and the regional morphology of the sub-cropping region. The RGB data distribution characteristics within the sub-cropping region are analyzed, such as mean, variance, skewness, and kurtosis. Statistical features of the RGB data, such as brightness, contrast, and color saturation, are extracted. Regional morphological features are collected. The formula for calculating the second cropping level coefficient is: Second cropping level coefficient = v1 × RGB feature comprehensive value + v2 × morphological feature comprehensive value; where v1 and v2 are weighting coefficients, and v1 + v2 = 1. Coefficient range adjustment: The calculation result is adjusted to the same numerical range as the first cropping level coefficient.
[0046] The cropping level of a sub-cropped region is determined based on its regional morphology, the first cropping level coefficient, and the second cropping level coefficient. Further extraction or enhancement of regional morphological features, such as boundary clarity and internal uniformity, is then performed. The cropping level calculation formula is: Cropping Level = a × Regional Morphological Enhancement Value + b × First Cropping Level Coefficient + c × Second Cropping Level Coefficient; where a, b, and c are weighting coefficients, and a + b + c = 1. The level classification criteria are set according to application requirements, such as: High level: Cropping level ≥ 8; Medium level: 5 ≤ Cropping level < 8; Low level: Cropping level < 5. Local optimization is performed based on the level relationships between adjacent sub-regions to ensure the rationality of the level distribution.
[0047] refer to Figure 6 In step S15, the specific steps are as follows: S151: Collect the cutting level of each sub-cutting area, and determine the area cutting process table based on the cutting level of each sub-cutting area, the corresponding area position, and the overall shape of the area cutting part. At this time, the area cutting process table has multiple area cutting items, and each area cutting item performs corresponding cutting work for the corresponding sub-cutting area. S152: Based on the identification of the area cutting process table, determine multiple area cutting items, mark the item content of each area cutting item, and determine the area cutting order of each sub-cutting area according to the priority of multiple area cutting items and the area shape of the corresponding sub-cutting area. S153: Determine the first cropping style based on multiple cropping items and the corresponding cropping order; determine the second cropping style based on multiple cropping items and the characteristics of the subject; determine the corresponding regional correlation coefficient based on the matching of the subject characteristics and each sub-cropping region; determine the final cropping region and the highly correlated retention region based on the first cropping style, the second cropping style, the regional correlation coefficient, and the cropping region; and use the highly correlated retention region as the non-cropped region.
[0048] In the embodiments of this application, the cutting level of each sub-cutting area is collected, and a regional cutting process table is determined based on the cutting level of each sub-cutting area, the corresponding area position, and the overall shape of the area cutting part. At this time, the regional cutting process table has multiple regional cutting items, and each regional cutting item performs corresponding cutting work for the corresponding sub-cutting area. This takes into account the overall consideration of the cutting level of each sub-cutting area, the corresponding area position, and the overall shape of the area cutting part, ensuring the accuracy of the regional cutting process table.
[0049] At this point, the cropping level of each sub-cropping region is collected. The cropping level of each sub-cropping region is calculated in step S143 and is a numerical index used to represent the importance or priority of the region in the overall cropping task. Simultaneously, the sub-cropping regions are sorted from high to low according to their cropping level, with higher-level regions processed first. The position of each sub-region in the overall image is analyzed to determine whether it is in a critical position (such as the center region or the edge region). The shape characteristics of the entire cropped portion are analyzed, such as whether it is a continuous region, whether there are holes, or whether it is a scattered small region. Based on the above analysis, a structured process table is generated, including: cropping project number; corresponding sub-region number; cropping level; region location; region shape; and cropping work description (such as "fine cropping", "coarse cropping", "retain", etc.).
[0050] The region trimming process table contains multiple region trimming projects. Each region trimming project corresponds to a specific sub-region and is an independent task unit containing trimming operations on a specific sub-region. Trimming job types: Fine trimming: for high-level, critical regions, using a high-precision algorithm to retain more details; Standard trimming: for medium-level regions, using a balanced algorithm to balance efficiency and accuracy; Coarse trimming: for low-level, background regions, using a fast algorithm to reduce computational resource consumption. Execution order: Executed sequentially from highest to lowest trimming level, ensuring that critical regions are processed first.
[0051] Furthermore, multiple regional cutting items are identified based on the regional cutting process table, and the content of each regional cutting item is marked. The regional cutting order of each sub-cutting area is determined based on the priority of multiple regional cutting items and the regional shape of the corresponding sub-cutting areas. This takes into account the overall consideration of the priority of multiple regional cutting items and the regional shape of the corresponding sub-cutting areas, ensuring the accuracy of the regional cutting order of each sub-cutting area.
[0052] At this point, the system reads the region trimming process table generated by S151 and identifies all independent region trimming items. Each region trimming item corresponds to a sub-trimming region, which includes: item number (e.g., P1, P2, …); corresponding sub-region number (e.g., R1, R2, …); trimming level (e.g., 3.2, 5.5, …); region location (e.g., coordinate range); region shape (e.g., rectangle, circle, irregular polygon, etc.). Marking information is added to each item to facilitate subsequent processing and tracking.
[0053] Define specific tasks for each region cropping project, including: cropping method (e.g., fine cropping, standard cropping, coarse cropping); processing algorithm (e.g., high-resolution interpolation, edge enhancement, fast downsampling); output requirements (e.g., retaining original resolution, compressing to a specified size); and tagging rules: automatically assign project content tags based on cropping level and region shape.
[0054] The region clipping order of each sub-clipping region is determined based on the priority of multiple region clipping projects and the region shape of the corresponding sub-clipping regions. The priority is determined by the clipping level, with higher levels having higher priority. The spatial distribution and adjacency relationship of the regions are considered to optimize the clipping order: adjacent high-priority regions are processed first; concentrated regions are processed first to reduce frequent switching; a greedy algorithm or dynamic programming is used to generate the optimal clipping order.
[0055] Therefore, a first cropping style is determined based on multiple cropping projects and their corresponding cropping order. A second cropping style is determined based on multiple cropping projects and the characteristics of the subject. The corresponding regional correlation coefficient is determined based on the matching of the subject characteristics and each sub-cropping region. The final cropping region and a highly correlated retention region are determined based on the first cropping style, the second cropping style, the regional correlation coefficient, and the cropped region. This highly correlated retention region, as a non-cropping region, incorporates the overall considerations of the first cropping style, the second cropping style, the regional correlation coefficient, and the cropped region, ensuring the accuracy of the final cropping region and the highly correlated retention region. Simultaneously, a cropping level and a regional cropping process table are introduced for this sub-cropping region, realizing the overall consideration of multiple cropping projects, their corresponding cropping order, and the characteristics of the subject, improving the accuracy of the final cropping region and the highly correlated retention region, and achieving fine-grained control over the cropping region.
[0056] At this point, the first clipping style is determined based on multiple region clipping items and their corresponding region clipping order. Clipping style refers to the overall strategy or pattern adopted by the system when performing region clipping, including clipping precision, speed, and resource allocation. The criteria for determining the first clipping style are: Region clipping items: considering the number, distribution, and priority of all items; Region clipping order: considering the execution order of clipping, especially the concentration of high-priority items; Style type: Fine-grained style: suitable for high-precision requirements, where most items require fine-grained processing; Standard style: suitable for general precision requirements, where item processing precision is moderate; Fast style: suitable for fast processing, where most items can be processed coarsely; Style determination algorithm: calculating the proportion of high-priority items; analyzing the continuity of the clipping order (e.g., whether high-priority items are concentrated at the beginning); and determining the style type based on a preset threshold.
[0057] The second cropping style is determined based on multiple cropping items and the characteristics of the photographed object. The object characteristics are analyzed as follows: object type (e.g., PCB board, mechanical parts, biological samples); feature complexity (e.g., texture complexity, edge density, color variation); and key area distribution (e.g., whether important features are concentrated in specific areas). The second cropping style is determined based on: cropping items (considering the number and distribution of items); object characteristics (considering the overall characteristics of the object and the distribution of key areas); and style type: focused style (suitable for areas with concentrated key areas requiring focused processing); balanced style (suitable for areas with uniform feature distribution requiring balanced processing of all areas); and scanning style (suitable for areas with dispersed features requiring comprehensive scanning of all areas). The style determination algorithm analyzes the concentration of key areas (e.g., variance or cluster analysis); calculates feature complexity indices; and determines the style type according to preset rules.
[0058] The region correlation coefficient represents the degree of matching between the sub-cropped region and the key features of the photographed object, and the numerical range is usually [0, 1]. The correlation coefficient is calculated based on: features of the photographed object, such as the position, type, and intensity of key features; features of the sub-cropped region, such as position, shape, texture, and color; calculation methods: position matching degree: calculate the distance between the center of the region and the center of the key feature; shape matching degree: compare the similarity between the shape of the region and the shape of the key feature; feature matching degree: analyze the degree of matching between the texture, color, and other features in the region and the key features; comprehensive calculation: weighted fusion of various matching degree indices; normalization methods are used to ensure that the results are within the range of [0, 1].
[0059] Simultaneously, based on the first cropping style, the second cropping style, the regional correlation coefficient, and the cropped portion, the final cropped region and the high-correlation retention region are determined. The final cropped region is determined by comprehensively considering the first cropping style (processing accuracy) and the second cropping style (processing strategy); combined with the regional correlation coefficient, regions with high correlation coefficients are prioritized for retention. The high-correlation retention region is determined by setting a correlation coefficient threshold (e.g., 0.8); regions with correlation coefficients exceeding the threshold are marked as high-correlation retention regions; these regions are treated as non-cropped regions, retaining the original data. The decision algorithm employs multi-parameter fusion decision-making, considering the spatial relationships between regions and the overall layout.
[0060] Please see Figure 7 , Figure 7 This is a schematic diagram of the structure of the image cropping device according to an embodiment of the present invention; the image cropping device includes: The area module 21 is used for the camera to take pictures with the help of the fill light, and to determine the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; Scene module 22 is used to determine the features of the photographed object and multiple scene features based on the recognition of the scene area of the photographed object, and to determine the scene content of the photographed image based on the features of the photographed object, multiple scene features and the image form of the photographed image; Prediction module 23 is used to determine the corresponding highlight influencing factors based on the region shape of the highlight area and the scene content of the captured image, and to predict the region cropping part based on the highlight influencing factors, the combination of collaborative shooting data between the fill light and the camera device, and the RGB data combination of the highlight area. The cropping level module 24 is used to determine multiple sub-cropping regions based on the identification of the cropped portion of the region, and to determine the cropping level of the sub-cropping region based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region. The final cropping area module 25 is used to determine the area cropping process table based on the cropping level of each sub-cropping area and the overall shape of the area cropping part. Based on the recognition of the area cropping process table, multiple area cropping items and corresponding area cropping sequences are determined. The final cropping area and highly correlated retention area are determined based on the multiple area cropping items, the corresponding area cropping sequences and the characteristics of the photographed object.
[0061] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
Claims
1. A method for cropping a region of a captured image, characterized in that, include: The camera takes pictures with the help of a fill light, and determines the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; Based on the identification of the scene area of the photographed object, the features of the photographed object and multiple scene features are determined. Based on the features of the photographed object, multiple scene features and the image form of the photographed image, the scene content of the photographed image is determined. Based on the regional shape of the highlighted area and the scene content of the captured image, the corresponding highlight influencing factors are determined. Based on the highlight influencing factors, the combination of collaborative shooting data between the fill light and the shooting device, and the combination of RGB data of the highlighted area, the area to be cropped is predicted. Multiple sub-cropping regions are determined based on the identification of the cropped portion of the region. The cropping level of the sub-cropping region is determined based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region. The region cropping process table is determined based on the cropping level of each sub-cropping region and the overall shape of the region cropping part. Based on the identification of the region cropping process table, multiple region cropping items and corresponding region cropping sequences are determined. The final cropping region and highly correlated retention region are determined based on the multiple region cropping items, the corresponding region cropping sequences and the characteristics of the photographed object.
2. The method for cropping a region of a photographed image according to claim 1, characterized in that, The photographing device takes pictures with the assistance of a fill light, and determines the corresponding highlight area and the scene area of the subject based on the recognition of the captured image, including: The fill light provides illumination to the location being photographed by the camera, the camera takes a picture of that location, and outputs the corresponding captured image. Based on the captured image, the fill light data, and the environmental scene of the location being photographed by the camera, the corresponding area division mode is determined. Based on the detection of the region division pattern, the region division path and corresponding division content are determined. Based on the region division path and the captured images, multiple sub-regions are determined. Based on the region location, corresponding region shape and division content of each sub-region, the corresponding highlighted region and the scene region of the captured object are determined.
3. The method for cropping a region of a photographed image according to claim 1, characterized in that, The process of determining object features and multiple scene features based on the identification of the scene area, and determining the scene content of the captured image based on the object features, multiple scene features, and the image format of the captured image, includes: The scene area of the photographed object is collected, and multiple parts to be identified are determined based on the detection of the scene area of the photographed object. The features of the photographed object and multiple scene features are determined based on the position, corresponding shape and regional content of the scene area of the photographed object. At this time, the features of the photographed object are located at the center of the multiple scene features, and the multiple scene features are arranged around the features of the photographed object along different directions. The scene transition section is determined based on the characteristics of the subject and the image form of the captured image. The scene-related content of multiple scene features is determined based on the scene transition section and the feature positions of multiple scene features. The scene content of the captured image is determined based on the scene-related content of multiple scene features, the feature forms of multiple scene features, and the image form of the captured image.
4. The method for cropping a region of a photographed image according to claim 1, characterized in that, The process involves determining the corresponding highlight influencing factors based on the region shape of the highlighted area and the scene content of the captured image. Based on these highlight influencing factors, the combined data from the coordinated shooting between the fill light and the camera, and the RGB data combination of the highlighted area, a region cropping portion is predicted, including: Collect highlighted areas, identify the corresponding area shapes based on the highlighted areas, determine the scene influence combination based on the area location of the highlighted areas, the corresponding area shapes, and the scene content of the captured images, and determine the corresponding highlight influencing factors based on the scene influence combination, the feature shapes of the photographed objects, and the image shapes of the captured images.
5. The method for cropping a region of a photographed image according to claim 4, characterized in that, The process of determining corresponding highlight influencing factors based on the region shape of the highlighted area and the scene content of the captured image, and predicting the region cropping part based on the highlight influencing factors, the combined shooting data between the fill light and the camera, and the RGB data combination of the highlighted area, also includes: Based on the tracing of already captured images, the collaborative shooting data combination between the fill light and the camera is determined, and the first area cropping combination is determined according to the high brightness influencing factors and the collaborative shooting data combination between the fill light and the camera. Simultaneously, based on the brightness detection of the bright areas, RGB data combinations of the bright areas are collected, and a second region clipping combination is determined according to the RGB data combination of the bright areas and the factors affecting brightness; the first region clipping combination, the second region clipping combination, and the predicted bright area are then used to clip the portion.
6. The method for cropping a region of a photographed image according to claim 1, characterized in that, The process of identifying multiple sub-cropping regions based on the recognition of the cropped portion of the region, and determining the cropping level of each sub-cropping region based on the RGB data combination of each sub-cropping region, the RGB data variation between two adjacent sub-cropping regions, and the region shape of the sub-cropping region, includes: In the cropping region, multiple sub-cropping regions are determined based on the identification of the cropping region, and the RGB data combination of each sub-cropping region is determined based on the detection of each sub-cropping region; The cropping path of the cropped area is collected, and the region order of each sub-cropping region is arranged along the cropping path. The RGB data change of two adjacent sub-cropping regions is determined based on the region order of each sub-cropping region, the adjacency of two adjacent sub-cropping regions, and the RGB data combination of each sub-cropping region.
7. The method for cropping a region of a photographed image according to claim 6, characterized in that, The process of determining multiple sub-cropping regions based on the identification of the cropped portion of the region, and determining the cropping level of the sub-cropping region based on the RGB data combination of each sub-cropping region, the RGB data variation between two adjacent sub-cropping regions, and the region shape of the sub-cropping region, further includes: The first cropping level coefficient is determined based on the RGB data variation of two adjacent sub-cropping regions and the region shape of the sub-cropping regions. The second cropping level coefficient is determined based on the RGB data combination of each sub-cropping region and the region shape of the sub-cropping regions. The cropping level of the sub-cropping region is determined based on the region shape of the sub-cropping region, the first cropping level coefficient, and the second cropping level coefficient.
8. The method for cropping a region of a photographed image according to claim 1, characterized in that, The process involves determining a region cropping process table based on the cropping level of each sub-cropping region and the overall shape of the cropped region. Based on the identification of the region cropping process table, multiple region cropping items and their corresponding cropping sequences are determined. Finally, the final cropping region and highly relevant retention regions are determined based on these multiple cropping items, their corresponding cropping sequences, and the characteristics of the photographed object. Collect the cutting level of each sub-cutting area, and determine the area cutting process table based on the cutting level of each sub-cutting area, the corresponding area position, and the overall shape of the area cutting part. At this time, the area cutting process table has multiple area cutting items, and each area cutting item performs corresponding cutting work for the corresponding sub-cutting area. Multiple regional cutting items are identified based on the regional cutting process table, and the content of each regional cutting item is marked. The regional cutting order of each sub-cutting area is determined according to the priority of multiple regional cutting items and the regional shape of the corresponding sub-cutting areas.
9. The method for cropping a region of a photographed image according to claim 8, characterized in that, The process of determining a region cropping process table based on the cropping level of each sub-cropping region and the overall shape of the region cropping portion, determining multiple region cropping items and corresponding region cropping sequences based on the identification of the region cropping process table, and determining the final cropping region and highly correlated retention region based on the multiple region cropping items, the corresponding region cropping sequence, and the characteristics of the photographed object, further includes: The first cropping style is determined based on multiple cropping items and their corresponding cropping order. The second cropping style is determined based on multiple cropping items and the characteristics of the subject. The corresponding regional correlation coefficient is determined based on the matching of the subject characteristics and each sub-cropping region. The final cropping region and the highly correlated retention region are determined based on the first cropping style, the second cropping style, the regional correlation coefficient, and the cropped region. The highly correlated retention region is used as the non-cropped region.
10. A region cropping device for already captured images, characterized in that, The image cropping device is applied to the image cropping method as described in any one of claims 1-9, and the image cropping device comprises: The area module is used by the camera device to take pictures with the help of the fill light, and to determine the corresponding highlight area and the scene area of the subject based on the recognition of the captured image; The scene module is used to determine the features of the photographed object and multiple scene features based on the recognition of the scene area of the photographed object, and to determine the scene content of the photographed image based on the features of the photographed object, multiple scene features and the image form of the photographed image; The prediction module is used to determine the corresponding highlight influencing factors based on the region shape of the highlight area and the scene content of the captured image. It predicts the region to be cropped based on the highlight influencing factors, the combined shooting data between the fill light and the camera, and the RGB data combination of the highlight area. The cropping level module is used to determine multiple sub-cropping regions based on the identification of the cropped portion of the region. The cropping level of the sub-cropping region is determined based on the RGB data combination of each sub-cropping region, the RGB data change of two adjacent sub-cropping regions, and the region shape of the sub-cropping region. The final cropping area module is used to determine the cropping process table based on the cropping level of each sub-cropping area and the overall shape of the cropped area. Based on the recognition of the cropping process table, multiple cropping items and corresponding cropping sequences are determined. The final cropping area and highly relevant retention area are determined based on the multiple cropping items, the corresponding cropping sequences, and the characteristics of the photographed object.