A computer screen automatic rotation adjusting method and device based on face recognition and angle measurement
By using facial recognition and angle measurement technology, a multi-objective health cost function and state space model are constructed to achieve automatic rotation adjustment of the computer screen. This solves the problems of the traditional adjustment method being singular and lacking in health benefits, and provides personalized and comfortable screen angle adjustment to prevent eye strain and cervical spondylosis.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-12
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies lack precise measurement of the angle between the user's face and the screen plane, resulting in a single method of computer screen adjustment that cannot adapt to changes in user posture in a timely manner. This lack of optimization for health and comfort leads to health problems such as eye strain and cervical spondylosis.
The system obtains the user's brow and lip feature points through facial recognition, measures the angle between the face and the screen by combining trigonometric functions and pinhole imaging principles, constructs a multi-objective health cost function, establishes a continuous-time state-space model, performs discretization processing, generates the optimal control input sequence, and drives the motor to achieve automatic screen rotation.
It achieves precise, comfortable, and personalized automatic adjustment of the computer screen angle, effectively preventing eye strain and cervical spondylosis, improving the user's health protection level, and the adjustment process is smooth and adaptable to different user needs.
Smart Images

Figure CN121501085B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of human-computer interaction, and in particular to a computer screen automatic rotation adjusting method and device based on face recognition and angle measurement. BACKGROUND
[0002] With the popularity of computers and mobile devices in modern society, users have long been in a fixed posture in front of the computer, which has caused serious health problems such as vision loss, neck pain and spinal disorders. The traditional computer screen adjustment method mainly relies on manual adjustment, which has the problems of insufficient accuracy, delayed response and inability to adapt to changes in user posture in time. In addition, current automatic adjustment schemes are usually limited to simple mechanical operations, lacking real-time user posture data feedback and corresponding precise mathematical model support, making the adjustment method single and less personalized.
[0003] On the other hand, the prior art lacks a method for measuring the precise angle between the user's face and the plane on which the screen is located, and even more lacks an optimization model that combines user comfort and health, resulting in users being unable to obtain precise, comfortable and healthy screen angles. Over time, users working at inappropriate screen angles for a long time will cause significant visual fatigue, neck muscle fatigue, and even long-term damage.
[0004] Therefore, there is an urgent need for an intelligent, precise and real-time response to user posture changes computer screen automatic rotation adjusting device and method, which realizes personalized and precise automatic adjustment of screen angles through systematic model building and intelligent feedback control, and effectively improves the health of users. SUMMARY
[0005] The present application provides a computer screen automatic rotation adjusting method and device based on face recognition and angle measurement to solve at least one of the above technical problems in the prior art.
[0006] In a first aspect, the present application provides a computer screen automatic rotation adjusting method based on face recognition and angle measurement, which comprises:
[0007] Obtaining a user face image and extracting the positions of the user's eyebrow center and lip pearl feature points based on the user face image, and inversely calculating the first angle between the user's face plane and the computer screen using trigonometric functions and pinhole imaging principles, while using an angle encoder to measure the second angle between the computer screen and the desktop on which the computer is located in real time;
[0008] construct a multi-objective health cost function with user health posture and visual comfort as optimization targets based on the first and second angles, and set an angle compensation term based on the multi-objective health cost function, and perform double-interval constraint compensation on the first and second angles based on the angle compensation term to obtain a target rotation angle;
[0009] a continuous-time state space model of the computer screen rotation system is established with the second angle as a state variable and a preset angular acceleration as a control input, and the continuous-time state space model is discretized to obtain a discrete-time model;
[0010] a quasi-convex optimization problem of a computer screen rotation trajectory is constructed according to the discrete-time model, the target rotation angle, and a preset performance index;
[0011] an optimization algorithm is used to solve the quasi-convex optimization problem to generate an optimal control input sequence from the second angle to the target rotation angle, and a driving execution motor for controlling the rotation of the computer screen is driven according to the optimal control input sequence until the computer screen is rotated to the target rotation angle with the computer screen.
[0012] In an optional implementation, the multi-objective health cost function is:
[0013]
[0014] In the formula, represents a posture deviation; represents a visual comfort deviation; represents a posture deviation weight coefficient; represents a visual comfort deviation weight coefficient.
[0015] In an optional implementation, the discrete-time model is:
[0016]
[0017] In the formula, represents a discrete-time state matrix, used to describe the change of system state over time; represents a discrete time point, used to construct a discrete-time model to convert a continuous-time model into a discrete-time model; represents a state variable at a discrete time point ; represents an input matrix, used to map a control input to a system state; represents a sampling time point, representing a time interval at which a system state is sampled or updated; represents a control input at a discrete time point ; represents a discrete-time model at a discrete time point In an alternative embodiment, a quasi-convex optimization problem is constructed for the computer screen rotation trajectory, specifically including:
[0018] Boundary conditions for the computer screen rotation trajectory are set, while system constraints are set, including amplitude constraints of control input, amplitude constraints of angular velocity, and angular range constraints of target rotation angle;
[0019] The discrete-time model, boundary conditions, and system constraints are collectively formed into a sub-level set of the optimization problem, while a corresponding objective function is selected according to the preset performance index, which is one of time optimality, energy optimality, or comfort optimality;
[0020] Based on the objective function and the sub-level set, a quasi-convex optimization problem for the computer screen rotation trajectory is constructed.
[0021] In an alternative embodiment, an optimization algorithm is used to solve the quasi-convex optimization problem, specifically including:
[0022] When the preset performance index is a time optimality index, the objective function is a minimum adjustment step function, and a bisection search algorithm is used to iteratively solve the minimum transport time and its corresponding control input sequence that satisfy all constraints;
[0023] When the preset performance index is an energy optimality index, the objective function is a total control energy minimization function, and a quadratic programming algorithm is used to determine the energy-minimal trajectory within a limited transport time, obtaining the corresponding control input sequence;
[0024] When the preset performance index is a comfort optimality index, the objective function is a minimum angular acceleration change rate function, and a quadratic programming algorithm is used to adjust the angular acceleration change within a limited transport time, obtaining a control input sequence with smooth acceleration change.
[0025] In a second aspect, the present application provides a computer screen automatic rotation adjustment device based on face recognition and angle measurement, which can perform a computer screen automatic rotation adjustment method based on face recognition and angle measurement as described in the first aspect and any alternative embodiment, including:
[0026] A real-time included angle acquisition module is used to acquire a user face image, extract the positions of user eyebrow center and lip pearl feature points based on the user face image, and inversely calculate the first included angle between the user face plane and the computer screen based on the trigonometric function and pinhole imaging principle, while a second included angle between the computer screen and the desktop where the computer is located is measured in real time using an angle encoder;
[0027] a health target decision module, configured to construct a multi-objective health cost function with user health posture and visual comfort as optimization targets based on the first included angle and the second included angle, and set an angle compensation term based on the multi-objective health cost function, and perform double-interval constraint compensation on the first included angle and the second included angle based on the angle compensation term to obtain a target rotation angle;
[0028] a discrete model construction module, configured to establish a continuous-time state space model of the computer screen rotation system with the second included angle and an angular velocity as state variables and an angular acceleration as a control input, and perform discretization processing on the continuous-time state space model to obtain a discrete-time model;
[0029] a trajectory planning module, configured to construct a quasi-convex optimization problem of a computer screen rotation trajectory according to the discrete-time model, the target rotation angle, and a preset performance index;
[0030] a driving execution module, configured to solve the quasi-convex optimization problem by using an optimization algorithm to generate an optimal control input sequence from the second included angle to the target rotation angle, and drive a driving execution motor to control the rotation of the computer screen until the included angle between the computer and the desktop is the target rotation angle.
[0031] In an optional implementation, the driving execution module is one of a micro-step motor or a servo motor, and is installed at a rotation shaft of the computer screen.
[0032] Compared with the prior art, the present application has the following beneficial effects:
[0033] 1. The computer screen angle adaptive adjustment is realized: the present application breaks through the limitation of traditional manual or simple automatic adjustment, and constructs a closed-loop feedback control system by collecting user face images and screen angles in real time. The control system can dynamically perceive the change of user posture, and automatically and accurately adjust the screen angle.
[0034] 2. The health protection level is significantly improved: the prior art lacks quantitative evaluation and active intervention on user health posture. The present application innovatively introduces a multi-objective health cost function based on the face plane included angle and the screen included angle, and simultaneously takes user health posture and visual comfort into the optimization target, and automatically calculates the optimal health screen angle through a mathematical model, thereby effectively preventing health problems such as visual fatigue and cervical spondylosis caused by long-term improper posture from the source.
[0035] 3. Smooth and comfortable adjustment process: Unlike the abrupt feeling that may be caused by the traditional motor directly driving to the target rotation angle, the present application models the screen rotation process as an optimal control problem. By establishing a state space model and discretizing it, using trajectory planning strategies such as time-optimal, energy-optimal or comfort-optimal, a smooth and efficient control instruction sequence is generated, making the screen rotation action gentle and greatly improving the user's comfort during the adjustment process.
[0036] 4. High personalization and universality: The health cost function weights and comfort angle interval parameters in the present application can be flexibly configured according to the body type, habits and preferences of different users, thus realizing personalized health angle recommendation. This design makes the device more adaptable to a wider user group and meets the specific needs of different individuals, with stronger universality. BRIEF DESCRIPTION OF DRAWINGS
[0037] In order to more clearly illustrate the specific embodiments of the present application or the technical solutions in the prior art, the following will briefly introduce the drawings needed to be used in the specific embodiments or prior art description. Obviously, the drawings described below are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.
[0038] Figure 1 is a flowchart of the computer screen automatic rotation adjustment method based on face recognition and angle measurement according to an embodiment of the present application;
[0039] Figure 2 is a schematic diagram of the angle measurement principle of the user's face and the screen plane according to an embodiment of the present application;
[0040] Figure 3 is a schematic diagram of the feature extraction points of the face when it is vertical and after it is rotated according to an embodiment of the present application;
[0041] Figure 4 is a schematic diagram of the angle measurement principle of the screen and the desktop plane according to an embodiment of the present application;
[0042] Figure 5 is a structural block diagram of the computer screen automatic rotation adjustment device based on face recognition and angle measurement according to an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the present application.
[0044] According to the embodiments of the present application, a computer screen automatic rotation adjusting method based on face recognition and angle measurement is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.
[0045] Figure 1 is a flowchart of the computer screen automatic rotation adjusting method based on face recognition and angle measurement according to the embodiments of the present application, as shown in Figure 1 , the flowchart includes the following steps:
[0046] S1: obtaining a user face image, and extracting the positions of eyebrow center and lip bead feature points based on the user face image, combining the trigonometric function and pinhole imaging principle to inversely calculate the first included angle between the user face plane and the computer screen, and simultaneously using an angle encoder to measure the second included angle between the computer screen and the desktop on which the computer is located.
[0047] In the embodiments, in the daily use scenario of the user, the first included angle and the second included angle satisfy the corresponding analytic geometry relationship, for the convenience of description, the following takes the second included angle as 90° as an example, that is, when the computer screen is in a vertical state: deriving the general formula of the first included angle . Correspondingly, the initial user face plane of the user is defined as the vertical state.
[0048] In the embodiments, as shown in Figure 2 , the angle measurement schematic diagram of the user face and the screen plane, taking the intersection point of the straight line of the inclined face plane and the straight line of the vertical screen plane as the origin of the axis, the direction of the axis pointing to the lip bead direction of the face plane as the positive direction, the actual point of the eyebrow center feature after the face turns as , the actual point of the lip bead feature as , and the horizontal direction of the face as the positive direction of the axis;Figure 2 In the embodiment, the first angle represents the focal length of the computer screen camera built-in the real-time angle acquisition module, represents the horizontal resolution of the image captured by the camera, represents the vertical resolution of the image captured by the camera, represents the width of the computer screen camera built-in the real-time angle acquisition module, represents the height of the computer screen camera built-in the real-time angle acquisition module, represents the actual distance from the actual point of the eyebrow center feature after the face turns to the screen plane, represents the actual distance from the actual point of the lip pearl feature after the face turns to the screen plane.
[0049] In the embodiment, the first angle is positive when the face plane is downward relative to the screen plane, and the first angle is defined as 0° when the two planes are parallel.
[0050] The following formula is obtained:
[0051]
[0052] In the formula, represents a small line segment horizontally pointing to the face direction on the axis; represents a small line segment vertically pointing to the lip pearl direction along the face plane on the axis.
[0053] According to the imaging principle of the camera built-in the real-time angle acquisition module, the ratio expression of the image length and the actual length of the line segment composed of the facial feature points about the actual distance from the feature point to the screen is constructed under the condition that the camera parameters are known, which is specifically:
[0054]
[0055]
[0056] In the formula, represents the ratio of the image length and the actual length of the horizontal line segment; represents the physical width of each pixel, ; represents the ratio of the image length and the actual length of the vertical line segment; represents the physical height of each pixel, ; in view of the fact that the taken line segment is parallel to the screen plane; represents the actual distance from any point on the taken line segment to the screen plane, which is equivalent to the actual distance from the line segment to the screen plane.
[0057] In this embodiment, considering that the coordinates of the brow peak and the brow center are similar in actual situation, the coordinates of the lip corner and the lip pearl are similar, the common deflection angle is small, the distance from the brow peak to the screen plane is roughly estimated as the distance from the brow center to it, the distance from the lip corner to the screen plane is roughly estimated as the distance from the lip pearl to it, and the error is small.
[0058] In this embodiment, as shown in Figure 3 is a schematic diagram of feature extraction points when the face is vertical and after rotation, in which , represents the initial feature extraction points of the brow peak of both eyes, , represents the initial feature extraction points of the left and right lip corners, represents the initial feature extraction points of the brow center, represents the initial feature extraction points of the lip pearl, , represents the feature extraction points of the brow peak of both eyes after rotation, , represents the feature extraction points of the left and right lip corners after rotation, represents the feature extraction points of the brow center after rotation, represents the feature extraction points of the lip pearl after rotation.
[0059] The feature extraction points when the face is vertical and after rotation are collected, and according to the ratio of the length of the line segment image to the actual length, it is set that:
[0060]
[0061] At the same time, it is recorded as:
[0062]
[0063] In the formula, represents the ratio of the corresponding image length of the horizontal line segment composed of the brow peak of both eyes after the face is rotated to the actual length; represents the image length of the horizontal line segment composed of the brow peak of both eyes after the face is rotated; represents the actual length of the horizontal line segment composed of the brow peak of both eyes; represents the ratio of the corresponding image length of the horizontal line segment when the face is vertical to the actual length; represents the image length of the horizontal line segment composed of the brow peak of both eyes when the face is vertical; represents the ratio of the corresponding image length of the horizontal line segment composed of the left and right lip corners after the face is rotated to the actual length; represents the image length of the horizontal line segment composed of the left and right lip corners after the face is rotated; represents the actual length of the horizontal line segment composed of the left and right lip corners; represents the image length of the horizontal line segment composed of the left and right lip corners when the face is vertical.
[0064] Figure 3 In this method, the tilted facial plane is considered as countless tiny vertical line segments, and the center of the eyebrows is selected. and the cupid's bow As a feature focus, based on the expression for the ratio of the image length to the actual length of the facial feature line segment, an expression is established for the image projection length of the tiny element on the screen with respect to the angle between the face plane and the screen plane, specifically:
[0065]
[0066] In the formula, This represents the feature extraction point between the eyebrows after the face is rotated. With lip feature extraction points Image distance. The real-time angle acquisition module uses the focal length of the built-in computer screen camera. and physical height per pixel It is a constant; at fixed time intervals, discrete image sequences of rotated faces are acquired, and the discrete... It is a definite value within the integration interval and is treated as a constant in the calculation. Therefore:
[0067]
[0068] Then, by inverse solution, we can obtain the first included angle corresponding to the face when it is tilted down. The solution formula is:
[0069]
[0070] Considering the cases where the face is tilted upwards and vertical, the solution formula is verified to be satisfied.
[0071] In summary, the first angle between the user's face and the computer screen... The solution formula is:
[0072] .
[0073] S2: Construct a multi-objective health cost function based on the first included angle and the second included angle, with the user's healthy posture and visual comfort as optimization objectives. Simultaneously, set an angle compensation term based on the multi-objective health cost function, and perform dual-interval constraint compensation on the first included angle and the second included angle based on the angle compensation term to obtain the target rotation angle.
[0074] In this embodiment, a multi-objective health cost function is defined to quantitatively assess postural health. :
[0075]
[0076] In the formula, represents the posture deviation; represents the visual comfort deviation; represents the posture deviation weight coefficient; represents the visual comfort deviation weight coefficient.
[0077] By adjusting the posture deviation weight coefficient and the visual comfort deviation weight coefficient , the method can reduce other potential health risks while ensuring a healthy posture.
[0078] In this embodiment, as Figure 4 shown in the schematic diagram of the angle measurement principle of the screen and the desktop plane, an angle compensation term is introduced to compensate for the target rotation angle, while ensuring that the second included angle satisfies the healthy use range.
[0079] Set
[0080]
[0081] :
[0082]
[0083] satisfies , that is, only the second included angle between the computer screen and the desktop on which the computer is located needs to be kept at the ideal value. In actual applications, the first included angle between the user's face plane and the computer screen also needs to be considered. Therefore, on the basis of , the angle compensation term is used for correction.
[0084] The angle compensation term is used to satisfy the interval constraints of the first included angle and the second included angle . The calculation formula of the angle compensation term is as follows:
[0085]
[0086] Further, the target rotation angle is obtained as follows:
[0087] .
[0088] In this embodiment, the target rotation angle is required to be clipped into the healthy use range, and it is ensured that it does not exceed the user's comfort zone. Therefore, it is set that:
[0089]
[0090] wherein, denotes the second angle minimum value; denotes the second angle maximum value; denotes the value range defining function.
[0091] S3: establishing a continuous time state space model of the computer screen rotating system with the second angle as the state variable and the preset angular acceleration as the control input, and discretizing the continuous time state space model to obtain a discrete time model.
[0092] In this embodiment, the expression of the continuous time state space model is set as follows, wherein the control input is assigned as the preset angular acceleration of the screen rotation, i.e. .
[0093]
[0094] wherein, denotes the full state vector of the change rate when tending to 0 over time; denotes the first system parameter matrix, , ; denotes the second system parameter matrix, , denotes the transpose of the second system parameter matrix, denotes the real number set; denotes the full state vector, denotes the transpose of the full state vector.
[0095] In this embodiment, the initial time is used to define the initial state of the system and the final time defines the last time point that the system state needs to reach or analyze, which are respectively set as and , the initial control input and the final control input are defined as:
[0096]
[0097]
[0098] The initial state vector and the final state vector of the control system are defined as follows:
[0099]
[0100] wherein, denotes the derivative of the second angle at the initial time ; denotes the final time denotes the derivative of the second angle at the time denotes the angle between the relative position between the computer screen and the final time of the desktop on which the computer is located.
[0101] In this embodiment, due to the saturation of the drive execution module, the angle, acceleration, and angular acceleration of the second angle executed should be limited:
[0102]
[0103]
[0104]
[0105] In the formula, denotes the maximum value of the acceleration of the rotation of the computer screen; denotes the rate of change of the required rotation angle of the computer screen; denotes the maximum value of the rate of change of the required rotation angle of the computer screen; denotes the maximum value of the required rotation angle of the computer screen.
[0106] Optionally, the discrete-time model is:
[0107]
[0108] In the formula, denotes the discrete-time state matrix, which is used to describe the number of times the system state changes over time; denotes the discrete time, which is used to construct a discrete-time model and convert a continuous-time model into a discrete-time model; denotes the state variable at the discrete time denotes the input matrix, which is used to map the control input to the system state; denotes the sampling time, which denotes the time interval at which the system state is sampled or updated; denotes the control input at the discrete time denotes the discrete-time model at the discrete time
[0109] In this embodiment, according to and the natural constant can be calculated as:
[0110] .
[0111] Based on the initial state vector of the control system, the discrete time Discrete system model at:
[0112]
[0113] In the formula, Indicates at discrete time Use discrete-time state matrix Processing the initial state vector The number of times; Indicates at discrete time Use discrete-time state matrix Processing the initial state vector Number of times, i This represents the time step index, used for time steps in iterative computation and optimization problems. In the discrete-time model, the first... Control input at any given moment.
[0114] In this embodiment, the obtained discrete system model satisfies a strict one-to-one mapping relationship between discrete time points and the number of discrete events (i.e., an event is triggered only once in each time interval with no omissions or repetitions). Therefore, the discrete time points... It can also represent the corresponding discrete event number.
[0115] Input sequence to the control system Mapped to a specified time System status .
[0116] Thus, the full state vector of the control system The constraints can be transformed into constraints on the system input sequence. Constraints.
[0117] The initial state vector can then be obtained. Final state vector Both driving and non-driving state constraints can be rewritten in the following form:
[0118]
[0119]
[0120]
[0121]
[0122]
[0123] In the formula, This represents the first auxiliary matrix, used to construct state constraints. ; denotes a second auxiliary matrix used for constructing state constraints, ; ; denotes a first auxiliary matrix used for constructing state constraints, denotes a discrete time variable corresponding to a time step, , is a certain time interval, is a sampling time, denotes a certain time step; denotes an input matrix at a time step in a discrete time model, ; denotes a preset limit value of a second included angle ; denotes a preset limit value of a derivative of a second included angle ; denotes a product of an input matrix and a control input at a time step ; denotes an upper limit of a number of input channels in a discrete time model, used for traversing all control inputs; is a state transition matrix, denoting a discrete time state matrix after a free motion response of a discrete time variable corresponding to a time step ; denotes a discrete time state matrix after a free motion response of a discrete time variable corresponding to a time step .
[0124] S4: constructing a quasi-convex optimization problem of the computer screen rotation trajectory according to the discrete time model, the target rotation angle, and a preset performance index.
[0125] Optionally, the quasi-convex optimization problem of the computer screen rotation trajectory comprises: setting a boundary condition of the computer screen rotation trajectory, and setting a system constraint condition including an amplitude constraint of a control input, an amplitude constraint of an angular velocity, and an angle change range constraint of the target rotation angle; setting a sub-level set of the optimization problem by combining the discrete time model, the boundary condition, and the system constraint condition, and selecting a corresponding objective function according to the preset performance index, the preset performance index being one of time optimization, energy optimization, and comfort optimization; and constructing the quasi-convex optimization problem of the computer screen rotation trajectory based on the objective function and the sub-level set.
[0126] In this embodiment, a suitable control input sequence can drive an initial state vector to a final state vector satisfying the controllable system constraint.As long as it relates to the control input sequence If the function is a quasi-convex function, the trajectory planning problem of the screen rotation system can be successfully transformed into a quasi-convex optimization problem.
[0127] In this embodiment, a control input sequence is defined. The optimal function, and the undetermined expression of the optimal function. As shown below, its control input sequence is :
[0128]
[0129] In the formula, For about The objective function;
[0130] Undetermined function It has the following definition:
[0131] First, define the quasi-convex function:
[0132] scalar function : A function is quasi-convex if and only if all its sublevels and its domain satisfy the following condition:
[0133]
[0134] In the formula, Represents scalar functions The valid domain, This represents a vector of decision variables that are used as variables to be optimized in an optimization problem. Let a convex parameter be defined on the set of real numbers. Used to describe scalar functions Properties of sublevel sets.
[0135] For the undetermined function Its sublevel set can be given To indicate:
[0136]
[0137] In the formula, It is a set of non-negative integers, representing the value space of the discrete time step index; Indicates the endpoint time and the upper limit of the length of the input sequence, used to truncate or constrain the sequence.
[0138] Combining the above equations, we get:
[0139]
[0140] In the formula, denotes the free response of the discrete-time state matrix at a certain discrete-time step index chosen in the convex parameter denotes the free response of the discrete-time state matrix at a certain discrete-time step index chosen in the convex parameter
[0141] The solution set is affine in the linear equations. Therefore, the sublevel set is an affine set related to the control input sequence , while the pending function is a quasi-convex function related to the control input sequence , and in addition, the state constraints are all convex.
[0142] Define quasi-convex optimization: quasi-convex optimization can be expressed as follows:
[0143] minimize
[0144] subject to
[0145] , denotes there are inequality constraints;
[0146] , and both denote constant vectors with equality constraints, where , denote the number index of the corresponding constraint, used to traverse all constraints, minimize denotes minimization, and subject to denotes constraint conditions.
[0147] In the formula, is the objective function of quasi-convex optimization, and all constraint conditions are convex.
[0148] Based on the quasi-convex optimization theory, the screen rotation problem task can be expressed as:
[0149] minimize
[0150] Subject to
[0151]
[0152]
[0153]
[0154]
[0155]
[0156] .
[0157] S5: solving the quasi-convex optimization problem by using an optimization algorithm to generate an optimal control input sequence from the second included angle to the target rotation angle, and driving a driving execution motor of the computer screen rotation according to the optimal control input sequence until the computer screen rotates to an included angle between the computer and the desktop to the target rotation angle.
[0158] Optionally, solving the quasi-convex optimization problem by using an optimization algorithm specifically includes: when the preset performance index is a time optimal index, the objective function is a minimum adjustment step function, and a bisection search algorithm is used to iteratively solve the minimum transport time and its corresponding control input sequence that satisfy all constraints; when the preset performance index is an energy optimal index, the objective function is a total control energy minimization function, and a quadratic programming algorithm is used to determine the energy minimum trajectory within a limited transport time to obtain the corresponding control input sequence; when the preset performance index is a comfort optimal index, the objective function is a minimum angular acceleration change rate function, and a quadratic programming algorithm is used to adjust the angular acceleration change within a limited transport time to obtain a control input sequence with smooth acceleration change.
[0159] In this embodiment, according to different optimization objective functions , three kinds of optimization trajectories are designed in this paper: minimum time trajectory, minimum energy trajectory and most comfortable trajectory.
[0160] In this embodiment, to solve the minimum time problem, an algorithm based on bisection method is proposed. Define the optimal time index , calculate the minimum transport time .
[0161] By continuously adjusting the upper and lower bounds of , until the optimal time index is found, and the minimum transport time and its corresponding control input sequence that satisfy all constraints are calculated :
[0162] .
[0163] In this embodiment, for the minimum energy problem, the corresponding algorithm is proposed to find the minimum energy trajectory within a limited transport time. Pseudocode is introduced to implement the algorithm, where is the input parameter of the algorithm.
[0164] By optimizing the control input sequence, the system energy consumption is minimized to obtain the corresponding control input sequence :
[0165] .
[0166] In this embodiment, the comfort optimal strategy aims to maximize user comfort. By adjusting the control input sequence, the acceleration change during screen rotation is smooth, reducing user discomfort, and the corresponding control input sequence is:
[0167]
[0168] wherein, represents a user-adjustable weight parameter for balancing between "energy saving" and "comfort", and is an adjustment factor in the comfort optimal strategy objective function, ; represents the derivative of the control input sequence .
[0169] As one or more specific application embodiments of the present application, the optimal implementation scheme or the scheme that the inventor most wants to embody is described in combination with a specific application scenario.
[0170] In this embodiment, an automatic computer screen rotation adjustment device based on face recognition and angle measurement is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0171] The present embodiment provides an automatic computer screen rotation adjustment device based on face recognition and angle measurement, as shown in Figure 5 , comprising:
[0172] A real-time included angle acquisition module is configured to acquire a user face image, extract the positions of the user's eyebrow center and lip pearl feature points based on the user face image, and inversely calculate a first included angle between the user's face plane and the computer screen by combining trigonometric functions and pinhole imaging principles, and simultaneously measure a second included angle between the computer screen and the desktop on which the computer is located by using an angle encoder.
[0173] A health target decision module is configured to construct a multi-objective health cost function with user health posture and visual comfort as optimization targets based on the first included angle and the second included angle, set an angle compensation term based on the multi-objective health cost function, and perform double-interval constraint compensation on the first included angle and the second included angle based on the angle compensation term to obtain a target rotation angle.
[0174] The discrete model construction module is configured to establish a continuous time state space model of the computer screen rotating system by taking the second included angle and the angular velocity as state variables and taking the angular acceleration as a control input, and to discretize the continuous time state space model to obtain a discrete time model.
[0175] The trajectory planning module is configured to construct a quasi-convex optimization problem of the computer screen rotating trajectory according to the discrete time model, the target rotating angle, and a preset performance index.
[0176] The driving execution module is configured to solve the quasi-convex optimization problem by using an optimization algorithm, to generate an optimal control input sequence from the second included angle to the target rotating angle, and to drive a driving execution motor to control the computer screen to rotate until the included angle between the computer and the desktop is the target rotating angle.
[0177] In the embodiment, the real-time included angle acquisition module is internally provided with an image acquisition module, which is a front camera of the computer.
[0178] Optionally, the driving execution module is one of a micro-step motor or a servo motor, and is installed at a rotating shaft of the computer screen.
[0179] Further function descriptions of the above modules and units are the same as those of the corresponding embodiments, and will not be described here again.
[0180] The computer screen automatic rotating and adjusting device based on face recognition and angle measurement in the embodiment is presented in the form of functional units. The units herein refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories executing one or more software or fixed programs, and / or other devices capable of providing the above functions.
[0181] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes fall within the scope defined by the appended claims.
Claims
1. A method for automatic rotation adjustment of a computer screen based on face recognition and angle measurement, characterized in that, The method includes: The system acquires a user's face image and extracts the positions of the user's brow and lip feature points based on the user's face image. It then uses trigonometric functions and pinhole imaging principles to calculate the first angle between the user's face plane and the computer screen. Simultaneously, it uses an angle encoder to measure the second angle between the computer screen and the desktop in real time. Based on the first included angle and the second included angle, a multi-objective health cost function is constructed with user health posture and visual comfort as optimization objectives. At the same time, an angle compensation term is set based on the multi-objective health cost function. Based on the angle compensation term, dual-interval constraint compensation is performed on the first included angle and the second included angle to obtain the target rotation angle. The multi-objective health cost function for: In the formula, Indicates postural deviation; Indicates visual comfort deviation; This represents the posture deviation weighting coefficient; Indicates the weighting coefficient for visual comfort deviation; A continuous-time state-space model of a computer screen rotation system is established with the second included angle as the state variable and a preset angular acceleration as the control input. The continuous-time state-space model is then discretized to obtain a discrete-time model. The discrete-time model is as follows: In the formula, This represents the discrete-time state matrix, used to describe the changes in the system state over time. It represents discrete time points and is used to construct discrete-time models, converting continuous-time models into discrete-time models. Representing discrete time as The state variables at that time; This represents the input matrix, used to map control inputs to system states; Indicates the sampling time, representing the time interval at which the system state is sampled or updated; Representing discrete time as Time control input; Representing discrete time as Discrete-time model; Based on the discrete-time model, the target rotation angle, and the preset performance indicators, a quasi-convex optimization problem for the computer screen rotation trajectory is constructed. The problem of constructing a quasi-convex optimization of computer screen rotation trajectory includes: Set the boundary conditions for the computer screen rotation trajectory, and set system constraints, including the amplitude constraints of the control input, the amplitude constraints of the angular velocity, and the angular change range constraints of the target rotation angle; The discrete-time model, boundary conditions, and system constraints together constitute a sub-level set of the optimization problem. At the same time, the corresponding objective function is selected according to the preset performance index, which is one of time optimal, energy optimal, or comfort optimal. Based on the objective function and the sublevel set, a quasi-convex optimization problem for the computer screen rotation trajectory is constructed. An optimization algorithm is used to solve the quasi-convex optimization problem, generating an optimal control input sequence from the second included angle to the target rotation angle. The drive motor that controls the rotation of the computer screen is driven according to the optimal control input sequence until the computer screen rotates to the angle between itself and the desktop where the computer is located, which is the target rotation angle.
2. The method for automatic rotation adjustment of a computer screen based on face recognition and angle measurement according to claim 1, characterized in that, The quasi-convex optimization problem is solved using an optimization algorithm, specifically including: When the preset performance index is the time-optimal index, the objective function is to minimize the adjustment step function, and the binary search algorithm is used to iteratively solve for the minimum transportation time and the corresponding control input sequence that satisfy all constraints. When the preset performance index is the energy-optimal index, the objective function is to minimize the total control energy function. The quadratic programming algorithm is used to determine the trajectory with the minimum energy within a limited transportation time, and the corresponding control input sequence is obtained. When the preset performance index is the optimal comfort index, the objective function is to minimize the rate of change of angular acceleration. A quadratic programming algorithm is used to adjust the change of angular acceleration within a limited transportation time to obtain a control input sequence with a smooth acceleration change.
3. A computer screen automatic rotation adjustment device based on face recognition and angle measurement, capable of executing the computer screen automatic rotation adjustment method based on face recognition and angle measurement as described in any one of claims 1-2, characterized in that, include: The real-time angle acquisition module is used to acquire the user's face image and extract the position of the user's brow center and lip feature points based on the user's face image. It then calculates the first angle between the user's face plane and the computer screen using trigonometric functions and pinhole imaging principles. At the same time, it uses an angle encoder to measure the second angle between the computer screen and the desktop in real time. The health goal decision module is used to construct a multi-objective health cost function with user health posture and visual comfort as optimization goals based on the first angle and the second angle. At the same time, it sets an angle compensation term based on the multi-objective health cost function and performs dual-interval constraint compensation on the first angle and the second angle based on the angle compensation term to obtain the target rotation angle. The discrete model construction module is used to establish a continuous-time state-space model of the computer screen rotation system with the second included angle and angular velocity as state variables and angular acceleration as control input, and to discretize the continuous-time state-space model to obtain a discrete-time model. The trajectory planning module is used to construct a quasi-convex optimization problem of the computer screen rotation trajectory based on the discrete-time model, the target rotation angle, and preset performance indicators. The drive execution module is used to solve the quasi-convex optimization problem using an optimization algorithm, generate an optimal control input sequence from the second included angle to the target rotation angle, and drive the drive execution motor that controls the rotation of the computer screen according to the optimal control input sequence until the computer screen rotates to the target rotation angle with the computer desktop.
4. The automatic rotation adjustment device for a computer screen based on face recognition and angle measurement according to claim 3, characterized in that, The drive execution module is either a micro stepper motor or a servo motor, and is installed at the hinge of the computer screen.
Citation Information
Patent Citations
Processing method and device for automatically rotating television screen according to user posture
CN111651039A
Method and system for dynamically adjusting posture of notebook computer screen
CN120949924A