Intelligent painting auxiliary method of artistic style
By generating a spatial illusion index matrix and adjusting the color temperature and edges of the painting brush strokes in real time, the problem of inconsistency in spatial illusion in intelligent painting assistive technology is solved, and dynamic control of spatial hierarchical coherence and visual fluidity of artistic style painting is realized.
Patent Information
- Application Number
- CN202510639193.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-19
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing intelligent painting assistance technology cannot effectively assist painting scholars in maintaining the spatial hierarchy coherence and visual fluidity of a specific artistic style during the dynamic drawing process, and lacks a structured perception and real-time feedback mechanism for local area spatial illusion.
By extracting the edge intensity distribution and color distribution of the transition area of the art style reference diagram, a spatial illusion index matrix is generated, the brushstroke input position is monitored in real time and the color temperature and edge are adjusted, the main flow direction of the transition texture is extracted, and the texture flow direction is corrected, so as to achieve dynamic control of the spatial structure sense during the painting process.
Real-time perception and control of the spatial structure sense in the painting process is realized, the problem of spatial sense fracture caused by color or edge adjustment is eliminated, and the overall directional consistency and visual fluidity of the picture are enhanced.
Smart Images

Figure CN120510240A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of painting assistance technology, and more particularly, to an intelligent painting assistance method of artistic style. Background Art
[0002] In traditional painting, particularly in oil painting, watercolor, and the Impressionist style, meticulous color distribution, brushstroke direction, and localized light and dark relationships are often used to create a strong illusion of spatial depth, allowing a two-dimensional image to visually appear as a distinct three-dimensional space. This spatial composition, rather than relying on perspective and geometry, is driven by factors such as the contrast of warm and cold colors, variations in detail density, and the coherence of texture direction, forming the spatial compositional language of a specific artistic style.
[0003] However, existing intelligent painting assistance is generally limited to low-level image generation tasks such as color harmony, style transfer, and brush simulation. It lacks structured perception and real-time feedback mechanisms for local spatial illusions, and cannot assist painters of a specific artistic style to maintain spatial hierarchical coherence and visual fluidity that matches the artistic style during the dynamic painting process.
[0004] In order to solve the above problems, a technical solution is now provided. Summary of the Invention
[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides an intelligent painting assistance method of artistic style to solve the problems raised in the above-mentioned background technology.
[0006] To achieve the above object, the present invention provides the following technical solutions:
[0007] An intelligent painting assistance method for an artistic style comprises the following steps:
[0008] S1: Extract edge intensity distribution and color distribution of transition areas in the artistic style benchmark image to generate detailed features of the transition areas;
[0009] S2: Extract the color temperature offset of the transition area of the artistic style benchmark image based on the Lab color space;
[0010] S3: Fusion of the transition area's detail features and color temperature offset to generate a spatial illusion index matrix, and calibrate the spatial perception levels of different transition areas in the artistic style benchmark image.
[0011] S4: Real-time monitoring of the correspondence between the brushstroke input position and the transition area of the artistic style benchmark map, and adjustment of the color temperature and edge of the brushstroke area based on the current spatial level of the brushstroke area;
[0012] S5: extracting the transition texture flow direction of the adjusted painting stroke input position area to form a transition texture main flow direction map;
[0013] S6: Identify the spatial sense fracture area based on the main flow direction map of the transition texture, and perform texture flow direction correction on the spatial sense fracture area.
[0014] In a preferred embodiment, in S1, extracting the edge intensity distribution and color distribution of the transition region in the artistic style reference image and generating the transition region detail features specifically includes:
[0015] Perform transition region division on the artistic style benchmark image, and establish grid index distribution of different transition regions based on the set equal-size gridding rule;
[0016] Extract the sub-image block defined by the grid index, apply the Sobel gradient operator to the sub-image block, perform convolution operations along the horizontal and vertical directions respectively, and output the edge intensity distribution matrix corresponding to the grid index;
[0017] Extract the color histogram corresponding to the RGB color space of the sub-image block, count the color value distribution density of each channel, and output the color distribution feature matrix corresponding to the grid index;
[0018] The edge intensity distribution matrix of all transition region grid indexes and the color distribution feature matrix are linearly superimposed to generate the detail features of the corresponding transition region grid indexes.
[0019] In a preferred embodiment, the performing of transition region division on the artistic style reference image and establishing grid index distribution of different transition regions based on setting equal-size gridding rules specifically includes:
[0020] According to the changing trend of depth of field, the artistic style benchmark map is divided into three dynamic transition areas: mid-ground-near-ground, mid-ground-far-ground, and far-ground-near-ground.
[0021] For the dynamic transition area that has been divided, internal subdivision is performed based on the set size grid rule, and the transition area attribute label corresponding to each grid and the coordinate position of the grid in the image are marked;
[0022] The attribution labels of each grid are encoded according to the coordinate position in the image to form the transition area index distribution.
[0023] In a preferred embodiment, in S2, extracting the color temperature offset of the transition region of the artistic style reference image based on the Lab color space specifically includes:
[0024] Input the artistic style benchmark image into the Lab color space conversion function to generate the corresponding a and b channel image data;
[0025] Extract the pixel value sets of the a-channel and b-channel of the sub-image block corresponding to each transition region index distribution, calculate the mean of the a-channel and the mean of the b-channel, and output the center vector of the warm and cold color balance;
[0026] According to the center vector of the warm and cold color balance, the warm and cold color offset is calculated according to the set color temperature distinction rule and encoded into a normalized warm and cold color offset map;
[0027] The warm and cool color offset map is associated with the transition region index distribution to form a color temperature offset distribution of the transition region index distribution.
[0028] In a preferred embodiment, in S3, the detailed features of the transition area and the offset of warm and cold colors are integrated to generate a spatial illusion index matrix, and the spatial sense levels of different transition areas in the artistic style reference image are calibrated. Specifically, the steps include:
[0029] Based on the transition region attribution label, the detail features in the transition region index and the color temperature offset are integrated into the spatial illusion index value, and the spatial illusion index matrix corresponding to the transition region is constructed.
[0030] Based on the index values in the spatial illusion index matrix, quantile division processing is performed to divide the index values into spatial sense level intervals according to the set quantile ratio;
[0031] According to the spatial sense level range, the spatial sense level of each transition area is calibrated.
[0032] In a preferred embodiment, in S4, the correspondence between the painting brushstroke input position and the transition area of the artistic style reference image is monitored in real time, and the color temperature and edge of the brushstroke area are adjusted according to the current spatial level of the brushstroke area, specifically including:
[0033] Receive the real-time position coordinate stream of the painting stroke, calibrate the transition area to which the current stroke position belongs based on the transition area of the artistic style reference map, and extract the spatial illusion indicator matrix corresponding to the current stroke position;
[0034] Determine the spatial sense level based on the spatial illusion index matrix of the current brush stroke position, and match the spatial sense level of the current brush stroke position with the spatial sense level of the corresponding transition area in the calibration art style benchmark map;
[0035] If the spatial sense level is not matched successfully, the color temperature and edge of the stroke area are adjusted based on the preset adjustment rules.
[0036] In a preferred embodiment, adjusting the color temperature and edge of the brush stroke area based on the preset adjustment rules specifically includes:
[0037] Read the Lab color space a-channel and b-channel components of the color value at the current stroke position, and perform multiplicative adjustments on the a-channel and b-channel according to the preset color temperature offset adjustment ratio;
[0038] Collect the edge grayscale gradient distribution of the current stroke position and calculate its local standard deviation value, and perform linear scaling of the gradient distribution according to the preset edge enhancement factor;
[0039] The spatial illusion index matrix of the current stroke position during the adjustment process is extracted in real time, and the spatial sense level is divided and re-matched until the color temperature and edge adjustment is completed after the match is successful.
[0040] In a preferred embodiment, in S5, extracting the transition texture flow direction of the adjusted painting brushstroke input position area to form a transition texture main flow direction map specifically includes:
[0041] Based on the change of the coordinate stream of the painting stroke input position, the edge-adjusted painting stroke input trajectory is obtained, and pixel block windows of a set size are continuously intercepted in the stroke input trajectory;
[0042] Calculate the grayscale gradient direction and magnitude of the pixel point in the pixel block window to obtain the edge gradient of each stroke position in the stroke input trajectory;
[0043] Principal component analysis is performed on the edge gradient of the entire trajectory, and the main direction vector corresponding to the maximum eigenvalue is extracted as the main flow direction of the transition texture of the stroke input trajectory to form a transition texture main flow direction map.
[0044] In a preferred embodiment, in S6, identifying the spatial sense fracture area based on the transition texture main flow direction map and performing texture flow direction correction on the spatial sense fracture area specifically includes:
[0045] Performing continuity detection on the main flow direction of the transition texture of the stroke input trajectory, identifying adjacent pixel blocks whose main flow direction angle changes exceed a preset deviation threshold;
[0046] Encode the detected boundary positions of adjacent pixel blocks with sudden directional changes as spatial fracture boundaries and generate directional difference maps between corresponding pixel blocks;
[0047] In the spatial fracture boundary area, a transition direction interpolation zone is constructed based on the direction difference map to generate an interpolation direction vector;
[0048] The interpolation direction vector is injected into the area where the fracture boundary is located to replace the original main flow direction vector and form a continuous flow direction correction map.
[0049] The technical effects and advantages of the present invention's intelligent painting assistance method for an artistic style are as follows:
[0050] By introducing the detailed features and color temperature offset information of the artistic style benchmark image, a spatial illusion index matrix is constructed and the local spatial sense level is calibrated to achieve the perception and regulation of the sense of spatial structure during the painting process. Compared with the traditional intelligent painting assistance method that only performs color migration and brushstroke simulation, the present invention can associate the user's brush stroke area with the spatial composition relationship in the target artistic style in real time, dynamically adjust the edge clarity and color temperature tendency of the brushstroke, and make the spatial sense performance in the painting process more consistent with the visual laws of the artistic style benchmark image. In addition, by extracting the main direction of the transition texture of the adjusted brushstroke area during the painting process and performing directional correction in the area where the texture flow suddenly changes, the problem of spatial sense interruption caused by color or edge adjustment is effectively eliminated, and the overall directional consistency and visual fluidity of the picture are enhanced. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 This is a schematic diagram of an intelligent painting assistance method for an artistic style according to the present invention. DETAILED DESCRIPTION
[0052] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0053] Example 1
[0054] Figure 1 The present invention provides an intelligent painting assistance method of an artistic style, which includes the following steps:
[0055] S1: Extract edge intensity distribution and color distribution of transition areas in the artistic style benchmark image to generate detailed features of the transition areas;
[0056] S2: Extract the color temperature offset of the transition area of the artistic style benchmark image based on the Lab color space;
[0057] S3: Fusion of the transition area's detail features and color temperature offset to generate a spatial illusion index matrix, and calibrate the spatial perception levels of different transition areas in the artistic style benchmark image.
[0058] S4: Real-time monitoring of the correspondence between the brushstroke input position and the transition area of the artistic style benchmark map, and adjustment of the color temperature and edge of the brushstroke area based on the current spatial level of the brushstroke area;
[0059] S5: extracting the transition texture flow direction of the adjusted painting stroke input position area to form a transition texture main flow direction map;
[0060] S6: Identify the spatial sense fracture area based on the main flow direction map of the transition texture, and perform texture flow direction correction on the spatial sense fracture area.
[0061] In S1, the edge intensity distribution and color distribution of the transition area in the artistic style benchmark image are extracted to generate the detail features of the transition area.
[0062] In the artistic style benchmark map (representative works of artistic styles with multiple depth levels), multiple local transition regions are divided through manual pre-calibration or automatic segmentation based on texture variation trends. The classification categories include at least three typical depth relationships: medium-near transition region, medium-far transition region, and far-near transition region. The following is an example of the division of medium, far, and near scenes: the area at the forefront and the lower half of the picture height containing clear details (such as stone texture, branch texture) or framing elements (such as door frames and tree branches) is classified as the near scene; the area occupying the center of the picture and containing the narrative subject (such as people, buildings, etc.) is classified as the middle scene; the area at the top or far end of the picture that appears as a blurred background (such as distant mountains and sky) is classified as the far scene.
[0063] Within each transition region, the gridding rules are set to divide the image into equal-sized blocks (specifically set based on the transition region area, with a default setting of 1% of the area). A square grid is preferred to simplify subsequent index mapping and feature extraction. Each grid cell is assigned a unique index number, which corresponds one-to-one with the canvas coordinate system. A transition region grid index distribution map is generated as the basis for subsequent sub-image block extraction and detail feature binding. The grid size is set to match the overall size of the reference image with the target spatial resolution. The grid index map is logically bound to the original image coordinate system.
[0064] Edge feature extraction is performed on the sub-image blocks defined by each index number. First, the sub-image blocks are grayscaled to ensure uniform input data channels and reduce the interference of color information on gradient calculation. Subsequently, convolution operations are performed using the Sobel gradient operator in the horizontal and vertical directions to obtain local gradient maps in the Gx and Gy directions, respectively. Based on Gx and Gy, the gradient modulus is calculated pixel by pixel to form a local edge intensity matrix. Each matrix is saved separately and bound to the grid index number to which it belongs. The edge intensity matrix value range is normalized to 0-1 to reflect the edge structure density and spatial mutation degree of the local area.
[0065] For the sub-image block area defined by each grid index, the distribution characteristics of its color channel are extracted to supplement the detail level information of the transition area. In this step, the RGB color space is selected as the image processing reference space, and the color histogram statistics of each sub-image block are performed in the three channels of R (red), G (green), and B (blue). The pixel value range of each channel is 0 to 255. During processing, a fixed number of histogram groups is set for each channel. The grouping interval can be configured as 8, 16 or 32 discrete intervals of equal width to count the distribution of the number of pixels in different color brightness ranges. During the statistical process, for each grouping interval, the system calculates the number of pixels it contains and records it as the frequency value of the corresponding group. In order to enhance the inter-channel comparability of the subsequent feature matrix, the original frequency histogram of each channel needs to be normalized so that the sum of the histogram of each channel is standardized to 1. After processing, each sub-image block outputs a set of normalized color histogram vectors containing the R, G, and B channels, reflecting the color distribution density of the sub-block area in the red, green, and blue dimensions, respectively. Finally, the normalized histogram vectors of the three channels are concatenated in the channel dimension to form a single regional color feature vector with a length three times the number of groups, and the color distribution feature matrix for that grid index position is constructed.
[0066] Based on the local edge intensity distribution matrix and the local color distribution feature matrix, feature fusion processing is performed to form the final detail feature expression. The fusion method adopts a linear weighted superposition model, setting weight coefficients for the edge intensity matrix and the color distribution feature matrix respectively. The typical value range is between 0.4-0.6, and it is dynamically adjusted according to the target artistic style type. Weighted superposition is performed at the pixel level or feature unit level to ensure that the fused matrix is balanced and effective in expressing local detail mutations and color change density. After the fusion is completed, the detail feature matrix corresponding to each transition area grid index is output and uniformly normalized. The result serves as a structured expression of the detail level of the overall artistic style benchmark image.
[0067] In S2, the color temperature offset of the transition area of the artistic style reference image is extracted based on the Lab color space.
[0068] The artistic style reference image to be processed is input into a standard Lab color space conversion function. Based on the CIELAB color model, the original image is converted from RGB color space or other formats (such as sRGB) to Lab color space. Based on the conversion results, a- and b-channel image matrices are output as the basis for subsequent color temperature offset analysis. Color calibration is required during the conversion process, using D65 illuminant as the standard viewing condition. Ensure that the input image color space is correctly annotated with an ICC profile to avoid gamut shift. The a- and b-channel image data maintain the original resolution.
[0069] Based on the constructed transition region grid index distribution map, all pixel values for the a and b channels are extracted within the sub-image block corresponding to each grid index, generating a set of local color samples. Subsequently, a mean calculation operation is performed on the a and b channel pixel sets according to the set color temperature distinction rule, obtaining the a and b channel means for the region, respectively. These two values are combined to form a two-dimensional vector, defined as the center vector of the warm and cool color balance for the region. This vector expresses the overall color tendency of the local region and is the statistical center of the warm and cool color temperature distribution within the region. The center vectors corresponding to all grid indices are sequentially stored to form a vector table.
[0070] The warm and cool color balance center vector is compared with the global a and b channel averages of the entire artistic style benchmark image. The degree of deviation in warm and cool color temperature between the current sub-image block and the overall image is calculated (expressed as an offset ratio). To ensure comparability between different grids, the deviation values are normalized using a Min-Max normalization algorithm, with the maximum offset value normalized to 1. Each offset value in the normalized warm and cool color offset map is mapped back to the original index distribution map according to its corresponding grid index position, forming a structured transition region index-color temperature offset mapping table. This mapping structure logically forms a two-dimensional array, where each element records the normalized color temperature offset value for the current index number region.
[0071] In S3, the detailed features of the transition area and the offset of warm and cold colors are integrated to generate a spatial illusion index matrix, and the spatial sense levels of different transition areas in the artistic style benchmark image are calibrated.
[0072] Based on the transition region attribution label, a linear combination operation is performed on the two feature data, with the detail feature value as the first factor and the color temperature offset value as the second factor. A directional adjustment mechanism is introduced, and the color temperature offset value is subjected to a first-order reverse mapping process, which is used to enhance the values corresponding to cool areas and reduce the values corresponding to warm areas. Weights are set (specifically based on the artistic style type, such as increasing the weight of the first factor for a brushstroke-based artistic style benchmark and increasing the weight of the second factor for a color-based artistic style benchmark) to fuse the first and second factors to ensure a uniform expression standard for the index values across the entire image. This fusion operation is performed sequentially for all grid index positions, outputting a two-dimensional spatial illusion index matrix consistent with the original grid distribution structure. This matrix maintains the same structure as the index mapping and numerically records the composite spatial index value sequence formed by the detail features and color temperature response of each region.
[0073] After the indicator matrix is constructed, a spatial class interval partitioning operation based on quantile sorting is performed. First, all values in the matrix are linearly expanded to form a one-dimensional indicator sequence set. This set is sorted in ascending order of numerical magnitude, and several class interval boundaries are defined based on the set quantile ratio. The number of planned scores can be specified as three, four, or more class groups, each containing an equal number of data points. After sorting, the values corresponding to the quantiles are extracted as interval boundary thresholds to form a spatial perception class boundary table. The partitioning process does not rely on absolute numerical magnitude; it is based solely on the sorted position, adapting to the overall distribution of spatial illusion indicator values in the image. The boundary table is represented as numerical intervals and stored in a memory structure linked to the number of segments and the interval index number. An interval matching operation is performed for each indicator value in the original spatial illusion indicator matrix. Each grid index position is traversed, the corresponding indicator value is retrieved, and the spatial class interval to which it belongs is determined. The matching logic relies on the class boundary table generated in the previous processing step. Based on the numerical interval determination method, the current indicator value is assigned to its corresponding segment and the corresponding class number.
[0074] In S4, the correspondence between the painting stroke input position and the transition area of the artistic style reference map is monitored in real time, and the color temperature and edge of the stroke area are adjusted according to the current spatial level of the stroke area.
[0075] Receive real-time brushstroke position coordinate data streams from drawing devices or brush inputs, and determine the spatial attribution of the brushstroke landing point based on the transition region structure marked in the artistic style benchmark map. Using a coordinate-region mapping relationship (for painting scholars imitating paintings) or a pre-marked mapping relationship (for painting scholars freely painting), determine the transition region index corresponding to the current brushstroke position, and further calculate the index value of this region position in the spatial illusion index matrix. This index value is matched with the defined spatial sense level interval to define the spatial sense level of the current brushstroke. At the same time, the spatial sense level marked in the artistic style benchmark map for the landing point is used as the target level, forming a matching reference structure between the actual spatial level of the current brushstroke landing point and the target spatial level.
[0076] The color temperature and edge adjustment operation is triggered when the actual spatial sense level does not match the target level. In the color temperature adjustment process, the pixel color value at the current stroke landing point is first obtained, and its a channel and b channel components are extracted. According to the preset color temperature offset adjustment ratio, the original values of the a channel and the b channel are subjected to multiplicative factor processing. The offset adjustment ratio range is determined based on experiments, and the default setting is between 0.7 and 1.3, which is used to enhance or weaken the local cold and warm tendencies, so that it shifts in the direction required by the target spatial level in the color temperature distribution. This process does not affect the L channel brightness information, but only makes directional changes to the hue. The adjusted a and b channel values are fed back to the display canvas through the image rendering buffer and participate in the real-time indicator calculation.
[0077] In the edge adjustment process, the grayscale value matrix is extracted based on the current landing point neighborhood image block, and a gradient operation is performed within the local area window. The Sobel or equivalent gradient operator is used to calculate the direction-independent grayscale gradient amplitude. The extracted gradient distribution map is statistically analyzed within the current window, and its standard deviation is calculated as a response measure of the edge structure complexity. According to the preset edge enhancement factor (specifically set according to the type of transition region to which it belongs, with the default settings of 1.2, 1.5, and 1.8, corresponding to the mid-near transition region, mid-far transition region, and far-near transition region, respectively), a linear scaling operation is performed on the gradient amplitude map. The scaling operation directly multiplies the result of the multiplication on the matrix corresponding to the gradient modulus to achieve edge intensity enhancement or suppression.
[0078] After each color temperature and edge processing, the image parameters corresponding to the current brushstroke landing area are re-entered into the spatial illusion index construction to generate the latest index matrix sub-block. This index value is then again matched against the spatial perception level interval and compared to see if it aligns with the target level label. If the spatial level corresponding to the current processed index value does not match the target level, the next round of color temperature and edge parameter adjustment is performed, and the index reconstruction and level matching are re-performed. This process is repeated until the spatial level of the current brushstroke landing area after adjustment successfully matches the spatial level of the corresponding transition area in the artistic style benchmark image. Once a match is successful, the adjustment process is terminated, and the final brushstroke parameters are output for canvas rendering.
[0079] In S5 , the transition texture flow direction of the adjusted painting brush stroke input position area is extracted to form a transition texture main flow direction map.
[0080] The system obtains the trajectory of a painting stroke input that has undergone edge adjustment and performs structured extraction of local texture directions based on this trajectory to construct a main flow direction map that reflects the continuity of the spatial illusion texture created by the current drawing action. First, a continuous sequence of input coordinates from a drawing device or digital brush within the drawing area is received, forming a time-series coordinate stream of the stroke input positions. Each input position in the current coordinate stream is then extracted in real time. Based on a preset window size, a fixed-width pixel block region is continuously captured, centered around the current position. This pixel block serves as the local area window for texture analysis.
[0081] For each extracted pixel block window, its image content under the current edge adjustment parameters is obtained, including local grayscale information, edge enhancement results, and the visual state after color temperature adjustment. Within the window area, the grayscale gradient direction and magnitude are calculated using a directional edge detection operator, extracting gradient components along the horizontal and vertical directions. From these, the gradient direction angle and gradient magnitude of the current pixel are calculated. Each stroke position corresponds to a window area, and the gradient information of all pixels in the window is normalized into a set of local gradient vectors, which are then organized into a trajectory-level edge gradient sequence in order of position.
[0082] After extracting the edge gradient sequence corresponding to the complete stroke trajectory, principal component analysis (PCA) is performed on this sequence to extract the principal axis structure that constitutes the trajectory's texture direction. PCA uses the unit vectors corresponding to the gradient direction angles of all windows as sample data, calculates the covariance structure of the entire set of direction vectors in two-dimensional space, and outputs the direction of maximum variance (i.e., the principal direction corresponding to the largest eigenvalue) as the principal direction vector. This principal direction vector represents the texture extension trend with the most consistent and stable edge structure changes throughout the entire stroke input trajectory, reflecting the dominant texture flow in space formed by the drawing action.
[0083] The main direction vector calculated for each stroke trajectory is associated with the spatial coordinate information of the trajectory to form a structured dataset. The main direction vectors of multiple trajectories are organized in index order to generate a complete main flow direction map of the transition texture.
[0084] In S6, the spatial sense fracture area is identified based on the main flow direction map of the transition texture, and the texture flow direction of the spatial sense fracture area is corrected.
[0085] A directional field continuity analysis is performed on the main flow direction map, and a texture correction strategy is constructed in the area where the direction jump occurs. First, adjacent detection processing is performed on the main flow direction vectors of all stroke trajectory segments. Relying on the trajectory index relationship, the main direction angle difference between any two adjacent pixel blocks is determined pair by pair. The direction difference calculation is based on the cosine formula of the unit vector angle, and the angle deviation is expressed in absolute value form. If the direction deviation value of any pair of adjacent blocks exceeds the set angle threshold (customized based on the artistic style, such as 30°), it is determined that the direction continuity is interrupted. All pixel block pairs that meet the jump conditions are recorded, and their boundary positions are extracted and encoded as spatial fracture boundaries, which serve as the edge reference line of the texture field structure instability area. For each pair of main direction vectors at both ends of the fracture boundary, the difference result is calculated and stored in the directional difference map in a unified format to form a quantitative description matrix of the direction change of the fracture area.
[0086] Each fracture boundary is used as the basis for the interpolation channel. A local interpolation region, called a transitional direction interpolation zone, is constructed based on the changing trend of the angle formed by the boundary direction and the main direction vector of the adjacent block. The interpolation zone structurally spans the two pixel blocks where the transition occurs and extends a number of pixels into its neighborhood to buffer the directional offset. Within this region, a linear directional interpolation method is used to perform a piecewise continuous fit of the directional vectors on both sides of the fracture to generate a series of intermediate interpolated directional vectors. The interpolation result is represented as a vector field, covering the original fracture boundary and its buffer zone. The interpolation process does not introduce any new structure and only interpolates based on the original directional data. The interpolation method can be linear interpolation, B-spline fitting, or spherical interpolation of directional vectors.
[0087] After the interpolation vector is generated, it is written into the main flow direction map, and the original vectors corresponding to the fracture boundary range in the original main direction vector map are replaced. This replacement action is performed directly at the data structure level, and the direction field of the corresponding position is reassigned to the direction vector in the interpolation band, achieving a smooth transition and continuity restoration of the direction field. After all interpolation replacements are completed, the output structure is updated. The transition texture main flow direction map is defined as a flow continuity correction map. This map provides painting assistance to painters by retaining the original trajectory direction and bridging the direction field in the fracture area.
[0088] The above formulas are all dimensionless and numerical calculations. The formulas are obtained by collecting a large amount of data and performing software simulation to obtain the most recent real situation. The preset parameters and thresholds in the formulas are set by technicians in this field according to actual conditions.
[0089] The above embodiments can be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer program are loaded or executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state drive.
[0090] Those skilled in the art will appreciate that the modules and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0091] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and modules described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0092] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0093] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, and may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0094] In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module.
[0095] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0096] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0097] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. An intelligent painting assistance method for artistic style, characterized in that: The steps include: S1: Extract edge intensity distribution and color distribution of transition areas in the artistic style benchmark image to generate detailed features of the transition areas; S2: Extract the color temperature offset of the transition area of the artistic style benchmark image based on the Lab color space; S3: Fusion of the transition area's detail features and color temperature offset to generate a spatial illusion index matrix, and calibrate the spatial perception levels of different transition areas in the artistic style benchmark image. S4: Real-time monitoring of the correspondence between the brushstroke input position and the transition area of the artistic style benchmark map, and adjustment of the color temperature and edge of the brushstroke area based on the current spatial level of the brushstroke area; S5: extracting the transition texture flow direction of the adjusted painting stroke input position area to form a transition texture main flow direction map; S6: Identify the spatial sense fracture area based on the main flow direction map of the transition texture, and perform texture flow direction correction on the spatial sense fracture area.
2. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: In S1, the edge intensity distribution and color distribution of the transition area in the artistic style benchmark image are extracted to generate the detailed features of the transition area, including: Perform transition region division on the artistic style benchmark image, and establish grid index distribution of different transition regions based on the set equal-size gridding rule; Extract the sub-image block defined by the grid index, apply the Sobel gradient operator to the sub-image block, perform convolution operations along the horizontal and vertical directions respectively, and output the edge intensity distribution matrix corresponding to the grid index; Extract the color histogram corresponding to the RGB color space of the sub-image block, count the color value distribution density of each channel, and output the color distribution feature matrix corresponding to the grid index; The edge intensity distribution matrix of all transition region grid indexes and the color distribution feature matrix are linearly superimposed to generate the detail features of the corresponding transition region grid indexes.
3. The method for assisting an artistic style in intelligent painting according to claim 2, characterized in that: The performing of transition area division on the artistic style reference image and establishing grid index distribution of different transition areas based on setting equal-size gridding rules specifically includes: According to the changing trend of depth of field, the artistic style benchmark map is divided into three dynamic transition areas: mid-ground-near-ground, mid-ground-far-ground, and far-ground-near-ground. For the dynamic transition area that has been divided, internal subdivision is performed based on the set size grid rule, and the transition area attribute label corresponding to each grid and the coordinate position of the grid in the image are marked; The attribution labels of each grid are encoded according to the coordinate position in the image to form the transition area index distribution.
4. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: In S2, the color temperature offset of the transition area of the artistic style reference image is extracted based on the Lab color space, specifically including: Input the artistic style benchmark image into the Lab color space conversion function to generate the corresponding a and b channel image data; Extract the pixel value sets of the a-channel and b-channel of the sub-image block corresponding to each transition region index distribution, calculate the mean of the a-channel and the mean of the b-channel, and output the center vector of the warm and cold color balance; According to the center vector of the warm and cold color balance, the warm and cold color offset is calculated according to the set color temperature distinction rule and encoded into a normalized warm and cold color offset map; The warm and cool color offset map is associated with the transition region index distribution to form a color temperature offset distribution of the transition region index distribution.
5. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: In S3, the detailed features of the transition area and the offset of warm and cold colors are integrated to generate a spatial illusion index matrix, and the spatial sense levels of different transition areas in the artistic style benchmark image are calibrated. Specifically, the following are included: Based on the transition region attribution label, the detail features in the transition region index and the color temperature offset are integrated into the spatial illusion index value, and the spatial illusion index matrix corresponding to the transition region is constructed. Based on the index values in the spatial illusion index matrix, quantile division processing is performed to divide the index values into spatial sense level intervals according to the set quantile ratio; According to the spatial sense level range, the spatial sense level of each transition area is calibrated.
6. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: In S4, the correspondence between the brushstroke input position and the transition area of the artistic style benchmark map is monitored in real time. Based on the current spatial level of the brushstroke area, the color temperature and edge of the brushstroke area are adjusted. Specifically, the following steps are performed: Receive the real-time position coordinate stream of the painting stroke, calibrate the transition area to which the current stroke position belongs based on the transition area of the artistic style reference map, and extract the spatial illusion indicator matrix corresponding to the current stroke position; Determine the spatial sense level based on the spatial illusion index matrix of the current brush stroke position, and match the spatial sense level of the current brush stroke position with the spatial sense level of the corresponding transition area in the calibration art style benchmark map; If the spatial sense level is not matched successfully, the color temperature and edge of the stroke area are adjusted based on the preset adjustment rules.
7. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: The adjusting of the color temperature and edge of the brush stroke area based on the preset adjustment rules specifically includes: Read the Lab color space a-channel and b-channel components of the color value at the current stroke position, and perform multiplicative adjustments on the a-channel and b-channel according to the preset color temperature offset adjustment ratio; Collect the edge grayscale gradient distribution of the current stroke position and calculate its local standard deviation value, and perform linear scaling of the gradient distribution according to the preset edge enhancement factor; The spatial illusion index matrix of the current stroke position during the adjustment process is extracted in real time, and the spatial sense level is divided and re-matched until the color temperature and edge adjustment is completed after the match is successful.
8. The method for assisting an artistic style with intelligent painting according to claim 1, characterized in that: In S5, extracting the transition texture flow direction of the adjusted painting brush stroke input position area to form a transition texture main flow direction map specifically includes: Based on the change of the coordinate stream of the painting stroke input position, the edge-adjusted painting stroke input trajectory is obtained, and pixel block windows of a set size are continuously intercepted in the stroke input trajectory; Calculate the grayscale gradient direction and magnitude of the pixel point in the pixel block window to obtain the edge gradient of each stroke position in the stroke input trajectory; Principal component analysis is performed on the edge gradient of the entire trajectory, and the main direction vector corresponding to the maximum eigenvalue is extracted as the main flow direction of the transition texture of the stroke input trajectory to form a transition texture main flow direction map.
9. The method for assisting an artistic style in intelligent painting according to claim 1, characterized in that: In S6, the spatial sense fracture area is identified based on the main flow direction map of the transition texture, and the texture flow direction correction of the spatial sense fracture area specifically includes: Performing continuity detection on the main flow direction of the transition texture of the stroke input trajectory, identifying adjacent pixel blocks whose main flow direction angle changes exceed a preset deviation threshold; Encode the detected boundary positions of adjacent pixel blocks with sudden directional changes as spatial fracture boundaries and generate directional difference maps between corresponding pixel blocks; In the spatial fracture boundary area, a transition direction interpolation zone is constructed based on the direction difference map to generate an interpolation direction vector; The interpolation direction vector is injected into the area where the fracture boundary is located to replace the original main flow direction vector and form a continuous flow direction correction map.