Novel safety water cup and monitoring method
By integrating battery management and communication modules into the water cup lid, and combining multi-mode image acquisition and optical distortion correction, the problems of high standby power consumption and large field-of-view imaging distortion in safety water cups are solved, enabling remote evidence collection and high-precision face recognition.
Patent Information
- Application Number
- CN202511770271.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-28
- Publication Date
- 2026-02-17
AI Technical Summary
Existing safety water cups have high standby power consumption, cannot be used for remote image evidence collection, and their large field-of-view imaging introduces severe geometric distortions that affect the accuracy of facial recognition.
The cup lid integrates a USB interface, lithium battery, battery management module, PMOS switch circuit, MCU module, detection circuit, camera main control and storage module, and 4G communication module. Image acquisition is triggered by buttons and the cup lid status. Combined with fine power management and multi-mode switching, remote image uploading and optical distortion correction are realized.
It significantly reduces standby power consumption, extends battery life, improves the ability to detect abnormal opening behavior, and enhances the accuracy of facial recognition.
Smart Images

Figure CN121533607A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of water cup technology, and in particular to a novel safe water cup and monitoring method. Background Technology
[0002] Most safety water bottles on the market today are based on a standard cup structure with the addition of a fingerprint recognition module, electronic lock, or simple audible and visual alarm circuitry to authorize the opening of the lid. These products generally suffer from three problems: First, high standby power consumption, typically reaching 20 microamps, can rapidly deplete the battery and reduce usable time. Second, when abnormal opening is detected, alarms are usually only triggered locally, lacking the ability to collect images or videos of suspicious activity or remotely notify the user. In cases of pranks or malicious placement, it is difficult to obtain effective evidence afterward, resulting in a lack of deterrence. Third, the quality and reliability of the fingerprint recognition module itself are significantly affected by cost and environmental factors, leading to unstable security.
[0003] On the other hand, in order to maximize the monitoring angle within limited installation space, various security monitoring and visual measurement systems are increasingly using imaging devices with a large field of view. While these imaging devices acquire a wide-range image, they often introduce significant spherical projection and optical distortion, resulting in severe geometrical distortion of the original image, which is detrimental to subsequent accurate measurement and identification. Summary of the Invention
[0004] In view of the above technical problems, the present invention provides a novel safety water cup and monitoring method, which solves the problems of high standby power consumption of existing safety water cups, inability to remotely collect images and issue alarms for abnormal opening behavior, and serious geometric distortion caused by large field of view imaging affecting the accuracy of face recognition.
[0005] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part by practice of this disclosure.
[0006] According to one aspect of the present invention, a novel safety water cup is provided, the water cup comprising a cup body and a cup lid, wherein the cup lid integrates a USB interface, a lithium battery, a battery management module, a PMOS switching circuit, an MCU module, a button, a detection circuit, a camera main control and storage module, and a 4G communication module, wherein: The USB interface is used to connect to an external power source and to read and write data to the camera main control and storage module. The output terminal of the lithium battery provides DC power; The input terminal of the battery management module is electrically connected to the USB interface, and its output terminal is electrically connected to the lithium battery, for performing charging management and overcharge and over-discharge protection on the lithium battery; The input terminal of the PMOS switching circuit is electrically connected to the output terminal of the lithium battery, and its output terminal is electrically connected to the power supply terminal of the camera main control and storage module and the 4G communication module. The power supply terminal of the MCU module is electrically connected to the lithium battery, its first signal input terminal is electrically connected to the button, its second signal input terminal is electrically connected to the detection circuit, and its control output terminal is electrically connected to the control terminal of the PMOS switch circuit. The MCU module is used to control the conduction and cutoff of the PMOS switch circuit according to the signals from the button and the detection circuit. The detection circuit is disposed between the cup lid and the cup body, and is used to output a cup lid state change signal to the MCU module when the cup lid is opened or closed; The data input terminal of the camera control and storage module is electrically connected to at least one camera sensor, and the data output terminal is electrically connected to the data terminal of the 4G communication module and the USB interface. The camera control and storage module is used to control the camera sensor to take pictures and / or record videos, store the acquired images or video files and attach timestamps, and send them through the 4G communication module or the USB interface. At least one of the camera sensors is installed on the cup lid and is used to collect images around the cup. The power supply terminal of the 4G communication module is electrically connected to the output terminal of the PMOS switching circuit. The 4G communication module is used to upload the image or video files output by the camera main control and storage module to a preset terminal in real time through the cellular mobile network. The MCU module is configured as follows: In sleep mode, only the device itself, the button, and the detection circuit are in a power-on monitoring state. When it is detected that the button has been pressed for a first preset duration, the PMOS switch circuit is turned on to power on the camera main control and storage module and the 4G communication module, and the camera main control and storage module is controlled to drive the camera sensor to perform a preset number of continuous shots and / or a preset duration of video recording. When the detection circuit detects a change in the state of the cup lid, it controls the PMOS switch circuit to turn on, powering on the camera main control and storage module and the 4G communication module. It then controls the camera main control and storage module to drive the camera sensor to take the preset number of continuous shots and record for the preset duration. The obtained images or video files are then uploaded to the preset terminal in real time via the 4G communication module. After completing the preset duration of video recording and photo taking, if no new button operation or change signal of the cup lid state is detected again within the preset monitoring time, the PMOS switch circuit is controlled to turn off, so that the camera main control and storage module and the 4G communication module are powered off and re-enter the sleep mode.
[0007] Furthermore, the MCU module is also configured to: When the button is detected to be pressed for a second preset duration, the camera main control and storage module is first controlled to drive the camera sensor to take a series of shots for the preset number of times and record video for the preset duration. The obtained image or video file is then uploaded to the preset terminal via the 4G communication module. Then, the photo and video recording functions triggered by the detection circuit are set to the off state, so that the photo and / or video recording will only be enabled when the operation of the button is detected. When the photo and video recording functions are enabled, when the button is detected to be pressed continuously a specified number of times, the system cycles between photo-only mode, video-only mode, and photo plus video mode, and controls the indicator light inside the button to flash a different number of times to indicate the current mode. In the photo-only mode, only the preset number of continuous shots are performed; in the video-only mode, only the preset duration of video recording is performed; and in the photo plus video mode, both the preset number of continuous shots and the preset duration of video recording are performed simultaneously.
[0008] Furthermore, there are two camera sensors, which are symmetrically arranged around the circumference of the cup lid, so that the cup has a 360° shooting range in the horizontal direction and a 270° shooting range in the vertical direction.
[0009] According to a second aspect of this disclosure, a monitoring method is provided, the method comprising: The monitoring image captured by the above-mentioned new type of safety water cup is obtained, and an image coordinate system with the principal point of the monitoring image as the origin is established. It is assumed that there is a virtual perspective projection image plane tangent to the spherical surface of the camera sensor. According to the equidistant projection imaging relationship, the image points of the monitoring image are mapped onto the virtual perspective projection image plane to obtain perspective projection image points with spherical distortion removed. For the perspective projection image points, an optical distortion model is established, and the perspective projection image points are corrected using the optical distortion model to obtain the perspective projection image points after optical distortion correction. Using the corrected perspective projection image points as the image plane points, and combining the interior and exterior orientation elements of the camera sensor, based on the equidistant projection model and the optical distortion model, the collinearity equation is established as a functional relationship between the three-dimensional coordinates of the ground point and the pixel coordinates of the image point in the monitoring image, thereby constructing the orthorectification model of the monitoring image. Using a calibration field image containing three-dimensional control points, the orthorectification model is solved based on the ground coordinates of each three-dimensional control point and its pixel coordinates in the calibration field image to obtain the interior orientation elements, exterior orientation elements, and distortion parameters. A digital elevation model corresponding to the area to be orthorectified is obtained, wherein the area to be orthorectified is the face image area in the monitoring image. A digital orthorectified image grid is established according to a predetermined resolution. The corresponding three-dimensional ground coordinates of each pixel in the digital orthorectified image grid are calculated and substituted into the orthorectified correction model after calibration to obtain the image point coordinates of the monitoring image. The gray values of the neighboring pixels of the image point are interpolated and assigned to the corresponding pixels until all pixels are filled, thereby obtaining the digital orthorectified image of the monitoring image. The digital orthophoto is input into a pre-trained face recognition model for identity verification. If the face in the digital orthophoto is not a preset face, a warning message is sent to a predetermined address.
[0010] Furthermore, the optical distortion model is obtained by superimposing the radial distortion model and the eccentric distortion model, wherein: The radial distortion model is used to describe the axisymmetric distortion of the image point along the line connecting the principal point to the image point. The radial distortion correction of the image point in both the horizontal and vertical directions is obtained by multiplying the square, fourth power, and sixth power of the distance from the image point to the principal point with the corresponding radial distortion parameters and summing them. The eccentric distortion model is used to describe asymmetric distortion caused by the non-coincidence of the lens image axis and the imaging plane normal.
[0011] Furthermore, the eccentric distortion model includes eccentric distortion variables along the lateral and longitudinal directions, wherein: The eccentric distortion along the lateral direction is the sum of the following two parts: The square of the distance from the image point to the principal point is added to the square of the horizontal coordinate and then multiplied by the first eccentricity distortion parameter; The product of the horizontal and vertical coordinates is multiplied by the second eccentricity distortion parameter; The eccentric distortion along the longitudinal direction is the sum of the following two parts: The square of the distance from the image point to the principal point is added to the square of the vertical coordinate and then multiplied by the second eccentricity distortion parameter; The product of the horizontal and vertical coordinates is multiplied by the first eccentricity distortion parameter.
[0012] Furthermore, when solving the orthorectified model, obtaining the initial values of the interior orientation elements includes: Edge detection is performed on the monitoring image to extract the edge pixels of the effective imaging area of the monitoring image; A quadratic curve is fitted using the edge pixels as samples, and the quadratic curve is simplified into an ellipse to obtain the coordinates of the ellipse center and the lengths of the major and minor axes. The position of the ellipse center in the image coordinate system is used as the initial pixel coordinate of the main point of the monitoring image, and the sum of the lengths of the major and minor axes is divided by pi as the initial pixel value of the focal length of the camera sensor. The initial pixel values of the principal point and focal length, together with the three-dimensional control points, are used as the initial values of the interior orientation elements in solving the orthorectification model.
[0013] Furthermore, the process of acquiring and solving the parameters of the three-dimensional control points includes: At least seven control points with known locations and uniform distribution in three-dimensional space are set up, the three-dimensional coordinates of each control point in the ground coordinate system are measured, and the pixel coordinates of each control point are extracted from the monitoring image. Using the interior orientation element, the exterior orientation element, and the distortion parameter as unknowns, a first-order Taylor expansion is performed on the theoretical values of the pixel coordinates of the orthorectification model with respect to each control point to construct the image point observation equation. The least squares iterative adjustment is then used to solve the equation until the correction values of each unknown quantity meet the preset threshold.
[0014] Furthermore, determining the extent and resolution of the digital orthophoto grid includes: Based on the mapping relationship between the monitoring image and the virtual perspective projection image plane, all pixels on the monitoring image are converted into perspective projection image points to form a perspective projection image, and the pixel coordinates of the four corner points of the perspective projection image are obtained. Under the constraints of the calibrated exterior orientation elements, the pixel coordinates of the four corner points are substituted into the collinearity equation and combined with the elevation to obtain the three-dimensional coordinates of the four corner points in the ground coordinate system. The number of rows and columns of the digital orthophoto grid is determined based on the planar coordinate range of the four corner points and the desired ground resolution. The planar coordinates of each pixel in the digital orthophoto grid are then determined recursively according to the resolution, starting from one corner point.
[0015] Furthermore, when interpolating the grayscale of neighboring pixels of an image point, the following steps are included: When the image point coordinates of the monitoring image obtained by the orthorectification model fall within the pixel grid of the original monitoring image and are non-integer, select multiple adjacent pixels of the pixel grid where the corresponding image point is located. Interpolation weights are constructed based on the horizontal and vertical distances from the corresponding image point to each adjacent pixel point. Bilinear interpolation or bicubic interpolation with cubic convolution kernels introduced in both the horizontal and vertical directions is used to weight and sum the gray values of adjacent pixels to obtain the interpolated gray value of the corresponding image point. The interpolated gray value is then written into the corresponding pixel of the digital orthophoto grid. After generating the digital orthophoto grid, several checkpoints are selected, and the ground coordinates of the checkpoints in the digital orthophoto grid are compared with the independently measured ground coordinates. The root mean square error in the two coordinate directions and the plane is calculated to evaluate the accuracy of the orthophoto correction result of the monitoring image.
[0016] The technical solution disclosed herein has the following beneficial effects: Compared to traditional security water cups that rely on fingerprint recognition and local alarms, this invention's security water cup integrates a rechargeable power supply, charge / discharge management circuit, power switch, and MCU inside the lid, enabling precise control over the power supply to the camera and communication units: in sleep mode, only the microcontroller and buttons, and the lid status detection circuit are powered on, while all other high-power modules are powered off, significantly reducing standby current to levels lower than existing products and greatly extending battery life. Image acquisition is triggered by button operations and lid opening / closing events. Combined with multiple operating modes, timestamp storage, and real-time data upload functions, it can automatically take photos and / or videos and send them to a preset terminal when abnormal lid opening or user-initiated triggering is detected, achieving true remote evidence collection and alarm functionality. Simultaneously, imaging sensors are arranged around the circumference of the lid to enhance the ability to detect suspicious behavior.
[0017] The monitoring method of this invention, after acquiring monitoring images around a water cup, introduces a spherical projection model and an optical distortion model to map image points onto a virtual plane imaging surface. Combining the calibration results of internal and external parameters and a digital elevation model, a geometric correction model of the monitoring image is constructed. The target area is orthorectified and grayscale interpolation is performed to generate a digital orthophoto image with high geometric accuracy, thereby improving the accuracy of identifying unauthorized users and reducing the probability of false alarms and missed alarms. Attached Figure Description
[0018] Figure 1 This is a structural block diagram of a novel safety water cup as described in the embodiments of this specification; Figure 2 This is a top view of the lid of a novel water cup used in this embodiment. Figure 3 This is a flowchart of a monitoring method in one of the embodiments of this specification. Detailed Implementation
[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this disclosure more comprehensive and complete, and to fully convey the concept of the example embodiments to those skilled in the art. The described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a full understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced with one or more of the specific details omitted, or other methods, components, apparatus, steps, etc., can be employed. In other instances, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of this disclosure.
[0020] Furthermore, the accompanying drawings are merely illustrative of this disclosure. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0021] This invention provides a novel safe water cup. (See reference...) Figures 1 to 2 The diagram shown is a structural block diagram of a novel safe water cup and a top view of the cup lid provided in an embodiment of the present invention.
[0022] This embodiment provides a novel safety water cup, including a cup body and a cup lid. All electronic components are integrated inside the cup lid, so as to realize power management, image acquisition and wireless transmission functions without changing the cup body structure.
[0023] The upper surface of the cup lid is roughly circular, with a button 106 located at its center. This button 106 serves as both a user interface switch and an integrated red-green dual-color indicator light to indicate the current operating status and mode switching results. Two camera sensors 1081 are installed symmetrically around the button 106, allowing for a near 360° horizontal and approximately 270° vertical shooting range, enabling the cup to capture images of its surroundings from multiple angles. Alternatively, a single camera sensor 1081 with a distorted fisheye effect can be used for wide-range imaging. To balance aesthetic symmetry and deceptive effects, a fake camera sensor 1081 structure resembling the actual camera sensor 1081 can be placed at symmetrical positions, making it difficult for others to discern the true imaging direction.
[0024] A USB interface 101, preferably a waterproof Type-C interface, is provided on the side edge of the cup lid. It is used to connect an external power source to charge the internal lithium battery 102 of the cup lid. It can also establish a wired connection with an external terminal via a data cable during maintenance or evidence collection to read the timestamped photos and video files stored inside the cup lid.
[0025] The cup lid houses a lithium battery 102, a battery management module 103, a PMOS switching circuit 104, an MCU module 105, a detection circuit 107, a camera control and storage module 108, and a 4G communication module. The power supply terminal of the USB interface 101 is electrically connected to the input terminal of the battery management module 103, and the output terminal of the battery management module 103 is electrically connected to the charging terminal of the lithium battery 102. This connection is used to charge the lithium battery 102 and provide overcharge and over-discharge protection to ensure long-term safe operation of the system. The output terminal of the lithium battery 102 provides DC power, directly supplying power to the MCU module 105 and also supplying power to the camera control and storage module 108 and the 4G communication module via the PMOS switching circuit 104.
[0026] The input terminal of the PMOS switching circuit 104 is electrically connected to the output terminal of the lithium battery 102, and its output terminal is electrically connected to the power supply terminal of the camera main control and storage module 108 and the 4G communication module. The power supply terminal of the MCU module 105 is electrically connected to the lithium battery 102, and its control output terminal is electrically connected to the control terminal of the PMOS switching circuit 104. It is used to control the conduction and cutoff of the PMOS switching circuit 104 according to the signal of the button 106 and the cup lid state change signal, thereby realizing centralized power-on and power-off control of the camera main control and storage module 108 and the 4G communication module.
[0027] The detection circuit 107 is located between the lid and the cup body and can be in the form of a reed switch, Hall effect switch, or photoelectric switch to detect changes in the relative position between the lid and the cup body. When the lid is opened or closed, the detection circuit 107 outputs a lid state change signal (lid opening / closing event) to the MCU module 105 to trigger image acquisition or power management processes.
[0028] The data input terminal of the camera main control and storage module 108 is electrically connected to at least one camera sensor 1081 to receive image data from multiple directions. Its data output terminal is electrically connected to the data terminals of a 4G communication module and a USB interface 101, respectively, allowing the transmission of images or video files via cellular network or wired connection. The camera main control and storage module 108 integrates image acquisition control, power management, and non-volatile memory. It controls the camera sensor 1081 to take pictures and / or videos according to trigger commands, and stores the acquired images or video files along with the shooting time information into its internal storage space. A rolling storage method is used, overwriting the oldest data when space is insufficient.
[0029] The power supply terminal of the 4G communication module is electrically connected to the output terminal of the PMOS switching circuit 104, and the data terminal is electrically connected to the camera main control and storage module 108. It is used to upload the image or video files output by the camera main control and storage module 108 to a preset terminal, such as a user's mobile phone or cloud server in real time through the cellular mobile network.
[0030] The MCU module 105 preferably adopts the ultra-low power model 8102 (hereinafter referred to as MCU8102). Its first signal input terminal is electrically connected to the center button 106 of the cup lid, and is used to detect events such as single click, long press and multiple consecutive presses of the button 106; the second signal input terminal is electrically connected to the detection circuit 107 (cup lid switch), and is used to detect changes in the opening and closing state of the cup lid; the control output terminal controls the PMOS switch circuit 104 to turn on and off, so as to realize unified power supply management for the camera main control and storage module 108 and the 4G communication module.
[0031] In this embodiment, the basic working principle of the novel safety water cup is as follows: Charging and basic power supply: The user connects the cup lid to an external power source (such as a charger or computer) via the USB interface 101. The battery management module 103 charges the lithium battery 102 and provides overcharge protection during the charging process; during the discharge process, it monitors the battery voltage and provides over-discharge protection to prevent the lithium battery 102 from being damaged under high load or long-term use.
[0032] Long press of button 106 for power-on and default monitoring: In the initial state, MCU8102 is in ultra-low power sleep mode, only maintaining the MCU's internal basic clock and the interrupt monitoring function of button 106 and detection circuit 107. At this time, the standby current of the whole device is about 0.5μA. When it is detected that button 106 has been pressed for a first preset duration (e.g., 5 seconds), MCU8102 determines it as a power-on command. First, it controls the green indicator light in the center of button 106 to flash a predetermined number of times (e.g., 5 times) to remind the user. Then, it controls the PMOS switch circuit 104 to conduct, so that the camera main control and storage module 108 and the 4G communication module are powered on, and the system enters the working state. Subsequently, the camera main control and storage module 108 drives the camera sensor 1081 to perform a preset number of continuous shots, such as taking 5 photos continuously with an interval of about 0.2 seconds. At the same time, it starts video recording for a preset duration, such as continuous recording for 10 seconds, and stores the captured photos and videos in the internal memory. If the 4G communication module is configured to work in this mode in this embodiment, the acquired images or videos can be uploaded to the preset terminal simultaneously according to the settings.
[0033] During the aforementioned photo and video recording process, if no new cup lid status change signal or new button 106 operation is detected within the preset monitoring time (e.g., 10s) from the moment of power-on, the MCU8102 controls the PMOS switch circuit 104 to turn off after completing the current photo and video recording, thereby powering off the camera main control and storage module 108 and the 4G communication module, and re-entering sleep mode to maintain extremely low standby power consumption.
[0034] Automatic evidence collection triggered by lid opening and closing: When the monitoring function is enabled, when the detection circuit 107 detects a change in the lid's opening and closing (such as the lid being opened or closed), the MCU8102 is quickly woken up from sleep mode and immediately controls the PMOS switch circuit 104 to turn on, powering on the camera control and storage module 108 and the 4G communication module. The camera control and storage module 108 then drives at least one camera sensor 1081 to perform a preset number of continuous shots and a preset duration of video recording, for example, taking 5 photos and recording video for 10 seconds. Simultaneously, the acquired photos or videos are uploaded in real time to a preset terminal via the 4G communication module, realizing remote alarm for suspicious lid opening behavior. If no new lid state change signal is detected again within the preset monitoring time elapsed from the moment the lid state change occurs after taking photos and videos, the MCU8102 controls the PMOS switch circuit 104 to turn off, the camera control and storage module 108 and the 4G communication module are powered off, and the MCU8102 re-enters sleep mode. At this time, the system power consumption can be restored to approximately 0.5μA.
[0035] In this embodiment, to balance user privacy and power management, the MCU module 105 also implements a manual lid-off switch trigger function and multiple photo / video mode switching: When a user wishes to temporarily disable the photo and video recording functions triggered by the cup lid switch event, they can press and hold button 106 for a second preset duration, such as 10 seconds. After the MCU8102 detects the 10-second press and hold event of button 106, it first controls the red indicator light in the center of button 106 to flash a predetermined number of times (e.g., 5 times) to indicate that the mode is being switched; then, it still performs a complete evidence collection action, that is, it controls the camera main control and storage module 108 to drive the camera sensor 1081 to take a preset number of continuous shots and record video for a preset duration, and uploads the obtained photos or videos to a preset terminal through the 4G communication module as the last record before turning off automatic monitoring.
[0036] After the aforementioned photo and video recording are completed, the MCU8102 writes a flag to its internal register or non-volatile memory to mark the "cup lid switch triggers photo / video recording" function as disabled. Thereafter, the cup lid opening / closing event only wakes up the MCU8102 and no longer powers on the camera controller and storage module 108 or the 4G communication module. The photo and / or video recording functions are only executed when button 106 is detected. During this time, the system maintains a sleep power consumption of approximately 0.5μA. When woken up by button 106 or a cup lid switch event, the operating current is approximately 0.5mA, enabling ultra-long standby time.
[0037] When the photo and video recording functions are enabled, the user can cycle through different operating modes by pressing button 106 a specified number of times. For example, the MCU8102 is configured to cycle through "photo-only mode," "video-only mode," and "photo and video mode" when button 106 is detected to be pressed three times consecutively. In photo-only mode, the system only performs a preset number of consecutive shots and does not record video; In video-only mode, the system only records video for a preset duration and does not perform continuous shooting; In photo and video mode, a preset number of consecutive shots and a preset video recording duration are performed simultaneously.
[0038] To help users identify the current mode, the indicator light in the center of button 106 can be set to flash for different numbers of times: for example, in the photo-only mode, the red and green indicator lights flash alternately 3 times; in the video-only mode, they flash alternately 4 times; in the photo and video mode, they flash alternately 5 times, and then the system performs photo taking and / or video recording according to the current mode.
[0039] In any operating mode, the camera control and storage module 108 writes the captured images or videos to the internal storage space in chronological order, with each file appended with a shooting timestamp. To avoid running out of storage space, this embodiment employs a rolling storage strategy, automatically overwriting the oldest photo and video files when the storage space is nearing full capacity. Users can connect the cup lid to a computer or other terminal at any time via the USB interface 101 to export photo and video files from the cup lid for viewing, backup, or as evidence.
[0040] Through the above structural arrangement and workflow, the novel safety water cup of this embodiment achieves the following while ensuring that the daily drinking function of the cup is not affected: Achieving ultra-long battery life with an ultra-low standby current of approximately 0.5μA; The cup lid opening and closing and button 106 events enable automatic or manual triggering of photo taking, video recording, and real-time uploading; The ability to detect and collect evidence of abnormal opening behavior is enhanced by using a multi-camera sensor 1081 and multi-mode switching. Local data reading and maintenance are achieved through the USB interface 101.
[0041] Compared to traditional security water cups that rely on fingerprint recognition and local alarms, this invention's security water cup integrates a rechargeable power supply, charge / discharge management circuit, power switch, and MCU inside the lid, enabling precise control over the power supply to the camera and communication units: in sleep mode, only the microcontroller and buttons, and the lid status detection circuit are powered on, while all other high-power modules are powered off, significantly reducing standby current to levels lower than existing products and greatly extending battery life. Image acquisition is triggered by button operations and lid opening / closing events. Combined with multiple operating modes, timestamp storage, and real-time data upload functions, it can automatically take photos and / or videos and send them to a preset terminal when abnormal lid opening or user-initiated triggering is detected, achieving true remote evidence collection and alarm functionality. Simultaneously, imaging sensors are arranged around the circumference of the lid to enhance the ability to detect suspicious behavior.
[0042] The above embodiments are merely specific application examples of the technical solution of the present invention. Those skilled in the art can make equivalent substitutions or adjustments to specific circuit device models, button 106 long press duration, preset number of continuous shots, video recording duration, and indicator light prompting methods without departing from the concept of the present invention, and all such substitutions or adjustments should fall within the protection scope of the claims of the present invention.
[0043] Based on the same line of thought, such as Figure 3The diagram illustrates a monitoring method provided by an embodiment of the present invention, which can be applied to a server in the cloud. The method can be executed by a device, which can be implemented by software and / or hardware, and specifically includes the following steps S201-S206: In step S201, the monitoring image captured by the above-mentioned new type of safety water cup is acquired, and an image coordinate system with the principal point of the monitoring image as the origin is established. It is assumed that there is a virtual perspective projection image plane tangent to the spherical surface of the camera sensor. According to the equidistant projection imaging relationship, the image points of the monitoring image are mapped onto the virtual perspective projection image plane to obtain perspective projection image points with spherical distortion removed.
[0044] In this embodiment, when the new safety water cup is triggered, the camera sensor inside the cup lid acquires a monitoring image of the surrounding environment. This monitoring image is stored in the form of a pixel matrix, with each pixel corresponding to an image point p(u,v) on the monitoring image. To facilitate subsequent geometric correction, an image coordinate system O–uv is established on the image plane where the monitoring image is located. The principal point of the monitoring image (i.e., the intersection of the imaging optical axis and the image plane) is taken as the origin, and its pixel coordinates are denoted as (u0,v0). For any image point p(u,v), its distance to the principal point is defined as: ; Where r reflects the radial position of the image point in the image coordinate system. For a wide-field imaging system using an isometric projection imaging model, its imaging geometry satisfies the isometric projection relation: ; in The equivalent focal length of the imaging system in this model. Let be the incident angle of the incident ray relative to the optical axis. The above relationship describes the spherical projection characteristics, which vary proportionally between the incident angle and the distance from the image point to the principal point. This relationship allows for a one-to-one correspondence between each image point on the monitoring image and the incident ray on the imaging sphere.
[0045] To establish a virtual perspective projection imaging model that removes spherical distortion, this embodiment assumes the existence of a virtual perspective projection image plane E outside the spherical imaging structure of the camera sensor, which is tangent to the spherical surface of the camera sensor at the principal point. The spatial target point is first linearly projected onto the unit sphere by the imaging system, and then mapped from the sphere to the image point p(u, v) on the monitoring image through a non-central projection. To equate this spherical projection to ordinary perspective projection, corresponding perspective projection image points are defined on the virtual image plane E. Its physical meaning is: under the same internal and external orientation conditions, if ideal perspective projection imaging is used, then the spatial point should be imaged on the image plane E. Based on imaging geometry, the image point p(u,v) on the monitored image and the image point on the virtual perspective projection image plane are... The following conditions must be met: ; in This represents the imaging distance of the same incident ray on the virtual perspective projection image plane, where (u0, v0) are the coordinates of the principal point. Combining the isometric projection formula and perspective projection geometry, we can... By writing this as a function of r and focal length, we can obtain the explicit transformation relationship of the image point from the monitoring image coordinate system to the virtual perspective projection image plane coordinate system:
[0046] in , , and Here, r represents the number of pixels per unit length in the u and v directions, respectively, used to convert the physical focal length f (in millimeters) into an equivalent focal length in pixels. Using the above formula, r is calculated point-by-point for all pixels in the monitoring image. and the corresponding This process generates a set of perspective projection image points on the virtual perspective projection image plane, free from spherical structural distortion. Subsequent steps involve overlaying optical distortion models, collinearity equations, and digital elevation models onto these perspective projection image points to further complete optical distortion correction and orthorectification of the monitoring image. The purpose of this step is to utilize the equidistant projection imaging relationship and the construction of the virtual perspective projection image plane to transform the original monitoring image from spherical imaging geometry into perspective projection geometry that is easier to measure and model.
[0047] In step S202, an optical distortion model is established for the perspective projection image point, and the perspective projection image point is corrected using the optical distortion model to obtain the perspective projection image point after optical distortion correction.
[0048] The optical distortion model is obtained by superimposing a radial distortion model and an eccentric distortion model. The radial distortion model is used to describe the axisymmetric distortion of the image point along the line connecting the principal point to the image point. The radial distortion correction of the image point in both the horizontal and vertical directions is obtained by multiplying the square, fourth power, and sixth power of the distance from the image point to the principal point with the corresponding radial distortion parameters and summing them. The eccentric distortion model is used to describe the asymmetric distortion caused by the non-coincidence of the lens image axis and the normal of the imaging plane.
[0049] The eccentricity distortion model includes eccentricity distortion variables along the lateral and longitudinal directions, wherein: the eccentricity distortion variable along the lateral direction is the sum of the following two parts: the square of the distance from the image point to the principal point plus the square of the lateral coordinate multiplied by the first eccentricity distortion parameter; the product of the lateral coordinate and the longitudinal coordinate multiplied by the second eccentricity distortion parameter; Furthermore, the eccentric distortion along the longitudinal direction is the sum of the following two parts: the square of the distance from the image point to the principal point plus the square of the longitudinal coordinate multiplied by the second eccentric distortion parameter; and the product of the lateral coordinate and the longitudinal coordinate multiplied by the first eccentric distortion parameter.
[0050] Specifically, taking the perspective projection image points obtained in step S201 as the research object, within the same image coordinate system O–uv, the coordinates of each perspective projection image point are denoted as (u,v), and the coordinates of the principal point (i.e., the image center) are denoted as (u0,v0). The distance from the image point to the principal point is defined as... ; The distance *r* characterizes the radial position of the image point on the image plane. For wide-field imaging systems, there is still a deviation between the actual lens and the ideal spherical lens. This deviation manifests as optical distortion on the image plane, which can be decomposed into radial distortion and eccentric distortion based on its distortion characteristics. Radial distortion reflects the radial displacement of the "distorted image point" relative to the "theoretical image point," exhibiting axisymmetric characteristics. The radial distortion model can be expressed as:
[0051] in, Here, r is the radial distortion parameter, and r is the distance from the image point to the principal point. , Let (u0, v0) represent the radial distortions of the image point in the horizontal (u direction) and vertical (v direction) directions, respectively, with (u0, v0) being the principal point coordinates. It can be seen that the radial distortions are caused by... and It is obtained by weighted superposition of even-power terms, and the same radial polynomial is used in the u and v directions, which reflects the axisymmetric characteristics along the radial direction of the principal point.
[0052] Besides radial distortion, imaging systems often suffer from issues such as incomplete alignment between the lens image axis and the camera's optical axis, and misalignment during installation. This results in eccentric distortion (decentering, off-centering), which is characterized by no longer being strictly symmetrical radially along the principal point, but rather being related to the squares of the image point's horizontal and vertical coordinates, as well as their product. The eccentric distortion model can be written as:
[0053] Where p1 and p2 are eccentric distortion parameters, , The ) represent the eccentric distortion of the image point in the u and v directions, respectively. It can be seen that the eccentric distortion along the lateral direction consists of two parts: one part is... One part corresponds to the combination of the r² term and the squared term of the horizontal axis; the other part is... The corresponding terms are the product of the horizontal and vertical coordinates; the eccentric distortion along the vertical direction is also caused by... and The two types of terms are obtained by linear combination, with coefficients p2 and p1 respectively. In this form, two asymmetric distortion effects, namely "stretching / compression along a certain coordinate axis" and "tilting shear", can be characterized simultaneously.
[0054] When establishing the optical distortion model, the radial distortion model and the eccentric distortion model mentioned above are superimposed to obtain the total optical distortion of the image point in the u and v directions:
[0055] in and Let be the total optical distortion of the image point in the u and v directions, and k1, k2, k3, p1, and p2 be the distortion parameters that need to be solved through calibration.
[0056] In this embodiment, step S202 uses the perspective projection image points obtained in step S201 as input, substitutes their coordinates into the above formula, and sequentially calculates r and radial distortion for each perspective projection image point. , ), eccentricity variables ( ) and total optical distortion ( , The obtained optical distortion is then used as a correction factor in the subsequent image point coordinate solution and orthorectification model to correct the coordinates of the perspective projection image points, thus obtaining the optically distorted perspective projection image points. This "radial + eccentric" superimposed optical distortion model effectively compensates for the non-ideal optical offset of the perspective projection image points on the image plane while maintaining the equidistant projection geometry, providing more accurate image point input for the subsequent construction of an orthorectification model based on collinearity equations.
[0057] In step S203, the corrected perspective projection image point is taken as the image plane point. Combining the interior and exterior orientation elements of the camera sensor, and based on the equidistant projection model and the optical distortion model, the collinearity equation is established as a functional relationship between the three-dimensional coordinates of the ground point and the pixel coordinates of the image point of the monitoring image, and the orthorectification model of the monitoring image is constructed.
[0058] Based on the aforementioned distortion correction, the perspective projection image points, which have already had spherical and optical distortion removed, are considered as standard image points on the virtual perspective image plane. The geometric relationship between the ground coordinate system and the imaging coordinate system is established: In the ground coordinate system, X, Y, Z represent the three-dimensional ground coordinates of any point P in the monitoring scene; the optical center of the camera sensor is denoted as... Its three-dimensional coordinates in the ground coordinate system are On the image plane, establish an image coordinate system with the principal point as the origin, and the pixel coordinates of the principal point are... The pixel coordinates of the corrected perspective projection image points obtained through the aforementioned steps are: The interior orientation elements of the camera sensor include the principal distance along two pixel directions. , and principal point coordinates Exterior orientation elements include optical center coordinates. and attitude angle The attitude angle can be represented by a three-dimensional rotation as a rotation matrix from the ground coordinate system to the imaging coordinate system, and its nine elements are denoted as follows: In perspective projection imaging geometry, the ground point P and the perspective projection image point are... and light center When three points are collinear, the classical collinearity equation can be derived from this condition. This equation relates the three-dimensional coordinates of the image plane point and the ground point, and can be written as:
[0059] in, This indicates the position of the camera sensor's optical center in the ground coordinate system. For interior orientation elements, These are the rotation matrix elements derived from the exterior orientation attitude angle. As can be seen from the above equation, the image plane points after perspective projection correction... The connection between the three-dimensional spatial point and the ground point (X,Y,Z) is achieved through a set of rational functions, realizing the geometric imaging constraint from the three-dimensional spatial point to the corrected image plane point.
[0060] Based on this, under the aforementioned isometric projection imaging relationship, the pixel coordinates (u,v) of the X monitoring image and the plane coordinates of the virtual perspective projection image are... Substituting the transformation relationship into the collinearity equation, the pixel coordinates of the monitoring image are directly introduced into the functional relationship between the ground point and the image point. Let r be the distance from the image point to the principal point in the original monitoring image, and (u,v) be the pixel coordinates of the corresponding image point on the monitoring image. Then, under the isometric projection model, the perspective projection image point... Substituting the relationship between pixel coordinates (u,v) and the above formula, we get:
[0061] The formula unifies the equidistant projection model with the collinearity equation. The left side is determined by the equidistant projection geometry, while the right side is determined by perspective imaging and exterior orientation elements. Considering the unavoidable optical distortion during imaging, the pixel coordinates (u,v) also include corrections for optical distortion. , , The optical distortion model (a superposition model of radial and eccentric distortion) is given above. To make the geometric relationship more consistent with the actual imaging situation, the optical distortion correction is combined into the model, using... Replacing the pixel coordinates with those of an ideal imaging scenario, we obtain:
[0062] The formula allows us to explicitly represent the pixel coordinates (u,v) of the original surveillance image as a function of the three-dimensional coordinates (X,Y,Z) of the ground point, interior and exterior orientation elements, and optical distortion parameters. Further simplification of this formula yields an explicit expression for the pixel coordinates of the surveillance image with respect to the three-dimensional coordinates of the ground point:
[0063] The above equation gives the complete functional relationship between the pixel coordinates (u,v) of the monitoring image and the three-dimensional coordinates (X,Y,Z) of the ground point. The function also includes the features introduced by the isometric projection model. Nonlinear terms and distortion corrections provided by the optical distortion model It also explicitly reflects the interior orientation elements. With exterior orientation elements Impact on imaging geometry. This step uses the corrected perspective projection image points as the image plane points. Under the joint constraints of the equidistant projection model and the optical distortion model, the collinearity equation is constructed as a nonlinear functional relationship between the three-dimensional coordinates of the ground points and the pixel coordinates of the monitoring image. The formulas in this step together constitute the orthorectification model of the monitoring image in this embodiment, providing a mathematical basis for subsequently using ground control points to solve for interior and exterior orientation elements and distortion parameters, and further generating digital orthophotos.
[0064] In step S204, using the calibration field image containing three-dimensional control points, the orthorectification model is solved based on the ground coordinates of each three-dimensional control point and its pixel coordinates in the calibration field image to obtain the interior orientation elements, exterior orientation elements, and distortion parameters.
[0065] When solving the orthorectification model, the initial values of the interior orientation elements are specifically obtained by: performing edge detection on the monitoring image and extracting the edge pixels of the effective imaging area of the monitoring image; fitting a quadratic curve using the edge pixels as samples and simplifying the quadratic curve into an ellipse to obtain the coordinates of the ellipse center and the lengths of the major and minor axes; using the position of the ellipse center in the image coordinate system as the initial pixel coordinates of the principal point of the monitoring image, and using the sum of the lengths of the major and minor axes divided by pi as the initial pixel value of the focal length of the camera sensor; and using the initial pixel values of the principal point and the focal length, together with the three-dimensional control points, as the initial values of the interior orientation elements to participate in solving the orthorectification model.
[0066] The process of acquiring and solving the parameters of the three-dimensional control points includes: setting up at least seven control points with known positions and uniform distribution in three-dimensional space, measuring the three-dimensional coordinates of each control point in the ground coordinate system, and extracting the pixel coordinates of each control point from the monitoring image; using the interior orientation element, the exterior orientation element, and the distortion parameter as unknowns, performing a first-order Taylor expansion on the theoretical values of the pixel coordinates of each control point in the orthorectification model, constructing the image point observation equation, and using least squares iterative adjustment to solve until the correction values of each unknown quantity meet the preset threshold.
[0067] To solve for the interior orientation elements, exterior orientation elements, and distortion parameters in the aforementioned orthorectification model, it is first necessary to construct a calibration field containing three-dimensional control points and acquire monitoring images of this calibration field. Specifically, in one implementation, a three-dimensional calibration field can be constructed indoors, for example, using a multi-layered frame structure with artificial markers evenly pasted on several columns to ensure the markers are distributed as uniformly as possible in three-dimensional space. Each marker uses a high-contrast circular target with a precision crosshair at its center to accurately extract its pixel coordinates from the monitoring image. Then, using a total station or other surveying equipment, the angles and distances of several control points are measured in a free coordinate system. Using methods such as resection and trigonometric leveling, the three-dimensional coordinates of the control points in the ground coordinate system are obtained. The planar position accuracy of the control points can be estimated using the following formula: ; Where mA and mB are the angle measurement errors at the two stations, a and b are the horizontal distances from each station to the control point, and S is the horizontal distance between the two stations. The angle formed by the two stations and the control point; This is a constant used to convert angles from units such as "seconds" to radians. Similarly, the trigonometric leveling error of control point elevations can be calculated using the following formula: ; Where mS is the root mean square error of the distance measurement between the station and the point to be determined. To account for vertical angle measurement error, The vertical angle is used. Through the aforementioned error propagation formula, the average planar position accuracy and elevation accuracy of the three-dimensional coordinates of the control points can be obtained, ensuring the reliability of the three-dimensional control point coordinates in the calibration field. Subsequently, on the monitoring image of the calibration field, for the selected control points, a sub-pixel level extraction algorithm is used to obtain their pixel coordinates, thereby establishing a one-to-one correspondence between the ground three-dimensional coordinates and the image pixel coordinates in the same coordinate system, providing observational data for the parameter calculation of the orthorectification model.
[0068] When solving for the parameters of the orthorectified model, reasonable initial values for the interior orientation elements are required. To this end, edge detection can be performed on the monitoring image to extract the edge pixels of the effective imaging area. Since the aspect ratio of the imaging device is usually not 1:1, the contour of the effective imaging area can be considered as an approximate ellipse. The extracted edge points can be used as samples to fit a general quadratic curve: ; After obtaining the curve coefficients A to F, the quadratic curve can be simplified to an ellipse, and the center and major and minor axes of the ellipse can be calculated. The coordinates of the ellipse center can be expressed as: ; ; Where du and dv are the individual pixel dimensions of the monitored image in two pixel directions, and u0 and v0 are the midpoint indices of the image's row and column directions, used to convert pixel indices into physical lengths. The major semi-axis a and minor semi-axis b can be calculated using the following formulas: ; ; After obtaining the center and semi-major axes of the ellipse, the position of the ellipse center in the image coordinate system can be used as the initial pixel coordinates of the principal point of the monitoring image. The sum of the lengths of the semi-major and semi-minor axes divided by pi (π) yields the initial pixel value of the focal length of the imaging system. ; This yields the principal point coordinates and focal length in the initial values of the interior orientation elements. These initial values, along with the previously obtained coordinates of the three-dimensional control points, are used as the initial estimates of the interior orientation elements when solving the orthorectification model. The initial values of the exterior orientation elements can be the average of the three-dimensional coordinates of the control points as the initial position of the camera center. The initial values of the attitude angles can be 0 or approximate values, and the initial values of the distortion parameters are generally 0. The set of initial interior and exterior orientation elements and distortion parameters obtained through the above method makes subsequent iterative solutions more likely to converge to the correct solution.
[0069] Having obtained the ground coordinates and corresponding pixel coordinates of the 3D control points, and given the initial interior and exterior orientation elements and distortion parameters, the orthorectification model established in the preceding steps can be solved linearly. Specifically, the model is expanded using a first-order Taylor series with respect to the desired exterior orientation elements, interior orientation elements, and distortion parameters at their initial values, yielding the image point error equation:
[0070]
[0071] in, , These are the residuals of the image point in two pixel directions, respectively. , , The correction value for the three-dimensional coordinates of the camera center. , , This is the correction for the external orientation rotation angle. , , These are corrections for the focal length and principal point coordinates. , , This is the correction number for the radial distortion parameter. , This is the correction value for the eccentricity distortion parameter; ~ These are the partial derivative coefficients of the imaging model with respect to each unknown parameter. = , = This represents the difference between the observed pixel coordinates and the theoretical pixel coordinates predicted by the current parameters. Representing these two equations in matrix form, we can write: ; Where V is the residual vector, and A, B, and C are coefficient matrices for the exterior orientation elements, interior orientation elements, and distortion parameters, respectively. , Let and be the correction vectors for the exterior orientation element, interior orientation element, and distortion parameter, respectively, and L be the constant term vector. Since redundant observations are common, the above linear equations can be solved using least squares adjustment. For the three parameter blocks, we have: ; In practical applications, the orthorectification model contains 14 unknown parameters. Each 3D control point provides two independent observation equations, thus requiring at least 7 spatially distributed 3D control points and their image coordinates. More control points are typically selected, and the interior and exterior orientation elements and distortion parameters are repeatedly updated through the aforementioned least-squares iterative calculation until the absolute value of each parameter correction is less than a preset threshold or the residual converges. The final interior orientation elements include the principal point coordinates and focal length; the exterior orientation elements include the 3D coordinates of the camera center and the attitude angle; and the distortion parameters include radial distortion and eccentric distortion coefficients. These parameters can then be incorporated back into the aforementioned orthorectification model for subsequent rigorous orthorectification processing of the monitoring images.
[0072] In step S205, a digital elevation model corresponding to the area to be orthorectified is obtained. The area to be orthorectified is the face image area in the monitoring image. A digital orthorectified image grid is established according to a predetermined resolution. The corresponding three-dimensional ground coordinates of each pixel in the digital orthorectified image grid are calculated and substituted into the orthorectified correction model after calibration to obtain the image point coordinates of the monitoring image. The grayscale of the neighboring pixels of the image point is interpolated and assigned to the corresponding pixel until all pixels are filled, thus obtaining the digital orthorectified image of the monitoring image.
[0073] The determination of the extent and resolution of the digital orthophoto grid includes: Based on the mapping relationship between the monitoring image and the virtual perspective projection image plane, all pixels on the monitoring image are converted into perspective projection image points to form a perspective projection image, and the pixel coordinates of the four corner points of the perspective projection image are obtained. Under the constraints of the calibrated exterior orientation elements, the pixel coordinates of the four corner points are substituted into the collinearity equation and combined with the elevation to obtain the three-dimensional coordinates of the four corner points in the ground coordinate system. The number of rows and columns of the digital orthophoto grid is determined based on the planar coordinate range of the four corner points and the desired ground resolution. The planar coordinates of each pixel in the digital orthophoto grid are then determined recursively according to the resolution, starting from one corner point.
[0074] When interpolating the grayscale values of neighboring pixels of an image point, the following steps are included: When the image point coordinates of the monitoring image obtained by the orthorectification model fall within the pixel grid of the original monitoring image and are non-integer, select multiple adjacent pixels of the pixel grid where the corresponding image point is located. Interpolation weights are constructed based on the horizontal and vertical distances from the corresponding image point to each adjacent pixel point. Bilinear interpolation or bicubic interpolation with cubic convolution kernels introduced in both the horizontal and vertical directions is used to weight and sum the gray values of adjacent pixels to obtain the interpolated gray value of the corresponding image point. The interpolated gray value is then written into the corresponding pixel of the digital orthophoto grid. After generating the digital orthophoto grid, several checkpoints are selected, and the ground coordinates of the checkpoints in the digital orthophoto grid are compared with the independently measured ground coordinates. The root mean square error in the two coordinate directions and the plane is calculated to evaluate the accuracy of the orthophoto correction result of the monitoring image.
[0075] In step S205, for a selected orthorectified area in the monitoring image (e.g., an image area containing a target face), a digital elevation model (DEM) corresponding to the area is obtained. To achieve point-by-point orthorectification at the pixel level, it is preferable to ensure that the DEM is consistent with the generated digital orthorectified image DOM in terms of planar extent and resolution, guaranteeing that each elevation sampling point in the DEM corresponds to a pixel on the DOM. Then, the pixel coordinates of the four corner points of the original monitoring image in the image coordinate system are determined. Under known exterior orientation element constraints, these four corner point pixel coordinates are substituted into the spatial forward intersection relationship in the orthorectification model, and combined with the corresponding elevation values, their actual planar coordinates in the ground coordinate system are solved. Specifically, the coordinates of the four corner points in the virtual perspective projection image plane can be denoted as... The coordinates (X, Y) in the ground coordinate system can be calculated using the following formula:
[0076] in The three-dimensional coordinates of the optical center of the camera sensor in the ground coordinate system. The equivalent focal length in the two pixel directions. These are the elements of a rotation matrix composed of attitude angles; while This is obtained by combining the pixel coordinates (u,v) of the monitored image with the relationship between equidistant projection and optical distortion correction, for example:
[0077] Where r is the radial distance from the image point to the principal point. , This is the optical distortion correction amount. The main pixel coordinates are used. The above formula can accurately convert the pixel coordinates of the four corner points of the monitoring image into the planar coordinates of the four corner points in the ground coordinate system, thereby determining the bounding rectangle of the area to be orthorectified in the ground coordinate system. Next, based on the resolution of the DEM or a predetermined ground resolution, the number of pixels in the row and column directions of the DOM is calculated. The DEM is divided into a regular grid according to the resolution, with each grid cell corresponding to a pixel on the DOM. The point with the smallest planar coordinates among the four corner points is used as the starting coordinate of the lower left corner pixel of the DOM. This process is repeated sequentially in both coordinate directions according to the set resolution to obtain the planar coordinates of each pixel in the digital orthorectified image grid.
[0078] After constructing the digital orthorectified image grid, for each pixel P falling within the area to be orthorectified, its ground plane coordinates (X,Y) are obtained through the above recursive method, and its elevation Z is assigned by the elevation value of the DEM at the corresponding location, thus obtaining the three-dimensional ground coordinates (X,Y,Z) of the pixel's center point. Subsequently, these three-dimensional coordinates are substituted into the orthorectification model obtained through calibration, and inverse calculation is performed to solve for its corresponding image point coordinates p(u,v) in the original monitoring image. This process of inversely deriving the original monitoring image image point p from the DOM point P can be summarized as follows: assuming that the monitoring image image point p(u,v) corresponds to the pixel point P(U,V) on the orthorectified image, starting from the DOM pixel P on the ground, based on the interior orientation elements, exterior orientation elements, and distortion parameters, the three-dimensional ground coordinates (X,Y,Z) are mapped back to the image plane through the collinearity equation and equidistant projection relationship to obtain the image point coordinates (u,v) on the original monitoring image. Since the (u,v) obtained by inverse calculation is usually a non-integer pixel position, grayscale interpolation needs to be performed in the neighborhood of this point to obtain continuous grayscale values. Specifically, several adjacent pixels surrounding (u,v) can be selected in the pixel grid. Interpolation weights are constructed based on the horizontal and vertical distances from (u,v) to the centers of each adjacent pixel. Bilinear interpolation or bicubic interpolation with cubic convolution kernels in both the horizontal and vertical directions is used to weighted sum the grayscale values of neighboring pixels, obtaining the grayscale value of the interpolation point p. This grayscale value is then assigned to the corresponding pixel P in the DOM grid. This "inverse calculation + interpolation + assignment" operation is performed point-by-point on all pixels in the digital orthophoto grid that fall within the area to be orthophotoned, until all pixels are filled, thus obtaining the digital orthophoto image corresponding to the face image area in the surveillance image.
[0079] After generating the digital orthophoto, in order to quantitatively evaluate the geometric accuracy of the orthorectification results, several checkpoints (CPs) can be selected within the coverage area of the DEM and DOM, and the actual planar coordinates of these checkpoints in the ground coordinate system can be measured independently. And read the corresponding planar coordinates on the digital orthophoto. The two are compared, the difference in planar coordinates is calculated, and statistical evaluation is performed using the root mean square error (RMSE). The root mean square errors in the X and Y directions are defined as follows: ; ; The root mean square error of planar synthesis is defined as: ; in Let be the coordinates of the i-th checkpoint in the digital orthophoto. Here, RMSx represents the actual ground coordinates obtained independently at each checkpoint, and n represents the number of checkpoints. By analyzing the values of RMSx, RMSy, and RMSxy, it can be determined whether the geometric accuracy of the orthorectified digital orthophoto image in the two coordinate directions and on the plane meets the predetermined requirements. This verifies the reliability and engineering applicability of the orthophoto face surveillance image generated based on the digital elevation model, point inverse calculation, and neighborhood grayscale interpolation.
[0080] In step S206, the digital orthophoto is input into a pre-trained face recognition model for identity recognition. If the face contained in the digital orthophoto is not a preset face, a warning message is sent to a predetermined address.
[0081] The digital orthophoto generated in step S205 is input into a pre-trained face recognition model for identity verification. This face recognition model can employ deep learning algorithms, such as convolutional neural networks (CNNs), to extract and compare facial features in the image. Specifically, the facial regions contained in the digital orthophoto, after distortion correction, are fed into the model as input images. The model locates and extracts features from key facial points, then compares them with a pre-set database of authorized faces. If the recognition result matches a pre-set face, the user is considered authorized and no special alert is required; if the recognition result does not match any pre-set face, it indicates that an unauthorized user has been detected, possibly having moved the water cup, and a warning message is sent to a predetermined address.
[0082] The warning message may include an image or video file and timestamp information for subsequent security reviews or tracing. The warning message can be sent from the server to the user's mobile device, or via a 4G communication module, triggering a red flashing LED light on a button. This process enables timely detection and response to unauthorized access, enhancing security and providing necessary evidence for subsequent investigations.
[0083] The monitoring method of this invention, after acquiring monitoring images around a water cup, introduces a spherical projection model and an optical distortion model to map image points onto a virtual plane imaging surface. Combining the calibration results of internal and external parameters and a digital elevation model, a geometric correction model of the monitoring image is constructed. The target area is orthorectified and grayscale interpolation is performed to generate a digital orthophoto image with high geometric accuracy, thereby improving the accuracy of identifying unauthorized users and reducing the probability of false alarms and missed alarms.
[0084] Some details of the above method have been described in detail in the implementation of the water cup section. For any undisclosed details, please refer to the implementation of the water cup section, and therefore will not be repeated here.
[0085] The accompanying drawings are merely illustrative of the processes included in the methods according to exemplary embodiments of this disclosure and are not intended to be limiting. It is readily understood that the processes shown in the drawings do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0086] It should be noted that although several modules or units of the system have been mentioned in the detailed description above, this division is not mandatory. In fact, according to exemplary embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0087] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and embodiments are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the claims.
[0088] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.
Claims
1. A new safety water cup characterized in that, The water cup comprises a cup body and a cup cover, and the cup cover is integrated with a USB interface, a lithium battery, a battery management module, a PMOS switch circuit, an MCU module, a key, a detection circuit, a camera main control and storage module, and a 4G communication module, wherein: The USB interface is used for connecting an external power supply and reading and writing data of the camera main control and storage module; A direct-current power is provided by an output end of the lithium battery; An input end of the battery management module is electrically connected with the USB interface, and an output end thereof is electrically connected with the lithium battery, and the battery management module is used for charging management and overcharge and overdischarge protection of the lithium battery; An input end of the PMOS switch circuit is electrically connected with an output end of the lithium battery, and an output end thereof is electrically connected with a power supply end of the camera main control and storage module and the 4G communication module; A power supply end of the MCU module is electrically connected with the lithium battery, a first signal input end thereof is electrically connected with the key, a second signal input end thereof is electrically connected with the detection circuit, and a control output end thereof is electrically connected with a control end of the PMOS switch circuit, and the MCU module is used for controlling conduction and turn-off of the PMOS switch circuit according to signals from the key and the detection circuit; The detection circuit is arranged between the cup cover and the cup body, and is used for outputting a cup cover state change signal to the MCU module when the cup cover is opened or closed; A data input end of the camera main control and storage module is electrically connected with at least one camera sensor, and a data output end thereof is electrically connected with a data end of the 4G communication module and the USB interface, and the camera main control and storage module is used for controlling the camera sensor to take a picture and / or shoot a video, storing an obtained image or video file and adding a time stamp, and sending the image or video file through the 4G communication module or the USB interface, and the at least one camera sensor is installed on the cup cover and is used for collecting images around the cup body; A power supply end of the 4G communication module is electrically connected with an output end of the PMOS switch circuit, and the 4G communication module is used for uploading an image or video file output by the camera main control and storage module to a preset terminal in real time through a cellular mobile network; The MCU module is configured to: only itself, the key and the detection circuit are in a power-on monitoring state in a sleep mode; when it is detected that the key is pressed for a first preset time length, the PMOS switch circuit is controlled to be turned on, the camera main control and storage module and the 4G communication module are powered on, and the camera main control and storage module is controlled to drive the camera sensor to take a preset number of continuous pictures and / or shoot a preset time length of video; when it is detected that the cup cover state change signal output by the detection circuit, the PMOS switch circuit is controlled to be turned on, the camera main control and storage module and the 4G communication module are powered on, and the camera main control and storage module is controlled to drive the camera sensor to take the preset number of continuous pictures and shoot the preset time length of video, and the obtained image or video file is uploaded to the preset terminal in real time through the 4G communication module. After the preset time length of shooting and photographing is completed, and no new key operation or the cup cover state change signal is detected again within a preset monitoring time, the PMOS switch circuit is controlled to be turned off, the shooting master control and storage module and the 4G communication module are powered off, and the sleep mode is re-entered.
2. The novel safety water cup according to claim 1, characterized in that, The MCU module is further configured to: When it is detected that the key is long-pressed for a second preset time length, the shooting master control and storage module is first controlled to drive the camera sensor to perform the preset number of continuous shooting and the preset time length of shooting, and the obtained image or video file is uploaded to the preset terminal through the 4G communication module, and then the photographing and shooting functions triggered by the detection circuit are set to be in an off state, so that photographing and / or shooting are started only when the operation of the key is detected thereafter; When the photographing and shooting functions are in an on state, when it is detected that the key is continuously pressed for a specified number of times, the only photographing mode, the only shooting mode and the photographing and shooting mode are cyclically switched, and the indicator light arranged in the key is controlled to indicate the current mode by different flashing numbers, wherein, in the only photographing mode, only the preset number of continuous shooting is performed, in the only shooting mode, only the preset time length of shooting is performed, and in the photographing and shooting mode, the preset number of continuous shooting and the preset time length of shooting are simultaneously performed.
3. The novel safety water cup according to claim 1, characterized in that, The camera sensor has two, and the two camera sensors are arranged symmetrically along the circumference of the cup cover, so that the water cup has a 360° shooting range in the horizontal direction and a 270° shooting range in the vertical direction.
4. A monitoring method characterized by, The method comprises: The monitoring image photographed by the novel safety water cup of any one of claims 1-3 is acquired, an image coordinate system with a principal point of the monitoring image as an origin is established, a virtual perspective projection image plane tangent to a camera sensor spherical surface is assumed to exist, the image points of the monitoring image are mapped onto the virtual perspective projection image plane according to an equirectangular projection imaging relationship, and perspective projection image points with spherical distortion removed are obtained; An optical distortion model is established for the perspective projection image points, and the perspective projection image points are corrected by using the optical distortion model, so that the perspective projection image points after optical distortion correction are obtained; The perspective projection image points after correction are taken as image plane points, the internal orientation elements and the external orientation elements of the camera sensor are combined, the collinearity equation is established as a functional relationship between the three-dimensional coordinates of the ground points and the pixel coordinates of the image points of the monitoring image based on the equirectangular projection model and the optical distortion model, and the orthographic rectification model of the monitoring image is constructed; A calibration field image containing three-dimensional control points is used, the orthographic rectification model is solved according to the ground coordinates of each three-dimensional control point and the pixel coordinates of the three-dimensional control points in the calibration field image, so that the internal orientation elements, the external orientation elements and the distortion parameters are obtained. The digital orthographic image of the monitoring image is obtained by acquiring a digital elevation model corresponding to a to-be-orthographic region, the to-be-orthographic region being a face image region in the monitoring image, establishing a digital orthographic image grid according to a predetermined resolution, calculating corresponding three-dimensional ground coordinates for each pixel in the digital orthographic image grid, and substituting the three-dimensional ground coordinates into the orthographic correction model to obtain pixel point coordinates of the monitoring image, interpolating and assigning pixel gray scales of a neighborhood of the pixel point to the corresponding pixel until all pixels are filled to obtain the digital orthographic image of the monitoring image. The digital orthographic image is input into a pre-trained face recognition model for identity recognition, and when a face included in the digital orthographic image is not a preset face, an alert message is sent to a predetermined address.
5. The monitoring method according to claim 4, characterized in that, The optical distortion model is obtained by superimposing a radial distortion model and an eccentric distortion model, wherein: The radial distortion model is used to describe the axial symmetric distortion of the image point along the line connecting the principal point to the image point, and the radial distortion correction amount of the image point in the transverse and longitudinal directions is obtained by multiplying the square, fourth power and sixth power of the distance from the image point to the principal point by the corresponding radial distortion parameters and summing them up. The eccentric distortion model is used to describe the asymmetric distortion caused by the non-coincidence of the lens image axis and the normal of the imaging plane.
6. The monitoring method according to claim 5, characterized in that, In the eccentric distortion model, the eccentric distortion amount along the transverse direction and the longitudinal direction is included, wherein: The eccentric distortion amount along the transverse direction is the sum of the following two parts: The square of the distance from the image point to the principal point is added to the square of the transverse coordinate, and then multiplied by the first eccentric distortion parameter; The product of the transverse coordinate and the longitudinal coordinate is multiplied by the second eccentric distortion parameter. The eccentric distortion amount along the longitudinal direction is the sum of the following two parts: The square of the distance from the image point to the principal point is added to the square of the longitudinal coordinate, and then multiplied by the second eccentric distortion parameter; The product of the transverse coordinate and the longitudinal coordinate is multiplied by the first eccentric distortion parameter.
7. The monitoring method of claim 4, wherein, When solving the orthographic correction model, the initial values of the interior orientation elements are obtained, including: Edge detection is performed on the monitoring image to extract edge pixel points of the effective imaging area of the monitoring image; A quadratic curve is fitted using the edge pixel points as samples, and the quadratic curve is simplified to an elliptical form to obtain the coordinates of the center of the ellipse and the lengths of the major and minor semi-axes; The position of the center of the ellipse in the image coordinate system is taken as the initial pixel coordinates of the principal point of the monitoring image, and the sum of the lengths of the major and minor semi-axes is divided by the value of pi to obtain the initial pixel value of the focal length of the camera sensor; The initial pixel values of the principal point and the focal length are used together with the three-dimensional control points as the initial values of the interior orientation elements to participate in the solution of the orthographic correction model.
8. The monitoring method of claim 4, wherein, The acquisition and parameter solving process of the three-dimensional control points includes: At least seven control points with known positions in three-dimensional space and uniform distribution are laid out, the three-dimensional coordinates of each control point in the ground coordinate system are determined, and the pixel coordinates of each control point are extracted on the monitoring image; The pixel coordinate theoretical value of the orthorectification model about each control point is first-order Taylor expanded with the inner orientation elements, the outer orientation elements and the distortion parameters as unknown quantities, an image point observation equation is constructed, and least squares iterative adjustment is adopted to solve until each unknown quantity correction number meets a preset threshold.
9. The monitoring method of claim 4, wherein, The determination of the range and resolution of the digital orthophoto image grid comprises: According to the mapping relationship between the monitoring image and the virtual perspective projection image plane, all pixel points on the monitoring image are converted into perspective projection image points to form a perspective projection image, and pixel coordinates of four corner points of the perspective projection image are obtained; Under the constraint of the calibrated outer orientation elements, the pixel coordinates of the four corner points are substituted into the collineation equation respectively and combined with the elevation to obtain three-dimensional coordinates of the four corner points in the ground coordinate system; The number of rows and columns of the digital orthophoto image grid is determined according to the planar coordinate range of the four corner points and the expected ground resolution, and the planar coordinates of each pixel in the digital orthophoto image grid are determined recursively according to the resolution with one corner point as the starting point.
10. The monitoring method of claim 4, wherein, When interpolating the gray scale of the neighborhood pixels of the image point, the steps comprise: When the image point coordinate of the monitoring image obtained by back calculation of the orthorectification model falls within the pixel grid of the original monitoring image and is not an integer, a plurality of adjacent pixel points of the pixel grid where the corresponding image point is located are selected; According to the horizontal and vertical distances from the corresponding image point to each adjacent pixel point, interpolation weights are constructed, the gray scale values of the adjacent pixel points are weighted and summed by using bilinear interpolation or double cubic interpolation method in which a cubic convolution kernel is introduced in the horizontal and vertical directions respectively, the interpolation gray scale value of the corresponding image point is obtained, and the interpolation gray scale value is written into the corresponding pixel of the digital orthophoto image grid; After the digital orthophoto image grid is generated, a plurality of check points are selected, the ground coordinates of the check points in the digital orthophoto image grid are compared with the independently measured ground coordinates, the root mean square error in two coordinate directions and on the plane is calculated, and the accuracy of the orthorectification result of the monitoring image is evaluated.