Mirror body angle adjusting method, controller, bathroom mirror and storage medium
By combining image acquisition and driving modules, the mirror angle is automatically identified and adjusted, solving the problems of mirror automation and insufficient angle selection, and achieving precise adjustment and improved universality of mirror angle.
Patent Information
- Application Number
- CN202410887659.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-03
- Publication Date
- 2024-11-19
AI Technical Summary
Existing mirrors suffer from low automation and insufficient angle options in adjusting the mirror angle, failing to meet users' personalized needs.
The target image is acquired by the image acquisition module, the initial mirror angle is identified, and the angle difference is calculated. The drive module is used for automatic mirror adjustment, and the angle sensing module is used for precise control to achieve flexible adjustment of the mirror angle.
The automation and versatility of mirror angle adjustment have been improved, allowing users to obtain better mirror effects and making mirror angle adjustment more precise and convenient.
Smart Images

Figure CN118975734A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of bathroom products, and in particular to a mirror angle adjustment method, a controller, a bathroom mirror and a storage medium. Background Art
[0002] At present, mirrors with adjustable mirror angles can be adjusted manually or electrically. However, the electric adjustment method also requires the user to perform manual operations, such as pressing the adjustment button of the mirror. In addition, electrically adjustable mirrors often only provide a small number of optional mirror angles, which cannot meet the personalized needs of users. For example, they can only adjust angles of 5 degrees, 10 degrees, 15 degrees, etc., but cannot adjust other angles except the optional mirror angles. In summary, the current manual adjustment of the mirror angle is required and the optional mirror angles are small, which is not enough to meet the needs of intelligent furniture.
[0003] Therefore, how to improve the automation and universality of mirror angle adjustment has become a technical problem that needs to be solved urgently. Summary of the invention
[0004] The main purpose of the embodiments of the present application is to propose a mirror angle adjustment method, a controller, a bathroom mirror and a storage medium, aiming to improve the automation and universality of mirror angle adjustment.
[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application provides a mirror body angle adjustment method, the method comprising:
[0006] Perform image acquisition through the image acquisition module to obtain a target image;
[0007] Performing angle recognition according to the target image to obtain an initial mirror angle; the initial mirror angle is used to characterize an actual angle formed by a first direction and a second direction, the first direction being the direction from the image acquisition module to the face, and the second direction being the direction perpendicular to the mirror;
[0008] Obtaining a first angle difference according to a preset first target mirror angle and the initial mirror angle;
[0009] The mirror is controlled by a driving module to adjust a first angle according to the first angle difference.
[0010] In some embodiments, controlling the mirror to adjust the first angle by the driving module with the first angle difference includes:
[0011] The driving module controls the mirror to adjust a first angle, and the angle sensing module measures the rotation angle of the mirror to obtain an actual rotation angle;
[0012] Performing a first angle judgment according to the first angle difference, the actual rotation angle, and a preset mirror angle error threshold to obtain a first angle judgment result;
[0013] If the first angle judgment result is not passed, a first remaining rotation angle is calculated according to the first angle difference and the actual rotation angle, the first angle difference is replaced by the first remaining rotation angle, and the step of controlling the mirror to adjust the first angle by the driving module and measuring the rotation angle of the mirror by the angle sensing module to obtain the actual rotation angle is returned;
[0014] If the first angle determination result is passed, the first angle adjustment is stopped.
[0015] In some embodiments, performing a first angle judgment according to the first angle difference, the actual rotation angle, and a preset mirror angle error threshold to obtain a first angle judgment result includes:
[0016] Obtaining a rotation angle error according to a difference between the first angle difference and the actual rotation angle;
[0017] If the rotation angle error is less than the mirror angle error threshold, determining that the first angle judgment result is passed;
[0018] If the rotation angle error is greater than or equal to the mirror angle error threshold, the first angle judgment result is determined to be failed.
[0019] In some embodiments, before controlling the mirror to adjust the first angle by the driving module with the first angle difference, the method further includes:
[0020] Compare the first angle difference with the mirror angle error threshold;
[0021] If the first angle difference is less than the mirror angle error threshold, the process returns to the step of acquiring the image through the image acquisition module to obtain the target image.
[0022] In some embodiments, before performing angle recognition according to the target image to obtain an initial mirror angle, the method further includes:
[0023] Performing face detection on the target image to obtain a face detection result;
[0024] If the face detection result indicates that the target image does not contain a face, the target duration is obtained; the target duration is used to indicate the duration during which the target image captured by the image acquisition module does not contain a face;
[0025] If the target duration is greater than or equal to a preset time threshold, the mirror is controlled by the driving module to adjust a second angle at a preset second target mirror angle so that the mirror reaches a target position corresponding to the second target mirror angle.
[0026] In some embodiments, if the target duration is greater than or equal to a preset time threshold, controlling the mirror to adjust the second angle at a preset second target mirror angle by the driving module includes:
[0027] If the target duration is greater than or equal to a preset time threshold, the angle of the mirror is measured by the angle sensing module to obtain an actual mirror angle;
[0028] Calculating a second angle difference according to the actual mirror angle and the second target mirror angle;
[0029] Perform a second angle judgment according to the mirror angle error threshold and the second angle difference to obtain a second angle judgment result;
[0030] If the second angle judgment result is not passed, a second remaining rotation angle is calculated according to the second angle difference and the actual mirror angle, and the mirror is controlled by the driving module to perform a second angle adjustment at the second remaining rotation angle;
[0031] If the second angle determination result is passed, the second angle adjustment is stopped.
[0032] In some embodiments, after performing face detection on the target image to obtain a face detection result, the method further includes:
[0033] If the face detection result indicates that the target image contains a face, obtaining a first current time, and setting a preset time mark as the first current time;
[0034] If the face detection result indicates that the target image does not contain a face, obtaining the target duration includes:
[0035] If the face detection result indicates that the target image does not contain a face, obtaining a second current time;
[0036] The time difference between the time mark and the second current time is calculated to obtain the target duration.
[0037] To achieve the above-mentioned purpose, the second aspect of an embodiment of the present application proposes a controller, which includes a memory and a processor, the memory stores a computer program, and the processor implements the mirror angle adjustment method described in the first aspect when executing the computer program.
[0038] To achieve the above-mentioned purpose, a third aspect of an embodiment of the present application provides a bathroom mirror, which includes the controller, image acquisition module, drive module, mirror surface and outer frame described in the second aspect above;
[0039] Wherein, the mirror is integrated with the image acquisition module, and the mirror is rotatably connected to the outer frame through the driving module.
[0040] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes 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 mirror angle adjustment method described in the first aspect is implemented.
[0041] The mirror angle adjustment method, controller, bathroom mirror and storage medium proposed in the present application perform image acquisition through an image acquisition module to obtain a target image, wherein the target image contains a human face; perform angle recognition based on the target image to obtain an initial mirror angle; the initial mirror angle can represent the actual angle relationship between the human face and the mirror, and the first target mirror angle can represent the reference angle relationship between the human face and the mirror; then the mirror angle is automatically adjusted based on the first target mirror angle and the initial mirror angle, thereby realizing the automation of the mirror angle adjustment method and improving the universality of the mirror angle adjustment method. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 is a flow chart of a mirror body angle adjustment method provided in an embodiment of the present application;
[0043] Figure 2 yes Figure 1 Flow chart of step S104 in FIG.
[0044] Figure 3 It is a schematic diagram of a specific implementation of the mirror body angle adjustment method provided in one embodiment of the present application;
[0045] Figure 4 is a schematic diagram of a specific implementation of a mirror body angle adjustment method provided in another embodiment of the present application;
[0046] Figure 5 is a schematic diagram of a specific implementation of a mirror body angle adjustment method provided in another embodiment of the present application;
[0047] Figure 6 is a schematic diagram of a specific implementation of a mirror body angle adjustment method provided in another embodiment of the present application;
[0048] Figure 7 It is a flowchart of an application example provided by an embodiment of the present application;
[0049] Figure 8It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0051] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0052] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0053] First, some nouns involved in this application are analyzed:
[0054] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robots, language recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0055] The mirror angle adjustment method, controller, bathroom mirror and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the mirror angle adjustment method in the embodiments of the present application is described.
[0056] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0057] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0058] It should be noted that in each specific implementation manner of the present application, when it comes to performing relevant processing based on user information (such as user facial images) and other data related to user identity or characteristics, the user's permission or consent must be obtained first, and the collection, use and processing of such data will comply with relevant laws, regulations and standards.
[0059] Figure 1 is an optional flow chart of the mirror angle adjustment method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to including S101 to S104.
[0060] S101, performing image acquisition through an image acquisition module to obtain a target image;
[0061] S102, performing angle recognition according to the target image to obtain an initial mirror angle; the initial mirror angle is used to represent an actual angle formed by a first direction and a second direction, the first direction being a direction from the image acquisition module to the face, and the second direction being a direction perpendicular to the mirror;
[0062] S103, obtaining a first angle difference according to a preset first target mirror angle and an initial mirror angle;
[0063] S104, controlling the mirror to adjust a first angle with a first angle difference through a driving module.
[0064] The beneficial effects of the embodiments of the present application include but are not limited to: performing image acquisition through an image acquisition module to obtain a target image, wherein the target image includes a face; performing angle recognition based on the target image to obtain an initial mirror angle; the initial mirror angle can represent the actual angle relationship between the face and the mirror, and the first target mirror angle can represent the reference angle relationship between the face and the mirror; and then automatically adjusting the mirror angle based on the first target mirror angle and the initial mirror angle, thereby realizing automation of the mirror angle adjustment method and improving the universality of the mirror angle adjustment method.
[0065] Specifically, the initial mirror angle is an acute angle, that is, the angle formed by the first direction and the second direction is an acute angle.
[0066] It should be noted that, at present, the mirror with adjustable mirror angle can be adjusted by manual adjustment or electric adjustment, but the manual adjustment method requires the user to perform manual operation, and the electric adjustment mirror often only provides a few optional mirror angles, such as only being able to adjust 5 degrees, 10 degrees, 15 degrees, etc., which cannot meet the personalized needs of users. In the embodiment of the present application, image acquisition is performed by an image acquisition module, and a first angle difference is calculated based on the acquired target image and a preset first target mirror angle, and the mirror is controlled by a driving module to adjust the first angle with the first angle difference, and the angle can be adjusted flexibly, such as being able to adjust 7 degrees, 16 degrees, etc. The mirror angle adjustment method of the present application allows users to obtain a better mirroring effect, and improves the degree of automation and universality of the mirror angle adjustment method.
[0067] In S101 of some embodiments, the image acquisition module may be a camera, and an image may be acquired through the camera to obtain a target image.
[0068] In S102 of some embodiments, the target image contains facial information, so that facial recognition can be performed on the target image through an AI (artificial intelligence) algorithm, and facial coordinates are obtained based on the result of facial recognition. Then, angle recognition is performed based on the facial coordinates and the coordinate system preset in the camera to calculate the initial mirror angle.
[0069] In S103 of some embodiments, the absolute value of the difference between the preset first target mirror angle and the initial mirror angle is calculated to obtain a first angle difference. For example, if the first target mirror angle is 20 degrees and the initial mirror angle is 35 degrees, the first angle difference is |20-35|=15 degrees.
[0070] In S104 of some embodiments, the mirror is controlled to rotate by a driving module, wherein the angle of the mirror rotation is a first angle difference. Specifically, the driving module includes a motor and a rotating device. It should be noted that the motor may be a stepper motor. A stepper motor refers to a motor that drives the rotation with a fixed unit step. For example, a common unit step may be 1.8 degrees or 0.9 degrees.
[0071] See also Figure 2 In some embodiments, S104 may include but is not limited to S201 to S204:
[0072] S201, controlling the mirror to adjust a first angle through a driving module, and measuring the rotation angle of the mirror through an angle sensing module to obtain an actual rotation angle;
[0073] S202, performing a first angle judgment according to the first angle difference, the actual rotation angle, and a preset mirror angle error threshold to obtain a first angle judgment result;
[0074] S203, if the first angle judgment result is not passed, a first remaining rotation angle is calculated according to the first angle difference and the actual rotation angle, the first angle difference is replaced by the first remaining rotation angle, and the process returns to the step of controlling the mirror to adjust the first angle through the driving module, and measuring the rotation angle of the mirror through the angle sensing module to obtain the actual rotation angle;
[0075] S204: If the first angle determination result is passed, stop adjusting the first angle.
[0076] The advantage of this embodiment is that the mirror is controlled to perform a first angle adjustment through a driving module, and the rotation angle of the mirror is measured through an angle sensing module to obtain an actual rotation angle, and a first angle judgment is performed based on the first angle difference, the actual rotation angle and a preset mirror angle error threshold. If the judgment passes, the angle adjustment is stopped, thereby adjusting the angle of the mirror to a suitable angle, allowing the user to obtain a better mirroring effect, and realizing the automation of the mirror angle adjustment method, thereby improving the universality of the mirror angle adjustment method.
[0077] Specifically, the first angle difference is the absolute value of the difference between the preset first target mirror angle and the initial mirror angle. The first angle difference is an absolute value, indicating that the preset mirror angle error threshold includes the positive and negative error range of the mirror position.
[0078] It should be noted that in actual operation, the first angle difference may not be completely equal to the actual rotation angle. For example, the unit step of the stepper motor imposes a limit on the rotation angle. If errors are not allowed, the mirror may not be able to complete the angle adjustment. Therefore, a mirror angle error threshold is pre-set to define the allowable angle error range, so that the angle adjustment can be performed quickly to allow the mirror to rotate quickly into place without affecting the mirroring effect. The embodiment of the present application calculates the angle of rotation required for the mirror and drives the motor to rotate the mirror, and measures the rotation angle of the mirror through an angle sensing module to further confirm whether the mirror has been rotated into place, and perform fine-tuning to make the mirror rotation more precise. The embodiment of the present application can achieve precise rotation, increase the speed at which the mirror rotates into place, and improve the user experience.
[0079] It should be noted that the first target mirror angle is a preset value. When the angle formed by the first direction and the second direction is the first target mirror angle, the user can obtain the best mirroring effect.
[0080] See also Figure 3 In one application example, the image acquisition module 10 is located at the top of the mirror 20, the mirror 20 is parallel to the wall and vertical to the ground, and the user 30 stands in front of the mirror 20. The first direction D1 is the direction from the image acquisition module 10 to the face of the user 30, and the second direction D2 is the direction perpendicular to the mirror 20. When the angle formed by the first direction D1 and the second direction D2 is the first target mirror angle α0, the user 30 can normally perform the mirror-looking activity and obtain the best mirror-looking effect.
[0081] Specifically, the first direction is the direction from the image acquisition module to the center point of the face. The center point of the face may be the center point between the eyes of the face, which is not limited in the embodiment of the present application.
[0082] It should be noted that when the difference between the initial mirror angle and the first target mirror angle is greater than a preset mirror angle error threshold, the user cannot use the mirror well, which reduces the mirroring effect.
[0083] See also Figure 4 , Figure 4 and Figure 3 The difference is that the angle formed by the first direction D1 and the second direction D2 is the initial mirror angle α1, at which time the user's face cannot be completely reflected in the mirror.
[0084] See also Figure 4 and Figure 5 In an application example, after the mirror 20 is controlled by the driving module to perform a first angle adjustment, the included angle between the mirror 20 and the wall in the vertical direction changes from zero to an actual rotation angle Δβ.
[0085] It should be noted that the actual rotation angle refers to the angle between the plane where the mirror is located before rotation and the plane where the mirror is located after rotation. Figure 4 In the example, the mirror is parallel to the wall before rotation, so Figure 5 The actual rotation angle in is represented as the angle between the plane where the wall is located and the plane where the mirror is located after rotation. In other embodiments, the mirror may not be parallel to the wall before rotation, and the embodiment of the present application is not limited to this.
[0086] Reference Figure 5 After the first angle adjustment, the first direction D1 and the second direction D2 form an actual angle α2. The actual angle α2 is equal to the first target mirror angle (in the embodiment of the present application, the first target mirror angle is Figure 3 The difference of α0) is less than the mirror angle error threshold.
[0087] In some embodiments, it should be noted that the image acquisition module includes a lens, and the lens corresponds to an imaging plane. The imaging plane may be a plane where the photosensitive element of the camera is located. Specifically, the lens has a lens center point, that is, the optical center of the lens.
[0088] See also Figure 6 In an application example, the initial mirror angle α1 is the angle between the first direction D1 and the second direction D2. The face position X can be represented as the position of the center point of the face. According to the face position X, the first component a and the second component b1 can be measured. Among them, the first component a specifically represents the component of the distance value from the center point of the face to the center point of the lens in the direction perpendicular to the second direction, and the second component b1 specifically represents the component of the distance value from the center point of the face to the center point of the lens in the second direction. Among them, the second component b2 is a preset focus distance, the focus distance represents the distance between the center point of the lens and the imaging plane, and the second component b2=y*arctan(α1). The first coordinate y is used to represent the coordinates of the face. The initial mirror angle α1=arctan(y / b2). And, the initial mirror angle α1=arctan(a / b1). The initial mirror angle α1 can be calculated based on the first coordinate y and the second component b2. According to the principle of equal vertical angles and the proportional relationship of triangles, it can be seen that the initial mirror angle α1 can represent the face position (that is, the first component a and the second component b1 mentioned above).
[0089] In some embodiments, performing angle recognition according to the target image to obtain an initial mirror angle includes:
[0090] Obtaining a first coordinate according to the target image, the first coordinate being used to represent the coordinate of the human face on the imaging plane of the image acquisition module;
[0091] An initial mirror angle is calculated based on the first coordinate and a preset focusing distance.
[0092] In some embodiments, S202 includes:
[0093] Obtaining a rotation angle error according to a difference between the first angle difference and the actual rotation angle;
[0094] If the rotation angle error is less than the mirror angle error threshold, the first angle judgment result is determined to be passed;
[0095] If the rotation angle error is greater than or equal to the mirror angle error threshold, the first angle determination result is determined to be failed.
[0096] The advantage of this embodiment is that a rotation angle error is obtained based on the difference between the first angle difference and the actual rotation angle, and a first angle judgment is performed based on the rotation angle error and a preset mirror angle error threshold to obtain a first angle judgment result. If the rotation angle error is less than the mirror angle error threshold, the first angle judgment result is passed, thereby improving the precision and accuracy of the mirror angle adjustment method, and improving the degree of automation and universality of the method.
[0097] In some embodiments, before S104, the mirror angle adjustment method also includes: comparing the first angle difference with the mirror angle error threshold; if the first angle difference is smaller than the mirror angle error threshold, returning to the step of performing image acquisition through the image acquisition module to obtain the target image.
[0098] It should be noted that if the first angle difference is greater than or equal to the mirror angle error threshold, the process proceeds to a step of controlling the mirror to adjust the first angle by using the first angle difference through the driving module.
[0099] The advantage of this embodiment is that the mirror is adjusted only when the first angle difference is greater than or equal to the mirror angle error threshold, avoiding adjusting the mirror when the first angle difference is small, so that the mirror does not need to be adjusted frequently, thereby improving the simplicity of the method.
[0100] In some embodiments, before S102, the method further includes:
[0101] Perform face detection on the target image to obtain the face detection result;
[0102] If the face detection result indicates that the target image does not contain a face, the target duration is obtained; the target duration is used to indicate the duration during which the target image captured by the image acquisition module does not contain a face;
[0103] If the target duration is greater than or equal to a preset time threshold, the mirror is controlled by the driving module to adjust the second angle at a preset second target mirror angle so that the mirror reaches the target position corresponding to the second target mirror angle.
[0104] The advantage of this embodiment is that if the target duration is greater than or equal to a preset time threshold, the mirror is controlled by the driving module to adjust the second angle at a preset second target mirror angle so that the mirror reaches the target position corresponding to the second target mirror angle, thereby achieving the resetting of the mirror.
[0105] It should be noted that if the target duration is greater than or equal to the preset time threshold, it means that the image acquisition module cannot capture the human face for a long time, and no one has used the mirror for a long time, and the mirror needs to be reset.
[0106] In some embodiments, if the target duration is greater than or equal to a preset time threshold, the mirror is controlled by the driving module to adjust the second angle at a preset second target mirror angle, including:
[0107] If the target duration is greater than or equal to the preset time threshold, the angle of the mirror is measured by the angle sensor module to obtain the actual mirror angle;
[0108] A second angle difference is calculated based on the actual mirror angle and the second target mirror angle;
[0109] Perform a second angle judgment according to the mirror angle error threshold and the second angle difference to obtain a second angle judgment result;
[0110] If the second angle judgment result is not passed, a second remaining rotation angle is calculated according to the second angle difference and the actual mirror angle, and the mirror is controlled by the driving module to adjust the second angle at the second remaining rotation angle;
[0111] If the second angle determination result is passed, the second angle adjustment is stopped.
[0112] The advantage of this embodiment is that if the target duration is greater than or equal to a preset time threshold, a second angle judgment is performed based on the mirror angle error threshold and the second angle difference to obtain a second angle judgment result. If the second angle judgment result is passed, the second angle adjustment is stopped to allow the mirror to reach the target position corresponding to the second target mirror angle, thereby achieving mirror resetting.
[0113] In some embodiments, after performing face detection on the target image and obtaining the face detection result, the method further includes:
[0114] If the face detection result indicates that the target image contains a face, obtaining a first current time, and setting a preset time mark as the first current time;
[0115] If the face detection result indicates that the target image does not contain a face, the target duration is obtained, including:
[0116] If the face detection result indicates that the target image does not contain a face, obtaining a second current time;
[0117] Calculate the time difference between the time mark and the second current time to obtain the target duration.
[0118] The advantage of this embodiment is that if the face detection result indicates that the target image contains a face, the first current time is obtained, and the preset time mark is set to the first current time; if the face detection result indicates that the target image does not contain a face, the second current time is obtained, and the time difference between the time mark and the second current time is calculated to obtain the target duration, thereby accurately calculating the target duration, thereby improving the accuracy of the method.
[0119] See also Figure 7 In an application example, the mirror angle adjustment method may include the following steps:
[0120] Initialize the parameters; wherein the initialized parameters include a preset first target mirror angle, a second target mirror angle and a time mark; specifically, the first target mirror angle can be initialized to a suitable angle value, such as any angle value between 15 degrees and 45 degrees. The second target mirror angle is used to indicate the angle between the mirror and the plane where the outer frame is located when the mirror is in the initial position. For example, when the outer frame is fixed on the wall, the second target mirror angle can be initialized to zero angle, indicating that the mirror is in a vertical state when the mirror is in the initial position. The time mark can be initialized to time zero.
[0121] The image acquisition module is used to acquire the target image.
[0122] Perform face detection on the target image to obtain a face detection result to determine whether the target image contains a face; specifically, it can be determined whether the face coordinates in the target image are empty. If the face coordinates are empty, it means that no face is obtained;
[0123] If the face detection result indicates that the target image contains a face, a first current time is obtained, and a preset time mark is reset to the first current time; specifically, the first current time may be the current time when the face detection result is obtained;
[0124] Angle recognition is performed according to the target image to calculate an initial mirror angle; the initial mirror angle is used to characterize the actual angle formed by a first direction and a second direction, the first direction is the direction from the image acquisition module to the face, and the second direction is the direction perpendicular to the mirror;
[0125] Calculating a first angle difference according to a preset first target mirror angle and an initial mirror angle;
[0126] Determine whether the first angle difference is less than a mirror angle error threshold;
[0127] If the first angle difference is less than the mirror angle error threshold, the process ends, that is, the mirror does not need to be adjusted in angle;
[0128] If the first angle difference is greater than or equal to the mirror angle error threshold, the required rotation angle is output, where the required rotation angle is the first angle difference; specifically, the driving module obtains the required rotation angle;
[0129] Rotate the mirror according to the required rotation angle to adjust the angle;
[0130] The rotation angle of the mirror is measured by the sensor to obtain the sensor angle value; the sensor angle value here is the actual rotation angle;
[0131] The rotation angle error is calculated based on the first angle difference and the actual rotation angle; wherein the rotation angle error is an absolute value;
[0132] Determine whether the rotation angle error is less than the mirror angle error threshold;
[0133] If the rotation angle error is less than the mirror angle error threshold, the first angle adjustment is stopped.
[0134] If the rotation angle error is greater than or equal to the mirror angle error threshold, the rotation angle error is used as the required rotation angle, and the process returns to the step of outputting the required rotation angle.
[0135] If the face detection result indicates that the target image does not contain a face, obtaining a second current time;
[0136] Calculate the time difference between the time mark and the second current time to obtain the target duration; the target duration is used to characterize the duration of time during which the target image acquired by the image acquisition module does not contain a human face;
[0137] Determine whether the target duration is less than a preset time threshold;
[0138] If the target duration is less than the time threshold, return to the step of obtaining the target image;
[0139] If the target duration is greater than or equal to the time threshold, the rotation angle of the mirror is measured by the sensor to obtain the sensor angle value; the sensor angle value here is the actual mirror angle;
[0140] Calculate the second angle difference according to the sensor angle value and the preset second target mirror angle;
[0141] Determine whether the second angle difference is less than the mirror angle error threshold;
[0142] If the second angle difference is greater than or equal to the mirror angle error threshold, the second remaining rotation angle is calculated based on the second angle difference and the actual mirror angle, and the second remaining rotation angle is used as the required rotation angle, and the step of outputting the required rotation angle is returned.
[0143] If the second angle difference is the mirror angle error threshold, return to the step of acquiring the target image.
[0144] The advantage of this application example is that it can control the mirror to adjust the angle, so that users can obtain a better mirroring effect, and improve the automation and universality of the mirror angle adjustment method.
[0145] The embodiment of the present application also provides a controller, the controller includes a memory and a processor, the memory stores a computer program, and the processor can implement the above-mentioned mirror angle adjustment method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0146] The specific implementation of the controller is basically the same as the specific implementation of the above-mentioned mirror angle adjustment method, and will not be repeated here.
[0147] See also Figure 8 , Figure 8 The hardware structure of a controller of another embodiment is illustrated, and the controller includes:
[0148] The processor 801 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0149] The memory 802 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 802 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 802, and the processor 801 calls and executes the mirror angle adjustment method of the embodiment of this application;
[0150] Input / output interface 803, used to implement information input and output;
[0151] The communication interface 804 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WI FI, Bluetooth, etc.);
[0152] A bus 805 that transmits information between the various components of the device (e.g., the processor 801, the memory 802, the input / output interface 803, and the communication interface 804);
[0153] The processor 801 , the memory 802 , the input / output interface 803 and the communication interface 804 are connected to each other in communication within the device via a bus 805 .
[0154] The embodiment of the present application further provides a bathroom mirror, characterized in that the bathroom mirror comprises the above-mentioned controller, an image acquisition module, a driving module, a mirror surface and an outer frame;
[0155] The mirror is integrated with the image acquisition module, and the mirror is rotatably connected to the outer frame through the driving module.
[0156] The specific implementation of the bathroom mirror is basically the same as the specific embodiment of the mirror angle adjustment method described above, and will not be repeated here.
[0157] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned mirror angle adjustment method is implemented.
[0158] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0159] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0160] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0161] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0162] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0163] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0164] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0165] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0166] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0167] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0168] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0169] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A mirror body angle adjustment method, characterized in that: The method comprises: Perform image acquisition through the image acquisition module to obtain a target image; Angle recognition is performed according to the target image to obtain an initial mirror angle; the initial mirror angle is used to characterize an actual angle formed by a first direction and a second direction, the first direction is a direction from the image acquisition module to the face, and the second direction is a direction perpendicular to the mirror; Obtaining a first angle difference according to a preset first target mirror angle and the initial mirror angle; The mirror is controlled by a driving module to adjust a first angle according to the first angle difference.
2. The mirror body angle adjustment method according to claim 1, characterized in that: The controlling the mirror surface to adjust the first angle by the driving module according to the first angle difference includes: The driving module controls the mirror to adjust a first angle, and the angle sensing module measures the rotation angle of the mirror to obtain an actual rotation angle; Performing a first angle judgment according to the first angle difference, the actual rotation angle, and a preset mirror angle error threshold to obtain a first angle judgment result; If the first angle judgment result is not passed, a first remaining rotation angle is calculated according to the first angle difference and the actual rotation angle, the first angle difference is replaced by the first remaining rotation angle, and the step of controlling the mirror to adjust the first angle by the driving module and measuring the rotation angle of the mirror by the angle sensing module to obtain the actual rotation angle is returned; If the first angle determination result is passed, the first angle adjustment is stopped.
3. The mirror body angle adjustment method according to claim 2, characterized in that: The first angle judgment is performed according to the first angle difference, the actual rotation angle and a preset mirror angle error threshold to obtain a first angle judgment result, including: Obtaining a rotation angle error according to a difference between the first angle difference and the actual rotation angle; If the rotation angle error is less than the mirror angle error threshold, determining that the first angle judgment result is passed; If the rotation angle error is greater than or equal to the mirror angle error threshold, the first angle judgment result is determined to be failed.
4. The mirror body angle adjustment method according to claim 2, characterized in that: Before controlling the mirror surface to adjust the first angle by the driving module with the first angle difference, the method further includes: Compare the first angle difference with the mirror angle error threshold; If the first angle difference is less than the mirror angle error threshold, the process returns to the step of acquiring the image through the image acquisition module to obtain the target image.
5. The mirror body angle adjustment method according to claim 2, characterized in that: Before performing angle recognition according to the target image to obtain an initial mirror angle, the method further includes: Performing face detection on the target image to obtain a face detection result; If the face detection result indicates that the target image does not contain a face, the target duration is obtained; the target duration is used to indicate the duration during which the target image captured by the image acquisition module does not contain a face; If the target duration is greater than or equal to a preset time threshold, the driving module controls the mirror to adjust a second angle at a preset second target mirror angle so that the mirror reaches a target position corresponding to the second target mirror angle.
6. The mirror body angle adjustment method according to claim 5, characterized in that: If the target duration is greater than or equal to a preset time threshold, the mirror is controlled by the driving module to adjust the second angle at a preset second target mirror angle, including: If the target duration is greater than or equal to a preset time threshold, the angle of the mirror is measured by the angle sensing module to obtain an actual mirror angle; Calculating a second angle difference according to the actual mirror angle and the second target mirror angle; Perform a second angle judgment according to the mirror angle error threshold and the second angle difference to obtain a second angle judgment result; If the second angle judgment result is not passed, a second remaining rotation angle is calculated according to the second angle difference and the actual mirror angle, and the mirror is controlled by the driving module to perform a second angle adjustment at the second remaining rotation angle; If the second angle determination result is passed, the second angle adjustment is stopped.
7. The mirror body angle adjustment method according to claim 5, characterized in that: After performing face detection on the target image to obtain a face detection result, the method further includes: If the face detection result indicates that the target image contains a face, obtaining a first current time, and setting a preset time mark as the first current time; If the face detection result indicates that the target image does not contain a face, obtaining the target duration includes: If the face detection result indicates that the target image does not contain a face, obtaining a second current time; The time difference between the time mark and the second current time is calculated to obtain the target duration.
8. A controller, characterized in that: The invention comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the mirror angle adjustment method according to any one of claims 1 to 7 when executing the computer program.
9. A bathroom mirror, characterized in that: It comprises the controller, image acquisition module, driving module, mirror and outer frame as claimed in claim 8; Wherein, the mirror is integrated with the image acquisition module, and the mirror is rotatably connected to the outer frame through the driving module.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the mirror angle adjustment method described in any one of claims 1 to 7 is implemented.
