Camera parameter adjustment method, device, equipment and storage medium
By preprocessing and pose recognition of the original image, and adjusting the camera parameters in combination with the multivariate linear regression function and gradient descent algorithm, the problems of low efficiency and high technical threshold in the existing technology are solved, and high in various environments are achieved Quality shooting.
Patent Information
- Application Number
- CN202411427369.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-14
AI Technical Summary
In the field of photography and photography, the camera parameter adjustment efficiency is low, the technical threshold is high, and the environmental adaptability is poor, making it difficult to obtain high-quality images in various shooting environments.
By preprocessing the original image, the preset pose recognition model is used to extract features and environmental analysis, the pose-environment-camera parameter mapping relationship is established by combining multiple linear regression functions and gradient descent algorithms, camera parameters are adjusted in real time, and parameters are optimized through quality scoring are optimized , and finally adjust the camera parameters according to user preferences.
It improves shooting efficiency, lowers technical thresholds, ensures high-quality images in various shooting environments, and significantly improves shooting effect and user experience.
Smart Images

Figure CN118945460B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image capture technology, and in particular to a camera parameter adjustment method, device, equipment and storage medium. Background Art
[0002] Currently, in the field of photography and videography, the adjustment of camera parameters is crucial to obtaining high-quality images. Existing technologies usually rely on manual operation to manually adjust camera parameters such as focal length, exposure, white balance, etc. according to the shooting environment and the posture of the target object. Although professional photographers can make effective adjustments based on experience, this method has problems such as low efficiency, high technical threshold, and poor environmental adaptability. Summary of the invention
[0003] The present application provides a camera parameter adjustment method, device, equipment and storage medium for improving shooting efficiency, lowering technical barriers, and ensuring that high-quality images can be obtained in various shooting environments.
[0004] In a first aspect, an embodiment of the present application provides a camera parameter adjustment method, the method comprising:
[0005] Preprocess the original image to obtain an enhanced image;
[0006] Inputting the enhanced image into a preset posture recognition model for feature extraction and posture analysis, and outputting a posture information data set;
[0007] Performing environmental factor analysis on the enhanced image and the posture information data set to obtain an environmental feature parameter set;
[0008] Based on a preset multivariate linear regression function, a posture-environment-camera parameter mapping relationship is established according to the posture information data set and the environmental feature parameter set, and the camera parameters in the posture-environment-camera parameter mapping relationship are adjusted using a preset gradient descent algorithm to obtain a camera parameter adjustment value set;
[0009] generating a real-time captured image according to the camera parameter adjustment value set and the original image, performing a quality score on the real-time captured image, and adjusting the camera parameter adjustment value set according to a result of the quality score to obtain a camera parameter optimization value set;
[0010] According to the preset operation preference information, the camera parameter optimization value set is adjusted to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot.
[0011] In a second aspect, an embodiment of the present application provides a camera parameter adjustment device, the device comprising:
[0012] An image enhancement module is used to preprocess the original image to obtain an enhanced image;
[0013] A posture analysis module, used for inputting the enhanced image into a preset posture recognition model for feature extraction and posture analysis, and outputting a posture information data set;
[0014] An environmental analysis module, used to perform environmental factor analysis on the enhanced image and the posture information data set to obtain an environmental feature parameter set;
[0015] A parameter adjustment module, for establishing a posture-environment-camera parameter mapping relationship according to the posture information data set and the environmental feature parameter set based on a preset multivariate linear regression function, and adjusting the camera parameters in the posture-environment-camera parameter mapping relationship using a preset gradient descent algorithm to obtain a camera parameter adjustment value set;
[0016] a quality analysis module, configured to generate a real-time captured image according to the camera parameter adjustment value set and the original image, perform a quality score on the real-time captured image, and adjust the camera parameter adjustment value set according to a result of the quality score to obtain a camera parameter optimization value set;
[0017] The personalized following module is used to adjust the camera parameter optimization value set according to preset operation preference information to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot.
[0018] In a third aspect, an embodiment of the present application provides a terminal device, wherein the terminal device includes a memory and a processor;
[0019] The memory is used to store computer programs;
[0020] The processor is used to execute the computer program and implement the camera parameter adjustment method as described in any one of the embodiments of the present application when executing the computer program.
[0021] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor enables the processor to implement a camera parameter adjustment method as described in any one of the embodiments of the present application.
[0022] The embodiment of the present application provides a camera parameter adjustment method, which includes: preprocessing an original image to obtain an enhanced image; inputting the enhanced image into a preset posture recognition model to perform feature extraction and posture analysis, and outputting a posture information data set; performing environmental factor analysis on the enhanced image and the posture information data set to obtain an environmental feature parameter set; based on a preset multivariate linear regression function, establishing a posture-environment-camera parameter mapping relationship according to the posture information data set and the environmental feature parameter set, and using a preset gradient descent algorithm to adjust the camera parameters in the posture-environment-camera parameter mapping relationship to obtain a camera parameter adjustment value set; generating a real-time captured image according to the camera parameter adjustment value set and the original image, performing a quality score on the real-time captured image, and adjusting the camera parameter adjustment value set according to the result of the quality score to obtain a camera parameter optimization value set; adjusting the camera parameter optimization value set according to preset operation preference information to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot. In the above method, the original image is preprocessed to obtain a high-quality enhanced image, which ensures the accuracy of the subsequent steps. The posture recognition model is used to perform feature extraction and posture analysis, accurately identify the posture information of the target object, and construct a detailed posture information data set. The posture information data set and the preprocessed image are combined to achieve a comprehensive analysis of environmental factors and generate an environmental feature parameter set. The multivariate linear regression function and the gradient descent algorithm are then combined to comprehensively calculate the posture and environmental characteristics, establish a posture-environment-parameter mapping relationship, and obtain a set of camera parameter adjustment values. The quality of the real-time captured image is scored, and the camera parameters are fine-tuned based on the scoring results to ensure the effect of the parameter adjustment. Finally, a personalized parameter adjustment plan is constructed to meet the user's image output requirements, improve shooting efficiency, reduce technical barriers, and ensure that high-quality images can be obtained in various shooting environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.
[0024] Figure 1 A schematic flow chart of a camera parameter adjustment method provided in an embodiment of the present application;
[0025] Figure 2 A schematic block diagram of a camera parameter adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[0028] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.
[0029] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0030] See also Figure 1 , Figure 1 The embodiment of the present application also provides a schematic flow chart of a camera parameter adjustment method. Figure 1 As shown, the specific steps of the camera parameter adjustment method include: S101-S106.
[0031] S101, preprocessing the original image to obtain an enhanced image.
[0032] Exemplarily, the camera parameter adjustment method of the present application is applied to portrait photography, where the target object of the photography is a natural person. An image of the target object is captured using a camera device. In order to ensure the accuracy of subsequent processing, the captured image is preprocessed, including operations such as noise filtering, edge enhancement, and color correction. These preprocessing steps help improve the quality of the image, making subsequent gesture recognition and environmental analysis more accurate and reliable.
[0033] S102: Input the enhanced image into a preset posture recognition model for feature extraction and posture analysis, and output a posture information data set.
[0034] Exemplarily, based on the preprocessed image, a neural network model, for example, a posture recognition model based on MMpose, is used to perform posture recognition and key point tracking of the target object. The posture recognition module is a trained neural network model that extracts a posture information data set of the target object from the image, including key point information and posture information. This information includes but is not limited to the position of the head, the position of the limbs, and the overall posture of the body. The recognized posture information will serve as the basic data for subsequent environmental analysis and parameter adjustment.
[0035] S103: Perform environmental factor analysis on the enhanced image and posture information data set to obtain an environmental feature parameter set.
[0036] For example, based on the posture information data set provided by the posture recognition module, a comprehensive analysis is performed in combination with environmental factors such as illumination, background, and color distribution in the image. The illumination intensity, color balance, and background complexity of the shooting environment are evaluated through a specific algorithm. These environmental analysis results will be recorded as part of the input of the parameter adjustment algorithm to optimize the camera parameter settings.
[0037] By combining the portrait posture information dataset to strip out environmental factors and analyze the environmental factors, it is helpful to eliminate the interference of environmental factors and obtain higher quality images.
[0038] S104, based on a preset multivariate linear regression function, establish a posture-environment-camera parameter mapping relationship according to the posture information data set and the environmental feature parameter set, and use a preset gradient descent algorithm to adjust the camera parameters in the posture-environment-camera parameter mapping relationship to obtain a camera parameter adjustment value set.
[0039] Exemplarily, based on a preset multivariate linear regression function, the various parameters of the camera are automatically calculated and adjusted according to the posture information data set and the environmental characteristic parameter set. Specifically, the focal length will be adjusted according to the posture of the target object and the environment, the exposure value will be adjusted according to the lighting conditions, the white balance will be adjusted according to the background color, and the ISO sensitivity and other parameters will be adjusted according to the overall environment. The adjusted camera parameters will be applied to the camera in real time to optimize the shooting effect.
[0040] In this way, the camera's focal length can be dynamically adjusted according to the specific posture and environment of the target object to ensure that the target is presented clearly; the exposure value can be intelligently adjusted according to the lighting conditions on site to ensure that the brightness of the picture is appropriate; the white balance setting can be flexibly adjusted according to the changes in background color to make the color reproduction more accurate and natural; and the ISO sensitivity can be reasonably set according to the overall environmental conditions to effectively control noise and improve image quality. This series of intelligent adjustment processes are completed in real time in the background without manual intervention by the user, which significantly improves the shooting effect and enables each shot to obtain the best visual experience.
[0041] S105 , generating a real-time captured image according to the camera parameter adjustment value set and the original image, performing a quality score on the real-time captured image, and adjusting the camera parameter adjustment value set according to a result of the quality score to obtain a camera parameter optimization value set.
[0042] Exemplarily, after the application parameter adjustment, a real-time captured image is generated by a real-time feedback system, and the real-time captured image is generated by correcting the original image according to the camera parameter adjustment value set. The real-time feedback system records the quality of the captured image and feeds this information back to the gesture recognition module and the parameter adjustment algorithm. This mechanism ensures that the system can dynamically respond to changes in the shooting effect and make necessary adjustments and optimizations. If the feedback system detects that the image quality does not meet expectations, it will trigger the parameter readjustment process to ensure the best state of the final shooting effect.
[0043] S106. Adjust the camera parameter optimization value set according to the preset operation preference information to obtain a personalized camera parameter set, where the personalized camera parameter set is used to control the camera to shoot.
[0044] Exemplarily, the preset operation preference information is generated by two methods: 1. Providing a friendly user interaction interface allows users to set shooting preferences and manually adjust parameters, thereby generating preset operation preference information, which improves the user experience; 2. In the case where the user does not manually set, the preset operation preference information is generated based on historical shooting parameters and historical operation data. Through the user interaction interface, users can enter personal preferences, which will be recorded by the system and considered in subsequent automatic adjustments. Using machine learning technology, the parameter adjustment strategy is continuously optimized based on historical shooting parameters and user feedback, and the shooting effect is continuously improved to meet the personalized needs of users.
[0045] The embodiment of the present application provides a camera parameter adjustment method, which includes: preprocessing an original image to obtain an enhanced image; inputting the enhanced image into a preset posture recognition model to perform feature extraction and posture analysis, and outputting a posture information data set; performing environmental factor analysis on the enhanced image and the posture information data set to obtain an environmental feature parameter set; based on a preset multivariate linear regression function, establishing a posture-environment-camera parameter mapping relationship according to the posture information data set and the environmental feature parameter set, and using a preset gradient descent algorithm to adjust the camera parameters in the posture-environment-camera parameter mapping relationship to obtain a camera parameter adjustment value set; generating a real-time captured image according to the camera parameter adjustment value set and the original image, performing a quality score on the real-time captured image, and adjusting the camera parameter adjustment value set according to the result of the quality score to obtain a camera parameter optimization value set; adjusting the camera parameter optimization value set according to preset operation preference information to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot. In the above method, the original image is preprocessed to obtain a high-quality enhanced image, which ensures the accuracy of the subsequent steps. The posture recognition model is used to perform feature extraction and posture analysis, accurately identify the posture information of the target object, and construct a detailed posture information data set. The posture information data set and the preprocessed image are combined to achieve a comprehensive analysis of environmental factors and generate an environmental feature parameter set. The multivariate linear regression function and the gradient descent algorithm are then combined to comprehensively calculate the posture and environmental characteristics, establish a posture-environment-parameter mapping relationship, and obtain a set of camera parameter adjustment values. The quality of the real-time captured image is scored, and the camera parameters are fine-tuned based on the scoring results to ensure the effect of the parameter adjustment. Finally, a personalized parameter adjustment plan is constructed to meet the user's image output requirements, improve shooting efficiency, reduce technical barriers, and ensure that high-quality images can be obtained in various shooting environments.
[0046] In order to more clearly introduce the technical solution of the present application, the technical solution of the present application will be introduced through specific embodiments below. It should be noted that the specific embodiments are used to expand the technical solution of the present application, but are not intended to limit the present application.
[0047] In some embodiments, the enhanced image is input into a preset posture recognition model for feature extraction and posture analysis, and a posture information data set is output, including: S201-S210.
[0048] S201, performing a multi-scale pyramid transformation on the enhanced image to obtain an image set with multiple resolutions.
[0049] Exemplarily, by performing a multi-scale pyramid transform on the enhanced image, the enhanced image is downsampled to obtain a series of images of different resolutions, including image levels from high resolution to low resolution. The multi-scale pyramid transform can capture different scale information of the image, improve the robustness of feature extraction, and adapt to different object sizes and detail levels.
[0050] S202, performing convolution operations on images of each resolution using convolution kernels of 3x3, 5x5, and 7x7, respectively, to obtain a multi-scale feature map.
[0051] S203, applying maximum pooling and average pooling operations to the multi-scale feature map to obtain a downsampled feature map. The downsampled feature map is input into the residual network module, and a deep feature set is obtained through skip connection and identity mapping processing.
[0052] For example, the downsampled feature map is input into the residual network (ResNet) module, processed through skip connections and identity mapping, and the deep feature set is extracted layer by layer. The residual network can effectively solve the gradient vanishing problem in deep network training, allowing information to propagate more efficiently in the network, and improving the depth and expression ability of feature extraction.
[0053] S204, applying a spatial pyramid pooling operation to the deep feature set, integrating features of different scales into a vector of fixed length, and obtaining a global feature descriptor.
[0054] For example, a spatial pyramid pooling (SPP) operation is applied to the deep feature set to integrate feature patches of different scales into a feature vector of fixed length. Spatial pyramid pooling can convert input images of different sizes into feature vectors of fixed size, enhance the scale invariance of features, and retain spatial hierarchical information.
[0055] S205: Apply the attention mechanism to the global feature descriptor to calculate feature weights and obtain a weighted feature vector.
[0056] S206: Input the weighted feature vector into the fully connected layer, and obtain an intermediate representation feature set through ReLU activation function and Dropout regularization processing.
[0057] S207: Apply a softmax classifier to the intermediate representation feature set, output the category probability distribution of the target object, and obtain an object classification result.
[0058] S208. Based on the object classification result, a regression network is applied to the intermediate representation feature set to output the key point coordinates of the target object, and geometric constraints and confidence threshold screening are applied to the key point coordinates to obtain a refined key point position set.
[0059] For example, the object classification result is used as prior information, and the intermediate representation feature set is input into the regression network to predict the key point coordinates of the target object for refined positioning. The regression network can accurately predict the key point coordinates of the target object based on the classification result and the intermediate representation, thereby improving the accuracy of key point detection.
[0060] Apply geometric constraints and confidence thresholds to filter the predicted key point coordinates, remove outliers and low-confidence points, and obtain a refined set of key point locations. Geometric constraints and confidence filtering can remove inaccurate key point detection results and improve the accuracy and reliability of key point locations.
[0061] S209: Calculate the relative positions and angle relationships between the key points based on the refined key point position set to obtain a posture vector combination.
[0062] Exemplarily, based on the structure of the target object, select key point pairs with significant posture features. For example, commonly used key points in human posture include head, shoulders, elbows, wrists, hips, knees and ankles. Define key point pairs, such as (shoulder-elbow), (elbow-wrist), (hip-knee), etc. For each pair of key points, calculate their relative positions in the image coordinate system. Calculate the angular relationship between each pair of key points. Assuming the key point pairs (A, B) and (B, C), their angular relationship θ can be calculated by the vector angle formula:
[0063] ;
[0064] Among them, r AB and r BC are the relative position vectors of the key point pairs (A, B) and (B, C), is the angle relationship between key points A, B and C. The relative position vectors and angle relationships of all key point pairs are combined into a high-dimensional vector, which is called a posture vector combination.
[0065] The relative position and angle relationship can fully reflect the posture characteristics of the target object. By calculating the relative position and angle relationship between key points and constructing the posture vector, the posture change and structural information of the target object can be captured, providing the necessary information support for subsequent posture analysis and camera parameter adjustment.
[0066] S210: Combine the object classification result and the posture vector to form a posture information data set.
[0067] Through the above method, the posture features in the image are extracted to assist in improving the accuracy of camera parameter adjustment in subsequent steps.
[0068] In some embodiments, environmental factor analysis is performed on the enhanced image and posture information data set to obtain an environmental feature parameter set, including: S301-S306.
[0069] S301. Extract Y channel brightness information of the enhanced image based on the YCbCr color space, and determine a light intensity index according to the Y channel brightness information.
[0070] Exemplarily, the enhanced image is processed in YCbCr color space, the Y channel brightness information is extracted, and the light intensity index is obtained by calculating the global average and global standard deviation of the Y channel. The specific calculation formula is:
[0071] ;
[0072] Among them, LI is the light intensity index, is the global average value of the Y channel, is the global standard deviation of the Y channel, α is the first weight coefficient, and β is the second weight coefficient.
[0073] S302, based on the YCbCr color space, extracting the Cb channel data and the Cr channel data of the enhanced image, performing K-means clustering on the pixels of the enhanced image according to the Cb channel data and the Cr channel data, and generating a color distribution feature matrix.
[0074] Exemplarily, based on the Cb channel data and Cr channel data of the YCbCr color space, K-means clustering is performed on the pixels of the enhanced image, and the K value is set to 5 to obtain 5 main color clusters. The center point coordinates (Cbi, Cri) and center proportion Pi of each cluster are calculated to construct a color distribution feature matrix. The specific expression of the color distribution feature matrix is:
[0075] CD=[(Cb1, Cr1, P1), (Cb2, Cr2, P2),..., (Cb5, Cr5, P5)];
[0076] Among them, CD is the color distribution feature matrix.
[0077] S303, performing a two-dimensional discrete Fourier transform on the enhanced image to obtain a frequency domain image, and calculating the proportion of high-frequency components in the frequency domain image as a background complexity index.
[0078] Exemplarily, a two-dimensional discrete Fourier transform is performed on the enhanced image to obtain a frequency domain image, and the proportion of high-frequency components is calculated as an indicator of background complexity. The high-frequency components represent the rapidly changing components and details in the image in the frequency domain image. By calculating the proportion of high-frequency components, the degree of details and changes in the image can be effectively quantified, thereby reflecting the complexity of the background.
[0079] S304. Calculate the image ratio and position eccentricity of the target object according to the key point coordinates in the posture information data set, wherein the image ratio is the ratio of the area of the positioning frame of the target object to the area of the enhanced image, and the position eccentricity is determined according to the center coordinates of the target object, the width of the enhanced image, and the height of the enhanced image.
[0080] Exemplarily, according to the key point coordinates in the posture information data set, the image proportion value and the position eccentricity EC of the target object are calculated, wherein the image proportion value is the ratio of the area of the positioning frame of the target object to the area of the enhanced image, and the positioning frame is generated according to the key point coordinates of the target object. The specific calculation formula of the position eccentricity is:
[0081] ;
[0082] Among them, EC is the position eccentricity, (Cx, Cy) is the target center coordinate, W is the image width, and H is the image height.
[0083] S305, constructing an environment feature vector using the light intensity index, the color distribution feature matrix, the background complexity index, the target proportion OP and the position eccentricity.
[0084] S306 , applying a preset principal component analysis algorithm to the environmental feature vector for dimensionality reduction processing, retaining the first three principal components, and obtaining an environmental feature parameter set.
[0085] In some embodiments, based on a preset multivariate linear regression function, a posture-environment-camera parameter mapping relationship is established according to a posture information data set and an environmental feature parameter set, and a preset gradient descent algorithm is used to adjust the camera parameters in the posture-environment-camera parameter mapping relationship to obtain a camera parameter adjustment value set, including: S401-S407.
[0086] S401. Perform feature dimensionality reduction processing on the posture information data set through a principal component analysis algorithm to obtain a posture feature vector after dimensionality reduction.
[0087] Exemplarily, the high-dimensional posture information data is mapped to an important low-dimensional space through the principal component analysis (PCA) algorithm to obtain the reduced-dimensional posture feature vector P, thereby retaining the main posture features and enhancing the generalization ability of the model.
[0088] S402, normalizing the environmental characteristic parameter set by using the Min-Max normalization method to obtain a normalized environmental characteristic vector.
[0089] Exemplarily, the environmental feature parameter set is normalized to obtain a normalized environmental feature vector, so that different features can be compared and calculated on the same scale, avoiding deviations between features due to different dimensions and ensuring data consistency and stability of model training.
[0090] S403, constructing a first input feature matrix according to the posture feature vector after dimension reduction and the normalized environment feature vector, matching the target variable from the preset shooting data set, and establishing a multivariate linear regression function according to the first input feature matrix and the target variable.
[0091] Exemplarily, a first input feature matrix X=[P, E] is constructed based on the reduced-dimensional posture feature vector and the normalized environmental feature vector, and the target variable Y is matched from a preset shooting data set based on the first input feature matrix. The preset shooting data set includes: manually annotated historical posture parameters, historical environmental parameters, and historical camera parameters. The historical camera parameters include: focal length, aperture, shutter speed, ISO. When establishing a multivariate linear regression function, the target camera parameters are matched from the historical camera parameters of the preset shooting data set based on the first input feature matrix X. The multivariate linear regression function is: Y=XW1+b1, where W1 is the first weight matrix and b1 is the first bias vector.
[0092] The parameter adjustment model is constructed through the multivariate linear regression function, and the mapping relationship between posture characteristics and environmental characteristics is determined. This mapping relationship provides a clear mathematical basis for camera parameter adjustment, and can automatically calculate the optimal camera settings according to different shooting conditions, thereby improving the accuracy and consistency of the shooting effect.
[0093] S404. Through the Lasso regression function, a penalty term is introduced into the multivariate linear regression function. The penalty term is: λ||W1||, and the first regularized regression function is obtained: J(W, b)=||Y-XW1-b1|| 2 +λ||W1||, where λ is the regularization coefficient.
[0094] S405. Optimize the first regularized regression function by using a preset small batch stochastic gradient descent algorithm to obtain a second regularized regression function.
[0095] Exemplarily, the first regularized regression function is optimized by a preset small batch stochastic gradient descent algorithm to obtain a second weight matrix W2 and a second bias vector b2. The specific calculation formula is:
[0096] ;
[0097] ;
[0098] Among them, η is the learning rate.
[0099] By introducing the Mini-batch Stochastic Gradient Descent (Mini-batch SGD) algorithm, the weight matrix and bias vector are further optimized, and the efficiency and stability of parameter optimization are improved.
[0100] S406: Obtain a second input feature matrix according to the posture feature vector and the environment feature vector.
[0101] Exemplarily, a second input feature matrix is obtained according to the posture feature vector and the environment feature vector.
[0102] S407 . Predict the posture-environment input feature matrix of the current scene according to the second weight matrix W2 and the second bias vector b2 to obtain a set of camera parameter adjustment values.
[0103] Finally, the optimized parameter adjustment model can accurately predict the current posture-environment feature input (the second input feature matrix) and output a set of camera parameter adjustment values. Through precise calculation and optimization, the intelligent level of automatic camera parameter adjustment is significantly improved, ensuring the best image quality under different shooting conditions, greatly simplifying user operations and improving user experience.
[0104] In some embodiments, a quality score is performed on a real-time captured image, and a camera parameter adjustment value set is adjusted according to the result of the quality score to obtain a camera parameter optimization value set, including: edge detection is performed on the real-time captured image by a Laplace operator, and the gradient amplitude variance of the real-time captured image is calculated to obtain an image clarity index. A brightness histogram of the real-time captured image is constructed, and the global standard deviation and skewness of the brightness value are calculated according to the brightness histogram to obtain an exposure balance index. The real-time captured image is converted into an HSV color space, and the average value and variance of the saturation channel are calculated to obtain a color saturation index. A weighted score is performed according to the image clarity index, the exposure balance index, and the color saturation index to obtain an image quality score. If it is detected that the image quality score is lower than a preset score threshold, a parameter fine-tuning process is triggered, and the camera parameter adjustment value set is optimized using a particle swarm optimization algorithm to obtain a fine-tuned parameter value. Verification shooting is performed according to the fine-tuned parameter value until the image quality score exceeds the preset score threshold or the maximum number of iterations is reached, and a camera parameter optimization value set is obtained.
[0105] By scoring the quality of real-time captured images, key indicators such as the clarity, exposure balance, and color saturation of the current captured image can be dynamically evaluated to ensure comprehensive optimization of the shooting effect. The Laplace operator is used to calculate the variance of the image gradient amplitude to quantify the clarity of the image. The brightness histogram and HSV color space conversion are used to evaluate the exposure balance and color saturation, respectively. Through the weighted scoring of these indicators, the system can accurately judge the image quality. If the score is lower than the preset scoring threshold, the particle swarm optimization algorithm is triggered to fine-tune the camera parameters until the image quality score reaches the expected standard or the maximum number of iterations is reached. This process ensures the automatic optimization of camera parameters, reduces manual intervention, improves shooting efficiency and consistency of image quality, adapts to various shooting conditions, and provides a more professional shooting experience.
[0106] In some embodiments, the camera parameter optimization value set is adjusted according to preset operation preference information to obtain a personalized camera parameter set, including: extracting features of historical shooting parameters and historical operation data to construct a historical feature vector; establishing a user preference model through a support vector machine algorithm, and inputting the historical feature vector into the user preference model; dynamically optimizing the historical feature vector through a preset reinforcement learning method, and using a preset Q-learning algorithm to adjust the parameter optimization strategy to obtain a personalized camera parameter set.
[0107] In some embodiments, the original image is preprocessed to obtain an enhanced image, including: applying a Gaussian filter to the original image to obtain a first corrected image; performing edge enhancement on the first corrected image through a Sobel operator to obtain a second corrected image; and performing color correction on the second corrected image through histogram equalization to obtain an enhanced image.
[0108] By processing the original image with a Gaussian filter, the noise in the image can be effectively reduced, thereby obtaining a smoother first corrected image; then, the edge enhancement of the first corrected image using the Sobel operator can highlight the edge features in the image and enhance the detail expression of the image, thereby obtaining a second corrected image; finally, by color correction of the second corrected image using histogram equalization, the brightness and contrast of the image can be balanced, making the color distribution of the image more uniform and natural, and finally obtaining an enhanced image. Through this series of preprocessing steps, the quality of the image is significantly improved, providing a more accurate and reliable data basis for subsequent gesture recognition and environmental analysis.
[0109] See also Figure 2 , Figure 2 The embodiment of the present application also provides a schematic block diagram of a camera parameter adjustment device, wherein the camera parameter adjustment device 200 is used to execute the aforementioned camera parameter adjustment method. The camera parameter adjustment device 200 may be configured in a server.
[0110] Among them, the server can be an independent server or a server cluster, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms.
[0111] like Figure 2 As shown, the camera parameter adjustment device 200 includes: an image enhancement module 201, a posture analysis module 202, an environment analysis module 203, a parameter adjustment module 204, a quality analysis module 205 and a personality following module 206.
[0112] The image enhancement module 201 is used to pre-process the original image to obtain an enhanced image.
[0113] The posture analysis module 202 is used to input the enhanced image into a preset posture recognition model for feature extraction and posture analysis, and output a posture information data set.
[0114] The environment analysis module 203 is used to perform environment factor analysis on the enhanced image and the posture information data set to obtain an environment feature parameter set.
[0115] The parameter adjustment module 204 is used to establish a posture-environment-camera parameter mapping relationship based on a preset multivariate linear regression function according to the posture information data set and the environmental feature parameter set, and use a preset gradient descent algorithm to adjust the camera parameters in the posture-environment-camera parameter mapping relationship to obtain a camera parameter adjustment value set.
[0116] The quality analysis module 205 is used to generate a real-time captured image according to the camera parameter adjustment value set and the original image, perform a quality score on the real-time captured image, and adjust the camera parameter adjustment value set according to the result of the quality score to obtain a camera parameter optimization value set.
[0117] The personalized following module 206 is used to adjust the camera parameter optimization value set according to the preset operation preference information to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot.
[0118] An embodiment of the present application provides a terminal device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a camera parameter adjustment method such as any one of the embodiments of the present application when executing the computer program.
[0119] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements any camera parameter adjustment method according to the embodiments of the present application.
[0120] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A camera parameter adjustment method, characterized in that: The method comprises: Preprocess the original image to obtain an enhanced image; The enhanced image is subjected to a multi-scale pyramid transformation to obtain an image set of multiple resolutions; a convolution operation is performed on each image of each resolution using 3x3, 5x5 and 7x7 convolution kernels to obtain a multi-scale feature map; a maximum pooling and an average pooling operation are applied to the multi-scale feature map to obtain a downsampled feature map; the downsampled feature map is input into a residual network module, and a deep feature set is obtained through skip connection and identity mapping processing; a spatial pyramid pooling operation is applied to the deep feature set to integrate features of different scales into a vector of a fixed length to obtain a global feature descriptor; an attention mechanism is applied to the global feature descriptor to calculate feature weights to obtain a weighted feature vector; the weighted feature vector is input into a residual network module. Enter the fully connected layer, and obtain the intermediate representation feature set through the ReLU activation function and Dropout regularization processing; apply the softmax classifier to the intermediate representation feature set, output the category probability distribution of the target object, and obtain the object classification result; based on the object classification result, apply the regression network to the intermediate representation feature set, output the key point coordinates of the target object, and apply geometric constraints and confidence threshold screening to the key point coordinates to obtain a refined key point position set; according to the refined key point position set, calculate the relative position and angle relationship between the key points to obtain a posture vector combination; combine the object classification result and the posture vector to form a posture information data set; Based on the YCbCr color space, extract the Y channel brightness information of the enhanced image, and determine the light intensity index according to the Y channel brightness information; based on the YCbCr color space, extract the Cb channel data and the Cr channel data of the enhanced image, perform K-means clustering on the pixels of the enhanced image according to the Cb channel data and the Cr channel data, and generate a color distribution feature matrix; perform a two-dimensional discrete Fourier transform on the enhanced image to obtain a frequency domain image, and calculate the proportion of high-frequency components of the frequency domain image as a background complexity index; calculate the image proportion value and position eccentricity of the target object according to the key point coordinates in the posture information data set, wherein the image proportion value is the ratio of the area of the positioning frame of the target object to the area of the enhanced image, and the position eccentricity is determined according to the center coordinates of the target object, the width of the enhanced image, and the height of the enhanced image; construct an environmental feature vector using the light intensity index, the color distribution feature matrix, the background complexity index, the target proportion OP, and the position eccentricity; apply a preset principal component analysis algorithm to the environmental feature vector for dimensionality reduction processing, retain the first three principal components, and obtain an environmental feature parameter set; The posture information data set is subjected to feature dimension reduction processing by a preset principal component analysis algorithm to obtain a posture feature vector after dimension reduction; the environmental feature parameter set is normalized by a Min-Max normalization method to obtain a normalized environmental feature vector; a first input feature matrix is constructed according to the posture feature vector after dimension reduction and the normalized environmental feature vector, and a target variable is matched from a preset shooting data set, and a multivariate linear regression function is established according to the first input feature matrix and the target variable; a penalty term is introduced into the multivariate linear regression function by a Lasso regression function to obtain a first regularized regression function; the first regularized regression function is optimized by a preset small batch stochastic gradient descent algorithm to obtain a second regularized regression function; a second input feature matrix is obtained according to the posture feature vector and the environmental feature vector; the second input feature matrix is predicted according to the second regularized regression function to obtain a set of camera parameter adjustment values; Generate a real-time captured image according to the camera parameter adjustment value set and the original image, perform edge detection on the real-time captured image by using the Laplace operator, calculate the gradient amplitude variance of the real-time captured image, and obtain an image clarity index; construct a brightness histogram of the real-time captured image, calculate the global standard deviation and skewness of the brightness value according to the brightness histogram, and obtain an exposure balance index; perform HSV color space conversion on the real-time captured image, calculate the average value and variance of the saturation channel, and obtain a color saturation index; perform weighted scoring according to the image clarity index, the exposure balance index, and the color saturation index to obtain an image quality score; if it is detected that the image quality score is lower than a preset scoring threshold, trigger a parameter fine-tuning process, use a particle swarm optimization algorithm to optimize the camera parameter adjustment value set, and obtain a fine-tuned parameter value; perform verification shooting according to the fine-tuned parameter value until the image quality score exceeds the preset scoring threshold or reaches a maximum number of iterations, and obtain a camera parameter optimization value set; According to the preset operation preference information, the camera parameter optimization value set is adjusted to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot.
2. The camera parameter adjustment method according to claim 1, characterized in that: The step of adjusting the camera parameter optimization value set according to the preset operation preference information to obtain a personalized camera parameter set includes: Perform feature extraction on historical shooting parameters and historical operation data to construct historical feature vectors: Establishing a user preference model by using a support vector machine algorithm, and inputting the historical feature vector into the user preference model; The historical feature vector is dynamically optimized by a preset reinforcement learning method, and the parameter optimization strategy is adjusted by a preset Q-learning algorithm to obtain the personalized camera parameter set.
3. The camera parameter adjustment method according to claim 1, wherein: The preprocessing of the original image to obtain an enhanced image includes: Applying a Gaussian filter to the original image to obtain a first corrected image; Performing edge enhancement on the first corrected image by using a Sobel operator to obtain a second corrected image; The second corrected image is color corrected by histogram equalization to obtain an enhanced image.
4. A camera parameter adjustment device, characterized in that: The camera parameter adjustment device comprises: An image enhancement module is used to preprocess the original image to obtain an enhanced image; The posture analysis module is used to perform multi-scale pyramid transformation on the enhanced image to obtain a set of images with multiple resolutions; convolution operations are performed on the images of each resolution using 3x3, 5x5 and 7x7 convolution kernels to obtain a multi-scale feature map; maximum pooling and average pooling operations are applied to the multi-scale feature map to obtain a downsampled feature map; the downsampled feature map is input into the residual network module, and a deep feature set is obtained through skip connection and identity mapping processing; a spatial pyramid pooling operation is applied to the deep feature set to integrate features of different scales into a vector of fixed length to obtain a global feature descriptor; an attention mechanism is applied to the global feature descriptor to calculate feature weights to obtain a weighted feature vector; the weighted feature vector is added to the weighted feature vector. The feature vector is input into the fully connected layer, and is processed by the ReLU activation function and Dropout regularization to obtain an intermediate representation feature set; a softmax classifier is applied to the intermediate representation feature set to output the category probability distribution of the target object and obtain an object classification result; based on the object classification result, a regression network is applied to the intermediate representation feature set to output the key point coordinates of the target object, and geometric constraints and confidence thresholds are applied to the key point coordinates to obtain a refined key point position set; based on the refined key point position set, the relative position and angle relationship between the key points are calculated to obtain a posture vector combination; the object classification result and the posture vector are combined to form a posture information data set; The environment analysis module is used to extract the Y channel brightness information of the enhanced image based on the YCbCr color space, and determine the light intensity index according to the Y channel brightness information; extract the Cb channel data and Cr channel data of the enhanced image based on the YCbCr color space, perform K-means clustering on the pixel points of the enhanced image according to the Cb channel data and the Cr channel data, and generate a color distribution feature matrix; perform a two-dimensional discrete Fourier transform on the enhanced image to obtain a frequency domain image, and calculate the proportion of high-frequency components of the frequency domain image as a background complexity index; according to the posture information The key point coordinates in the data set are used to calculate the image proportion value and position eccentricity of the target object, wherein the image proportion value is the ratio of the area of the positioning box of the target object to the area of the enhanced image, and the position eccentricity is determined according to the center coordinates of the target object, the width of the enhanced image, and the height of the enhanced image; an environmental feature vector is constructed using the illumination intensity index, the color distribution feature matrix, the background complexity index, the target proportion OP, and the position eccentricity; a preset principal component analysis algorithm is applied to the environmental feature vector for dimensionality reduction processing, and the first three principal components are retained to obtain an environmental feature parameter set; A parameter adjustment module is used to perform feature dimension reduction processing on the posture information data set through a preset principal component analysis algorithm to obtain a posture feature vector after dimension reduction; normalize the environmental feature parameter set through a Min-Max normalization method to obtain a normalized environmental feature vector; construct a first input feature matrix based on the posture feature vector after dimension reduction and the normalized environmental feature vector, match the target variable from a preset shooting data set, and establish a multivariate linear regression function based on the first input feature matrix and the target variable; introduce a penalty term into the multivariate linear regression function through a Lasso regression function to obtain a first regularized regression function; optimize the first regularized regression function through a preset small batch stochastic gradient descent algorithm to obtain a second regularized regression function; obtain a second input feature matrix based on the posture feature vector and the environmental feature vector; predict the second input feature matrix based on the second regularized regression function to obtain a camera parameter adjustment value set; A quality analysis module, used to generate a real-time captured image according to the camera parameter adjustment value set and the original image, perform edge detection on the real-time captured image by using a Laplace operator, calculate the gradient amplitude variance of the real-time captured image, and obtain an image clarity index; construct a brightness histogram of the real-time captured image, calculate the global standard deviation and skewness of the brightness value according to the brightness histogram, and obtain an exposure balance index; perform HSV color space conversion on the real-time captured image, calculate the average value and variance of the saturation channel, and obtain a color saturation index; perform weighted scoring according to the image clarity index, the exposure balance index, and the color saturation index to obtain an image quality score; if it is detected that the image quality score is lower than a preset scoring threshold, a parameter fine-tuning process is triggered, and the camera parameter adjustment value set is optimized using a particle swarm optimization algorithm to obtain a fine-tuned parameter value; verification shooting is performed according to the fine-tuned parameter value until the image quality score exceeds the preset scoring threshold or reaches a maximum number of iterations, and a camera parameter optimization value set is obtained; The personalized following module is used to adjust the camera parameter optimization value set according to preset operation preference information to obtain a personalized camera parameter set, and the personalized camera parameter set is used to control the camera to shoot.
5. A terminal device, characterized in that: The terminal device includes a memory and a processor; The memory is used to store computer programs; The processor is used to execute the computer program and implement the camera parameter adjustment method according to any one of claims 1 to 3 when executing the computer program.
6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor implements the camera parameter adjustment method according to any one of claims 1 to 3.
