CN113253857B - Mouse control method and device, mouse and readable storage medium - Google Patents

Mouse control method and device, mouse and readable storage medium Download PDF

Info

Publication number
CN113253857B
CN113253857B CN202110590683.0A CN202110590683A CN113253857B CN 113253857 B CN113253857 B CN 113253857B CN 202110590683 A CN202110590683 A CN 202110590683A CN 113253857 B CN113253857 B CN 113253857B
Authority
CN
China
Prior art keywords
time
mean value
current
value
pixel mean
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110590683.0A
Other languages
Chinese (zh)
Other versions
CN113253857A (en
Inventor
朱雨川
丛群
庄腾飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Yspring Technology Co ltd
Original Assignee
Shenzhen Yspring Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Yspring Technology Co ltd filed Critical Shenzhen Yspring Technology Co ltd
Priority to CN202110590683.0A priority Critical patent/CN113253857B/en
Publication of CN113253857A publication Critical patent/CN113253857A/en
Application granted granted Critical
Publication of CN113253857B publication Critical patent/CN113253857B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/038Control and interface arrangements therefor, e.g. drivers or device-embedded control circuitry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/03Arrangements for converting the position or the displacement of a member into a coded form
    • G06F3/033Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor
    • G06F3/0354Pointing devices displaced or positioned by the user, e.g. mice, trackballs, pens or joysticks; Accessories therefor with detection of 2D relative movements between the device, or an operating part thereof, and a plane or surface, e.g. 2D mice, trackballs, pens or pucks
    • G06F3/03543Mice or pucks
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/10Controlling the intensity of the light
    • HELECTRICITY
    • H05ELECTRIC TECHNIQUES NOT OTHERWISE PROVIDED FOR
    • H05BELECTRIC HEATING; ELECTRIC LIGHT SOURCES NOT OTHERWISE PROVIDED FOR; CIRCUIT ARRANGEMENTS FOR ELECTRIC LIGHT SOURCES, IN GENERAL
    • H05B45/00Circuit arrangements for operating light-emitting diodes [LED]
    • H05B45/30Driver circuits
    • H05B45/32Pulse-control circuits
    • H05B45/325Pulse-width modulation [PWM]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02BCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO BUILDINGS, e.g. HOUSING, HOUSE APPLIANCES OR RELATED END-USER APPLICATIONS
    • Y02B20/00Energy efficient lighting technologies, e.g. halogen lamps or gas discharge lamps
    • Y02B20/40Control techniques providing energy savings, e.g. smart controller or presence detection

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Position Input By Displaying (AREA)

Abstract

The embodiment of the invention discloses a mouse control method, a device, a mouse and a readable storage medium, wherein the method calculates the pixel mean value corresponding to each moment image frame; calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment; the method has the advantages that the image quality of adjacent image frames can be analyzed through the pixel mean value at the last moment, the pixel mean value at the current moment and the absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment, the duty ratio of a pulse width modulation signal for controlling the illumination intensity of an LED lamp at the bottom of the mouse is set through analyzing the image quality of the adjacent image frames, the frame rate or the shutter mode does not need to be adjusted, the dimming speed is high, the cursor shaking and the hysteresis phenomenon are avoided, the quality of the image frames is improved through changing the illumination intensity, a certain number of high-quality effective image frames can be obtained within a certain time interval, and the accuracy of cursor positioning is further ensured.

Description

Mouse control method and device, mouse and readable storage medium
Technical Field
The invention relates to the field of optical mouse control, in particular to a mouse control method, a device, a mouse and a readable storage medium.
Background
The photoelectric mouse obtains image frames of a working plane at the bottom of the mouse by utilizing light reflection, and judges the moving direction and the moving distance of the mouse by analyzing the change of the positions of characteristic points on a plurality of obtained image frames, thereby completing the positioning of a cursor. Because the surface material or color of the mouse work is different, the reflectivity of the work surface is different, and the obtained image often generates the phenomenon of underexposure or overexposure, which leads to the failure of accurately judging the moving direction and the moving distance of the mouse, and further the failure of accurately positioning the cursor.
Disclosure of Invention
In view of the above problems, the present invention provides a mouse control method, device, mouse and readable storage medium.
The application provides a mouse control method, which comprises the following steps:
acquiring image frames of a working plane at the bottom of the mouse in real time;
calculating the pixel mean value corresponding to each moment image frame;
calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment;
and setting the duty ratio of a pulse width modulation signal according to the pixel average value at the last moment, the pixel average value at the current moment and the absolute value, wherein the duty ratio of the pulse width modulation signal is used for controlling the illumination intensity of an LED lamp at the bottom of the mouse.
The method for controlling a mouse according to the present application, wherein setting the duty ratio of the pwm signal according to the last-time pixel average value, the current-time pixel average value, and the absolute value includes:
determining whether the current-time pixel mean value and the absolute value meet a first preset condition, wherein the first preset condition is that the current-time pixel mean value is smaller than a preset minimum mean value threshold value and the absolute value is smaller than a preset minimum absolute value threshold value;
determining whether the current-time pixel mean value and the absolute value meet a second preset condition, wherein the second preset condition is that the current-time pixel mean value is greater than or equal to a preset maximum mean value threshold value or the absolute value is greater than or equal to a preset maximum absolute value threshold value;
if the pixel mean value and the absolute value at the current moment meet a first preset condition or a second preset condition, monitoring whether the time meeting the first preset condition is greater than or equal to a preset first time threshold or whether the time meeting the second preset condition is greater than or equal to the first time threshold;
and if the time meeting a first preset condition is greater than or equal to the first time threshold or the time meeting a second preset condition is greater than or equal to the first time threshold, setting the duty ratio of the pulse width modulation signal according to the proportional relation between the pixel average value at the last moment and the pixel average value at the current moment.
The method for controlling a mouse according to the present application, wherein setting the duty ratio of the pwm signal according to the proportional relationship between the last time pixel average value and the current time pixel average value comprises:
if the ratio of the current time pixel mean value to the last time pixel mean value is less than or equal to 2 -n And is greater than 2 -(n+1) Then, the duty ratio of the pwm signal corresponding to the current time is set to 2 of the duty ratio of the pwm signal corresponding to the previous time n Multiple, n is an integer and n is more than or equal to 1;
if the ratio of the current-time pixel mean value to the last-time pixel mean value is more than or equal to 2 m And less than 2 (m+1) Then, the duty ratio of the pwm signal corresponding to the current time is set to 2 of the duty ratio of the pwm signal corresponding to the previous time -(m+1) Multiple, m is an integer and is more than or equal to 0;
and if the ratio of the current-time pixel mean value to the last-time pixel mean value is greater than 1/2 and less than 1, keeping the duty ratio of the pulse width modulation signal corresponding to the current time to be the same as the duty ratio of the pulse width modulation signal corresponding to the last time.
The mouse control method of the present application records a duty ratio of the pwm signal before setting, before setting the duty ratio of the pwm signal according to a proportional relationship between the last-time pixel average value and the current-time pixel average value, and further includes:
and if the duty ratio of the pulse width modulation signal for controlling the LED lamp at the bottom of the mouse is increased to be larger than a preset duty ratio threshold value and larger than the corresponding duty ratio before setting, and the absolute values of the pixel mean value at the current moment and the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment meet the first preset condition, determining that the mouse leaves the working plane.
After determining that the mouse leaves the desktop, the mouse control method further includes:
if the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than the maximum absolute value threshold value, monitoring whether the time that the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than or equal to a preset second time threshold value or not;
and if the time is larger than or equal to a preset second time threshold, determining that the mouse returns to the working plane.
The mouse control method of the present application, when determining that the mouse returns to the desktop, further includes:
determining the duty ratio corresponding to the pixel mean value and the absolute value at the current moment from a preset comparison relation table;
and setting the duty ratio of a pulse width modulation signal for controlling the LED lamp at the bottom of the mouse as the duty ratio determined by utilizing a preset comparison relation table.
The method for controlling a mouse according to the present application, wherein the setting of the duty ratio of the pwm signal according to the last-time pixel average value, the current-time pixel average value, and the absolute value includes:
if the pixel mean value at the current moment is greater than or equal to a preset minimum mean value threshold and less than a preset maximum mean value threshold, and the absolute value is greater than or equal to a preset minimum absolute value threshold and less than a preset maximum absolute value threshold, keeping the duty ratio of the pulse width modulation signal corresponding to the current moment the same as the duty ratio of the pulse width modulation signal corresponding to the previous moment, and calculating the moving distance of the mouse according to the image frame at the previous moment and the image frame at the current moment.
The application provides a mouse control device, the device includes:
the acquisition module is used for acquiring image frames of a working plane at the bottom of the mouse in real time;
the computing module is used for computing the pixel mean value corresponding to each moment image frame; calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment;
and the control module is used for setting the duty ratio of a pulse width modulation signal according to the pixel mean value at the last moment, the pixel mean value at the current moment and the absolute value, and the duty ratio of the pulse width modulation signal is used for controlling the illumination intensity of an LED lamp at the bottom of the mouse.
The application provides a mouse, including LED lamp, optical lens, photoelectric sensor, memory and treater, the LED lamp is used for sending light according to received pulse width modulation signal, in order to illuminate mouse bottom work plane makes mouse receipt bottom work plane reflection light, optical lens receives behind mouse bottom work plane's reflection light, will reflection light transmit extremely photoelectric sensor so that the treater gathers in real time mouse bottom work plane's image frame, the memory storage has computer program, computer program is in when the operation on the treater carries out this application mouse control method.
The present application proposes a readable storage medium storing a computer program which, when run on a processor, performs the mouse control method described herein.
The method comprises the steps of collecting image frames of a working plane at the bottom of the mouse in real time; calculating the pixel mean value corresponding to each moment image frame; calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment; the method has the advantages that the image quality of adjacent image frames can be analyzed through the pixel mean value at the last moment, the pixel mean value at the current moment and the absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment, the duty ratio of a pulse width modulation signal for controlling the illumination intensity of an LED lamp at the bottom of the mouse is set through analyzing the image quality of the adjacent image frames, the frame rate or the shutter mode does not need to be adjusted, the dimming speed is high, the cursor shaking and the hysteresis phenomenon are avoided, the quality of the image frames is improved through changing the illumination intensity, a certain number of high-quality effective image frames can be obtained within a certain time interval, and the accuracy of cursor positioning is further ensured.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings required to be used in the embodiments will be briefly described below, and it should be understood that the following drawings only illustrate some embodiments of the present invention, and therefore should not be considered as limiting the scope of the present invention. Like components are numbered similarly in the various figures.
FIG. 1 is a flowchart illustrating a first mouse control method according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a second mouse control method according to an embodiment of the present disclosure;
FIG. 3 is a flow chart illustrating a process of determining that a mouse leaves a work plane according to an embodiment of the present application;
FIG. 4 is a flow chart illustrating a process of determining that a mouse returns to a working plane according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a mouse control device according to an embodiment of the present disclosure;
fig. 6 shows a schematic structural diagram of a mouse according to an embodiment of the present application.
Description of the main element symbols:
10-a mouse control device; 11-an acquisition module; 12-a calculation module; 13-a control module; 100-mouse; 110-LED lamps; 120-an optical lens; 130-a photosensor; 140-a memory; 150-processor.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
Hereinafter, the terms "including", "having", and their derivatives, which may be used in various embodiments of the present invention, are only intended to indicate specific features, numbers, steps, operations, elements, components, or combinations of the foregoing, and should not be construed as first excluding the existence of, or adding to, one or more other features, numbers, steps, operations, elements, components, or combinations of the foregoing.
Furthermore, the terms "first," "second," "third," and the like are used solely to distinguish one from another and are not to be construed as indicating or implying relative importance.
Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which various embodiments of the present invention belong. The terms (such as terms defined in a commonly used dictionary) will be construed to have the same meaning as the contextual meaning in the related art and will not be construed to have an idealized or overly formal meaning unless expressly so defined in various embodiments of the present invention.
In order to ensure the operation quality of the optical mouse, realize the accurate positioning of the cursor and avoid the occurrence of cursor shaking and hysteresis, it is necessary to ensure that the contrast of the image frame of the collected image frame of the working plane at the bottom of the mouse is proper. The existing methods for ensuring the clear image frame and proper image contrast of the collected working plane at the bottom of the mouse are two: one is to adjust the frame rate, i.e. adjust the number of times of collecting image frames in unit time; the other is to adjust the shutter mode, i.e. adjust the length of time to acquire each frame of image. Generally, under the condition of not changing the illumination intensity, the frame rate or the shutter mode can be adjusted so that the acquired image frame is not overexposed or underexposed, and the acquired image frame on the working plane at the bottom of the mouse can be ensured to have proper contrast.
However, under the condition of not changing the illumination intensity, the frame rate or the shutter mode is adjusted, which not only consumes power and reduces the service time of the battery of the optical mouse, but also reduces the number of image frames acquired within a certain time interval due to the adjustment of the frame rate or the shutter mode, reduces the number of image frames acquired within a certain time by a processor for image analysis inside the optical mouse, reduces the analysis effect on the continuous image frames, further reduces the accuracy of cursor positioning, and may cause the cursor to move unsmoothly or the cursor to be stuck.
In addition, when the working plane is switched and needs dimming in the existing optical mouse movement detection technology, the cursor is possibly delayed due to long dimming time; in addition, in the process of lifting and returning the mouse to the working plane, because light reflected by the working plane can enter the photoelectric sensor, the mouse can be mistakenly judged to return to the desktop and start to calculate displacement when the mouse leaves the working plane, and further the output of the cursor is unstable to form jitter; after the mouse returns to the desktop, because the desktop when returning and the desktop when leaving are different, dimming judgment needs to be restarted according to the working principle of the mouse, and the displacement amount cannot be calculated during dimming, so that the cursor movement delay is caused.
Based on the above problem, the present application provides a mouse control method, in which a duty ratio of a pulse width modulation signal for controlling an illumination intensity of an LED lamp at a bottom of a mouse is set according to a pixel mean value at a previous time, a pixel mean value at a current time, and an absolute value of a difference between the pixel mean value at the previous time and the pixel mean value at the current time. The technical scheme of this application sets up through the image quality of analysis adjacent image frame and is used for control the duty cycle of the pulse width modulation signal of the illumination intensity of the LED lamp of mouse bottom need not to adjust the frame rate or adjust the shutter mode, and not only the speed of adjusting luminance is fast, avoids the emergence of cursor shake and hysteresis, improves the quality of image frame through changing illumination intensity moreover, can guarantee to acquire the high-quality effective image frame of certain figure in certain time interval, and then guarantees the accuracy of cursor positioning.
Example 1
One embodiment of the present application, as shown in fig. 1, provides a mouse control method, including the following steps:
s100: and acquiring image frames of the working plane at the bottom of the mouse in real time.
The method for controlling the mouse is applied to the optical mouse, the light emitting diode (LED lamp) is arranged inside the optical mouse, the light emitted by the LED lamp can illuminate the working plane at the bottom of the optical mouse, and a part of light reflected by the bottom working plane of the optical mouse passes through a group of optical lenses inside the optical mouse and is transmitted to a photoelectric sensor (micro-imager) for imaging. When the optical mouse moves, the moving track of the optical mouse can be recorded into a group of consecutive image frames shot at a high speed, a processor used for carrying out image analysis in the optical mouse analyzes the consecutive image frames, and the moving direction and the moving distance of the mouse are judged by analyzing the change of the position of the characteristic point on the consecutive image frames, so that the positioning of the cursor is completed.
Generally, in order to ensure the accuracy of mouse positioning, it is generally necessary to acquire image frames of a working plane at the bottom of a mouse in real time according to a higher acquisition frequency, that is, it is ensured that a time interval between the acquisition of adjacent frame images is as small as possible, and it is ensured that a certain number of high-quality effective image frames are obtained within a certain time, so that a processor inside a photoelectric mouse for performing image analysis can accurately position a cursor according to the obtained plurality of effective image frames.
S200: and calculating the pixel mean value corresponding to each moment image frame.
The pixel mean value of the image frame reflects the brightness of the image frame, the larger the pixel mean value is, the larger the brightness of the image frame is, and conversely, the smaller the pixel mean value is, the smaller the brightness of the image frame is. It can be understood that, for an image frame including n × m pixels, the corresponding pixel mean value is equal to the sum of the pixel values of the pixels, and then divided by n × m.
S300: and calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment.
The pixel mean of an image frame reflects the brightness of the image frame, and the absolute value of the difference between the pixel mean of adjacent image frames reflects the difference in brightness between the adjacent image frames.
S400: and setting the duty ratio of the pulse width modulation signal according to the pixel average value of the last moment, the pixel average value of the current moment and the absolute value.
It is understood that the duty cycle of the pulse width modulated signal is used to control the illumination intensity of the LED light at the bottom of the mouse.
The absolute values of the last-moment pixel mean value, the current-moment pixel mean value and the difference between the last-moment pixel mean value and the current-moment pixel mean value can be used for analyzing the image quality of adjacent image frames, and the duty ratio of a pulse width modulation signal used for controlling the illumination intensity of an LED lamp at the bottom of the mouse is set by analyzing the image quality of the adjacent image frames.
According to the technical scheme, the duty ratio of the pulse width modulation signal used for controlling the illumination intensity of the LED lamp at the bottom of the mouse is set by analyzing the image quality of the adjacent image frames, the frame rate or the shutter mode does not need to be adjusted, the dimming speed is high, cursor shaking and hysteresis are avoided, the quality of the image frames is improved by changing the illumination intensity, a certain number of high-quality effective image frames can be obtained within a certain time interval, and the accuracy of cursor positioning is further ensured.
Example 2
An embodiment of the present application, as shown in fig. 2, provides a method for setting a duty ratio of a pwm signal according to a previous-time pixel average value, a current-time pixel average value, and an absolute value, the method comprising the following steps:
s410: and determining whether the current pixel mean value and the absolute value meet a first preset condition.
The first preset condition is that the pixel mean value at the current moment is smaller than a preset minimum mean value threshold value, and the absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment is smaller than a preset minimum absolute value threshold value.
It can be understood that if the pixel mean value at the current time is smaller than the preset minimum mean value threshold, it indicates that the brightness of the image frame acquired at the current time is too low, and there may be a problem of underexposure. The absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment is smaller than the preset minimum absolute value threshold, which indicates that the adjacent image frames acquired at the adjacent moments have the phenomenon of undersized brightness. The brightness of the image frame is too low, which affects the analysis result of the processor inside the mouse for image analysis, resulting in inaccurate cursor positioning.
S420: and determining whether the current pixel mean value and the absolute value meet a second preset condition.
The second preset condition is that the current-time pixel average value is greater than or equal to a preset maximum average value threshold value or the absolute value of the difference between the previous-time pixel average value and the current-time pixel average value is greater than or equal to a preset maximum absolute value threshold value.
It can be understood that if the average value of the pixels at the current time is greater than or equal to the preset maximum average value threshold, it indicates that the brightness of the image frame acquired at the current time is too high, and there may be a problem of overexposure. The absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment is greater than or equal to the preset maximum absolute value threshold, which indicates that the adjacent image frames acquired at the adjacent moments have overlarge brightness. Too much brightness of the image frame may also affect the analysis result of the processor inside the mouse for image analysis, resulting in inaccurate cursor positioning.
Further, if the current-time pixel mean value and the absolute value (the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value) satisfy the first preset condition or the second preset condition, step S430 is executed.
S430: monitoring the time meeting the first preset condition or the time meeting the second preset condition.
It can be understood that if the image frame has very short underexposure or overexposure, the image frame can be ignored, the illumination intensity of the LED lamp is prevented from being frequently adjusted, the aging speed of the LED lamp is accelerated, and the phenomenon of blocking caused by frequently adjusting the LED lamp can be avoided. Therefore, a suitable first time threshold may be preset, and the time satisfying the first preset condition or the time satisfying the second preset condition may be monitored.
S440: and judging whether the time meeting the first preset condition or the time meeting the second preset condition is greater than or equal to the first time threshold value.
If the time meeting the first preset condition is greater than or equal to the first time threshold, the brightness of the multiple image frames acquired within the first time threshold is too small, and the problem of underexposure exists within the first time threshold; if the time meeting the second preset condition is greater than or equal to the first time threshold, it indicates that the brightness of the multiple image frames acquired within the first time threshold is too high, and the problem of overexposure exists within the first time threshold. Therefore, if the time meeting the first preset condition or the time meeting the second preset condition is greater than or equal to the first time threshold, step S450 is executed.
S450: and setting the duty ratio of the pulse width modulation signal according to the proportional relation between the pixel average value at the previous moment and the pixel average value at the current moment.
Further, the duty cycle of the pulse width modulated signal may be set using the following method:
if the ratio of the current time pixel mean value to the last time pixel mean value is less than or equal to 2 -n And is greater than 2 -(n+1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time n Multiple, n is an integer and n is more than or equal to 1.
For example, if the average value of the pixels at the current moment is 1/2 to 1/4 of the average value of the pixels at the previous moment, the duty ratio of the pulse width modulation signal corresponding to the current moment is set to be 2 times of the duty ratio of the pulse width modulation signal corresponding to the previous moment; and if the average value of the pixels at the current moment is 1/4-1/8 of the average value of the pixels at the previous moment, setting the duty ratio of the pulse width modulation signal corresponding to the current moment to be 4 times of the duty ratio of the pulse width modulation signal corresponding to the previous moment.
If the ratio of the current-time pixel mean value to the last-time pixel mean value is more than or equal to 2 m And less than 2 (m+1) Setting the duty ratio of the PWM signal corresponding to the current time as the pulse corresponding to the previous timeDuty cycle of width modulation signal 2 -(m+1) Multiple, m is an integer and m is more than or equal to 0.
For example, if the average value of the pixels at the current moment is 1 to 2 times of the average value of the pixels at the previous moment, the duty ratio of the pulse width modulation signal corresponding to the current moment is set to be 1/2 of the duty ratio of the pulse width modulation signal corresponding to the previous moment; and if the average value of the pixels at the current moment is 2-4 of the average value of the pixels at the previous moment, setting the duty ratio of the pulse width modulation signal corresponding to the current moment to be 1/4 times of the duty ratio of the pulse width modulation signal corresponding to the previous moment.
And if the ratio of the current-time pixel mean value to the last-time pixel mean value is greater than 1/2 and less than 1, keeping the duty ratio of the pulse width modulation signal corresponding to the current time to be the same as the duty ratio of the pulse width modulation signal corresponding to the last time.
It can be understood that the duty ratio of the pulse width modulation signal is set according to the ratio of the current-time pixel mean value to the last-time pixel mean value, so that the adjusting speed of the illumination intensity of the LED lamp at the bottom of the mouse can be accelerated, the sensitivity of the mouse is further improved, and the generation of the hysteresis phenomenon and the karton phenomenon is avoided.
Further, the execution sequence of step S410 and step S420 may be performed simultaneously, or may be performed sequentially, for example, step S410 may be performed first: determining whether the current-time pixel mean value and the absolute value (the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value) satisfy a first preset condition, that is, the current-time pixel mean value is smaller than a preset minimum mean value threshold, and the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value is smaller than a preset minimum absolute value threshold, if the first preset condition is not satisfied, then executing step S420: whether the current-time pixel mean value and the absolute value (the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value) meet a second preset condition is determined, namely the second preset condition is that the current-time pixel mean value is greater than or equal to a preset maximum mean value threshold value or the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value is greater than or equal to a preset maximum absolute value threshold value. It is understood that step S420 may be executed first, and step S410 may be executed again if the average value and the absolute value of the current-time pixel (the absolute value of the difference between the average value of the previous-time pixel and the average value of the current-time pixel) do not satisfy the second preset condition.
Further, if the current-time pixel mean value and the absolute value (the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value) do not satisfy the first preset condition and the second preset condition, that is, the current-time pixel mean value is greater than or equal to the preset minimum mean value threshold and is less than the preset maximum mean value threshold, and the absolute value (the absolute value of the difference between the previous-time pixel mean value and the current-time pixel mean value) is greater than or equal to the preset minimum absolute value threshold and is less than the preset maximum absolute value threshold, it indicates that the contrast of the current image frame is proper, and the problem of overexposure or underexposure does not exist, and indicates that the duty ratio of the pulse width modulation signal corresponding to the current time is proper, and the duty ratio of the pulse width modulation signal corresponding to the previous time can be kept the same, and the distance of the mouse movement is calculated according to the previous-time image frame and the current-time image frame.
Example 3
One embodiment of the present application proposes a method for determining whether the mouse leaves the working plane, where the method, as shown in fig. 3, further includes, before step S450, S449: and recording the corresponding duty ratio of the pulse width modulation signal before setting, namely when the time meeting the first preset condition or the time meeting the second preset condition is greater than or equal to the first time threshold, sequentially executing steps S449 and S450. Steps S460 and S470 are also included after step S450.
S460: and judging whether the duty ratio of the pulse width modulation signal is increased to be larger than a preset duty ratio threshold value and larger than the corresponding duty ratio of the pulse width modulation signal before setting, and the absolute values of the pixel mean value at the current moment and the difference between the pixel mean value at the last moment and the pixel mean value at the current moment meet a first preset condition.
The first preset condition is that the pixel mean value at the current moment is smaller than a preset minimum mean value threshold value, and the absolute value of the difference between the pixel mean value at the last moment and the pixel mean value at the current moment is smaller than a preset minimum absolute value threshold value.
If the duty ratio of the pulse width modulation signal for controlling the LED lamp at the bottom of the mouse is increased to be greater than the preset duty ratio threshold and greater than the duty ratio corresponding to the pulse width modulation signal before the setting, and the pixel average value at the current time meets the first preset condition, step S470 may be performed.
S470: determining that the mouse leaves a work plane.
It can be understood that the duty ratio of the pulse width modulation signal for controlling the LED lamp at the bottom of the mouse is increased to be greater than the preset duty ratio threshold and greater than the duty ratio corresponding to the pulse width modulation signal before setting, and the pixel mean value at the current moment meets the first preset condition, which indicates that under the condition that the duty ratio of the pulse width modulation signal is continuously increased, that is, under the condition that the luminance of the LED lamp is continuously increased, the luminance of the collected image frame is still too small, which indicates that the mouse cannot receive the reflected light of the working plane, and therefore, it can be determined that the mouse may leave the working plane.
In consideration of the mouse lifting habit of a user in the mouse application process, the detection of leaving the desktop needs to be added on the basis of the original image detection. When the mouse is lifted, the using environment of the mouse is detected in real time, when the duty ratio of the pulse width modulation signal is increased to be larger than a preset duty ratio threshold value and larger than the corresponding duty ratio of the pulse width modulation signal before setting, and the pixel mean value at the current moment meets a first preset condition, the calculation of the displacement is stopped, and the phenomenon that a cursor shakes when the mouse returns to a desktop due to displacement deviation generated in the process that the mouse leaves the desktop is avoided.
Example 4
One embodiment of the present application proposes a method for determining that a mouse returns to a working plane, which further includes steps S480, S490, and S491 after step S470, as shown in fig. 4.
S480: and judging whether the pixel mean value at the current moment is greater than the maximum mean value threshold value or not and whether the absolute value of the difference between the pixel mean value at the current moment and the pixel mean value at the previous moment is greater than the maximum absolute value threshold value or not.
If the current-time pixel mean value is greater than the maximum mean value threshold and the absolute value of the difference between the current-time pixel mean value and the previous-time pixel mean value is greater than the maximum absolute value threshold, step S490 is performed.
S490: and monitoring whether the time that the pixel mean value at the current moment is greater than the maximum mean value threshold value and the absolute value of the difference between the pixel mean value at the current moment and the pixel mean value at the previous moment is greater than or equal to a preset second time threshold value or not.
If the time is greater than or equal to the preset second time threshold, step S491 is executed.
S491: determining that the mouse returns to the work plane.
It can be understood that, in the process that the mouse leaves the working plane, the brightness of the collected image frame of the working plane at the bottom of the mouse is continuously reduced, the duty ratio of the pulse width modulation signal for controlling the illumination intensity of the LED lamp at the bottom of the mouse is gradually increased, and the illumination intensity of the LED lamp is gradually increased; at this time, if the mouse returns to the working plane, because the illumination intensity of the LED lamp is large, the brightness of the collected image frames is too high, and then the pixel mean value at the current time is greater than the preset maximum mean value threshold, and the brightness difference of the collected adjacent image frames is large, and further the absolute value of the difference between the pixel mean value at the current time and the pixel mean value at the previous time is greater than the preset maximum absolute value threshold, therefore, if the pixel mean value at the current time is greater than the maximum mean value threshold and the absolute value of the difference between the pixel mean value at the current time and the pixel mean value at the previous time is greater than the maximum absolute value threshold, it can be determined that the mouse may return to the working plane.
Further, whether the time that the pixel mean value at the current moment is greater than the maximum mean value threshold value and the absolute value of the difference between the pixel mean value at the current moment and the pixel mean value at the previous moment is greater than or equal to a preset second time threshold value or not is monitored, whether the mouse really returns to the working plane or is suddenly shielded by an obstacle when the mouse leaves the working plane is determined, and misjudgment is avoided.
Further, when it is determined that the mouse returns to the desktop, the method further includes: determining a duty ratio corresponding to a current pixel mean value and an absolute value (an absolute value of a difference between the current pixel mean value and a previous pixel mean value) from a preset comparison relation table; and setting the duty ratio of a pulse width modulation signal for controlling the LED lamp at the bottom of the mouse as the duty ratio determined by utilizing a preset comparison relation table.
Because there may be a difference between when the mouse returns to the working plane and when the mouse leaves the working plane, according to the working principle of the mouse, the dimming judgment needs to be restarted when the mouse returns to the working plane, the displacement amount will not be calculated during the dimming, and if the illumination intensity of the LED lamp is slowly adjusted when the mouse returns to the working plane, the cursor will be sluggish to move. Therefore, the duty ratio corresponding to the pixel mean value and the absolute value at the current moment (the absolute value of the difference between the pixel mean value at the current moment and the pixel mean value at the previous moment) is determined from the preset comparison relation table, the duty ratio of the most suitable pulse width modulation signal corresponding to the current situation can be rapidly determined, the adjusting speed of the illumination intensity of the LED lamp at the bottom of the mouse is accelerated, the sensitivity of the mouse is further improved, and the generation of the hysteresis phenomenon and the karton phenomenon is effectively avoided.
Example 5
One embodiment of the present application, as shown in fig. 5, proposes a mouse control device 10 comprising: an acquisition module 11, a calculation module 12 and a control module 13.
The acquisition module 11 is used for acquiring image frames of a working plane at the bottom of the mouse in real time; a calculating module 12, configured to calculate a pixel mean value corresponding to each temporal image frame; calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment; and the control module 13 is configured to set a duty ratio of a pulse width modulation signal according to the pixel mean value at the previous time, the pixel mean value at the current time, and the absolute value, where the duty ratio of the pulse width modulation signal is used to control the illumination intensity of an LED lamp at the bottom of the mouse.
Further, the setting the duty ratio of the pwm signal according to the last-time pixel average value, the current-time pixel average value, and the absolute value includes: determining whether the current-time pixel mean value and the absolute value meet a first preset condition, wherein the first preset condition is that the current-time pixel mean value is smaller than a preset minimum mean value threshold value and the absolute value is smaller than a preset minimum absolute value threshold value; determining whether the current-time pixel mean value and the absolute value meet a second preset condition, wherein the second preset condition is that the current-time pixel mean value is greater than or equal to a preset maximum mean value threshold value or the absolute value is greater than or equal to a preset maximum absolute value threshold value; if the pixel mean value and the absolute value at the current moment meet a first preset condition or a second preset condition, monitoring whether the time meeting the first preset condition is greater than or equal to a preset first time threshold or whether the time meeting the second preset condition is greater than or equal to the first time threshold; and if the time meeting a first preset condition is greater than or equal to the first time threshold or the time meeting a second preset condition is greater than or equal to the first time threshold, setting the duty ratio of the pulse width modulation signal according to the proportional relation between the pixel average value at the last moment and the pixel average value at the current moment.
Further, the setting the duty ratio of the pwm signal according to the proportional relationship between the previous-time pixel average value and the current-time pixel average value includes: if the ratio of the current-time pixel mean value to the last-time pixel mean value is less than or equal to 2 -n And is greater than 2 -(n+1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time n Multiple, n is an integer and n is more than or equal to 1; if the ratio of the current-time pixel mean value to the last-time pixel mean value is more than or equal to 2 m And less than 2 (m+1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time -(m+1) Multiple, m is an integer and is more than or equal to 0; if the ratio of the current-time pixel mean value to the last-time pixel mean value is larger than 1/2 and smallAnd at 1, keeping the duty ratio of the pulse width modulation signal corresponding to the current moment to be the same as the duty ratio of the pulse width modulation signal corresponding to the previous moment.
Further, before the duty ratio of the pulse width modulation signal is set according to the proportional relationship between the last-time pixel average value and the current-time pixel average value, recording the corresponding duty ratio of the pulse width modulation signal before the setting, and further including: and if the duty ratio of the pulse width modulation signal for controlling the LED lamp at the bottom of the mouse is increased to be larger than a preset duty ratio threshold value and larger than the corresponding duty ratio of the pulse width modulation signal before setting, and the absolute values of the pixel mean value at the current moment and the difference between the pixel mean value at the last moment and the pixel mean value at the current moment meet the first preset condition, determining that the mouse leaves the working plane.
Further, after determining that the mouse leaves the desktop or the mouse enters a dark environment, the method further includes: if the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than the maximum absolute value threshold value, monitoring whether the time that the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than or equal to a preset second time threshold value or not; and if the time is larger than or equal to a preset second time threshold, determining that the mouse returns to the working plane.
Further, when it is determined that the mouse returns to the desktop, the method further includes: determining the duty ratio corresponding to the pixel mean value and the absolute value at the current moment from a preset comparison relation table; and setting the duty ratio of a pulse width modulation signal for controlling the LED lamp at the bottom of the mouse as the duty ratio determined by utilizing a preset comparison relation table.
Further, the setting the duty ratio of the pwm signal according to the last-time pixel average value, the current-time pixel average value, and the absolute value includes: if the pixel mean value at the current moment is greater than or equal to a preset minimum mean value threshold and less than a preset maximum mean value threshold, and the absolute value is greater than or equal to a preset minimum absolute value threshold and less than a preset maximum absolute value threshold, keeping the duty ratio of the pulse width modulation signal corresponding to the current moment the same as the duty ratio of the pulse width modulation signal corresponding to the previous moment, and calculating the moving distance of the mouse according to the image frame at the previous moment and the image frame at the current moment.
The embodiment discloses a mouse control device 10, which is used for executing the mouse control method according to the above embodiment through the cooperation of an acquisition module 11, a calculation module 12 and a control module 13, and the implementation and beneficial effects related to the above embodiment are also applicable to this embodiment, and are not described herein again.
Further, as shown in fig. 6, the present application discloses a mouse 100, which includes an LED lamp 110, an optical lens 120, a photosensor 130, a memory 140 and a processor 150, where the LED lamp 110 is configured to emit light according to a received pulse width modulation signal to illuminate a bottom working plane of the mouse 100 and enable the mouse 100 to receive light reflected by the bottom working plane, after the optical lens 120 receives light reflected by the bottom working plane of the mouse 100, the reflected light is transmitted to the photosensor 130 to enable the processor 150 to collect image frames of the bottom working plane of the mouse 100 in real time, and the memory 140 stores a computer program, and when the computer program runs on the processor 150, the computer program executes the mouse control method described in the present application.
The application also discloses a readable storage medium, which stores a computer program, and the computer program executes the mouse control method when running on a processor.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented in other ways. The apparatus embodiments described above are merely illustrative and, for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, each functional module or unit in each embodiment of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a readable storage medium. Based on such understanding, the technical solution of the present invention or a part of the technical solution that contributes to the prior art in essence can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned readable storage medium comprises: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above description is only for the specific embodiments of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of the changes or substitutions within the technical scope of the present invention, and shall cover the scope of the present invention.

Claims (9)

1. A method for controlling a mouse, the method comprising:
acquiring image frames of a working plane at the bottom of the mouse in real time;
calculating the pixel mean value corresponding to each moment image frame;
calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment;
setting the duty ratio of a pulse width modulation signal according to the pixel average value at the last moment, the pixel average value at the current moment and the absolute value, wherein the duty ratio of the pulse width modulation signal is used for controlling the illumination intensity of an LED lamp at the bottom of the mouse;
the setting of the duty ratio of the pulse width modulation signal according to the last-time pixel mean value, the current-time pixel mean value and the absolute value includes:
determining whether the current-time pixel mean value and the absolute value meet a first preset condition, wherein the first preset condition is that the current-time pixel mean value is smaller than a preset minimum mean value threshold value and the absolute value is smaller than a preset minimum absolute value threshold value;
determining whether the current-time pixel mean value and the absolute value meet a second preset condition, wherein the second preset condition is that the current-time pixel mean value is greater than or equal to a preset maximum mean value threshold value or the absolute value is greater than or equal to a preset maximum absolute value threshold value;
if the pixel mean value and the absolute value at the current moment meet a first preset condition or a second preset condition, monitoring whether the time meeting the first preset condition is greater than or equal to a preset first time threshold or whether the time meeting the second preset condition is greater than or equal to the first time threshold;
if the time meeting a first preset condition is greater than or equal to the first time threshold or the time meeting a second preset condition is greater than or equal to the first time threshold, setting the duty ratio of the pulse width modulation signal according to the proportional relation between the pixel average value at the last moment and the pixel average value at the current moment;
the setting the duty ratio of the pulse width modulation signal according to the proportional relationship between the last-time pixel average value and the current-time pixel average value includes:
if the ratio of the current-time pixel mean value to the last-time pixel mean value is less than or equal to 2 -n And is greater than 2 -(n+1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time n Multiple, n is an integer and n is more than or equal to 1.
2. The method of claim 1, wherein the setting the duty ratio of the pwm signal according to the proportional relationship between the last-time pixel average value and the current-time pixel average value further comprises:
if the ratio of the current-time pixel mean value to the last-time pixel mean value is more than or equal to 2 m And less than 2 (m +1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time -(m+1) Multiple, m is an integer and is more than or equal to 0;
and if the ratio of the current-time pixel mean value to the last-time pixel mean value is greater than 1/2 and less than 1, keeping the duty ratio of the pulse width modulation signal corresponding to the current time to be the same as the duty ratio of the pulse width modulation signal corresponding to the last time.
3. The mouse control method according to claim 2, wherein before the duty ratio of the pwm signal is set according to the proportional relationship between the average value of the pixels at the previous time and the average value of the pixels at the current time, the duty ratio of the pwm signal before the setting is recorded, further comprising:
and if the duty ratio of the pulse width modulation signal for controlling the LED lamp at the bottom of the mouse is increased to be larger than a preset duty ratio threshold value and larger than the corresponding duty ratio before setting, and the absolute values of the current pixel mean value and the difference between the previous pixel mean value and the current pixel mean value meet the first preset condition, determining that the mouse leaves the working plane.
4. The mouse control method of claim 3, further comprising, after determining that the mouse leaves the desktop:
if the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than the maximum absolute value threshold value, monitoring whether the time that the current-time pixel mean value is larger than the maximum mean value threshold value and the absolute value of the difference between the current-time pixel mean value and the last-time pixel mean value is larger than or equal to a preset second time threshold value or not;
and if the time is larger than or equal to a preset second time threshold, determining that the mouse returns to the working plane.
5. The mouse control method according to claim 4, further comprising, when it is determined that the mouse returns to the desktop:
determining the duty ratio corresponding to the pixel mean value and the absolute value at the current moment from a preset comparison relation table;
and setting the duty ratio of a pulse width modulation signal for controlling the LED lamp at the bottom of the mouse as the duty ratio determined by utilizing a preset comparison relation table.
6. The mouse control method according to any one of claims 1 to 5, wherein the setting the duty ratio of the PWM signal according to the last-time pixel average value, the current-time pixel average value, and the absolute value includes:
if the pixel mean value at the current moment is greater than or equal to a preset minimum mean value threshold and less than a preset maximum mean value threshold, and the absolute value is greater than or equal to a preset minimum absolute value threshold and less than a preset maximum absolute value threshold, keeping the duty ratio of the pulse width modulation signal corresponding to the current moment the same as the duty ratio of the pulse width modulation signal corresponding to the previous moment, and calculating the moving distance of the mouse according to the image frame at the previous moment and the image frame at the current moment.
7. A mouse control apparatus, characterized in that the apparatus comprises:
the acquisition module is used for acquiring image frames of a working plane at the bottom of the mouse in real time;
the computing module is used for computing the pixel mean value corresponding to each moment image frame; calculating the absolute value of the difference between the pixel mean value at the previous moment and the pixel mean value at the current moment;
the control module is used for setting the duty ratio of a pulse width modulation signal according to the pixel mean value at the last moment, the pixel mean value at the current moment and the absolute value, and the duty ratio of the pulse width modulation signal is used for controlling the illumination intensity of an LED lamp at the bottom of the mouse;
the setting of the duty ratio of the pulse width modulation signal according to the last-time pixel mean value, the current-time pixel mean value and the absolute value includes:
determining whether the current-time pixel mean value and the absolute value meet a first preset condition, wherein the first preset condition is that the current-time pixel mean value is smaller than a preset minimum mean value threshold value and the absolute value is smaller than a preset minimum absolute value threshold value;
determining whether the current-time pixel mean value and the absolute value meet a second preset condition, wherein the second preset condition is that the current-time pixel mean value is greater than or equal to a preset maximum mean value threshold value or the absolute value is greater than or equal to a preset maximum absolute value threshold value;
if the pixel mean value and the absolute value at the current moment meet a first preset condition or a second preset condition, monitoring whether the time meeting the first preset condition is greater than or equal to a preset first time threshold or whether the time meeting the second preset condition is greater than or equal to the first time threshold;
if the time meeting a first preset condition is greater than or equal to the first time threshold or the time meeting a second preset condition is greater than or equal to the first time threshold, setting the duty ratio of the pulse width modulation signal according to the proportional relation between the pixel average value at the last moment and the pixel average value at the current moment;
the setting the duty ratio of the pulse width modulation signal according to the proportional relationship between the last-time pixel average value and the current-time pixel average value includes:
if the ratio of the current-time pixel mean value to the last-time pixel mean value is less than or equal to 2 -n And is greater than 2 -(n+1) Setting the duty ratio of the pwm signal corresponding to the current time to 2 of the duty ratio of the pwm signal corresponding to the previous time n Multiple, n is an integer and n is more than or equal to 1.
8. A mouse, comprising an LED lamp, an optical lens, a photosensor, a memory and a processor, wherein the LED lamp is configured to emit light according to a received pwm signal to illuminate a bottom working plane of the mouse and enable the mouse to receive light reflected by the bottom working plane, the optical lens is configured to transmit the reflected light to the photosensor after receiving the light reflected by the bottom working plane of the mouse, so as to enable the processor to collect image frames of the bottom working plane of the mouse in real time, and the memory stores a computer program, which executes the mouse control method according to any one of claims 1 to 6 when the computer program runs on the processor.
9. A readable storage medium, characterized in that it stores a computer program which, when run on a processor, performs the mouse control method of any one of claims 1 to 6.
CN202110590683.0A 2021-05-28 2021-05-28 Mouse control method and device, mouse and readable storage medium Active CN113253857B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110590683.0A CN113253857B (en) 2021-05-28 2021-05-28 Mouse control method and device, mouse and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110590683.0A CN113253857B (en) 2021-05-28 2021-05-28 Mouse control method and device, mouse and readable storage medium

Publications (2)

Publication Number Publication Date
CN113253857A CN113253857A (en) 2021-08-13
CN113253857B true CN113253857B (en) 2023-02-10

Family

ID=77185091

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110590683.0A Active CN113253857B (en) 2021-05-28 2021-05-28 Mouse control method and device, mouse and readable storage medium

Country Status (1)

Country Link
CN (1) CN113253857B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115361506B (en) * 2022-08-17 2024-05-24 中科微机电技术(北京)有限公司 Control method of active pixel sensor, active pixel sensor and electronic equipment

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933799A (en) * 2019-12-25 2020-03-27 浙江杜比医疗科技有限公司 Dynamic self-adaptive linear prediction control method, system and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP6790752B2 (en) * 2015-11-20 2020-11-25 株式会社リコー Image reader, image forming device and image reading method
CN109936698B (en) * 2017-12-18 2021-07-02 杭州海康威视数字技术股份有限公司 Automatic exposure control method and device, electronic equipment and storage medium
CN108197546B (en) * 2017-12-26 2020-12-11 深圳市友信长丰科技有限公司 Illumination processing method and device in face recognition, computer equipment and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933799A (en) * 2019-12-25 2020-03-27 浙江杜比医疗科技有限公司 Dynamic self-adaptive linear prediction control method, system and device

Also Published As

Publication number Publication date
CN113253857A (en) 2021-08-13

Similar Documents

Publication Publication Date Title
US8188986B2 (en) User input device with dynamic ambient light calibration
CN110351490B (en) Exposure method, exposure device and image pickup equipment
US8502913B2 (en) Video processing apparatus and video processing method
US20230385574A1 (en) System and method for illuminating a target of a barcode reader
US8107806B2 (en) Focus adjustment apparatus and focus adjustment method
EP2549738A1 (en) Method and camera for determining an image adjustment parameter
WO2019200998A1 (en) Automatic focusing method and device
CN113253857B (en) Mouse control method and device, mouse and readable storage medium
JP5791285B2 (en) Imaging apparatus, focus adjustment method, program
JP2001221633A (en) Distance-measuring apparatus
US10063779B2 (en) Image processing apparatus, image capturing apparatus, image processing method, and storage medium
US11240439B2 (en) Electronic apparatus and image capture apparatus capable of detecting halation, method of controlling electronic apparatus, method of controlling image capture apparatus, and storage medium
CN111405207A (en) Reconstructed image smear elimination algorithm applied to high-speed pulse sensor
CN105988599B (en) Navigation device capable of adjusting sampling period
US8537109B2 (en) System and method for automatically adjusting light source drive current during optical navigation operation
KR20220058957A (en) Reduce the flicker effect of multiple light sources in an image
US10694110B2 (en) Image processing device, method
US9800792B2 (en) Image pickup apparatus capable of determining light amount change characteristic, method of determining light amount change characteristic, and storage medium
CN105407269A (en) Photographing APPARATUS and CONTROL METHOD thereof
US11823428B2 (en) Image processing apparatus and control method therefor, image capturing apparatus, and storage medium
US20190238757A1 (en) Image capture apparatus and focusing adjustment method for same
US11838647B2 (en) Image capture apparatus capable of suppressing flicker reduction when detecting flicker during live view display, and method of controlling same
US11429204B1 (en) Lighting control method of optical pointing device
US11882353B2 (en) Information processing apparatus for controlling parameter to detect object, information processing method, and storage medium
US20240073522A1 (en) Image capturing apparatus, control method thereof, and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant