CN112995461A - Method for acquiring image through optical accessory and terminal equipment - Google Patents

Method for acquiring image through optical accessory and terminal equipment Download PDF

Info

Publication number
CN112995461A
CN112995461A CN202110156840.7A CN202110156840A CN112995461A CN 112995461 A CN112995461 A CN 112995461A CN 202110156840 A CN202110156840 A CN 202110156840A CN 112995461 A CN112995461 A CN 112995461A
Authority
CN
China
Prior art keywords
camera
optical accessory
terminal device
distance
optical
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.)
Pending
Application number
CN202110156840.7A
Other languages
Chinese (zh)
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.)
Guangdong Genius Technology Co Ltd
Original Assignee
Guangdong Genius 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 Guangdong Genius Technology Co Ltd filed Critical Guangdong Genius Technology Co Ltd
Priority to CN202110156840.7A priority Critical patent/CN112995461A/en
Publication of CN112995461A publication Critical patent/CN112995461A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/50Constructional details
    • H04N23/55Optical parts specially adapted for electronic image sensors; Mounting thereof
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/70Circuitry for compensating brightness variation in the scene

Abstract

The embodiment of the invention discloses a method for acquiring images through optical accessories and terminal equipment, which are applied to the technical field of terminal equipment and can solve the problems that in the prior art, the terminal equipment needs to be configured with special devices to acquire data in devices such as a microscope or a microphone, the implementation complexity is high, and the cost is high. The method comprises the following steps that a camera is arranged on a first surface of the terminal equipment, an optical accessory is arranged on the outer side of the camera on the first surface, and therefore the camera collects an imaging picture of the optical accessory, and the method comprises the following steps: detecting a first distance between the optical accessory and the camera; if the first distance is smaller than the first preset distance, starting a target application program corresponding to the optical accessory on the terminal equipment; and acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of a target application program.

Description

Method for acquiring image through optical accessory and terminal equipment
Technical Field
The embodiment of the invention relates to the technical field of terminal equipment, in particular to a method for acquiring images through optical accessories and the terminal equipment.
Background
At present, devices such as a microscope or a microphone can acquire image data or audio data, when terminal equipment acquires data in the devices such as the microscope or the microphone, functional modules (such as bluetooth) which can be used for data transmission need to be arranged in the devices to transmit the image data or the audio data acquired in the devices to the terminal equipment, but when the terminal equipment acquires the image data or the audio data in the devices such as the microscope or the microphone, the functional modules which can be used for data transmission need to be arranged in the devices, so that the cost of the devices is high, the terminal equipment acquires the data in the devices such as the microscope or the microphone, special devices need to be configured, the implementation complexity is high, and the cost is high.
Disclosure of Invention
The embodiment of the invention provides a method for acquiring an image through an optical accessory and a terminal device, which are used for solving the problems that in the prior art, the terminal device needs to be configured with a special device to acquire data in devices such as a microscope or a microphone, the implementation complexity is high, and the cost is high. In order to solve the above technical problem, the embodiment of the present invention is implemented as follows:
in a first aspect, a method for capturing an image through an optical accessory is provided, where a first surface of a terminal device is provided with a camera, and an optical accessory is disposed outside the camera on the first surface, so that the camera captures an imaging picture of the optical accessory, and the method includes: detecting a first distance between an optical accessory and the camera;
if the first distance is smaller than a first preset distance, starting a target application program corresponding to the optical accessory on the terminal equipment;
and acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of the target application program.
As an optional implementation manner, in the first aspect of the embodiments of the present invention, if an infrared distance sensor is disposed in the camera, the detecting a distance between the optical accessory and the camera includes:
controlling the distance sensor to emit a first light pulse signal and receive a second light pulse signal obtained by reflecting the first light pulse signal;
detecting the interval duration between the first optical pulse signal and the second optical pulse signal;
and determining the distance between the optical accessory and the camera according to the interval duration.
As an alternative implementation manner, in the first aspect of the embodiment of the present invention, if a hall sensor is disposed in the camera, and a magnet is disposed in the optical accessory, the detecting a distance between the optical accessory and the camera includes:
acquiring the magnetic field intensity between the optical accessory and the camera through the Hall sensor;
determining a distance between the optical accessory and the camera according to the magnetic field strength.
As an optional implementation manner, in the first aspect of the embodiment of the present invention, if a flash is disposed on the terminal device, after acquiring the target image acquired through the optical accessory and displaying the target image in an interface of the target application program, the method further includes:
detecting an average brightness value of the target image;
and if the average brightness value is smaller than the standard brightness value, starting the flash lamp, wherein the flash lamp and the camera are arranged on the same side of the terminal equipment.
As an optional implementation manner, in the first aspect of the embodiment of the present invention, after the turning on the flash, the method further includes:
detecting parameter information of the terminal equipment;
if the parameter information of the terminal equipment meets a preset condition, turning off the flash lamp;
wherein the parameter information of the terminal device includes: at least one of orientation of the flash, a duration of activation of the flash, and a second distance between the optical accessory and an object in the shooting environment.
As an optional implementation manner, in the first aspect of the embodiment of the present invention, if the parameter information of the terminal device satisfies a preset condition, the turning off the flash includes:
if the included angle between the orientation of the flash lamp and the gravity direction is larger than a preset included angle, the flash lamp is turned off;
and/or the presence of a gas in the gas,
if the starting time of the flash lamp is longer than the preset time, the flash lamp is turned off;
and/or the presence of a gas in the gas,
and if the second distance is greater than a second preset distance, turning off the flash lamp.
As an optional implementation manner, in the first aspect of the embodiment of the present invention, after the turning on the flash, the method further includes:
acquiring a first image through the camera;
turning off the flash when the presence of a facial feature in the first image is detected.
In a second aspect, a terminal device is provided, in which a first surface of the terminal device is provided with a camera, and an optical accessory is provided outside the camera on the first surface, so that the camera captures an imaging picture through the optical accessory, and the terminal device includes: the processing module is used for detecting a first distance between the optical accessory and the camera;
the control module is used for starting a target application program corresponding to the optical accessory on the terminal equipment if the first distance is smaller than a first preset distance;
the processing module is further configured to acquire an imaging picture of the optical accessory through the camera to obtain a target image, and display the target image in an interface of the target application program.
In a third aspect, a terminal device is provided, including:
a memory storing executable program code;
a processor coupled with the memory;
the processor calls the executable program code stored in the memory to execute the method for acquiring an image through an optical accessory in the first aspect of the embodiment of the present invention.
In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program for causing a computer to execute the method for capturing an image through an optical accessory according to the first aspect of the embodiment of the present invention. The computer readable storage medium includes a ROM/RAM, a magnetic or optical disk, or the like.
In a fifth aspect, there is provided a computer program product for causing a computer to perform some or all of the steps of any one of the methods of the first aspect when the computer program product is run on the computer.
A sixth aspect provides an application publishing platform for publishing a computer program product, wherein the computer program product, when run on a computer, causes the computer to perform some or all of the steps of any one of the methods of the first aspect.
Compared with the prior art, the embodiment of the invention has the following beneficial effects:
in the embodiment of the invention, a camera is arranged on the first surface of the terminal equipment, an optical accessory is arranged on the outer side of the camera on the first surface, so that the camera collects an imaging picture passing through the optical accessory, and the terminal equipment can detect the first distance between the optical accessory and the camera; if the first distance is smaller than the first preset distance, starting a target application program corresponding to the optical accessory on the terminal equipment; and acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of a target application program. Through the technical scheme, when the terminal equipment detects that the distance between the optical accessory and the camera is smaller than the preset distance, the terminal equipment can automatically start the application program corresponding to the optical accessory without touch operation of a user, so that the operation times of the user can be reduced, and a module for data transmission does not need to be configured in the optical accessory and the terminal equipment, so that the cost of the optical accessory and the terminal equipment is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a first schematic flowchart of a method for acquiring an image through an optical accessory according to an embodiment of the present invention;
fig. 2 is a first schematic structural diagram of a terminal device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
FIG. 4 is a first view of a first scene of a method for capturing an image through an optical accessory according to an embodiment of the present invention;
FIG. 5 is a second schematic view of a scene of a method for capturing an image through an optical accessory according to an embodiment of the present invention;
FIG. 6 is a second schematic flowchart of a method for capturing an image through an optical accessory according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram three of a terminal device according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a terminal device according to a fourth embodiment of the present invention;
fig. 9 is a schematic diagram of a hardware structure of a terminal device according to an embodiment of the present invention.
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 some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The terms "first" and "second," and the like, in the description and in the claims of the present invention are used for distinguishing between different objects and not for describing a particular order of the objects. For example, the first preset distance, the second preset distance, and the like are used to distinguish different preset distances, and are not used to describe a specific order of the preset distances.
The terms "comprises," "comprising," and any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that, in the embodiments of the present invention, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "e.g.," an embodiment of the present invention is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the related art, devices such as a microscope or a microphone and the like can acquire image data or audio data, when terminal equipment acquires data in the devices such as the microscope or the microphone and the like, functional modules (such as bluetooth) which can be used for data transmission need to be arranged in the devices to transmit the image data or the audio data acquired in the devices to the terminal equipment, but when the terminal equipment acquires the image data or the audio data in the devices such as the microscope or the microphone and the like, the functional modules which can be used for data transmission need to be arranged in the devices, so that the cost of the devices is high, the terminal equipment acquires the data in the devices such as the microscope or the microphone and the like, special devices need to be configured, the implementation complexity is high, and the cost is high.
In order to solve the above problem, embodiments of the present invention provide a method and a terminal device for acquiring an image through an optical accessory, where when it is detected that a distance between the optical accessory and a camera is smaller than a preset distance, the terminal device can automatically start an application program corresponding to the optical accessory without performing a touch operation by a user, so that the number of operations by the user can be reduced, and a module for data transmission does not need to be configured in the optical accessory and the terminal device, thereby reducing the costs of the optical accessory and the terminal device; in addition, data transmission is carried out between the optical accessory and the terminal equipment in a communication connection mode, so that data can be prevented from being lost or stolen under the condition of unstable signals, and the data transmission efficiency is prevented from being slow under the condition of unstable signals.
The terminal device according to the embodiment of the present invention may be an electronic device such as a Mobile phone, a tablet Computer, a notebook Computer, a palmtop Computer, a vehicle-mounted terminal device, a wearable device, an Ultra-Mobile Personal Computer (UMPC), a netbook, or a Personal Digital Assistant (PDA). The wearable device may be a smart watch, a smart bracelet, a watch phone, a smart foot ring, a smart earring, a smart necklace, a smart headset, or the like, and the embodiment of the present invention is not limited.
The execution main body of the method for acquiring an image through an optical accessory provided by the embodiment of the present invention may be the terminal device, or may also be a functional module and/or a functional entity capable of implementing the method for acquiring an image through an optical accessory in the terminal device, which may be specifically determined according to actual use requirements, and the embodiment of the present invention is not limited. The following describes an exemplary method for capturing an image through an optical accessory according to an embodiment of the present invention, taking a terminal device as an example.
The method for acquiring the image through the optical accessory provided by the embodiment of the invention can be applied to scenes in which a user needs to use the optical accessory to work.
Example one
As shown in fig. 1, an embodiment of the present invention provides a method for acquiring an image through an optical accessory, which may include the steps of:
101. a first distance between the optical accessory and the camera is detected.
In an embodiment of the present invention, the terminal device may detect a first distance between the optical accessory and the camera.
As shown in fig. 2, a schematic structural diagram of the terminal device before the optical accessory is connected, and as shown in fig. 3, a schematic structural diagram of the terminal device after the optical accessory is connected, a camera 22 and a flash 23 are disposed on a first surface 21 of the terminal device, and an optical accessory 24 is disposed on the first surface 21 outside the camera 22, so that the camera 22 can capture an image of the optical accessory 24. The first surface 21 is another surface of the terminal device where the display screen is located, that is, if the surface where the display screen is located is the front surface of the terminal device, the first surface 21 is the back surface.
It should be noted that the optical accessory is used for assisting the terminal device to perform operations, such as: the optical accessory can be a microscope, a magnifier, an external long lens and the like, and the embodiment of the invention is not limited.
It should be noted that the optical accessory is physically connected to the camera on the terminal device, such as: the optical accessory and the camera can be connected through the magnet, the magnet is arranged in the optical accessory and the camera respectively, and when the optical accessory is close to the camera, the magnets in the optical accessory and the camera attract each other to realize the connection of the optical accessory and the camera; the optical accessory can be connected with the camera through a buckle, the base is arranged on the outer side of the camera, the buckle is arranged on the outer side of the optical accessory, and when the optical accessory is close to the camera, the buckle on the optical accessory can be buckled with the base on the camera, so that the optical accessory is connected with the camera.
Optionally, detecting the first distance between the optical accessory and the camera may include the following two optional implementations:
the implementation mode is as follows: if the camera is provided with the infrared distance sensor, the terminal equipment can control the infrared distance sensor to emit a first light pulse signal and receive a second light pulse signal obtained by reflecting the first light pulse signal; detecting the interval duration between the first optical pulse signal and the second optical pulse signal; and determining the distance between the optical accessory and the camera according to the interval duration and the speed of light.
It should be noted that the infrared distance sensor is one of the distance sensors, and is mostly applied to a terminal device. The infrared distance sensor detects the distance between obstacles by using the principle that infrared signals meet the obstacles at different distances and the reflection time is different. The infrared distance measuring sensor is provided with a pair of infrared signal transmitting and receiving diodes, the transmitting tube transmits an infrared signal with specific frequency, the receiving tube receives the infrared signal with the frequency, and when the detection direction of the infrared signal meets an obstacle, the infrared signal is reflected back to be received by the receiving tube.
Since infrared rays have a small refractive index when passing through other substances, they are not substantially diffused when they travel. When the infrared distance sensor is used for distance measurement, the distance can be calculated according to the time from sending to receiving of an infrared signal and the transmission speed of infrared rays, namely the round-trip transit time delta t of the infrared rays modulated by high frequency on the distance to be measured is utilized, and according to the transmission speed V of the infrared rays, a formula is combined
Figure BDA0002933509620000081
The distance D can be obtained.
Illustratively, when the optical accessory is close to the camera, a bundle of infrared ray can be launched to infrared distance sensor's in the camera transmitting tube, and this infrared ray is the rectilinear propagation in the air, when infrared ray touches optical accessory, will reflect, is received by infrared distance sensor's in the camera receiving tube. Assuming that the infrared distance sensor takes 0.32ns from the emission of infrared rays to the reception of reflected infrared rays, the propagation speed of the infrared rays in the air is 3 x 108m/s, then substituting into the formula, can obtain
Figure BDA0002933509620000082
That is, it can be said that the distance between the camera and the optical accessory is 4.8 cm.
The implementation mode two is as follows: if the camera is provided with the Hall sensor and the optical accessory is provided with the magnet, the terminal equipment can acquire the magnetic field intensity between the optical accessory and the camera through the Hall sensor; and determining the distance between the optical accessory and the camera according to the magnetic field intensity.
It should be noted that the hall sensor uses the hall effect as the working principle, and is an integrated sensor composed of a hall element and an auxiliary circuit, and is used for detecting the magnitude of the magnetic field and the change of the magnetic field. The Hall semiconductor chip in the Hall sensor and the magnet generate a magnetic field, and under the action of the magnetic field, the constant current can be deviated when passing through the Hall semiconductor chip, so that Hall voltage is generated. The Hall voltage changes along with the change of the magnetic field intensity, and the stronger the magnetic field, the higher the voltage; the weaker the magnetic field, the lower the voltage.
For example, a magnetic field is generated between a hall sensor in the camera and a magnet in the optical accessory, so that the hall sensor in the camera can detect the magnetic field strength H and the current I between the hall sensor and the magnet through the hall effect, and then calculate the formula according to the magnetic field strength
Figure BDA0002933509620000083
The distance D between the optical accessory and the camera can be obtained through calculation, wherein K is a magnetic coefficient, is related to the magnet and is a fixed value.
102. And starting a target application program corresponding to the optical accessory on the terminal equipment.
In the embodiment of the present invention, if the first distance between the optical accessory and the camera is smaller than the first preset distance, the target application program corresponding to the optical accessory on the terminal device is started.
The first preset distance can be set in advance by the terminal device, and when the first distance is smaller than the first preset distance, it can be shown that the connection between the optical accessory and the camera is completed, and then the terminal device can start a target application program corresponding to the optical accessory on the terminal device.
The target application corresponds to the optical accessory. If the optical accessory is a microscope, then the target application may be a camera or microscope specific application; if the optical accessory is a magnifier, the target application may be a camera or magnifier-specific application; if the optical accessory is an external telephoto lens, the target application may be a camera.
Optionally, if a plurality of target applications corresponding to the optical accessory are provided on the terminal device, the terminal device may display application icons of the plurality of applications on the display screen, and output a prompt message for prompting the user to select a target application required by the user from the application icons of the plurality of applications, and the terminal device may respond to a touch operation of the user, determine an application corresponding to the application icon selected by the user as the target application, and start the target application.
For example, as shown in fig. 4, a sub-interface 41 is displayed in a display screen of the terminal device, and application icons 42 of a plurality of applications corresponding to the optical component are arranged and displayed in the sub-interface 41.
Optionally, the terminal device may also display application icons of the plurality of application programs in a floating manner on a display screen of the terminal device.
For example, assuming that the optical accessory is a microscope, the application corresponding to the microscope may include a system application (e.g., a camera application), and/or at least one third party application that may access a camera of the terminal device to acquire images. The terminal device may display the camera application and the at least one third party application on a display screen of the terminal device. Further, the terminal device may further display a prompt message "please select a desired application" to prompt the user to select, so that when the user clicks an application icon of a certain application, the terminal device may determine the certain application as a target application and start the certain application.
Further, when the terminal device displays application icons of a plurality of applications corresponding to the optical accessory, a search bar may be further provided so that the user can search for a target application in the search bar when the number of applications corresponding to the optical accessory is large.
For example, as shown in fig. 4, the terminal device may set a search bar 43, and the user may input an identifier (name, number, etc.) of the target application in the search bar 43 for searching the target application, so that when the number of applications corresponding to the optical accessory is large, the time for the user to search for the target application may be reduced.
Through the optional implementation mode, the terminal equipment can determine the target application program in a mode of outputting the prompt message to prompt the user to select from the plurality of application programs under the condition that the plurality of target application programs corresponding to the optical accessory exist, so that interaction between the terminal equipment and the user can be increased, operation can be performed according to the selection of the user, and the accuracy of the application program is improved.
Optionally, if a plurality of target applications corresponding to the optical accessory are provided on the terminal device, the method may further include: the terminal device acquires a history start record for a target application program, determines an application program which is started the most number of times after the optical accessory is connected as the target application program, and starts the target application program.
For example, assuming that the optical accessory is a microscope, the application corresponding to the microscope may be a camera and a miniature world, the miniature world may be connected to the camera, and the miniature world may display an image of the microscope captured by the camera. The terminal device may acquire a history start record for the camera and the mini-world, wherein the camera is started 4 times and the mini-world is started 15 times after the microscope is connected, and then the terminal device may determine the mini-world as the target application and start the mini-world application.
Through the optional implementation mode, the terminal device can select the application program with the largest starting times by acquiring the historical starting record to determine the target application program under the condition that a plurality of target application programs corresponding to the optical accessory exist, so that the terminal device can select the application program with the largest starting times according to the historical record, and the operation times of a user are reduced.
103. And acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of a target application program.
In the embodiment of the invention, after the optical accessory obtains the imaging picture, the terminal device can acquire the imaging picture of the optical accessory through the camera to obtain the target image, and the target image is displayed in the interface of the target application program.
The embodiment of the invention provides a method for acquiring an image through an optical accessory, wherein a camera is arranged on a first surface of a terminal device, the optical accessory is arranged on the outer side of the camera on the first surface, so that the camera acquires an imaging picture passing through the optical accessory, and the terminal device can detect a first distance between the optical accessory and the camera; if the first distance is smaller than the first preset distance, starting a target application program corresponding to the optical accessory on the terminal equipment; and acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of a target application program. Through the technical scheme, the terminal equipment can automatically start the application program corresponding to the optical accessory without touch operation of a user when detecting that the distance between the optical accessory and the camera is smaller than the preset distance, so that the operation times of the user can be reduced, and a module for data transmission does not need to be configured in the optical accessory and the terminal equipment, so that the cost of the optical accessory and the terminal equipment is reduced; in addition, data transmission is carried out between the optical accessory and the terminal equipment in a communication connection mode, so that data can be prevented from being lost or stolen under the condition of unstable signals, and the data transmission efficiency is prevented from being slow under the condition of unstable signals.
Optionally, acquiring an imaging picture of the optical component to obtain the target image may specifically include: continuously acquiring imaging pictures of a plurality of frames of optical accessories; comparing the imaging pictures of the multi-frame optical accessory to obtain a comparison result; and when the resident abnormal display area exists in the imaging picture of the multi-frame optical assembly according to the comparison result, repairing the resident abnormal display area according to the normal display area of the imaging picture of each frame of optical assembly to obtain the target image.
The resident abnormal display area is the same abnormal display area with the frequency higher than the frequency threshold value in the imaging picture of the multi-frame optical accessory.
It should be noted that, for an abnormal display area caused by dirt/cracks on a camera or an abnormal display area caused by dirt/cracks on a screen area corresponding to a camera under a screen, a difference between pixel values of the abnormal display area and adjacent areas of the abnormal display area is generally relatively large, so that a terminal device may identify an edge of each image area in an imaging picture of an optical accessory through an edge identification algorithm, after determining the edge of the image area, may compare the pixel value of the edge of the image area with a pixel value of an adjacent pixel point outside the edge of the image area, and if the difference between the pixel value of the edge and the pixel value of the adjacent pixel point is greater than a preset threshold, determine that the image area in the edge is the abnormal display area.
Further, after determining that the resident abnormal display area exists in the imaging picture of the multi-frame optical assembly according to the comparison result, the terminal device may further: determining the size of an inscribed circle of the resident abnormal display area and the size of an circumscribed circle of the resident abnormal display area; calculating a first ratio of the size of the inscribed circle to the size of the circumscribed circle; if the first ratio is smaller than the first ratio threshold, determining that the resident abnormal display area is caused by damage of the camera, or caused by damage of a screen area corresponding to the camera; and if the first ratio is larger than or equal to the first ratio threshold, determining that the resident abnormal display area is caused by the dirt of the camera or the dirt of the screen area corresponding to the camera.
It should be noted that, because the resident abnormal display area caused by general dirt is close to a circle, the difference between the sizes of the inscribed circle and the circumscribed circle of the resident abnormal display area is small, the resident display area caused by damage to the camera or the screen area corresponding to the camera is close to a linear shape, and the difference between the sizes of the inscribed circle and the circumscribed circle of the resident abnormal display area is large. The size of the circle involved in the embodiment of the present invention may be the area, radius or diameter of the circle.
In this optional implementation manner, the terminal device may detect whether an abnormal display area exists in an imaging picture of the currently acquired optical accessory, and if so, repair the abnormal display area, so that the terminal device may acquire a normal imaging picture of the optical accessory, and the terminal device may determine a reason for causing the abnormal display according to size information of the abnormal display area, which is more favorable for repairing the terminal device.
Example two
As shown in fig. 5, an embodiment of the present invention provides a method for acquiring an image through an optical accessory, which may further include the steps of:
501. a first distance between the optical accessory and the camera is detected.
502. And starting a target application program corresponding to the optical accessory on the terminal equipment.
503. And acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of a target application program.
In the embodiment of the present invention, for the description of steps 501 to 503, please refer to the detailed description of steps 101 to 103 in the first embodiment, which is not repeated herein.
504. An average luminance value of the target image is detected.
In the embodiment of the present invention, the terminal device may detect an average brightness value of the target image, where the average brightness value may be an average value of brightness values of each pixel in the target image.
505. And turning on the flash lamp.
In the embodiment of the present invention, if the average brightness value of the target image is smaller than the standard brightness value, it may be said that the brightness value of the target image is lower, and then the terminal device may turn on the flash lamp, so that the brightness value of the image acquired by the terminal device is increased.
It should be noted that the flash is used for providing a light source in a dark environment, and in the embodiment of the present invention, as shown in fig. 2 and fig. 3, the flash 23 and the camera 22 are disposed on the first surface 21 of the terminal device, and the flash 23 is avoided when the optical accessory 24 is connected with the camera 22, so that the flash 23 is not covered by the optical accessory 24, so as to achieve the purpose of providing a light source.
Optionally, after the flash is turned on, the method may further include: the terminal equipment acquires a first image through a camera; when the presence of a facial feature in the first image is detected, the flash is turned off.
In this implementation manner, after the terminal device turns on the flash, the camera may be further controlled to capture a current first image, and the first image is identified, if it is detected that the facial feature exists in the first image, it may be indicated that the user is facing the camera, and similarly, the terminal device may turn off the flash.
Through this optional implementation, terminal equipment can close the flash light when detecting that there is facial feature in the image that the camera was gathered, namely when the user openly faces camera and flash light, can avoid the user to look directly the flash light of opening like this, avoids user's eyes to receive the harm.
506. And detecting the parameter information of the terminal equipment.
In the embodiment of the invention, after the terminal device turns on the flash lamp, the parameter information of the terminal device can be detected.
Wherein, the parameter information of the terminal equipment comprises: at least one of an orientation of the flash, a turn-on duration of the flash, and a second distance between the optical accessory and an object in the photographic environment.
It should be noted that the orientation of the flash may be detected by a gyroscope in the terminal device, and the second distance may be detected by an infrared distance sensor in the optical accessory.
Alternatively, the gyroscope is also called an angular velocity sensor, the gyroscope measures the angular velocity of the terminal device during the yaw and the tilt, and the gyroscope can represent the current pose of the terminal device by X, Y, Z three parameters, wherein X, Y, Z three parameters represent three directions respectively. When the terminal equipment is in a static state, X, Y, Z all have 0 parameters; when the user uses the terminal device to turn over, X, Y, Z three parameters will change, so the gyroscope can obtain the pose change of the terminal device according to the three parameters, and the orientation of the flash lamp on the terminal device is obtained.
507. And if the parameter information of the terminal equipment meets the preset condition, turning off the flash lamp.
In the embodiment of the invention, if the parameter information of the terminal equipment meets the preset condition, the terminal equipment can turn off the flash lamp.
Optionally, if the parameter information of the terminal device meets the preset condition, turning off the flash lamp may include the following three optional implementation manners:
the implementation mode is as follows: and if the included angle between the orientation of the flash lamp and the gravity direction is larger than the preset included angle, closing the flash lamp.
If the terminal device detects that the included angle between the orientation of the flash lamp and the gravity direction is larger than the preset included angle through the gyroscope, it can be shown that the irradiation direction of the flash lamp is not the gravity direction, and the flash lamp deflects, so that the terminal device can close the flash lamp.
Illustratively, the preset included angle is assumed to be 45 °. If the terminal device detects that the included angle between the orientation of the flashlight and the gravity direction is 69 degrees and 69 degrees is larger than 45 degrees through the gyroscope, the terminal device can turn off the flashlight.
The implementation mode two is as follows: and if the starting time of the flash lamp is longer than the preset time, the flash lamp is turned off.
If the terminal device detects that the starting duration of the flash lamp is longer than the preset duration, it can be shown that the flash lamp is started for a long time, and heating of the terminal device may be caused, so that the terminal device can close the flash lamp.
For example, assume that the preset time period is 30 minutes. If the terminal device detects that the on-time of the flash lamp reaches 32 minutes, and the 32 minutes is more than 30 minutes, the terminal device can turn off the flash lamp.
The implementation mode is three: and if the second distance is greater than the second preset distance, the flash lamp is turned off.
If the terminal device detects that the second distance between the optical accessory and the object in the shooting environment is larger than the second preset distance through the infrared distance sensor, it can be shown that the optical accessory and the flash lamp are exposed in the air, and the flash lamp may irradiate the eyes of the user, so that the terminal device can turn off the flash lamp.
Illustratively, assume that the second predetermined distance is 50 cm. If the terminal device detects that the second distance is 60cm through the infrared distance sensor, and the second distance is larger than 50cm, the terminal device can turn off the flash lamp.
The implementation mode is four: judging whether the second distance is greater than a second preset distance; if the second distance is greater than the second preset distance, judging whether an included angle between the orientation of the flash lamp and the gravity direction is greater than a preset included angle; if the included angle between the orientation of the flash lamp and the gravity direction is larger than the preset included angle, judging whether the starting time of the flash lamp is larger than the preset time; and if the starting time of the flash lamp is longer than the preset time, the flash lamp is turned off.
In this implementation manner, if the parameter information of the terminal device includes: the orientation of the flash lamp, the opening duration and the second distance of the flash lamp, then the terminal equipment can detect the parameter information of the terminal equipment according to the sequence, firstly judge whether the second distance is greater than the second preset distance, if the second distance is greater than the second preset distance, judge whether the orientation of the flash lamp and the included angle of the gravity direction are greater than the preset included angle, if the orientation of the flash lamp and the included angle of the gravity direction are greater than the preset included angle, judge whether the opening duration of the flash lamp is greater than the preset duration, if the opening duration of the flash lamp is greater than the preset duration, then the terminal equipment can close the flash lamp.
Through the four optional implementation modes, the terminal equipment can close the flash lamp when the parameter information of the terminal equipment meets the preset condition, so that the flash lamp can be prevented from irradiating eyes of a user, the eyes of the user can be prevented from being damaged, the flash lamp can be prevented from being started for a long time, and the terminal equipment can be heated for a long time.
The embodiment of the invention provides a method for acquiring an image through an optical accessory, wherein when detecting that the distance between the optical accessory and a camera is smaller than a preset distance, a terminal device can automatically start an application program corresponding to the optical accessory without touch operation of a user, so that the operation times of the user can be reduced, and a module for data transmission is not required to be configured in the optical accessory and the terminal device, so that the cost of the optical accessory and the terminal device is reduced; in addition, data transmission is carried out between the optical accessory and the terminal equipment in a communication connection mode, so that data can be prevented from being lost or stolen under the condition of unstable signals, and the data transmission efficiency is prevented from being slow under the condition of unstable signals; when the average brightness value of the target image is lower, the flash lamp is started so that the terminal equipment can acquire the image with the standard brightness value; when the parameter information of the terminal equipment meets the preset condition, the flash lamp is turned off, so that the flash lamp can be prevented from irradiating eyes of the user, the eyes of the user are damaged, the flash lamp can be prevented from being turned on for a long time, and the terminal equipment can be heated for a long time.
Optionally, after the terminal device displays the target image in the interface of the target application, the method may further include: and the terminal equipment identifies the target image, and if the target image is detected to have no effective object displayed, a prompt message is output and used for prompting a user to adjust the optical accessory.
It should be noted that, if the terminal device detects that the target image is blank or completely black, that is, there is no valid object in the target image, it can be stated that the optical accessory is not correctly connected or the parameters of the optical accessory are incorrect, and then the terminal device can prompt the user to adjust the optical accessory.
Wherein the parameters of the optical accessory may include: magnification of optical accessory, position of observed object, ambient brightness, etc.
Through the optional implementation mode, the terminal equipment can prompt a user to adjust the optical accessory when the target image is abnormal, so that a correct target image is obtained, the working efficiency of the optical accessory can be improved, and abnormal images are prevented from being acquired for many times.
Optionally, after the terminal device displays the target image in the interface of the target application, the method may further include: the terminal device detects target content of the target image, acquires learning content corresponding to the target content, acquires personal information of the user, and outputs the learning content matched with the personal information.
It should be noted that, if the user is a student, the user may need the optical accessory to perform a biological experiment or the like, such as observing a specimen. The terminal device may detect the target content of the target image and search for the learning content corresponding to the target content, where the learning content may include: content explanation, exercise, content expansion and the like; when the terminal device searches a plurality of learning contents, the terminal device may obtain personal information of the user, where the personal information at least includes: user age, user grade; the terminal device may display the learning content matching the user grade on a display screen of the terminal device.
The optional implementation manner can be applied to a scene that a user observes a specimen by using the optical accessory, the terminal device can search and display the searched related learning content according to the content of the specimen, and when the learning content comprises a plurality of learning contents, the terminal device can display the learning content matched with the grade of the user according to the grade information of the user. Therefore, the terminal equipment can further output the content related to the target image after acquiring the target image, so that the terminal equipment is more intelligent.
Optionally, before detecting the first distance between the optical accessory and the camera, the terminal device may further obtain a plurality of learning contents, and determine, in response to a touch operation of the user, a target learning content matched with the grade and the subject of the user; acquiring a current image through a camera, and if an object matched with target learning content is detected to exist in the current image, determining that an optical accessory is arranged on the outer side of the camera and a sample to be observed is placed correctly; if it is detected that an object matched with the target learning content does not exist in the current image, it can be determined that the optical accessory is connected with the camera wrongly or the sample to be observed is selected wrongly.
It should be noted that the optional implementation manner is suitable for determining, when it is not determined whether the optical accessory is connected to the camera, that the optical accessory is disposed outside the camera and the sample to be observed is correctly placed, and then the terminal device may perform all the steps of the embodiment of the present invention.
For example, assuming that the current grade of the user is one higher and the user is learning the content related to the chloroplast, the user can determine that the target learning content is the content related to the chloroplast in the higher creature through a touch operation. At this moment, the camera can acquire the current image, and detect that the chloroplast exists in the current image, so that the optical accessory can be determined to be arranged outside the camera, and the sample to be observed is the chloroplast sample.
Through this optional implementation, terminal equipment can confirm whether optical accessories and camera are connected correctly to can detect whether the user will wait to observe the sample selection and place correctly, make terminal equipment more intelligent.
Further, the terminal device detects that an object matched with the target learning content exists in the current image, so that it can be determined that an optical accessory is arranged on the outer side of the camera, and after the sample to be observed is placed correctly, the terminal device can also determine the current learning progress of the user through the current image, and display the learning content and the practice questions related to the object matched with the target learning content on a display screen of the terminal device; the terminal device can also send the current learning progress and exercise topic completion condition of the user to the parent device associated with the terminal device.
Through the optional implementation mode, the terminal device can determine the current learning progress of the user, output related learning content and exercise questions to the user, and send the learning progress and the exercise question completion conditions to the parent device, so that parents can know the learning progress and the mastering conditions of the user.
Optionally, after the terminal device displays the target image in the interface of the target application, the method may further include: the terminal equipment detects a first angle between the terminal equipment and a horizontal plane through a gyroscope, if the first angle is within a preset angle range, a face image of a user is collected through a front camera, a second angle of the face of the user relative to the terminal equipment is calculated according to the face image of the user, a head lowering angle of the user is calculated according to the first angle and the second angle, if the head lowering angle is larger than a standard angle, a prompt message is output, and the prompt message is used for prompting the user to adjust the sitting posture.
Illustratively, the preset angle range is assumed to be 0 ° to 45 °, and the standard angle is 35 °. As shown in fig. 6, if the first angle of the terminal device 61 to the horizontal plane is 30 °, that is, angle a is 30 °, and is between 0 ° and 45 °, the terminal device 61 collects the user face image, and analyzes the user face image, and can obtain that the second angle of the user 62 relative to the terminal device 61 is 105 °, that is, angle D is 105 °, then by the sum of the internal angles of the triangle is 180 °, that is, angle B + C + angle D is 180 °, and because angle a and angle B are the same-position angles, angle B is 30 ° as well as angle C-30 ° -105 ° -55 °, that is, the low-angle of the user 62 is 55 °, 55 ° is greater than 35 °, it can be said that the sitting posture of the user 62 is incorrect, and at this time, the terminal device 61 can prompt the user 62 to adjust the sitting posture.
Through the optional implementation mode, the terminal equipment can acquire the deflection angle between the terminal equipment and the horizontal plane through the gyroscope, then the angle of the face of the user relative to the terminal equipment is obtained through analysis according to the face image of the user, and the head lowering angle of the user can be calculated according to the relation that the sight line of the user, the horizontal plane and the terminal equipment are triangular, so that the obtained head lowering angle of the user is accurate; when the head-lowering angle is larger than the preset angle, the user is prompted to adjust the sitting posture, so that the bad sitting posture of the user can be detected in time, and the terminal equipment is more humanized and intelligent.
EXAMPLE III
As shown in fig. 7, an embodiment of the present invention provides a terminal device, a first surface of which is provided with a camera, and an optical accessory is provided outside the camera on the first surface, so that the camera captures an image through the optical accessory, the terminal device including:
a processing module 701, configured to detect a first distance between the optical accessory and the camera;
the control module 702 is configured to start a target application program corresponding to the optical accessory on the terminal device if the first distance is smaller than a first preset distance;
the processing module 701 is further configured to acquire an imaging picture of the optical accessory through the camera to obtain a target image, and display the target image in an interface of the target application program.
Optionally, if an infrared distance sensor is configured in the camera, the control module 702 is specifically configured to control the distance sensor to emit a first optical pulse signal, and receive a second optical pulse signal obtained by reflecting the first optical pulse signal;
the processing module 701 is further configured to detect an interval duration between the first optical pulse signal and the second optical pulse signal;
the processing module 701 is further configured to determine a distance between the optical accessory and the camera according to the interval duration.
Optionally, if a hall sensor is configured in the camera, and a magnet is configured in the optical accessory, the processing module 701 is further configured to obtain the magnetic field strength between the optical accessory and the camera through the hall sensor;
the processing module 701 is further configured to determine a distance between the optical accessory and the camera according to the magnetic field strength.
Optionally, if the terminal device is provided with a flash lamp, the processing module 701 is further configured to detect an average brightness value of the target image;
the control module 702 is further configured to turn on a flash if the average brightness value is smaller than the standard brightness value, where the flash and the camera are disposed on the same side of the terminal device.
Optionally, the processing module 701 is further configured to detect parameter information of the terminal device;
the control module 702 is further configured to turn off the flash lamp if the parameter information of the terminal device meets a preset condition;
wherein, the parameter information of the terminal equipment comprises: at least one of the orientation of the flash, the on-time of the flash, and a second distance between the optical accessory and an object in the shooting environment.
Optionally, the control module 702 is further configured to turn off the flash lamp if an included angle between the orientation of the flash lamp and the gravity direction is greater than a preset included angle;
and/or the presence of a gas in the gas,
if the starting time of the flash lamp is longer than the preset time, the flash lamp is turned off;
and/or the presence of a gas in the gas,
and if the second distance is greater than the second preset distance, the flash lamp is turned off.
Optionally, the processing module 701 is further configured to acquire a first image through a camera;
the control module 702 is further configured to turn off the flash when the presence of the facial feature in the first image is detected.
In the embodiment of the present invention, each module may implement the method for acquiring an image through an optical accessory provided in the above method embodiment, and may achieve the same technical effect, and for avoiding repetition, details are not described here again.
As shown in fig. 8, an embodiment of the present invention further provides a terminal device, where the terminal device may include:
a memory 801 in which executable program code is stored;
a processor 802 coupled with the memory 801;
the processor 802 calls the executable program code stored in the memory 801 to execute the method for acquiring an image through an optical accessory, which is executed by the terminal device in the above-mentioned method embodiments.
As shown in fig. 9, an embodiment of the present invention further provides a terminal device, where the terminal device includes, but is not limited to: a Radio Frequency (RF) circuit 901, a memory 902, an input unit 903, a display unit 904, a sensor 905, an audio circuit 906, a WiFi (wireless communication) module 907, a processor 908, a power supply 909, and a camera 910. The radio frequency circuit 901 includes a receiver 9011 and a transmitter 9012. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 9 does not constitute a limitation of the terminal device and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
RF circuit 901 is used for receiving and transmitting signals during information transmission and reception or during a call, and in particular, receives downlink information from a base station and then processes the received downlink information to processor 908; in addition, the data for designing uplink is transmitted to the base station. In general, the RF circuit 901 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like. In addition, the RF circuit 901 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to global system for mobile communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Message Service (SMS), etc.
The memory 902 may be used to store software programs and modules, and the processor 908 executes various functional applications and data processing of the terminal device by operating the software programs and modules stored in the memory 902. The memory 902 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the terminal device, and the like. Further, the memory 902 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 903 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the input unit 903 may include a touch panel 9031 and other input devices 9032. The touch panel 9031, also called a touch screen, may collect a touch operation performed by a user on or near the touch panel 9031 (e.g., an operation performed by the user on or near the touch panel 9031 by using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a preset program. Alternatively, the touch panel 9031 may include two parts, namely, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 908, and receives and executes commands from the processor 908. In addition, the touch panel 9031 may be implemented by using various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 903 may include other input devices 9032 in addition to the touch panel 9031. In particular, other input devices 9032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like.
The display unit 904 may be used to display information input by a user or information provided to the user and various menus of the terminal device. The display unit 904 may include a display panel 9041, and optionally, the display panel 9041 may be configured in the form of a Liquid Crystal Display (LCD), an organic light-Emitting diode (OLED), or the like. Further, the touch panel 9031 may cover the display panel 9041, and when the touch panel 9031 detects a touch operation on or near the touch panel 9031, the touch panel is transmitted to the processor 908 to determine a touch event, and then the processor 908 provides a corresponding visual output on the display panel 9041 according to the touch event. Although in fig. 9, the touch panel 9031 and the display panel 9041 are implemented as two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 9031 and the display panel 9041 may be integrated to implement the input and output functions of the terminal device.
The terminal device may also include at least one sensor 905, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display panel 9041 according to the brightness of ambient light, and a proximity sensor that may exit the display panel 9041 and/or be backlit when the terminal device is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration) for recognizing the attitude of the terminal device, and related functions (such as pedometer and tapping) for vibration recognition; as for other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured in the terminal device, detailed description is omitted here. In the embodiment of the present invention, the terminal device may include an acceleration sensor, a depth sensor, a distance sensor, or the like.
The audio circuitry 906, speaker 9061, microphone 9062 may provide an audio interface between the user and the terminal device. The audio circuit 906 may transmit the electrical signal obtained by converting the received audio data to the speaker 9061, and convert the electrical signal into a sound signal by the speaker 9061 and output the sound signal; on the other hand, the microphone 9062 converts a collected sound signal into an electric signal, converts the electric signal into audio data after being received by the audio circuit 906, processes the audio data by the audio data output processor 908, and then sends the audio data to, for example, another terminal device via the RF circuit 901 or outputs the audio data to the memory 902 for further processing.
WiFi belongs to short-distance wireless transmission technology, and the terminal equipment can help a user to receive and send e-mails, browse webpages, access streaming media and the like through the WiFi module 907, and provides wireless broadband internet access for the user. Although fig. 9 shows the WiFi module 907, it is understood that it does not belong to the essential constitution of the terminal device, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The processor 908 is a control center of the terminal device, connects various parts of the entire terminal device by various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 902 and calling data stored in the memory 902, thereby performing overall monitoring of the terminal device. Alternatively, processor 908 may include one or more processing units; preferably, the processor 908 may integrate an application processor, which primarily handles operating systems, user interfaces, applications, etc., and a modem processor, which primarily handles wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 908.
The terminal device also includes a power supply 909 (such as a battery) for supplying power to the various components, which may preferably be logically connected to the processor 908 via a power management system, so as to manage charging, discharging, and power consumption via the power management system. Although not shown, the terminal device may further include a bluetooth module or the like, which is not described in detail herein.
Embodiments of the present invention provide a computer-readable storage medium storing a computer program, wherein the computer program causes a computer to execute some or all of the steps of the method as in the above method embodiments.
Embodiments of the present invention also provide a computer program product, wherein the computer program product, when run on a computer, causes the computer to perform some or all of the steps of the method as in the above method embodiments.
Embodiments of the present invention further provide an application publishing platform, where the application publishing platform is configured to publish a computer program product, where the computer program product, when running on a computer, causes the computer to perform some or all of the steps of the method in the above method embodiments.
It should be appreciated that reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic described in connection with the embodiment is included in at least one embodiment of the present invention. Thus, the appearances of the phrases "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily all referring to the same embodiment. Furthermore, the particular features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. Those skilled in the art should also appreciate that the embodiments described in this specification are exemplary and alternative embodiments, and that the acts and modules illustrated are not required in order to practice the invention.
The terminal device provided by the embodiment of the present invention can implement each process shown in the above method embodiments, and is not described herein again to avoid repetition.
In various embodiments of the present invention, it should be understood that the sequence numbers of the above-mentioned processes do not imply an inevitable order of execution, and the execution order of the processes should be determined by their functions and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated units, if implemented as software functional units and sold or used as a stand-alone product, may be stored in a computer accessible memory. Based on such understanding, the technical solution of the present invention, which is a part of or contributes to the prior art in essence, or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several requests for causing a computer device (which may be a personal computer, a server, a network device, or the like, and may specifically be a processor in the computer device) to execute part or all of the steps of the above-described method of each embodiment of the present invention.
It will be understood by those skilled in the art that all or part of the steps in the methods of the embodiments described above may be implemented by hardware instructions of a program, and the program may be stored in a computer-readable storage medium, where the storage medium includes Read-Only Memory (ROM), Random Access Memory (RAM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), One-time Programmable Read-Only Memory (OTPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Compact Disc Read-Only Memory (CD-ROM), or other Memory, such as a magnetic disk, or a combination thereof, A tape memory, or any other medium readable by a computer that can be used to carry or store data.

Claims (10)

1. A method for acquiring images through an optical accessory is applied to a terminal device, a first surface of the terminal device is provided with a camera, the optical accessory is arranged outside the camera on the first surface, so that the camera acquires an imaging picture of the optical accessory, and the method comprises the following steps:
detecting a first distance between an optical accessory and the camera;
if the first distance is smaller than a first preset distance, starting a target application program corresponding to the optical accessory on the terminal equipment;
and acquiring an imaging picture of the optical accessory through the camera to obtain a target image, and displaying the target image in an interface of the target application program.
2. The method of claim 1, wherein detecting the distance between the optical assembly and the camera if an infrared distance sensor is disposed in the camera comprises:
controlling the infrared distance sensor to emit a first light pulse signal, and receiving a second light pulse signal obtained by reflecting the first light pulse signal;
detecting the interval duration between the first optical pulse signal and the second optical pulse signal;
and determining the distance between the optical accessory and the camera according to the interval duration.
3. The method of claim 1, wherein if a hall sensor is disposed in the camera head and a magnet is disposed in the optical assembly, the detecting a distance between the optical assembly and the camera head comprises:
acquiring the magnetic field intensity between the optical accessory and the camera through the Hall sensor;
determining a distance between the optical accessory and the camera according to the magnetic field strength.
4. The method according to claim 1, wherein if a flash is provided on the terminal device, after acquiring the target image captured through the optical accessory and displaying the target image in an interface of the target application, the method further comprises:
detecting an average brightness value of the target image;
and if the average brightness value is smaller than the standard brightness value, starting the flash lamp, wherein the flash lamp and the camera are arranged on the same side of the terminal equipment.
5. The method of claim 4, wherein after the turning on the flash, further comprising:
detecting parameter information of the terminal equipment;
if the parameter information of the terminal equipment meets a preset condition, turning off the flash lamp;
wherein the parameter information of the terminal device includes: at least one of orientation of the flash, a duration of activation of the flash, and a second distance between the optical accessory and an object in the shooting environment.
6. The method according to claim 5, wherein turning off the flash if the parameter information of the terminal device satisfies a predetermined condition includes:
if the included angle between the orientation of the flash lamp and the gravity direction is larger than a preset included angle, the flash lamp is turned off;
and/or the presence of a gas in the gas,
if the starting time of the flash lamp is longer than the preset time, the flash lamp is turned off;
and/or the presence of a gas in the gas,
and if the second distance is greater than a second preset distance, turning off the flash lamp.
7. The method of claim 4, wherein after the turning on the flash, further comprising:
acquiring a first image through the camera;
turning off the flash when the presence of a facial feature in the first image is detected.
8. A terminal device characterized in that a first surface of the terminal device is provided with a camera, an optical accessory is provided outside the camera on the first surface, so that the camera collects an imaging picture through the optical accessory, the terminal device comprising:
the processing module is used for detecting a first distance between the optical accessory and the camera;
the control module is used for starting a target application program corresponding to the optical accessory on the terminal equipment if the first distance is smaller than a first preset distance;
the processing module is further configured to acquire an imaging picture of the optical accessory through the camera to obtain a target image, and display the target image in an interface of the target application program.
9. A terminal device comprising a memory and a processor, the memory having stored thereon a computer program which, when executed by the processor, causes the processor to carry out a method of capturing images via an optical accessory according to any one of claims 1 to 7.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of acquiring images by means of an optical accessory according to any one of claims 1 to 7.
CN202110156840.7A 2021-02-04 2021-02-04 Method for acquiring image through optical accessory and terminal equipment Pending CN112995461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110156840.7A CN112995461A (en) 2021-02-04 2021-02-04 Method for acquiring image through optical accessory and terminal equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110156840.7A CN112995461A (en) 2021-02-04 2021-02-04 Method for acquiring image through optical accessory and terminal equipment

Publications (1)

Publication Number Publication Date
CN112995461A true CN112995461A (en) 2021-06-18

Family

ID=76347176

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110156840.7A Pending CN112995461A (en) 2021-02-04 2021-02-04 Method for acquiring image through optical accessory and terminal equipment

Country Status (1)

Country Link
CN (1) CN112995461A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110294543A1 (en) * 2010-05-31 2011-12-01 Silverbrook Research Pty Ltd Mobile phone assembly with microscope capability
US20150356336A1 (en) * 2012-10-04 2015-12-10 The Code Corporation A barcode-reading system
CN105959581A (en) * 2015-03-08 2016-09-21 联发科技股份有限公司 Electronic device having dynamically controlled flashlight for image capturing and related control method
CN106820519A (en) * 2017-01-03 2017-06-13 惠州Tcl移动通信有限公司 The terminal protection set and camera mode acquisition methods of replaceable cam lens pattern
CN107727627A (en) * 2017-11-09 2018-02-23 吉林求是光谱数据科技有限公司 A kind of fluorescent whitening agent detector lens folder and its detection method based on mobile phone
CN108959857A (en) * 2018-06-12 2018-12-07 Oppo广东移动通信有限公司 Application program launching control method, device, electronic equipment and storage medium
CN109284149A (en) * 2018-10-19 2019-01-29 北京小米移动软件有限公司 Start the method and device of application program
CN111371923A (en) * 2018-12-26 2020-07-03 北京小米移动软件有限公司 Terminal and lens
CN112040223A (en) * 2020-08-25 2020-12-04 RealMe重庆移动通信有限公司 Image processing method, terminal device and storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110294543A1 (en) * 2010-05-31 2011-12-01 Silverbrook Research Pty Ltd Mobile phone assembly with microscope capability
US20150356336A1 (en) * 2012-10-04 2015-12-10 The Code Corporation A barcode-reading system
CN105959581A (en) * 2015-03-08 2016-09-21 联发科技股份有限公司 Electronic device having dynamically controlled flashlight for image capturing and related control method
CN106820519A (en) * 2017-01-03 2017-06-13 惠州Tcl移动通信有限公司 The terminal protection set and camera mode acquisition methods of replaceable cam lens pattern
CN107727627A (en) * 2017-11-09 2018-02-23 吉林求是光谱数据科技有限公司 A kind of fluorescent whitening agent detector lens folder and its detection method based on mobile phone
CN108959857A (en) * 2018-06-12 2018-12-07 Oppo广东移动通信有限公司 Application program launching control method, device, electronic equipment and storage medium
CN109284149A (en) * 2018-10-19 2019-01-29 北京小米移动软件有限公司 Start the method and device of application program
CN111371923A (en) * 2018-12-26 2020-07-03 北京小米移动软件有限公司 Terminal and lens
CN112040223A (en) * 2020-08-25 2020-12-04 RealMe重庆移动通信有限公司 Image processing method, terminal device and storage medium

Similar Documents

Publication Publication Date Title
EP3399461B1 (en) Optical fingerprint verification method and mobile terminal
US9760165B2 (en) Mobile terminal device and input operation receiving method for switching input methods
WO2018201848A1 (en) Optical fingerprint acquisition method, and related product
JP7303900B2 (en) Parameter acquisition method and terminal equipment
CN107145886A (en) Optical ftngetpnnt acquisidon method and Related product
CN106293076A (en) Communication terminal and intelligent terminal's gesture identification method and device
CN107463897B (en) Fingerprint identification method and mobile terminal
CN108877780B (en) Voice question searching method and family education equipment
CN105979141A (en) Image shooting method, device and mobile terminal
CN107580176A (en) A kind of terminal taking control method, camera shooting terminal and computer-readable recording medium
CN109472825B (en) Object searching method and terminal equipment
CN107782250A (en) A kind of depth information measuring method, device and mobile terminal
CN112929577A (en) Flash lamp control method and terminal equipment
CN106454078B (en) A kind of focal modes control method and terminal device
CN110069136B (en) Wearing state identification method and equipment and computer readable storage medium
CN112968992B (en) Dynamic distance prompting method and terminal equipment
CN112995461A (en) Method for acquiring image through optical accessory and terminal equipment
CN114849215B (en) Rope skipping counting method and device based on intelligent wearable equipment
CN112991439A (en) Method, apparatus, electronic device, and medium for positioning target object
CN110491380B (en) Power saving control method of intelligent terminal, intelligent terminal and storage medium
CN107071287A (en) A kind of method and apparatus and mobile terminal taken pictures
CN110233962A (en) A kind of optimization method of confidence level, device and computer readable storage medium
RU2794737C1 (en) Method for obtaining parameters and terminal device
CN109375232B (en) Distance measuring method and device
CN110807382B (en) Scanning method and electronic equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210618

RJ01 Rejection of invention patent application after publication