WO2021047461A1 - Detection method, apparatus and device - Google Patents

Detection method, apparatus and device Download PDF

Info

Publication number
WO2021047461A1
WO2021047461A1 PCT/CN2020/113665 CN2020113665W WO2021047461A1 WO 2021047461 A1 WO2021047461 A1 WO 2021047461A1 CN 2020113665 W CN2020113665 W CN 2020113665W WO 2021047461 A1 WO2021047461 A1 WO 2021047461A1
Authority
WO
WIPO (PCT)
Prior art keywords
camera
target image
shadow area
travel
target
Prior art date
Application number
PCT/CN2020/113665
Other languages
French (fr)
Chinese (zh)
Inventor
王星
王洪利
李浩杰
任红强
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2021047461A1 publication Critical patent/WO2021047461A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/002Diagnosis, testing or measuring for television systems or their details for television cameras
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces

Definitions

  • This application relates to the field of information detection technology, and more specifically, to detection methods, devices, and equipment.
  • the camera When the camera is extended or retracted, the camera may be stuck due to some reasons, that is, the camera cannot be fully extended or retracted. At this time, the telescopic mechanism cannot sense that the camera has been stuck. In this case, it will continue to work, and this situation is extremely easy to cause damage to the telescopic mechanism of the electronic device.
  • the present application provides a detection method that can protect the telescopic mechanism of an electronic device.
  • a detection method which includes: controlling a camera to obtain a target image; determining whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area, and the abnormal expansion and contraction includes obstruction of extension and retraction. Any one of obstruction and external force pressing; if the camera is in an abnormal state of expansion and contraction, the camera is controlled to perform a target action, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
  • the target image is acquired by controlling the camera, and whether the camera is in an abnormal state of expansion and contraction is determined according to whether the target image includes a shadow area.
  • measures are taken to make the camera recover from the abnormal state of expansion and contraction, thereby To achieve the purpose of protecting the telescopic mechanism of electronic equipment.
  • the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image includes a shadow area, determining that the camera is blocked from extending, and the target image is the first target image, so The first target image is acquired after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, and the first target image is A target image is acquired after the camera starts to travel; if the camera is prevented from extending, the controlling the camera to perform the target action includes: controlling the camera to perform a retracting action.
  • the target image is obtained by controlling the camera, and according to whether the target image includes a shadow area, it is determined whether the camera is extended abnormally, and when the camera is determined to be abnormally extended, the camera is controlled to perform a retracting action, so as to protect the telescopic mechanism of the electronic device the goal of.
  • the first target image is acquired when the travel time of the camera is greater than or equal to a preset first threshold.
  • the target image is acquired only when the travel time of the camera is greater than or equal to the preset first threshold, so that the target image does not need to be acquired when the travel time of the camera is less than the preset first threshold, thereby protecting the electronic equipment
  • the telescopic mechanism reduces the number of times the camera acquires the target image.
  • the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image is not completely covered by a shadow area, determining that the camera is blocked from being retracted, and the target image is the second target Image, the second target image is obtained after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, and the target image is the second target image The second target image is acquired after the camera starts to travel; if the camera is prevented from being retracted, the controlling the camera to perform the target action includes: controlling the camera to repeatedly perform the retracting action.
  • the target image is acquired by controlling the camera, and according to whether the target image is completely covered by the shadow area, it is determined whether the camera is retracted abnormally, and the camera is controlled to repeat the retracting action when it is determined that the camera retracts abnormally, so as to protect the electronic equipment
  • the purpose of the telescopic mechanism is described below.
  • the second target image is acquired when the traveling time of the camera is greater than or equal to a preset second threshold.
  • the target image is acquired only when the travel time of the camera is greater than or equal to the preset second threshold, so that the target image does not need to be acquired when the travel time of the camera is less than the preset second threshold, thereby protecting the electronic equipment
  • the telescopic mechanism reduces the number of times the camera acquires the target image.
  • the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image includes a shadow area, determining that the camera is pressed by an external force, and the target image is a third target image, so The third target image is obtained when the camera is in a normal working state; or, when the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, and the target image is the third target image, The third target image is obtained when the camera is in a normal working state; if the camera is pressed by an external force, controlling the camera to perform a target action includes: controlling the camera to perform a retracting action.
  • the target image includes a non-shaded area, and a direction along which a boundary line of the shadow area and the non-shaded area follows is perpendicular to the traveling direction of the camera.
  • a detection device configured to execute the foregoing first aspect or any possible implementation of the first aspect.
  • the device may include a module for executing the detection method in the first aspect and any one of its possible implementation manners.
  • a chip is provided, and the chip is configured with a memory and a processor.
  • the memory is used to store instructions; the processor executes the instructions stored in the memory, so that the device executes the detection method in the first aspect and any one of its possible implementation manners.
  • a device configured with the chip of the fourth aspect, and the chip is configured with a memory and a processor.
  • the memory is used to store instructions; the processor executes the instructions stored in the memory, so that the device executes the detection method in the first aspect and any one of its possible implementation manners.
  • a program is provided, when the program is executed by a processor, it is used to execute any method in the first aspect and its possible implementation manners.
  • a program product comprising: program code, which when the program code is executed by a chip, causes the chip to execute any method in the first aspect and its possible implementation manners.
  • a computer-readable storage medium stores instructions. When the instructions run on a computer, the computer executes the first aspect and any one of its possible implementations. Detection method.
  • Fig. 1 is a schematic flow chart of the detection method provided by the present application.
  • Figure 2 shows the distribution of shadowed and non-shaded areas in the target image
  • Figure 3 is another distribution of the shadow area and the non-shadow area in the target image
  • Figure 4 is another distribution of the shadow area and the non-shadow area in the target image
  • Figure 5 is another distribution of shadow areas and non-shadow areas in the target image
  • Fig. 6 is another schematic flowchart of the detection method provided by the present application.
  • FIG. 7 is another schematic flowchart of the detection method provided by the present application.
  • FIG. 8 is another schematic flowchart of the detection method provided by the present application.
  • FIG. 9 is a schematic diagram of the structure of the detection device provided by this application.
  • FIG. 10 is a schematic diagram of the structure of the chip provided by this application.
  • the camera When the camera is extended or retracted, the camera may be stuck due to some reasons, that is, the camera cannot be fully extended or retracted. At this time, the telescopic mechanism cannot sense that the camera has been stuck. In this case, it will continue to work, and this situation is extremely easy to cause damage to the telescopic mechanism of the electronic device.
  • the present application provides a detection method in order to achieve the purpose of protecting the telescopic mechanism of the electronic device.
  • the electronic device in the embodiments of the present application may be various devices with telescopic cameras.
  • the electronic device may be a mobile phone, a bracelet, a display, a tablet computer, a watch, a wearable device, a portable computer, and the like.
  • FIG. 1 is a schematic flowchart of a detection method 200 provided in the present application. Hereinafter, each step of the method 200 will be described in detail.
  • the camera is controlled to obtain a target image.
  • the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area.
  • the abnormal expansion and contraction includes any one of obstructed extension, obstructed retraction, and external force pressing.
  • the camera when it is necessary to detect whether the front camera of the mobile phone (hereinafter referred to as the "camera") has an abnormal expansion or contraction, the camera can be controlled to take a picture, so as to obtain the current image (ie, an example of the target image).
  • the current image ie, an example of the target image
  • the camera According to whether the current image includes a shadow area, it can be determined whether the camera is in an abnormal state of expansion and contraction, and then the camera is controlled to perform a corresponding action (that is, an example of a target action), so that the camera can recover from the abnormal state.
  • a corresponding action that is, an example of a target action
  • the target image includes both a shadow area and a non-shadow area (that is, an image captured by the unobstructed part of the camera)
  • the direction along which the boundary line of the shadow area and the non-shadow area is perpendicular to the traveling direction of the camera takes several cases as examples to illustrate the distribution of the shadow area and the non-shadow area in the target image when the target image includes both a shadow area and a non-shadow area.
  • the direction of travel when the camera is extended or retracted is perpendicular to the upper edge of the mobile phone.
  • the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 2. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
  • the direction of travel when the camera is extended or retracted is perpendicular to the lower edge of the mobile phone.
  • the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 3. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
  • the direction of travel when the camera is extended or retracted is perpendicular to the left edge of the mobile phone.
  • the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 4. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
  • the direction of travel when the camera is extended or retracted is perpendicular to the right edge of the mobile phone.
  • the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 5. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
  • FIGS. 2 to 5 are merely examples for illustrating the situation, and do not strictly correspond to the distribution of shadow areas and non-shadow areas in the target image.
  • FIG. 6 shows a schematic flow chart of the detection method 300 corresponding to the hindered extension. Hereinafter, each step of the method 300 will be described in detail.
  • the control device in the mobile phone for example, the central processing unit (CPU)
  • the control device in the mobile phone issues an extension instruction to the telescopic mechanism in the mobile phone, and then the extension mechanism executes the extension instruction. Command and drive the camera to extend.
  • the CPU can control the camera to take a picture, and obtain the current image #1 (that is, an example of the first target image).
  • the CPU can determine whether the current image #1 has no shadow area at all: if the current image #1 has no shadow area at all, it can be determined that the camera has been fully extended and execute S340; or, if the current image #1 has a shadow area, It can be determined that the camera is blocked from being extended. At this time, S360 can be executed. In addition, in order to further improve the accuracy of detection, S350 can also be executed.
  • S350 when it is determined that the camera may be blocked from extending, it can be further determined whether the length of time between the camera extending from the beginning to the current moment (i.e., an example of travel time) is greater than or equal to the preset threshold #1 (i.e., An example of the first threshold): If the travel time is greater than or equal to the threshold #1 (for example, 1.2 seconds (s)), it can be determined that the camera extension is blocked. At this time, S360 can be executed; or, if the travel time is less than the threshold #1 At this time, you can return to S320 and continue execution from S320.
  • the preset threshold #1 i.e., An example of the first threshold
  • the CPU controls the camera to perform a retracting action.
  • S320 can be replaced with: when the travel time after the camera is extended is equal to or greater than the threshold #1, the CPU controls the camera to take a picture and obtains the current image #1.
  • the method 300 may not include S350, that is, if it is determined in S330 that the current image #1 has a shadow area, it may be determined that the camera is blocked from extending, and S360 is directly executed.
  • FIG. 7 shows a schematic flow chart of the detection method 400 corresponding to the obstruction of retraction.
  • each step of the method 400 will be described in detail.
  • the CPU when detecting whether the camera is blocked from being retracted, issues a retracting instruction to the telescopic mechanism in the mobile phone, and then the extending mechanism executes the instruction and drives the camera to retract.
  • the CPU may control the camera to take a picture, and obtain the current image #2 (ie, an example of the second target image).
  • the CPU can determine whether the current image #2 is completely covered by the shadow area: if the current image #2 is completely covered by the shadow area, it can be determined that the camera has been completely retracted and execute S440; or, if the current image #2 is not completely covered If it is covered by the shaded area, it can be determined that the camera is blocked from retraction. At this time, S460 can be executed. In addition, in order to further improve the accuracy of detection, S450 can also be performed.
  • S450 when it is determined that the camera may be blocked from retracting, it can be further determined whether the length of time between the camera retracted from the beginning to the current moment (ie, another example of the travel time) is greater than or equal to the preset threshold #2 (ie , An example of the second threshold): If the travel time is greater than or equal to the threshold #2 (for example, 1.2 seconds (s)), it can be determined that the camera retraction is blocked. At this time, S460 can be performed; or, if the travel time is less than the threshold# 2. At this time, you can return to S420 and continue execution from S420.
  • the preset threshold #2 ie 1.2 seconds (s)
  • the CPU controls the camera to repeatedly execute the retracting action.
  • the repeated execution of the retracting operation means that the telescopic mechanism drives the camera to continue the retracting operation from the current position.
  • S420 can be replaced with: when the travel time after the camera is retracted is equal to or greater than the threshold #2, the CPU controls the camera to take a picture and obtains the current image #2.
  • the method 400 may not include S450, that is, if it is determined in S430 that the current image #2 is not completely covered by the shadow area, it can be determined that the camera is blocked from extending, and S460 is directly executed.
  • FIG. 8 shows a schematic flowchart of a detection method 500 corresponding to external force pressing. Hereinafter, each step of the method 500 will be described in detail.
  • the camera executes the instruction to control the camera to take pictures, and obtain the current image #3 (that is, an example of the third target image).
  • the camera executes the press detection instruction and completes the acquisition of the current image #3 every 20 milliseconds (ms).
  • the CPU can determine whether the current image #3 includes a shadow area: if the current image #3 includes a shadow area, it can be determined that the camera is pressed by an external force, and execute S540; or, if the current image #3 does not include a shadow area , It means that the camera is in a normal working state, at this time, it can return to S520, and continue execution from S520.
  • the CPU controls the camera to perform a retracting action.
  • the detection method provided by the present application is described in detail above with reference to FIGS. 1 to 8, and the detection device and chip provided by the present application are described in detail below with reference to FIGS. 9 to 10.
  • FIG. 9 is a schematic block diagram of the detection device 600 provided by this application, and includes a processing module 601.
  • the processing module 601 is used to control the camera to obtain a target image.
  • the processing module 610 is further configured to determine whether the camera is in an abnormal state of expansion or contraction according to whether the target image includes a shadow area, and the abnormal expansion or contraction includes any one of obstructed extension, obstructed retraction, and external force pressing.
  • the processing module 601 is further configured to control the camera to perform a target action if the camera is in an abnormal state of expansion and contraction, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
  • the processing module 601 is specifically configured to: when the target image includes a shadow area, determine that the camera is blocked from extending, the target image is a first target image, and the first target image is in the Obtained after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, and the first target image is in the camera Obtained after starting to travel; if the camera is blocked from extending, control the camera to perform a retracting action.
  • the first target image is acquired when the traveling time of the camera is greater than or equal to a preset first threshold.
  • the processing module 601 is specifically configured to: when the target image is not completely covered by a shadow area, determine that the camera is blocked from retraction, the target image is a second target image, and the second target image Is acquired after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, the target image is the second target image, and the second target image is Obtained after the camera starts to travel; if the camera is prevented from being retracted, control the camera to repeat the retracting action.
  • the second target image is acquired when the travel time of the camera is greater than or equal to a preset second threshold.
  • the processing module 601 is specifically configured to: when the target image includes a shadow area, determine that the camera is pressed by an external force, the target image is a third target image, and the third target image is in the The camera is acquired in a normal working state; or, when the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, the target image is a third target image, and the third target image is Obtained when the camera is in a normal working state; if the camera is pressed by an external force, the camera is controlled to perform a retracting action.
  • the target image includes a non-shaded area, and a direction along which a boundary line of the shadow area and the non-shaded area follows is perpendicular to the traveling direction of the camera.
  • the device 600 of the present application may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD).
  • the above-mentioned PLD may be a complex program logic device (complex logic device).
  • programmable logical device, CPLD programmable logical device
  • FPGA field-programmable gate array
  • GAL generic array logic
  • the detection method shown in Fig. 1, Fig. 6, Fig. 7 or Fig. 8 can also be realized by software.
  • the apparatus 600 and its various modules It can also be a software module.
  • the device 600 of the present application may correspond to executing the method described in the embodiments of the present application, and the above and other operations and/or functions of each module in the device 600 are intended to implement the method shown in FIG. 1, FIG. 6, FIG. 7, or FIG. 8. For the sake of brevity, the corresponding process in, will not be repeated here.
  • FIG. 10 is a schematic diagram of the structure of the chip provided by this application.
  • the device 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704.
  • the processor 701, the memory 702, and the communication interface 703 communicate through the bus 704, and may also communicate through other means such as wireless transmission.
  • the memory 702 is used to store instructions, and the processor 701 is used to execute instructions stored in the memory 702.
  • the memory 702 stores a program code 7021, and the processor 701 can call the program code 7021 stored in the memory 702 to execute the detection method shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8.
  • the processor 701 may be a CPU, and the processor 701 may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • DSP digital signal processors
  • ASIC application specific integrated circuits
  • FPGA field programmable gate arrays
  • the general-purpose processor may be a microprocessor or any conventional processor.
  • the memory 702 may include a read-only memory and a random access memory, and provides instructions and data to the processor 701.
  • the memory 702 may also include a non-volatile random access memory.
  • the memory 702 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electrically available Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • the volatile memory may be random access memory (RAM), which is used as an external cache.
  • RAM random access memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • SDRAM synchronous dynamic random access memory
  • Double data rate synchronous dynamic random access memory double data date SDRAM, DDR SDRAM
  • enhanced SDRAM enhanced synchronous dynamic random access memory
  • SLDRAM synchronous connection dynamic random access memory
  • direct rambus RAM direct rambus RAM
  • bus 704 may also include a power bus, a control bus, and a status signal bus. However, for clear description, various buses are marked as bus 704 in FIG. 7.
  • the chip 700 according to the present application may correspond to the device 600 in the present application, and the above-mentioned and other operations and/or functions of the various modules in the chip 700 are used to implement those shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8, respectively.
  • the operation steps of the detection method, or the above and other operations and/or functions of the various modules in the chip 700 are to implement the operation steps of the detection method shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8.
  • the foregoing embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-mentioned embodiments may be implemented in the form of a computer program product in whole or in part.
  • the computer program product includes one or more computer instructions.
  • the computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • the computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • the computer instructions may be transmitted from a website, computer, server, or data center.
  • the computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more sets of available media.
  • the usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium.
  • the semiconductor medium may be a solid state drive (SSD).
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Abstract

Provided in the present application is a detection method, the method comprising: acquiring a target image by means of controlling a camera, and according to whether the target image comprises a shadow region, determining whether the camera is in an abnormal telescopic state; and when determined that the camera is in an abnormal telescopic state, taking measures so that the camera recovers from the abnormal telescopic state. The described method provides a solution for protecting a telescoping mechanism of an electronic device.

Description

检测方法、装置与设备Detection method, device and equipment
本申请要求于2019年09月11日提交中国专利局、申请号为201910859422.7、申请名称为“检测方法、装置与设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office with the application number 201910859422.7 and the application name "Detection Method, Apparatus and Equipment" on September 11, 2019, the entire content of which is incorporated into this application by reference.
技术领域Technical field
本申请涉及信息检测技术领域,并且更具体地,涉及检测方法、装置与设备。This application relates to the field of information detection technology, and more specifically, to detection methods, devices, and equipment.
背景技术Background technique
随着科技的发展,一些电子设备上配置了伸缩摄像头。当用户打开电子设备的摄像功能时,电子设备的内部的伸缩机构会驱动伸缩摄像头伸出,从而进行拍照,当拍照完成后,摄像头会缩回至电子设备的内部。With the development of science and technology, some electronic devices are equipped with telescopic cameras. When the user turns on the camera function of the electronic device, the internal telescopic mechanism of the electronic device drives the telescopic camera to extend, thereby taking pictures. When the picture is completed, the camera is retracted into the inside of the electronic device.
在摄像头伸出或者缩回过程中,有可能会由于某些原因导致摄像头被卡住,即摄像头不能完全伸出或者不能完全缩回,此时,伸缩机构并不能感知摄像头已经被卡住这一情况,仍会继续工作,这种情况极容易导致电子设备的伸缩机构受损。When the camera is extended or retracted, the camera may be stuck due to some reasons, that is, the camera cannot be fully extended or retracted. At this time, the telescopic mechanism cannot sense that the camera has been stuck. In this case, it will continue to work, and this situation is extremely easy to cause damage to the telescopic mechanism of the electronic device.
因此,有必要提出一种检测摄像头伸缩位置的方法,从而保护电子设备的伸缩机构。Therefore, it is necessary to propose a method for detecting the telescopic position of the camera to protect the telescopic mechanism of the electronic device.
发明内容Summary of the invention
本申请提供一种检测方法,能够保护电子设备的伸缩机构。The present application provides a detection method that can protect the telescopic mechanism of an electronic device.
第一方面,提供了一种检测方法,包括:控制摄像头获取目标图像;根据所述目标图像是否包括阴影区域,确定所述摄像头是否处于伸缩异常状态,所述伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种;如果所述摄像头处于伸缩异常状态,控制所述摄像头执行目标动作,所述目标动作使所述摄像头从所述伸缩异常状态中恢复。In a first aspect, a detection method is provided, which includes: controlling a camera to obtain a target image; determining whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area, and the abnormal expansion and contraction includes obstruction of extension and retraction. Any one of obstruction and external force pressing; if the camera is in an abnormal state of expansion and contraction, the camera is controlled to perform a target action, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
基于上述技术方案,通过控制摄像头获取目标图像,并根据目标图像是否包括阴影区域,确定摄像头是否处于伸缩异常状态,在确定摄像头处于伸缩异常状态时,采取措施使得摄像头从伸缩异常状态中恢复,从而达到保护电子设备的伸缩机构的目的。Based on the above technical solution, the target image is acquired by controlling the camera, and whether the camera is in an abnormal state of expansion and contraction is determined according to whether the target image includes a shadow area. When it is determined that the camera is in an abnormal state of expansion and contraction, measures are taken to make the camera recover from the abnormal state of expansion and contraction, thereby To achieve the purpose of protecting the telescopic mechanism of electronic equipment.
在一种实现方式中,所述确定所述摄像头是否处于伸缩异常状态,包括:当所述目标图像包括阴影区域时,确定所述摄像头伸出受阻,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头正常伸出,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;如果所述摄像头伸出受阻,所述控制所述摄像头执行目标动作,包括:控制所述摄像头执行缩回动作。In an implementation manner, the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image includes a shadow area, determining that the camera is blocked from extending, and the target image is the first target image, so The first target image is acquired after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, and the first target image is A target image is acquired after the camera starts to travel; if the camera is prevented from extending, the controlling the camera to perform the target action includes: controlling the camera to perform a retracting action.
基于上述技术方案,通过控制摄像头获取目标图像,并根据目标图像是否包括阴影区域,确定摄像头是否伸出异常,在确定摄像头伸出异常时控制摄像头执行缩回动作,从而达到保护电子设备的伸缩机构的目的。Based on the above technical solution, the target image is obtained by controlling the camera, and according to whether the target image includes a shadow area, it is determined whether the camera is extended abnormally, and when the camera is determined to be abnormally extended, the camera is controlled to perform a retracting action, so as to protect the telescopic mechanism of the electronic device the goal of.
在一种实现方式中,所述第一目标图像是在所述摄像头的行进时长大于或等于预设的第一阈值时获取的。In an implementation manner, the first target image is acquired when the travel time of the camera is greater than or equal to a preset first threshold.
基于上述技术方案,通过仅在摄像头的行进时长大于或等于预设的第一阈值时获取目标图像,使得在摄像头的行进时长小于预设的第一阈值时不用获取目标图像,从而在保护电子设备的伸缩机构的同时减少摄像头获取目标图像的次数。Based on the above technical solution, the target image is acquired only when the travel time of the camera is greater than or equal to the preset first threshold, so that the target image does not need to be acquired when the travel time of the camera is less than the preset first threshold, thereby protecting the electronic equipment The telescopic mechanism reduces the number of times the camera acquires the target image.
在一种实现方式中,所述确定所述摄像头是否处于伸缩异常状态,包括:当所述目标图像未完全被阴影区域覆盖时,确定所述摄像头缩回受阻,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像完全被阴影区域覆盖时,确定所述摄像头正常缩回,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;如果所述摄像头缩回受阻,所述控制所述摄像头执行目标动作,包括:控制所述摄像头重复执行缩回动作。In an implementation manner, the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image is not completely covered by a shadow area, determining that the camera is blocked from being retracted, and the target image is the second target Image, the second target image is obtained after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, and the target image is the second target image The second target image is acquired after the camera starts to travel; if the camera is prevented from being retracted, the controlling the camera to perform the target action includes: controlling the camera to repeatedly perform the retracting action.
基于上述技术方案,通过控制摄像头获取目标图像,并根据目标图像是否完全被阴影区域覆盖,确定摄像头是否缩回异常,在确定摄像头缩回异常时控制摄像头重复执行缩回动作,从而达到保护电子设备的伸缩机构的目的。Based on the above technical solution, the target image is acquired by controlling the camera, and according to whether the target image is completely covered by the shadow area, it is determined whether the camera is retracted abnormally, and the camera is controlled to repeat the retracting action when it is determined that the camera retracts abnormally, so as to protect the electronic equipment The purpose of the telescopic mechanism.
在一种实现方式中,所述第二目标图像是在所述摄像头的行进时长大于或等于预设的第二阈值时获取的。In an implementation manner, the second target image is acquired when the traveling time of the camera is greater than or equal to a preset second threshold.
基于上述技术方案,通过仅在摄像头的行进时长大于或等于预设的第二阈值时获取目标图像,使得在摄像头的行进时长小于预设的第二阈值时不用获取目标图像,从而在保护电子设备的伸缩机构的同时减少摄像头获取目标图像的次数。Based on the above technical solution, the target image is acquired only when the travel time of the camera is greater than or equal to the preset second threshold, so that the target image does not need to be acquired when the travel time of the camera is less than the preset second threshold, thereby protecting the electronic equipment The telescopic mechanism reduces the number of times the camera acquires the target image.
在一种实现方式中,所述确定所述摄像头是否处于伸缩异常状态,包括:当所述目标图像包括阴影区域时,确定所述摄像头受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头未受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;如果所述摄像头受到外力按压,所述控制所述摄像头执行目标动作,包括:控制所述摄像头执行缩回动作。In an implementation manner, the determining whether the camera is in an abnormal state of expansion and contraction includes: when the target image includes a shadow area, determining that the camera is pressed by an external force, and the target image is a third target image, so The third target image is obtained when the camera is in a normal working state; or, when the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, and the target image is the third target image, The third target image is obtained when the camera is in a normal working state; if the camera is pressed by an external force, controlling the camera to perform a target action includes: controlling the camera to perform a retracting action.
基于上述技术方案,通过在摄像头正常伸出后控制摄像头获取目标图像,并根据目标图像是否包括阴影区域,确定摄像头是否存在外力按压,在确定摄像头存在外力按压时控制摄像头执行缩回动作,从而达到保护电子设备的伸缩机构的目的。Based on the above technical solution, by controlling the camera to obtain the target image after the camera is normally extended, and determining whether the camera is pressed by external force according to whether the target image includes a shadow area, and controlling the camera to perform a retracting action when it is determined that the camera is pressed by external force, so as to achieve The purpose of protecting the telescopic mechanism of electronic equipment.
在一种实现方式中,所述目标图像包括非阴影区域,所述阴影区域与所述非阴影区域的分界线所沿的方向与所述摄像头的行进方向垂直。In an implementation manner, the target image includes a non-shaded area, and a direction along which a boundary line of the shadow area and the non-shaded area follows is perpendicular to the traveling direction of the camera.
第二方面,提供一种检测装置,该装置用于执行上述第一方面或第一方面的任一可能的实现方式中的方法。具体地,该装置可以包括用于执行第一方面及其任意一种可能的实现方式中的检测方法的模块。In a second aspect, a detection device is provided, which is configured to execute the foregoing first aspect or any possible implementation of the first aspect. Specifically, the device may include a module for executing the detection method in the first aspect and any one of its possible implementation manners.
第三方面,提供一种芯片,该芯片配置有存储器与处理器。该存储器用于存储指令;该处理器执行该存储器存储的指令,使得该设备执行第一方面及其任意一种可能的实现方式中的检测方法。In a third aspect, a chip is provided, and the chip is configured with a memory and a processor. The memory is used to store instructions; the processor executes the instructions stored in the memory, so that the device executes the detection method in the first aspect and any one of its possible implementation manners.
第四方面,提供一种设备,该设备配置有第四方面的芯片,该芯片配置有存储器与处理器。该存储器用于存储指令;该处理器执行该存储器存储的指令,使得该设备执行第一方面及其任意一种可能的实现方式中的检测方法。In a fourth aspect, a device is provided, and the device is configured with the chip of the fourth aspect, and the chip is configured with a memory and a processor. The memory is used to store instructions; the processor executes the instructions stored in the memory, so that the device executes the detection method in the first aspect and any one of its possible implementation manners.
第五方面,提供了一种程序,该程序在被处理器执行时,用于执行第一方面及其可能的实施方式中的任一方法。In a fifth aspect, a program is provided, when the program is executed by a processor, it is used to execute any method in the first aspect and its possible implementation manners.
第六方面,提供了一种程序产品,所述程序产品包括:程序代码,当所述程序代码被芯片运行时,使得芯片执行上述第一方面及其可能的实施方式中的任一方法。In a sixth aspect, a program product is provided, the program product comprising: program code, which when the program code is executed by a chip, causes the chip to execute any method in the first aspect and its possible implementation manners.
第七方面,提供一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行第一方面及其任意一种可能的实现方式中的检测方法。In a seventh aspect, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions run on a computer, the computer executes the first aspect and any one of its possible implementations. Detection method.
本申请在上述各方面提供的实现方式的基础上,还可以进行进一步组合以提供更多实现方式。On the basis of the implementation manners provided in the above aspects, this application can be further combined to provide more implementation manners.
附图说明Description of the drawings
图1是本申请提供的检测方法的示意性流程图;Fig. 1 is a schematic flow chart of the detection method provided by the present application;
图2是阴影区域与非阴影区域在目标图像中的分布情况;Figure 2 shows the distribution of shadowed and non-shaded areas in the target image;
图3是阴影区域与非阴影区域在目标图像中的另一分布情况;Figure 3 is another distribution of the shadow area and the non-shadow area in the target image;
图4是阴影区域与非阴影区域在目标图像中的另一分布情况;Figure 4 is another distribution of the shadow area and the non-shadow area in the target image;
图5是阴影区域与非阴影区域在目标图像中的另一分布情况;Figure 5 is another distribution of shadow areas and non-shadow areas in the target image;
图6是本申请提供的检测方法的另一示意性流程图;Fig. 6 is another schematic flowchart of the detection method provided by the present application;
图7是本申请提供的检测方法的另一示意性流程图;FIG. 7 is another schematic flowchart of the detection method provided by the present application;
图8是本申请提供的检测方法的另一示意性流程图;FIG. 8 is another schematic flowchart of the detection method provided by the present application;
图9为本申请提供的检测装置的结构示意图;FIG. 9 is a schematic diagram of the structure of the detection device provided by this application;
图10为本申请提供的芯片的结构示意图。FIG. 10 is a schematic diagram of the structure of the chip provided by this application.
具体实施方式detailed description
下面将结合附图,对本申请中的技术方案进行描述。The technical solution in this application will be described below in conjunction with the accompanying drawings.
随着科技的发展,一些电子设备上配置了伸缩摄像头。当用户打开电子设备的摄像功能时,电子设备的内部的伸缩机构会驱动伸缩摄像头伸出,从而进行拍照,当拍照完成后,摄像头会缩回至电子设备的内部。With the development of science and technology, some electronic devices are equipped with telescopic cameras. When the user turns on the camera function of the electronic device, the internal telescopic mechanism of the electronic device drives the telescopic camera to extend, thereby taking pictures. When the picture is completed, the camera is retracted into the inside of the electronic device.
在摄像头伸出或者缩回过程中,有可能会由于某些原因导致摄像头被卡住,即摄像头不能完全伸出或者不能完全缩回,此时,伸缩机构并不能感知摄像头已经被卡住这一情况,仍会继续工作,这种情况极容易导致电子设备的伸缩机构受损。When the camera is extended or retracted, the camera may be stuck due to some reasons, that is, the camera cannot be fully extended or retracted. At this time, the telescopic mechanism cannot sense that the camera has been stuck. In this case, it will continue to work, and this situation is extremely easy to cause damage to the telescopic mechanism of the electronic device.
因此,本申请提供了一种检测方法,以期能够达到保护电子设备的伸缩机构的目的。Therefore, the present application provides a detection method in order to achieve the purpose of protecting the telescopic mechanism of the electronic device.
本申请实施例的电子设备可以是各种具有伸缩摄像头的设备,例如,该电子设备可以是手机、手环、显示器、平板电脑、手表、可穿戴设备、便携机等。The electronic device in the embodiments of the present application may be various devices with telescopic cameras. For example, the electronic device may be a mobile phone, a bracelet, a display, a tablet computer, a watch, a wearable device, a portable computer, and the like.
以下以手机中的前置摄像头为伸缩摄像头为例,结合图1至图8,对本申请提供的检测方法200进行详细说明。In the following, taking the front camera in the mobile phone as a retractable camera as an example, the detection method 200 provided in the present application will be described in detail with reference to FIGS. 1 to 8.
图1是本申请提供的检测方法200的示意性流程图。下面,对方法200的每个步骤进行详细说明。FIG. 1 is a schematic flowchart of a detection method 200 provided in the present application. Hereinafter, each step of the method 200 will be described in detail.
在S210中,控制摄像头获取目标图像。In S210, the camera is controlled to obtain a target image.
在S220中,根据目标图像是否包括阴影区域,确定摄像头是否处于伸缩异常状态,伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种。In S220, it is determined whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area. The abnormal expansion and contraction includes any one of obstructed extension, obstructed retraction, and external force pressing.
在S230中,如果摄像头处于伸缩异常状态,控制摄像头执行目标动作,目标动作使摄像头从伸缩异常状态中恢复。In S230, if the camera is in an abnormal state of expansion and contraction, the camera is controlled to perform a target action, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
具体而言,在需要检测手机的前置摄像头(以下简称为“摄像头”)是否发生伸缩异常时,可以控制摄像头进行拍照,从而获得当前图像(即,目标图像的一例)。Specifically, when it is necessary to detect whether the front camera of the mobile phone (hereinafter referred to as the "camera") has an abnormal expansion or contraction, the camera can be controlled to take a picture, so as to obtain the current image (ie, an example of the target image).
根据当前图像是否包括阴影区域,可以确定摄像头是否处于伸缩异常状态,进而控制摄像头执行相应动作(即,目标动作的一例),从而使得摄像头从异常状态中恢复。According to whether the current image includes a shadow area, it can be determined whether the camera is in an abnormal state of expansion and contraction, and then the camera is controlled to perform a corresponding action (that is, an example of a target action), so that the camera can recover from the abnormal state.
当目标图像既包括阴影区域,又包括非阴影区域(即,摄像头未被遮挡部分拍摄的图像)时,阴影区域与非阴影区域的分界线所沿的方向与摄像头的行进方向垂直。下面以几种情况为例,对当目标图像既包括阴影区域,又包括非阴影区域时,阴影区域与非阴影区域在目标图像中的分布情况进行说明。When the target image includes both a shadow area and a non-shadow area (that is, an image captured by the unobstructed part of the camera), the direction along which the boundary line of the shadow area and the non-shadow area is perpendicular to the traveling direction of the camera. The following takes several cases as examples to illustrate the distribution of the shadow area and the non-shadow area in the target image when the target image includes both a shadow area and a non-shadow area.
情况#1Situation #1
当摄像头配置在手机的上边缘时,摄像头伸出或者缩回时的行进方向与手机的上边缘垂直,此时,阴影区域与非阴影区域在目标图像中的分布情况如图2所示,可以看出,阴影区域与非阴影区域的分界线所沿的方向与摄像头的行进方向垂直。When the camera is configured on the upper edge of the mobile phone, the direction of travel when the camera is extended or retracted is perpendicular to the upper edge of the mobile phone. At this time, the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 2. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
情况#2Situation #2
当摄像头配置在手机的下边缘时,摄像头伸出或者缩回时的行进方向与手机的下边缘垂直,此时,阴影区域与非阴影区域在目标图像中的分布情况如图3所示,可以看出,阴影区域与非阴影区域的分界线所沿的方向与摄像头的行进方向垂直。When the camera is configured on the lower edge of the mobile phone, the direction of travel when the camera is extended or retracted is perpendicular to the lower edge of the mobile phone. At this time, the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 3. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
情况#3Situation #3
当摄像头配置在手机的左边缘时,摄像头伸出或者缩回时的行进方向与手机的左边缘垂直,此时,阴影区域与非阴影区域在目标图像中的分布情况如图4所示,可以看出,阴影区域与非阴影区域的分界线所沿的方向与摄像头的行进方向垂直。When the camera is configured on the left edge of the mobile phone, the direction of travel when the camera is extended or retracted is perpendicular to the left edge of the mobile phone. At this time, the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 4. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
情况#4Situation #4
当摄像头配置在手机的右边缘时,摄像头伸出或者缩回时的行进方向与手机的右边缘垂直,此时,阴影区域与非阴影区域在目标图像中的分布情况如图5所示,可以看出,阴影区域与非阴影区域的分界线所沿的方向与摄像头的行进方向垂直。When the camera is configured on the right edge of the mobile phone, the direction of travel when the camera is extended or retracted is perpendicular to the right edge of the mobile phone. At this time, the distribution of the shadow area and the non-shadow area in the target image is shown in Figure 5. It can be seen that the direction along which the boundary between the shaded area and the non-shaded area is perpendicular to the traveling direction of the camera.
需要说明的是,图2至图5中的摄像头的位置仅仅是为了说明情况所做的举例,并不与目标图像中阴影区域与非阴影区域的分布情况严格对应。It should be noted that the positions of the cameras in FIGS. 2 to 5 are merely examples for illustrating the situation, and do not strictly correspond to the distribution of shadow areas and non-shadow areas in the target image.
下面详细阐述本申请针对伸出受阻、缩回受阻以及外力按压三种伸缩异常状态提出的检测方法。The following describes in detail the detection methods proposed in this application for the three abnormal expansion and contraction states: obstructed extension, obstructed retraction, and external force pressing.
情况#1伸出受阻Situation #1 Restricted to reach out
图6示出了伸出受阻对应的检测方法300的示意性流程图。下面,对方法300的每个步骤进行详细说明。FIG. 6 shows a schematic flow chart of the detection method 300 corresponding to the hindered extension. Hereinafter, each step of the method 300 will be described in detail.
在S310中,在检测摄像头是否伸出受阻时,手机中的控制装置(例如,中央处理器(central processing unit,CPU))向手机中的伸缩机构发出伸出指令,之后,伸出机构执行该指令并驱动摄像头伸出。In S310, when detecting whether the camera is blocked, the control device in the mobile phone (for example, the central processing unit (CPU)) issues an extension instruction to the telescopic mechanism in the mobile phone, and then the extension mechanism executes the extension instruction. Command and drive the camera to extend.
在S320中,当摄像头开始伸出后,CPU可以控制摄像头拍照,获取当前图像#1(即,第一目标图像的一例)。In S320, when the camera starts to extend, the CPU can control the camera to take a picture, and obtain the current image #1 (that is, an example of the first target image).
在S330中,CPU可以判断当前图像#1是否完全没有阴影区域:如果当前图像#1完 全没有阴影区域,则可以确定摄像头已经完全伸出,执行S340;或者,如果当前图像#1存在阴影区域,则可以确定摄像头伸出受阻,此时,可以执行S360。此外,为了进一步提高检测的准确性,还可以执行S350。In S330, the CPU can determine whether the current image #1 has no shadow area at all: if the current image #1 has no shadow area at all, it can be determined that the camera has been fully extended and execute S340; or, if the current image #1 has a shadow area, It can be determined that the camera is blocked from being extended. At this time, S360 can be executed. In addition, in order to further improve the accuracy of detection, S350 can also be executed.
在S340中,检测结束。In S340, the detection ends.
在S350中,当确定摄像头可能伸出受阻时,可以进一步判断摄像头从开始伸出至当前时刻之间的时间长度(即,行进时长的一例)是否大于或等于预设的阈值#1(即,第一阈值的一例):如果行进时长大于或等于阈值#1(例如,1.2秒(s)),则可以确定摄像头伸出受阻,此时,可以执行S360;或者,如果行进时长小于阈值#1,此时,可以返回至S320,从S320处继续执行。In S350, when it is determined that the camera may be blocked from extending, it can be further determined whether the length of time between the camera extending from the beginning to the current moment (i.e., an example of travel time) is greater than or equal to the preset threshold #1 (i.e., An example of the first threshold): If the travel time is greater than or equal to the threshold #1 (for example, 1.2 seconds (s)), it can be determined that the camera extension is blocked. At this time, S360 can be executed; or, if the travel time is less than the threshold #1 At this time, you can return to S320 and continue execution from S320.
在S360中,CPU控制摄像头执行缩回动作。In S360, the CPU controls the camera to perform a retracting action.
需要说明的是,在方法300中,S320可以替换为:当摄像头伸出后的行进时长等于或者大于阈值#1时,CPU控制摄像头拍照,获取当前图像#1。此时,方法300中可以不包括S350,即,如果在S330中确定当前图像#1存在阴影区域,则可以确定摄像头伸出受阻,直接执行S360。It should be noted that, in the method 300, S320 can be replaced with: when the travel time after the camera is extended is equal to or greater than the threshold #1, the CPU controls the camera to take a picture and obtains the current image #1. At this time, the method 300 may not include S350, that is, if it is determined in S330 that the current image #1 has a shadow area, it may be determined that the camera is blocked from extending, and S360 is directly executed.
情况#2缩回受阻Situation #2 Retraction blocked
图7示出了缩回受阻对应的检测方法400的示意性流程图。下面,对方法400的每个步骤进行详细说明。FIG. 7 shows a schematic flow chart of the detection method 400 corresponding to the obstruction of retraction. Hereinafter, each step of the method 400 will be described in detail.
在S410中,在检测摄像头是否缩回受阻时,CPU向手机中的伸缩机构发出缩回指令,之后,伸出机构执行该指令并驱动摄像头缩回。In S410, when detecting whether the camera is blocked from being retracted, the CPU issues a retracting instruction to the telescopic mechanism in the mobile phone, and then the extending mechanism executes the instruction and drives the camera to retract.
在S420中,当摄像头开始缩回后,CPU可以控制摄像头拍照,获取当前图像#2(即,第二目标图像的一例)。In S420, when the camera starts to retract, the CPU may control the camera to take a picture, and obtain the current image #2 (ie, an example of the second target image).
在S430中,CPU可以判断当前图像#2是否完全被阴影区域覆盖:如果当前图像#2完全被阴影区域覆盖,则可以确定摄像头已经完全缩回,执行S440;或者,如果当前图像#2没有完全被阴影区域覆盖,则可以确定摄像头缩回受阻,此时,可以执行S460。此外,为了进一步提高检测的准确性,还可以执行S450。In S430, the CPU can determine whether the current image #2 is completely covered by the shadow area: if the current image #2 is completely covered by the shadow area, it can be determined that the camera has been completely retracted and execute S440; or, if the current image #2 is not completely covered If it is covered by the shaded area, it can be determined that the camera is blocked from retraction. At this time, S460 can be executed. In addition, in order to further improve the accuracy of detection, S450 can also be performed.
在S440中,检测结束。In S440, the detection ends.
在S450中,当确定摄像头可能缩回受阻时,可以进一步判断摄像头从开始缩回至当前时刻之间的时间长度(即,行进时长的另一例)是否大于或等于预设的阈值#2(即,第二阈值的一例):如果行进时长大于或等于阈值#2(例如,1.2秒(s)),则可以确定摄像头缩回受阻,此时,可以执行S460;或者,如果行进时长小于阈值#2,此时,可以返回至S420,从S420处继续执行。In S450, when it is determined that the camera may be blocked from retracting, it can be further determined whether the length of time between the camera retracted from the beginning to the current moment (ie, another example of the travel time) is greater than or equal to the preset threshold #2 (ie , An example of the second threshold): If the travel time is greater than or equal to the threshold #2 (for example, 1.2 seconds (s)), it can be determined that the camera retraction is blocked. At this time, S460 can be performed; or, if the travel time is less than the threshold# 2. At this time, you can return to S420 and continue execution from S420.
在S460中,CPU控制摄像头重复执行缩回动作。In S460, the CPU controls the camera to repeatedly execute the retracting action.
需要说明的是,此处的重复执行缩回操作是指伸缩机构驱动摄像头从当前位置继续执行缩回动作。It should be noted that the repeated execution of the retracting operation here means that the telescopic mechanism drives the camera to continue the retracting operation from the current position.
需要说明的是,在方法400中,S420可以替换为:当摄像头缩回后的行进时长等于或者大于阈值#2时,CPU控制摄像头拍照,获取当前图像#2。此时,方法400中可以不包括S450,即,如果在S430中确定当前图像#2没有完全被阴影区域覆盖,则可以确定摄像头伸出受阻,直接执行S460。It should be noted that, in the method 400, S420 can be replaced with: when the travel time after the camera is retracted is equal to or greater than the threshold #2, the CPU controls the camera to take a picture and obtains the current image #2. At this time, the method 400 may not include S450, that is, if it is determined in S430 that the current image #2 is not completely covered by the shadow area, it can be determined that the camera is blocked from extending, and S460 is directly executed.
情况#3外力按压Situation #3 External force pressing
图8示出了外力按压对应的检测方法500的示意性流程图。下面,对方法500的每个步骤进行详细说明。FIG. 8 shows a schematic flowchart of a detection method 500 corresponding to external force pressing. Hereinafter, each step of the method 500 will be described in detail.
在S510中,当CPU驱动摄像头完成了一次正常伸出后,即,摄像头目前处于完全伸出状态,也即,摄像头处于正常工作状态,CPU可以向摄像头发出按压检测指令。In S510, after the CPU drives the camera to complete a normal extension, that is, the camera is currently in a fully extended state, that is, the camera is in a normal working state, and the CPU can issue a pressing detection instruction to the camera.
在S520中,摄像头接收到按压检测指令后,执行该指令控制摄像头拍照,获取当前图像#3(即,第三目标图像的一例)。例如,摄像头执行按压检测指令,每20毫秒(ms)完成一次对当前图像#3的获取。In S520, after the camera receives the press detection instruction, it executes the instruction to control the camera to take pictures, and obtain the current image #3 (that is, an example of the third target image). For example, the camera executes the press detection instruction and completes the acquisition of the current image #3 every 20 milliseconds (ms).
在S530中,CPU可以判断当前图像#3是否包括阴影区域:如果当前图像#3包括阴影区域,则可以确定摄像头存在被外力按压的情况,执行S540;或者,如果当前图像#3不包括阴影区域,则说明摄像头处于正常工作状态,此时可以返回至S520,从S520处继续执行。In S530, the CPU can determine whether the current image #3 includes a shadow area: if the current image #3 includes a shadow area, it can be determined that the camera is pressed by an external force, and execute S540; or, if the current image #3 does not include a shadow area , It means that the camera is in a normal working state, at this time, it can return to S520, and continue execution from S520.
在S540中,CPU控制摄像头执行缩回动作。In S540, the CPU controls the camera to perform a retracting action.
在S550中,检测结束。In S550, the detection ends.
上文结合图1至图8详细介绍了本申请提供的检测方法,下文结合图9至图10详细地描述本申请的提供的检测装置与芯片。The detection method provided by the present application is described in detail above with reference to FIGS. 1 to 8, and the detection device and chip provided by the present application are described in detail below with reference to FIGS. 9 to 10.
图9为本申请提供的检测装置600的示意性框图,包括处理模块601。FIG. 9 is a schematic block diagram of the detection device 600 provided by this application, and includes a processing module 601.
处理模块601,用于控制摄像头获取目标图像。The processing module 601 is used to control the camera to obtain a target image.
处理模块610,还用于根据所述目标图像是否包括阴影区域,确定所述摄像头是否处于伸缩异常状态,所述伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种。The processing module 610 is further configured to determine whether the camera is in an abnormal state of expansion or contraction according to whether the target image includes a shadow area, and the abnormal expansion or contraction includes any one of obstructed extension, obstructed retraction, and external force pressing.
处理模块601,还用于如果所述摄像头处于伸缩异常状态,控制所述摄像头执行目标动作,所述目标动作使所述摄像头从所述伸缩异常状态中恢复。The processing module 601 is further configured to control the camera to perform a target action if the camera is in an abnormal state of expansion and contraction, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
可选的,所述处理模块601具体用于:当所述目标图像包括阴影区域时,确定所述摄像头伸出受阻,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头正常伸出,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;如果所述摄像头伸出受阻,控制所述摄像头执行缩回动作。Optionally, the processing module 601 is specifically configured to: when the target image includes a shadow area, determine that the camera is blocked from extending, the target image is a first target image, and the first target image is in the Obtained after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, and the first target image is in the camera Obtained after starting to travel; if the camera is blocked from extending, control the camera to perform a retracting action.
可选的,所述第一目标图像是在所述摄像头的行进时长大于或等于预设的第一阈值时获取的。Optionally, the first target image is acquired when the traveling time of the camera is greater than or equal to a preset first threshold.
可选的,所述处理模块601具体用于:当所述目标图像未完全被阴影区域覆盖时,确定所述摄像头缩回受阻,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像完全被阴影区域覆盖时,确定所述摄像头正常缩回,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;如果所述摄像头缩回受阻,控制所述摄像头重复执行缩回动作。Optionally, the processing module 601 is specifically configured to: when the target image is not completely covered by a shadow area, determine that the camera is blocked from retraction, the target image is a second target image, and the second target image Is acquired after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, the target image is the second target image, and the second target image is Obtained after the camera starts to travel; if the camera is prevented from being retracted, control the camera to repeat the retracting action.
可选的,所述第二目标图像是在所述摄像头的行进时长大于或等于预设的第二阈值时获取的。Optionally, the second target image is acquired when the travel time of the camera is greater than or equal to a preset second threshold.
可选的,所述处理模块601具体用于:当所述目标图像包括阴影区域时,确定所述摄像头受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头未受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常 工作状态下获取的;如果所述摄像头受到外力按压,控制所述摄像头执行缩回动作。Optionally, the processing module 601 is specifically configured to: when the target image includes a shadow area, determine that the camera is pressed by an external force, the target image is a third target image, and the third target image is in the The camera is acquired in a normal working state; or, when the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, the target image is a third target image, and the third target image is Obtained when the camera is in a normal working state; if the camera is pressed by an external force, the camera is controlled to perform a retracting action.
可选的,所述目标图像包括非阴影区域,所述阴影区域与所述非阴影区域的分界线所沿的方向与所述摄像头的行进方向垂直。Optionally, the target image includes a non-shaded area, and a direction along which a boundary line of the shadow area and the non-shaded area follows is perpendicular to the traveling direction of the camera.
应理解的是,本申请的装置600可以通过专用集成电路(application-specific integrated circuit,ASIC)实现,或可编程逻辑器件(programmable logic device,PLD)实现,上述PLD可以是复杂程序逻辑器件(complex programmable logical device,CPLD),现场可编程门阵列(field-programmable gate array,FPGA),通用阵列逻辑(generic array logic,GAL)或其任意组合。也可以通过软件实现图1、图6、图7或图8所示的检测方法,当通过软件实现图1、图6、图7或图8所示的检测方法时,装置600及其各个模块也可以为软件模块。It should be understood that the device 600 of the present application may be implemented by an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The above-mentioned PLD may be a complex program logic device (complex logic device). programmable logical device, CPLD), field-programmable gate array (FPGA), generic array logic (GAL) or any combination thereof. The detection method shown in Fig. 1, Fig. 6, Fig. 7 or Fig. 8 can also be realized by software. When the detection method shown in Fig. 1, Fig. 6, Fig. 7 or Fig. 8 is realized by software, the apparatus 600 and its various modules It can also be a software module.
本申请的装置600可对应于执行本申请实施例中描述的方法,并且装置600中的各个模块的上述和其它操作和/或功能为了实现图1、图6、图7或图8所示方法中的相应流程,为了简洁,在此不再赘述。The device 600 of the present application may correspond to executing the method described in the embodiments of the present application, and the above and other operations and/or functions of each module in the device 600 are intended to implement the method shown in FIG. 1, FIG. 6, FIG. 7, or FIG. 8. For the sake of brevity, the corresponding process in, will not be repeated here.
图10为本申请提供的芯片的结构示意图。如图10所示,所述设备700包括处理器701、存储器702、通信接口703和总线704。其中,处理器701、存储器702、通信接口703通过总线704进行通信,也可以通过无线传输等其他手段实现通信。该存储器702用于存储指令,该处理器701用于执行该存储器702存储的指令。该存储器702存储程序代码7021,且处理器701可以调用存储器702中存储的程序代码7021执行图1、图6、图7或图8所示的检测方法。FIG. 10 is a schematic diagram of the structure of the chip provided by this application. As shown in FIG. 10, the device 700 includes a processor 701, a memory 702, a communication interface 703, and a bus 704. Among them, the processor 701, the memory 702, and the communication interface 703 communicate through the bus 704, and may also communicate through other means such as wireless transmission. The memory 702 is used to store instructions, and the processor 701 is used to execute instructions stored in the memory 702. The memory 702 stores a program code 7021, and the processor 701 can call the program code 7021 stored in the memory 702 to execute the detection method shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8.
应理解,在本申请中,处理器701可以是CPU,处理器701还可以是其他通用处理器、数字信号处理器(DSP)、专用集成电路(ASIC)、现场可编程门阵列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者是任何常规的处理器等。It should be understood that in this application, the processor 701 may be a CPU, and the processor 701 may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA), or Other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.
该存储器702可以包括只读存储器和随机存取存储器,并向处理器701提供指令和数据。存储器702还可以包括非易失性随机存取存储器。该存储器702可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data date SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。The memory 702 may include a read-only memory and a random access memory, and provides instructions and data to the processor 701. The memory 702 may also include a non-volatile random access memory. The memory 702 may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), and electrically available Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of exemplary but not restrictive description, many forms of RAM are available, such as static random access memory (static RAM, SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (synchronous DRAM, SDRAM), Double data rate synchronous dynamic random access memory (double data date SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory (synchlink DRAM, SLDRAM) and direct Memory bus random access memory (direct rambus RAM, DR RAM).
该总线704除包括数据总线之外,还可以包括电源总线、控制总线和状态信号总线等。但是为了清楚说明起见,在图7中将各种总线都标为总线704。In addition to the data bus, the bus 704 may also include a power bus, a control bus, and a status signal bus. However, for clear description, various buses are marked as bus 704 in FIG. 7.
应理解,根据本申请的芯片700可对应于本申请中的装置600,芯片700中的各个模 块的上述和其它操作和/或功能分别为了实现图1、图6、图7或图8所示的检测方法的操作步骤,或者,芯片700中的各个模块的上述和其它操作和/或功能分别为了实现图1、图6、图7或图8所示的检测方法的操作步骤,为了简洁,在此不再赘述。It should be understood that the chip 700 according to the present application may correspond to the device 600 in the present application, and the above-mentioned and other operations and/or functions of the various modules in the chip 700 are used to implement those shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8, respectively. The operation steps of the detection method, or the above and other operations and/or functions of the various modules in the chip 700 are to implement the operation steps of the detection method shown in FIG. 1, FIG. 6, FIG. 7 or FIG. 8. For the sake of brevity, I won't repeat them here.
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在计算机上加载或执行所述计算机程序指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘(solid state drive,SSD)。The foregoing embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented by software, the above-mentioned embodiments may be implemented in the form of a computer program product in whole or in part. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center. Transmission to another website site, computer, server or data center via wired (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server or a data center that includes one or more sets of available media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium may be a solid state drive (SSD).
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。A person of ordinary skill in the art may be aware that the units and algorithm steps of the examples described in the embodiments disclosed in this document can be implemented by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are executed by hardware or software depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, which is not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. For example, the device embodiments described above are merely illustrative, for example, the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随 机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in this application. Should be covered within the scope of protection of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.

Claims (21)

  1. 一种检测方法,其特征在于,包括:A detection method, characterized in that it comprises:
    控制摄像头获取目标图像;Control the camera to obtain the target image;
    根据所述目标图像是否包括阴影区域,确定所述摄像头是否处于伸缩异常状态,所述伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种;Determine whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area, and the abnormal expansion and contraction includes any one of obstructed extension, obstructed retraction, and external force pressing;
    如果所述摄像头处于伸缩异常状态,控制所述摄像头执行目标动作,所述目标动作使所述摄像头从所述伸缩异常状态中恢复。If the camera is in an abnormal state of expansion and contraction, the camera is controlled to perform a target action, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述摄像头是否处于伸缩异常状态,包括:The method according to claim 1, wherein the determining whether the camera is in an abnormal state of expansion and contraction comprises:
    当所述目标图像包括阴影区域时,确定所述摄像头伸出受阻,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;或,When the target image includes a shadow area, it is determined that the camera is blocked from being extended, the target image is a first target image, and the first target image is acquired after the camera starts to travel; or,
    当所述目标图像不包括阴影区域时,确定所述摄像头正常伸出,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;When the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is a first target image, and the first target image is acquired after the camera starts to travel;
    如果所述摄像头伸出受阻,所述控制所述摄像头执行目标动作,包括:If the extension of the camera is blocked, the controlling the camera to perform a target action includes:
    控制所述摄像头执行缩回动作。Control the camera to perform a retracting action.
  3. 根据权利要求2所述的方法,其特征在于,所述第一目标图像是在所述摄像头的行进时长大于或等于预设的第一阈值时获取的。The method according to claim 2, wherein the first target image is acquired when the travel time of the camera is greater than or equal to a preset first threshold.
  4. 根据权利要求1所述的方法,其特征在于,所述确定所述摄像头是否处于伸缩异常状态,包括:The method according to claim 1, wherein the determining whether the camera is in an abnormal state of expansion and contraction comprises:
    当所述目标图像未完全被阴影区域覆盖时,确定所述摄像头缩回受阻,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;或,When the target image is not completely covered by the shadow area, it is determined that the retraction of the camera is blocked, the target image is a second target image, and the second target image is acquired after the camera starts to travel; or,
    当所述目标图像完全被阴影区域覆盖时,确定所述摄像头正常缩回,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;When the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, the target image is a second target image, and the second target image is acquired after the camera starts to travel;
    如果所述摄像头缩回受阻,所述控制所述摄像头执行目标动作,包括:If the retraction of the camera is blocked, the controlling the camera to perform a target action includes:
    控制所述摄像头重复执行缩回动作。Control the camera to repeatedly perform the retracting action.
  5. 根据权利要求4所述的方法,其特征在于,所述第二目标图像是在所述摄像头的行进时长大于或等于预设的第二阈值时获取的。The method according to claim 4, wherein the second target image is acquired when the travel time of the camera is greater than or equal to a second preset threshold.
  6. 根据权利要求1所述的方法,其特征在于,所述确定所述摄像头是否处于伸缩异常状态,包括:The method according to claim 1, wherein the determining whether the camera is in an abnormal state of expansion and contraction comprises:
    当所述目标图像包括阴影区域时,确定所述摄像头受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;或,When the target image includes a shadow area, it is determined that the camera is pressed by an external force, the target image is a third target image, and the third target image is obtained when the camera is in a normal working state; or,
    当所述目标图像不包括阴影区域时,确定所述摄像头未受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;When the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, the target image is a third target image, and the third target image is obtained when the camera is in a normal working state;
    如果所述摄像头受到外力按压,所述控制所述摄像头执行目标动作,包括:If the camera is pressed by an external force, the controlling the camera to perform a target action includes:
    控制所述摄像头执行缩回动作。Control the camera to perform a retracting action.
  7. 根据权利要求1至6中任一项所述的方法,其特征在于,所述目标图像包括非阴影区域,所述阴影区域与所述非阴影区域的分界线所沿的方向与所述摄像头的行进方向垂 直。The method according to any one of claims 1 to 6, wherein the target image includes a non-shaded area, and a direction along which a boundary line between the shadow area and the non-shaded area follows is the same as that of the camera. The direction of travel is vertical.
  8. 一种检测装置,其特征在于,包括:A detection device, characterized in that it comprises:
    处理模块,用于控制摄像头获取目标图像;The processing module is used to control the camera to obtain the target image;
    所述处理模块,还用于根据所述目标图像是否包括阴影区域,确定所述摄像头是否处于伸缩异常状态,所述伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种;The processing module is further configured to determine whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area, and the abnormal expansion and contraction includes any one of obstructed extension, obstructed retraction, and external force pressing;
    所述处理模块,还用于如果所述摄像头处于伸缩异常状态,控制所述摄像头执行目标动作,所述目标动作使所述摄像头从所述伸缩异常状态中恢复。The processing module is further configured to control the camera to execute a target action if the camera is in an abnormal state of expansion and contraction, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
  9. 根据权利要求8所述的装置,其特征在于,所述处理模块具体用于:当所述目标图像包括阴影区域时,确定所述摄像头伸出受阻,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头正常伸出,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;如果所述摄像头伸出受阻,控制所述摄像头执行缩回动作。The device according to claim 8, wherein the processing module is specifically configured to: when the target image includes a shadow area, determine that the camera is blocked from extending, and the target image is the first target image, so The first target image is acquired after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, and the first target image is A target image is obtained after the camera starts to travel; if the camera is prevented from extending, the camera is controlled to perform a retracting action.
  10. 根据权利要求9所述的装置,其特征在于,所述第一目标图像是在所述摄像头的行进时长大于或等于预设的第一阈值时获取的。The device according to claim 9, wherein the first target image is acquired when the travel time of the camera is greater than or equal to a preset first threshold.
  11. 根据权利要求8所述的装置,其特征在于,所述处理模块具体用于:当所述目标图像未完全被阴影区域覆盖时,确定所述摄像头缩回受阻,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像完全被阴影区域覆盖时,确定所述摄像头正常缩回,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;如果所述摄像头缩回受阻,控制所述摄像头重复执行缩回动作。The device according to claim 8, wherein the processing module is specifically configured to: when the target image is not completely covered by a shadow area, determine that the camera is blocked from retraction, and the target image is the second target Image, the second target image is acquired after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, and the target image is the second target image The second target image is obtained after the camera starts to travel; if the camera is blocked from being retracted, the camera is controlled to repeat the retracting action.
  12. 根据权利要求11所述的装置,其特征在于,所述第二目标图像是在所述摄像头的行进时长大于或等于预设的第二阈值时获取的。11. The device according to claim 11, wherein the second target image is acquired when the travel time of the camera is greater than or equal to a second preset threshold.
  13. 根据权利要求8所述的装置,其特征在于,所述处理模块具体用于:The device according to claim 8, wherein the processing module is specifically configured to:
    当所述目标图像包括阴影区域时,确定所述摄像头受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;或,When the target image includes a shadow area, it is determined that the camera is pressed by an external force, the target image is a third target image, and the third target image is obtained when the camera is in a normal working state; or,
    当所述目标图像不包括阴影区域时,确定所述摄像头未受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;When the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, the target image is a third target image, and the third target image is obtained when the camera is in a normal working state;
    如果所述摄像头受到外力按压,控制所述摄像头执行缩回动作。If the camera is pressed by an external force, the camera is controlled to perform a retracting action.
  14. 根据权利要求8至13中任一项所述的装置,其特征在于,所述目标图像包括非阴影区域,所述阴影区域与所述非阴影区域的分界线所沿的方向与所述摄像头的行进方向垂直。The device according to any one of claims 8 to 13, wherein the target image includes a non-shaded area, and a direction along which a boundary line between the shadow area and the non-shaded area follows is the same as that of the camera. The direction of travel is vertical.
  15. 一种芯片,其特征在于,包括:A chip, characterized in that it comprises:
    存储器,用于存储程序代码;Memory, used to store program code;
    所述存储器与处理器相连,所述程序代码被所述处理器执行之后,使得所述芯片执行:The memory is connected to a processor, and after the program code is executed by the processor, the chip executes:
    控制摄像头获取目标图像;Control the camera to obtain the target image;
    根据所述目标图像是否包括阴影区域,确定所述摄像头是否处于伸缩异常状态,所述伸缩异常包括伸出受阻、缩回受阻与外力按压中的任意一种;Determine whether the camera is in an abnormal state of expansion and contraction according to whether the target image includes a shadow area, and the abnormal expansion and contraction includes any one of obstructed extension, obstructed retraction, and external force pressing;
    如果所述摄像头处于伸缩异常状态,控制所述摄像头执行目标动作,所述目标动作使所述摄像头从所述伸缩异常状态中恢复。If the camera is in an abnormal state of expansion and contraction, the camera is controlled to perform a target action, and the target action causes the camera to recover from the abnormal state of expansion and contraction.
  16. 根据权利要求15所述的芯片,其特征在于,所述芯片具体用于执行以下操作:当所述目标图像包括阴影区域时,确定所述摄像头伸出受阻,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头正常伸出,所述目标图像为第一目标图像,所述第一目标图像是在所述摄像头开始行进后获取的;如果所述摄像头伸出受阻,控制所述摄像头执行缩回动作。The chip according to claim 15, wherein the chip is specifically configured to perform the following operations: when the target image includes a shadow area, it is determined that the camera is blocked from extending, and the target image is the first target image , The first target image is acquired after the camera starts to travel; or, when the target image does not include a shadow area, it is determined that the camera is normally extended, the target image is the first target image, so The first target image is obtained after the camera starts to travel; if the camera is prevented from being extended, the camera is controlled to perform a retracting action.
  17. 根据权利要求16所述的芯片,其特征在于,所述第一目标图像是在所述摄像头的行进时长大于或等于预设的第一阈值时获取的。The chip according to claim 16, wherein the first target image is acquired when the travel time of the camera is greater than or equal to a preset first threshold.
  18. 根据权利要求15所述的芯片,其特征在于,所述芯片具体用于执行以下操作:当所述目标图像未完全被阴影区域覆盖时,确定所述摄像头缩回受阻,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;或,当所述目标图像完全被阴影区域覆盖时,确定所述摄像头正常缩回,所述目标图像为第二目标图像,所述第二目标图像是在所述摄像头开始行进后获取的;如果所述摄像头缩回受阻,控制所述摄像头重复执行缩回动作。The chip according to claim 15, wherein the chip is specifically configured to perform the following operations: when the target image is not completely covered by a shadow area, it is determined that the retraction of the camera is blocked, and the target image is the first Two target images, the second target image is obtained after the camera starts to travel; or, when the target image is completely covered by the shadow area, it is determined that the camera is retracted normally, and the target image is the second The target image, the second target image is acquired after the camera starts to travel; if the camera is prevented from being retracted, the camera is controlled to repeat the retracting action.
  19. 根据权利要求18所述的芯片,其特征在于,所述第二目标图像是在所述摄像头的行进时长大于或等于预设的第二阈值时获取的。The chip according to claim 18, wherein the second target image is acquired when the travel time of the camera is greater than or equal to a preset second threshold.
  20. 根据权利要求15所述的芯片,其特征在于,所述芯片具体用于执行以下操作:当所述目标图像包括阴影区域时,确定所述摄像头受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;或,当所述目标图像不包括阴影区域时,确定所述摄像头未受到外力按压,所述目标图像为第三目标图像,所述第三目标图像是在所述摄像头处于正常工作状态下获取的;如果所述摄像头受到外力按压,控制所述摄像头执行缩回动作。The chip according to claim 15, wherein the chip is specifically configured to perform the following operations: when the target image includes a shadow area, determining that the camera is pressed by an external force, and the target image is a third target image , The third target image is obtained when the camera is in a normal working state; or, when the target image does not include a shadow area, it is determined that the camera is not pressed by an external force, and the target image is the third target Image, the third target image is obtained when the camera is in a normal working state; if the camera is pressed by an external force, the camera is controlled to perform a retracting action.
  21. 根据权利要求15至20中任一项所述的芯片,其特征在于,所述目标图像包括非阴影区域,所述阴影区域与所述非阴影区域的分界线所沿的方向与所述摄像头的行进方向垂直。The chip according to any one of claims 15 to 20, wherein the target image includes a non-shaded area, and a direction along which a boundary line between the shadow area and the non-shaded area runs is the same as that of the camera. The direction of travel is vertical.
PCT/CN2020/113665 2019-09-11 2020-09-07 Detection method, apparatus and device WO2021047461A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910859422.7 2019-09-11
CN201910859422.7A CN110691235B (en) 2019-09-11 2019-09-11 Detection method, device and equipment

Publications (1)

Publication Number Publication Date
WO2021047461A1 true WO2021047461A1 (en) 2021-03-18

Family

ID=69109043

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/113665 WO2021047461A1 (en) 2019-09-11 2020-09-07 Detection method, apparatus and device

Country Status (2)

Country Link
CN (1) CN110691235B (en)
WO (1) WO2021047461A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110691235B (en) * 2019-09-11 2021-02-23 华为技术有限公司 Detection method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106454336A (en) * 2016-11-23 2017-02-22 北京小米移动软件有限公司 Method and device for detecting whether camera of terminal is covered or not, and terminal
US20170244903A1 (en) * 2016-02-21 2017-08-24 Jinrong Yang Portable electronic device with retractable antenna rod for a camera
CN109089023A (en) * 2018-07-27 2018-12-25 维沃移动通信有限公司 A kind of terminal and control method
CN109547601A (en) * 2018-12-27 2019-03-29 维沃移动通信有限公司 A kind of stroke detecting method of terminal device and flexible camera
CN110691235A (en) * 2019-09-11 2020-01-14 华为技术有限公司 Detection method, device and equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5816390B2 (en) * 2013-03-13 2015-11-18 富士フイルム株式会社 Lens device and operation control method thereof
US10334158B2 (en) * 2014-11-03 2019-06-25 Robert John Gove Autonomous media capturing
CN105611188B (en) * 2015-12-23 2019-06-04 北京奇虎科技有限公司 Camera occlusion detection method and device based on automatic exposure
CN108600590B (en) * 2018-05-31 2020-11-13 京东方科技集团股份有限公司 Terminal
CN109120922A (en) * 2018-09-27 2019-01-01 太仓太乙信息工程有限公司 A kind of camera condition monitoring system and its method
CN109769051B (en) * 2019-03-01 2021-04-09 维沃移动通信有限公司 Stroke detection device and method and terminal
CN109951702B (en) * 2019-03-29 2024-04-05 荣耀终端有限公司 Position detection mechanism, mobile terminal and position detection method
CN109922246A (en) * 2019-04-02 2019-06-21 歌尔科技有限公司 A kind of camera stretching structure and picture pick-up device
CN110086987B (en) * 2019-04-22 2021-01-05 惠州Tcl移动通信有限公司 Camera visual angle cutting method and device and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170244903A1 (en) * 2016-02-21 2017-08-24 Jinrong Yang Portable electronic device with retractable antenna rod for a camera
CN106454336A (en) * 2016-11-23 2017-02-22 北京小米移动软件有限公司 Method and device for detecting whether camera of terminal is covered or not, and terminal
CN109089023A (en) * 2018-07-27 2018-12-25 维沃移动通信有限公司 A kind of terminal and control method
CN109547601A (en) * 2018-12-27 2019-03-29 维沃移动通信有限公司 A kind of stroke detecting method of terminal device and flexible camera
CN110691235A (en) * 2019-09-11 2020-01-14 华为技术有限公司 Detection method, device and equipment

Also Published As

Publication number Publication date
CN110691235A (en) 2020-01-14
CN110691235B (en) 2021-02-23

Similar Documents

Publication Publication Date Title
EP3076659B1 (en) Photographing apparatus, control method thereof, and non-transitory computer-readable recording medium
WO2019185003A1 (en) Display control method and device
US20160037067A1 (en) Method for generating image and electronic device thereof
WO2019001152A1 (en) Photographing method and mobile terminal
US9930269B2 (en) Apparatus and method for processing image in device having camera
US20130239050A1 (en) Display control device, display control method, and computer-readable recording medium
WO2015120677A1 (en) Method and apparatus for protecting privacy-sensitive information by automatically identifying scene
CN109120841B (en) Camera control method and device, mobile terminal and storage medium
EP3591961A1 (en) Photographing guide method, device and system
WO2021047461A1 (en) Detection method, apparatus and device
WO2018117409A1 (en) Operating method for function of iris recognition and electronic device supporting the same
US9560272B2 (en) Electronic device and method for image data processing
US8558849B2 (en) Method and apparatus for processing a user interface in an image processor
WO2017107855A1 (en) Picture searching method and device
EP4231625A1 (en) Photographing method and apparatus, and electronic device
WO2021169750A1 (en) Telescopic camera control method and device, and electronic device and storage medium
CN109040351A (en) Camera control method, device, mobile terminal and storage medium
JP2008287691A5 (en)
US10460202B2 (en) Multi-camera device
US20150015724A1 (en) Electronic device and method for controlling image capturing
WO2017061720A1 (en) Method of processing image of electronic device and electronic device thereof
US11132167B2 (en) Managing display of content on one or more secondary device by primary device
CN108604128B (en) Processing method and mobile device
JP7346051B2 (en) Image processing device, image processing method, and program
EP3301904A1 (en) A system and method for stencil based assistive photography

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20862207

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20862207

Country of ref document: EP

Kind code of ref document: A1