WO2019090556A1 - Method for measuring size of object and mobile terminal - Google Patents

Method for measuring size of object and mobile terminal Download PDF

Info

Publication number
WO2019090556A1
WO2019090556A1 PCT/CN2017/110095 CN2017110095W WO2019090556A1 WO 2019090556 A1 WO2019090556 A1 WO 2019090556A1 CN 2017110095 W CN2017110095 W CN 2017110095W WO 2019090556 A1 WO2019090556 A1 WO 2019090556A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile terminal
distance
image
measured
size
Prior art date
Application number
PCT/CN2017/110095
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 深圳传音通讯有限公司
Priority to PCT/CN2017/110095 priority Critical patent/WO2019090556A1/en
Publication of WO2019090556A1 publication Critical patent/WO2019090556A1/en

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/02Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness

Definitions

  • the present invention relates to the field of mobile terminals, and in particular, to a method for measuring an object size and a mobile terminal.
  • the mobile terminal can store contact information for communication with contacts.
  • the function of the mobile terminal is not limited to communication, and the camera function can be realized by integrating the camera device, and a digital photo is formed and stored in the mobile terminal.
  • the prior art continuously improves the camera performance of the mobile terminal, such as increasing the number of pixels of the lens, or increasing the number of lenses.
  • the front and back sides of the mobile terminal are integrated with a camera to meet the self-photographing requirement.
  • an object of the present invention is to provide a method for measuring an object size and a mobile terminal, which calculates an object to be measured and an image thereof by an imaging principle, and obtains a size of the object to be measured. .
  • a method for measuring an object size comprising the steps of:
  • a mobile terminal automatically focuses on an object to be measured and forms an image of the image
  • the step of the mobile terminal automatically focusing on an object to be measured and forming an image of the image comprises:
  • the mobile terminal performs an imaging operation on the measured object to obtain an image of the image
  • the sharpness is smaller than the sharpness threshold, the image distance of the measured object is adjusted, and the imaging operation step, the sharpness calculation and the determining step are repeated.
  • adjusting the image distance of the mobile terminal is achieved by adjusting a distance between a lens of the mobile terminal and an imaging position of the measured object.
  • the distance between the lens of the mobile terminal and the imaging position of the measured object is adjusted, it is adjusted by manual mechanical adjustment or electric motor.
  • the distance between the imaging position of the measured object and the lens of the mobile terminal is detected by a first distance sensor.
  • the method for measuring the size of the object further comprises the following steps:
  • the step of calculating the object distance of the measured object according to the focal length of the mobile terminal and the image distance is replaced by:
  • a second distance sensor on the mobile terminal detects a distance between the mobile terminal and the measured object to obtain an object distance.
  • a mobile terminal includes a memory, a processor, a communication module, a camera module, an imaging module, a first distance sensor, and a computer program stored on the memory and operable on the processor.
  • the processor implements the following steps when executing the computer program:
  • the camera module automatically focuses on an object to be measured and forms an image on the imaging module
  • the processor calculates an object distance of the measured object according to a focal length of the mobile terminal and the image distance;
  • the processor calculates a size of the measured object.
  • the photographing module comprises an electric motor, and the electric motor adjusts a distance between the lens and the imaging module in the photographing module.
  • the mobile terminal further includes a second distance sensor, and the second distance sensor detects a distance between the mobile terminal and the measured object to obtain an object distance.
  • FIG. 1 is a flow chart showing a method for measuring an object size in accordance with an embodiment of the present invention
  • FIG. 2 is a schematic flow chart of a method for measuring an object size according to another embodiment of the present invention.
  • step S101 of FIG. 1 is a schematic flow chart of step S101 of FIG. 1 in accordance with an embodiment of the present invention
  • FIG. 4 is a structural block diagram of a mobile terminal for measuring an object size in accordance with an embodiment of the present invention
  • FIG. 5 is a structural block diagram of a mobile terminal for measuring an object size in accordance with another embodiment of the present invention.
  • Figure 6 is a schematic diagram of imaging in accordance with an embodiment of the present invention.
  • 10-Mobile terminal 11-memory, 12-processor, 13-photographing module, 14-communication module, 15-display module, 16-imaging module, 17-first distance sensor, 18-second distance sensor.
  • first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
  • first information may also be referred to as second information without departing from the scope of the present disclosure.
  • second information may also be referred to as first information.
  • word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination.”
  • FIG. 1 is a schematic flow chart of a method for measuring an object size according to an embodiment of the present invention, the method comprising the following steps:
  • S101 A mobile terminal 10 automatically focuses on an object to be measured and forms an image of an image.
  • the implementation of the method is based on a mobile terminal 10 having a camera function, and the mobile terminal 10 is provided with an auto focus function.
  • the mobile terminal 10 automatically focuses on an object to be measured and forms an image of the image.
  • the mobile terminal 10 performs focusing by a single camera.
  • the camera has a lens group therein, and the light reflected by the measured object forms an image by the lens group in the camera.
  • the camera may also include only one lenticular lens sheet for the photographing operation.
  • the distance between the object to be measured and the convex lens that is, the object distance, when the object distance is greater than 2 times the focal length, is an inverted and reduced real image on the other side of the convex lens, the real image and the convex lens
  • the distance is the image distance.
  • the autofocus is implemented by adjusting the image distance when the focal length and the object distance are constant, so that the imaged image reaches the clearest state, that is, the imaged image detected by the mobile terminal 10.
  • the position is exactly at the position of the real image of the object to be measured.
  • the image distance should be adjusted in real time to satisfy the imaging. The image is clearly required to achieve autofocus.
  • the autofocus principle is similar to the single convex lens imaging focusing principle, and the image distance is adjusted to achieve an optimal imaging image.
  • the camera is movable, that is, a "scalable" movement seen from the outside.
  • a first distance sensor 17 is disposed in the mobile terminal 10, and the first distance sensor 17 detects a distance of the camera to an imaging position.
  • the first distance sensor 17 may be an infrared sensor or an ultrasonic sensor, and directly performs distance detection and transmission to the processor 12; or may be a contact detection point disposed on a moving path of the camera, the contact type
  • the detection point may be a piezoelectric material, and each of the contact detection points presets a corresponding image distance parameter, and the moving position of the camera can be perceived by acquiring the state of the different contact detection points, thereby obtaining the image distance.
  • S103 Calculate an object distance of the measured object according to a preset focal length and the image distance in the mobile terminal 10.
  • the object distance of the measured object is calculated by the convex lens imaging principle, and the calculation formula is:
  • f is the focal length
  • v is the image distance
  • u is the object distance.
  • the focal length of the camera is a constant parameter, which is preset in the mobile terminal 10, and the image distance has been acquired in step S102, so the object distance of the measured object can be calculated.
  • S104 Acquire an image size of the image of the measured object.
  • the light emitted by the measured object is imaged in the mobile terminal 10 through the camera to form an image, which is optical imaging.
  • the size of the optically imaged image is acquired.
  • the optically imaged image is first formed on a photosensitive element within the mobile terminal 10 and then converted into an image format in a digital format, represented by pixels, the size of the imaged image of the digital format and its inclusion
  • the number of pixels is related. Corresponding relationship between the range of pixel points of the imaged image of the digital format preset in the mobile terminal 10 and the size of the imaged image of the optical imaging, the correspondence relationship being a linear relationship.
  • the imaged image has a pixel point range of 100*100, and the corresponding optically imaged image has a size of 1 cm*1 cm; similarly, a digital format image corresponding to a pixel range of 200*200 corresponds to
  • the image size of the optical imaging image is 2 cm * 2 cm.
  • the correspondence relationship is affected by parameters of the photosensitive element of the mobile terminal 10, the conversion circuit, and the resolution of the display screen.
  • the boundary contour of the imaged image can be identified by image recognition, thereby obtaining its pixel point range.
  • FIG. 6 which is a schematic diagram of the convex lens imaging in the embodiment, it can be seen that the contour of the measured object is the line segment AB, the contour of the image is the line segment CD, the center point of the convex lens is O, and the object distance of the measured object is For the line segment BO, the image distance of the imaged image is the line segment DO, and the line segment AB is parallel to the line segment CD.
  • the principle of apex angle similarity can prove that the triangle AOB is similar to the triangle COD, then there is the following formula:
  • the object distance BO is obtained in step S103, the image distance DO is obtained in step S104, and the size CD of the imaged image is obtained in step S104, and finally the size AB of the measured object can be obtained.
  • the outer contour of the measured object is composed of a plurality of sets of line segments, and the length of all the contour segments can be calculated by this step, or the critical dimension can be obtained according to the geometric features of the measured object, such as the height of the triangle, the radius of the circle, and the like. size.
  • the method for measuring the size of the object by the user further comprises the following steps:
  • S106 Display an image and size of the image of the measured object on a display interface of the mobile terminal 10.
  • This step performs a display operation to display the size of the object to be measured to the user.
  • the step S105 calculates the size of the measured object, the user needs to know the measurement result, and the size of the measured object can be displayed while displaying the imaged image on the display interface of the mobile terminal 10. .
  • the size of the object to be measured is displayed in the form of a number plus a unit.
  • step S103 is replaced by:
  • Step S107 The second distance sensor 18 on the mobile terminal 10 detects the distance between the mobile terminal 10 and the measured object to obtain an object distance.
  • the object distance is obtained by using a direct measurement method.
  • the mobile terminal 10 When the user uses the mobile terminal 10 to shoot the object to be measured, the mobile terminal 10 is facing the object to be measured, and the use of the object is provided.
  • the second distance sensor 18 performs a condition of distance detection.
  • the second distance sensor 18 may be an infrared sensor, an ultrasonic sensor, and the distance information of the detected mobile terminal 10 and the measured object is transmitted to the processor 12 to acquire the object distance.
  • step S101 includes:
  • Step S101-1 The mobile terminal 10 performs an imaging operation on the measured object to obtain an imaged image.
  • This step performs an imaging operation, that is, the light reflected by the measured object is projected through the camera of the mobile terminal 10
  • An optically imaged image is formed onto the photosensitive element within the mobile terminal 10.
  • the optically imaged image is then converted by the photosensitive element and the conversion circuit into an imaged image in digital format.
  • Step S101-2 Calculating the sharpness of the imaged image using a focus evaluation function.
  • This step performs a sharpness calculation, and uses the focus evaluation function to perform a sharpness calculation on the imaged image of the digital format obtained in the step S101-1.
  • the imaged image in the digital format represents the image in pixel information, and accordingly, the focus evaluation function calculates the pixel information to obtain a sharpness value.
  • the focus evaluation function can be implemented by various algorithms, such as a gray gradient algorithm, a frequency domain analysis method, a statistical function, etc., wherein the gray gradient algorithm includes a Laplacian algorithm, a gray variance operator method, Gradient vector square function, difference absolute value sum method, Robert operator, S0be1 operator method, etc.
  • Step S101-3 determining whether the resolution is greater than or equal to a sharpness threshold preset in the mobile terminal.
  • a resolution threshold is preset in the mobile terminal for determining whether the resolution of the imaged image meets a focus requirement.
  • the resolution calculated in the step S101-2 is a single dimension value, so that numerical comparison can be performed.
  • Step S101-4 When the sharpness is greater than or equal to the sharpness threshold, the autofocus is stopped.
  • this step performs the stop of the autofocus operation, records the current imaged image as the final imaged image, and then performs step S102.
  • Step S101-5 When the sharpness is smaller than the sharpness threshold, adjust the image distance of the measured object, and repeat step S101-1, step S101-2, and step S101-3.
  • step S101-3 determines that the determination is not true, that is, the resolution is less than the resolution threshold
  • the step is performed.
  • the image distance of the measured object is adjusted, that is, the distance between the optically imaged image and the camera is adjusted to find the optimal imaging position.
  • the process proceeds to step S101-1 to continue the next imaging, definition calculation, that is, until the resolution is greater than the definition threshold, and proceeds to step S101-4 to end the autofocus.
  • the distance between the lens of the mobile terminal 10 and the imaging position of the measured object is adjusted.
  • the camera of the mobile terminal 10 includes a lens, and adjusts the distance between the lens and the imaging position, that is, adjusts the image distance.
  • the method of adjusting the focus is adopted, that is, the focal length of the lens is inconvenient, and the image is changed by changing the image distance.
  • the image forming position is actually the position of the photosensitive member, and the photosensitive member is generally fixed in the mobile terminal 10, and the movable member is the lens.
  • the present modified embodiment provides a way of adjusting the distance between the lens and the imaging position, which is actually the manner in which the lens is moved.
  • One way is manual mechanical mode, that is, the user manually operates the lens to change the distance between the lens and the imaging position.
  • the optical camera commonly used in life adopts manual mechanical mode to adjust the lens position.
  • the other is an electric motor adjustment, and the mobile terminal 10 incorporates an electric motor capable of driving the lens to be stretched or contracted in the optical path direction, thereby changing the position of the lens and the photosensitive member.
  • the mobile terminal 10 is provided with an operation button that allows the user to click a button to make adjustments.
  • a first distance sensor 17 distance detects the image forming position, that is, the position of the photosensitive member and the lens, by the first distance sensor 17.
  • the first distance sensor 17 may be a non-contact distance sensor such as an ultrasonic sensor or an infrared sensor, or a touch sensor may be used.
  • a line type resistor is disposed on the movement track of the lens, and a metal protrusion is disposed on the lens.
  • the mobile terminal 10 includes:
  • the processor 12 is a core component of the mobile terminal 10, that is, a CPU, and can perform high-speed operations, process various tasks, and run a computer program.
  • the memory 11 stores the computer program, as well as data, pictures, video files, audio files, contacts, and the like required for the computer program to run.
  • the processor 12 can acquire various data required for operation from the memory 11.
  • the camera module 13 is disposed in the mobile terminal 10, and includes an optical component such as a camera and a shutter.
  • the camera includes a lens, and the lens may be a single mirror lens or a lens group composed of a plurality of lenses.
  • the communication module 14 is a module for communication connection with the outside, and may be a wireless network card (wifi module), a mobile bee.
  • the socket communication module, Bluetooth module and other types can be connected to different networks according to the application.
  • the communication module 14 can receive communication information sent from the outside, and can also send the communication information outward.
  • the display module 15 is an important component of the mobile terminal 10, and displays various functional interfaces to the user. In particular, when the display module 15 includes a touch screen, it can also receive input operations of the user. The display module 15 displays various prompt information to the user. The display module 15 displays the imaged image in the digital format and the size of the object to be measured.
  • the imaging module 16 is used in combination with the camera module 13 and includes a photosensitive element and a conversion circuit.
  • the photosensitive element receives an optically imaged image formed by the camera module 13 and is converted into a digital format by the conversion circuit.
  • Photosensitive elements are the core of imaging technology. There are two types: one is a widely used CCD (charge-coupled) device; the other is a CMOS (complementary metal oxide conductor) device.
  • the first distance sensor 17 is configured to detect a distance between an imaging position of the measured object and a lens of the mobile terminal 10.
  • the first distance sensor 17 may be a non-contact distance sensor such as an ultrasonic sensor or an infrared sensor, or a touch sensor may be used.
  • a line type resistor is disposed on the movement track of the lens, and a metal protrusion is disposed on the lens. In contact with the linear resistor, when the lens moves, a resistance value between one end of the linear resistor and the metal bump changes, thereby acquiring a moving position of the lens. Corresponding relationship between the resistance value and the lens position is pre-stored in the mobile terminal 10.
  • the first distance sensor 17 transmits the detected distance parameter to the processor 12 to acquire the image distance.
  • the photographing module 13 includes an electric motor that adjusts a distance between a lens and the imaging module in the photographing module.
  • the mobile terminal 10 further includes:
  • the second distance sensor 18 detects the distance between the measured object and the mobile terminal 10 in a non-contact manner.
  • the second distance sensor 18 may be an infrared sensor, an ultrasonic sensor, and the distance information of the detected mobile terminal 10 and the measured object is transmitted to the processor 12 to acquire the object distance.
  • the mobile terminal 10 can be implemented in various forms.
  • the terminal described in the present invention may include, for example, a mobile phone, a smart phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (Tablet), a PMP (portable multiple Mobile terminals of media players, navigation devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like.
  • PDA Personal Digital Assistant
  • PAD Tablett
  • PMP portable multiple Mobile terminals of media players, navigation devices, and the like
  • fixed terminals such as digital TVs, desktop computers, and the like.
  • the terminal is a mobile terminal.
  • those skilled in the art will appreciate that configurations in accordance with embodiments of the present invention can be applied to fixed type terminals in addition to components that are specifically for mobile purposes.

Abstract

Provided are a method for measuring the size of an object and a mobile terminal. The method for measuring the size of an object comprises the following steps: a mobile terminal automatically focuses on a measured object and forms an image; obtain the image distance of the measured object; calculate the object distance of the measured object according to the preset focal length of the mobile terminal and the image distance; obtain the size of the image of the measured object; and calculate the size of the measured object. The technical solution achieves remote object size measurement without using other measuring tools, so that the time for measuring the size of an object is saved, and the working efficiency is improved.

Description

一种用于测量物体尺寸的方法及移动终端Method for measuring object size and mobile terminal 技术领域Technical field
本发明涉及移动终端领域,尤其涉及一种用于测量物体尺寸的方法及移动终端。The present invention relates to the field of mobile terminals, and in particular, to a method for measuring an object size and a mobile terminal.
背景技术Background technique
目前,智能手机、卫星电话等移动终端设备已成为人们生活中不可缺少的一部分,所述移动终端内可以存储联系人的信息,用于和联系人进行通讯交流。随着技术的发展,所述移动终端的功能不限于进行通讯交流,还可通过集成摄像设备来实现照相功能,并形成数码照片存储于所述移动终端内。现有技术不断提升所述移动终端的相机性能,例如提升镜头的像素点数,或者是增加镜头的数量,例如所述移动终端正面和背面各集成一摄像头,以满足自拍需求。At present, mobile terminal devices such as smart phones and satellite phones have become an indispensable part of people's lives. The mobile terminal can store contact information for communication with contacts. With the development of the technology, the function of the mobile terminal is not limited to communication, and the camera function can be realized by integrating the camera device, and a digital photo is formed and stored in the mobile terminal. The prior art continuously improves the camera performance of the mobile terminal, such as increasing the number of pixels of the lens, or increasing the number of lenses. For example, the front and back sides of the mobile terminal are integrated with a camera to meet the self-photographing requirement.
然而,人们在所述移动终端具备拍摄功能的基础上,提出了更多的应用需求,特别是希望能够通过远程摄像来测量物体的尺寸,无需使用其他工具进行测量,例如在进行快递发货时,可快速获知货物的尺寸大小,从而选择相应的包装箱体,对于物流行业或者需要发货的公司或个人,都能提供极大的便利。However, on the basis of the shooting function of the mobile terminal, people have put forward more application requirements, in particular, it is desirable to be able to measure the size of an object by remote cameraing, without using other tools for measurement, for example, when performing express delivery. It can quickly know the size of the goods, so that the corresponding packaging box can be selected, which can provide great convenience for the logistics industry or companies or individuals who need to ship.
因此,需要提供一种依托于移动终端的测量物体尺寸的方法,在不需要接触被测物体的情况下,能对被测物体进行尺寸测量,方便后续的包装选择、计量收费等应用措施。Therefore, it is necessary to provide a method for measuring the size of an object based on the mobile terminal, and can measure the size of the object to be measured without contacting the object to be measured, thereby facilitating subsequent packaging selection, metering and charging, and the like.
发明内容Summary of the invention
为了克服上述技术缺陷,本发明的目的在于提供一种用于测量物体尺寸的方法及移动终端,通过成像原理,对实现自动对焦的被测物体及其成像图像进行计算,得到被测物体的尺寸。In order to overcome the above technical deficiencies, an object of the present invention is to provide a method for measuring an object size and a mobile terminal, which calculates an object to be measured and an image thereof by an imaging principle, and obtains a size of the object to be measured. .
本发明的第一方面,公开了一种用于测量物体尺寸的方法,所述用于测量物体尺寸的方法包括以下步骤:In a first aspect of the invention, a method for measuring an object size is disclosed, the method for measuring an object size comprising the steps of:
一移动终端对一被测物体自动对焦并形成一成像图像; A mobile terminal automatically focuses on an object to be measured and forms an image of the image;
获取所述被测物体的像距;Obtaining an image distance of the measured object;
根据所述移动终端内预设的焦距及所述像距计算所述被测物体的物距;Calculating an object distance of the measured object according to a preset focal length and the image distance in the mobile terminal;
获取所述被测物体的成像图像尺寸;Obtaining an image size of the image to be measured;
计算所述被测物体的尺寸。Calculating the size of the measured object.
优选地,一移动终端对一被测物体自动对焦并形成一成像图像的步骤包括:Preferably, the step of the mobile terminal automatically focusing on an object to be measured and forming an image of the image comprises:
所述移动终端对所述被测物体执行一次成像操作,得到一成像图像;The mobile terminal performs an imaging operation on the measured object to obtain an image of the image;
使用调焦评价函数计算所述成像图像的清晰度;Calculating the sharpness of the imaged image using a focus evaluation function;
判断所述清晰度是否大于或等于一预设于所述移动终端内的清晰度阈值;Determining whether the resolution is greater than or equal to a definition threshold preset in the mobile terminal;
当所述清晰度大于或等于所述清晰度阈值时,停止自动对焦;Stopping the auto focus when the sharpness is greater than or equal to the sharpness threshold;
当所述清晰度小于所述清晰度阈值时,调整所述被测物体的像距,重复上述成像操作步骤、清晰度计算及判断步骤。When the sharpness is smaller than the sharpness threshold, the image distance of the measured object is adjusted, and the imaging operation step, the sharpness calculation and the determining step are repeated.
优选地,调整所述移动终端的像距通过调整所述移动终端的镜头与所述被测物体的成像位置的距离实现。Preferably, adjusting the image distance of the mobile terminal is achieved by adjusting a distance between a lens of the mobile terminal and an imaging position of the measured object.
优选地,调整所述移动终端的镜头与所述被测物体的成像位置的距离时,通过手动机械调整或电动马达调整。Preferably, when the distance between the lens of the mobile terminal and the imaging position of the measured object is adjusted, it is adjusted by manual mechanical adjustment or electric motor.
优选地,获取所述被测物体的像距时,通过一第一距离传感器检测所述被测物体的成像位置与所述移动终端的镜头的距离。Preferably, when acquiring the image distance of the measured object, the distance between the imaging position of the measured object and the lens of the mobile terminal is detected by a first distance sensor.
优选地,计算所述被测物体的尺寸的步骤之后,所述用于测量物体尺寸的方法还包括以下步骤:Preferably, after the step of calculating the size of the measured object, the method for measuring the size of the object further comprises the following steps:
于所述移动终端的显示界面上显示所述被测物体的成像图像及尺寸。Displaying an image and size of the object to be measured on a display interface of the mobile terminal.
优选地,根据所述移动终端的焦距及所述像距计算所述被测物体的物距的步骤替换为:Preferably, the step of calculating the object distance of the measured object according to the focal length of the mobile terminal and the image distance is replaced by:
所述移动终端上的第二距离传感器检测所述移动终端与所述被测物体的距离,得到物距。A second distance sensor on the mobile terminal detects a distance between the mobile terminal and the measured object to obtain an object distance.
本发明的第二方面,公开了一种移动终端,包括存储器、处理器、通讯模块、拍照模块、成像模块、第一距离传感器及存储在存储器上并可在处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现以下步骤:According to a second aspect of the present invention, a mobile terminal includes a memory, a processor, a communication module, a camera module, an imaging module, a first distance sensor, and a computer program stored on the memory and operable on the processor. The processor implements the following steps when executing the computer program:
所述拍照模块对一被测物体自动对焦并于所述成像模块上形成一成像图像;The camera module automatically focuses on an object to be measured and forms an image on the imaging module;
所述处理器从所述拍照模块获取所述被测物体的像距;Obtaining an image distance of the measured object from the camera module;
所述处理器根据所述移动终端的焦距及所述像距计算所述被测物体的物距; The processor calculates an object distance of the measured object according to a focal length of the mobile terminal and the image distance;
所述处理器从所述成像模块获取所述被测物体的成像尺寸;Obtaining, by the processor, an imaging size of the measured object from the imaging module;
所述处理器计算所述被测物体的尺寸。The processor calculates a size of the measured object.
优选地,所述拍照模块包括电动马达,所述电动马达调整所述拍照模块中镜头与所述成像模块的距离。Preferably, the photographing module comprises an electric motor, and the electric motor adjusts a distance between the lens and the imaging module in the photographing module.
优选地,所述移动终端还包括第二距离传感器,所述第二距离传感器检测所述移动终端与所述被测物体的距离,得到物距。Preferably, the mobile terminal further includes a second distance sensor, and the second distance sensor detects a distance between the mobile terminal and the measured object to obtain an object distance.
采用了上述技术方案后,与现有技术相比,具有以下有益效果:After adopting the above technical solution, compared with the prior art, the following beneficial effects are obtained:
1.实现远程物体尺寸测量,无需借助其他测量工具;1. Achieve remote object size measurement without the need for other measurement tools;
2.节省物体尺寸测量时间,提升工作效率。2. Save the object size measurement time and improve work efficiency.
附图说明DRAWINGS
图1为符合本发明一实施例中用于测量物体尺寸的方法的流程示意图;1 is a flow chart showing a method for measuring an object size in accordance with an embodiment of the present invention;
图2为符合本发明另一实施例中用于测量物体尺寸的方法的流程示意图;2 is a schematic flow chart of a method for measuring an object size according to another embodiment of the present invention;
图3为符合本发明一实施例中图1中步骤S101的流程示意图;3 is a schematic flow chart of step S101 of FIG. 1 in accordance with an embodiment of the present invention;
图4为符合本发明一实施例中用于测量物体尺寸的移动终端的结构框图;4 is a structural block diagram of a mobile terminal for measuring an object size in accordance with an embodiment of the present invention;
图5为符合本发明另一实施例中用于测量物体尺寸的移动终端的结构框图;5 is a structural block diagram of a mobile terminal for measuring an object size in accordance with another embodiment of the present invention;
图6为符合本发明一实施例中的成像原理图。Figure 6 is a schematic diagram of imaging in accordance with an embodiment of the present invention.
附图标记:Reference mark:
10-移动终端、11-存储器、12-处理器、13-拍照模块、14-通讯模块、15-显示模块、16-成像模块、17-第一距离传感器、18-第二距离传感器。10-Mobile terminal, 11-memory, 12-processor, 13-photographing module, 14-communication module, 15-display module, 16-imaging module, 17-first distance sensor, 18-second distance sensor.
具体实施方式Detailed ways
以下结合附图与具体实施例进一步阐述本发明的优点。Advantages of the present invention are further explained below in conjunction with the accompanying drawings and specific embodiments.
这里将详细地对示例性实施例进行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本公开相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本公开的一些方面相一致的装置和方法的例子。Exemplary embodiments will be described in detail herein, examples of which are illustrated in the accompanying drawings. The following description refers to the same or similar elements in the different figures unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with aspects of the present disclosure as detailed in the appended claims.
在本公开使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本公开。在本公开和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或” 是指并包含一个或多个相关联的列出项目的任何或所有可能组合。The terms used in the present disclosure are for the purpose of describing particular embodiments only, and are not intended to limit the disclosure. The singular forms "a", "the" and "the" It should also be understood that the term "and/or" is used herein. Means and includes any or all possible combinations of one or more associated listed items.
应当理解,尽管在本公开可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本公开范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。It should be understood that although the terms first, second, third, etc. may be used in the present disclosure to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, the first information may also be referred to as second information without departing from the scope of the present disclosure. Similarly, the second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "when" or "in response to a determination."
在本发明的描述中,需要理解的是,术语“纵向”、“横向”、“上”、“下”、“前”、“后”、“左”、“右”、“竖直”、“水平”、“顶”、“底”“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。In the description of the present invention, it is to be understood that the terms "longitudinal", "transverse", "upper", "lower", "front", "rear", "left", "right", "vertical", The orientation or positional relationship of the indications of "horizontal", "top", "bottom", "inside", "outside", etc. is based on the orientation or positional relationship shown in the drawings, only for the convenience of describing the present invention and simplifying the description, rather than It is to be understood that the device or elements referred to have a particular orientation, are constructed and operated in a particular orientation and are therefore not to be construed as limiting.
在本发明的描述中,除非另有规定和限定,需要说明的是,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是机械连接或电连接,也可以是两个元件内部的连通,可以是直接相连,也可以通过中间媒介间接相连,对于本领域的普通技术人员而言,可以根据具体情况理解上述术语的具体含义。In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "mounted", "connected", and "connected" are to be understood broadly, and may be, for example, mechanical or electrical, or both. The internal communication of the components may be directly connected or indirectly connected through an intermediate medium. For those skilled in the art, the specific meanings of the above terms may be understood according to specific circumstances.
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本发明的说明,其本身并没有特定的意义。因此,“模块”与“部件”可以混合地使用。In the following description, the use of suffixes such as "module", "component" or "unit" for indicating an element is merely an explanation for facilitating the present invention, and does not have a specific meaning per se. Therefore, "module" and "component" can be used in combination.
参阅图1,为符合本发明一实施例中用于测量物体尺寸的方法的流程示意图,所述方法包括以下步骤:1 is a schematic flow chart of a method for measuring an object size according to an embodiment of the present invention, the method comprising the following steps:
S101:一移动终端10对一被测物体自动对焦并形成一成像图像。S101: A mobile terminal 10 automatically focuses on an object to be measured and forms an image of an image.
所述方法的实现依托于一具有拍照功能的移动终端10,且所述移动终端10具备自动对焦功能。本步骤中所述移动终端10对一被测物体进行自动对焦,并形成一成像图像。本实施例中,所述移动终端10通过单摄像头进行对焦,所述摄像头内具有镜片组,所述被测物体反射的光线经所述摄像头内的镜片组后形成一成像图像。所述摄像头内也可仅含有一凸透镜片进行拍摄操作。The implementation of the method is based on a mobile terminal 10 having a camera function, and the mobile terminal 10 is provided with an auto focus function. In this step, the mobile terminal 10 automatically focuses on an object to be measured and forms an image of the image. In this embodiment, the mobile terminal 10 performs focusing by a single camera. The camera has a lens group therein, and the light reflected by the measured object forms an image by the lens group in the camera. The camera may also include only one lenticular lens sheet for the photographing operation.
根据凸透镜成像原理,所述被测物体与凸透镜的距离即物距,当所述物距大于2倍焦距时,于所述凸透镜的另一侧成倒立缩小的实像,所述实像与所述凸透镜的距离即像距。本实施例中所述自动对焦的实现,是在焦距、物距不变的情况下,调节所述像距,使得成像图像达到最清晰的状态,也就是所述移动终端10检测到的成像的位置正好处于所述被测物体的实像的位置上。当所述物距发生变化时,应实时地调整像距,满足成像 图像清晰的要求,以实现自动对焦。According to the principle of convex lens imaging, the distance between the object to be measured and the convex lens, that is, the object distance, when the object distance is greater than 2 times the focal length, is an inverted and reduced real image on the other side of the convex lens, the real image and the convex lens The distance is the image distance. In the embodiment, the autofocus is implemented by adjusting the image distance when the focal length and the object distance are constant, so that the imaged image reaches the clearest state, that is, the imaged image detected by the mobile terminal 10. The position is exactly at the position of the real image of the object to be measured. When the object distance changes, the image distance should be adjusted in real time to satisfy the imaging. The image is clearly required to achieve autofocus.
对于多个镜片组成的镜片组,其自动对焦原理与单一的凸透镜成像对焦原理相似,也是调节所述像距来实现最优的成像图像。所述摄像头是可移动的,也就是从外部看到的“可伸缩”移动。For a lens group composed of a plurality of lenses, the autofocus principle is similar to the single convex lens imaging focusing principle, and the image distance is adjusted to achieve an optimal imaging image. The camera is movable, that is, a "scalable" movement seen from the outside.
S102:获取所述被测物体的像距。S102: Acquire an image distance of the measured object.
所述像距的获取是实现后续步骤计算被测物体尺寸的基础。所述移动终端10内布设一第一距离传感器17,所述第一距离传感器17检测所述摄像头至成像位置的距离。所述第一距离传感器17可以是红外传感器、超声波传感器,直接进行距离探测并传输至所述处理器12;也可以是在所述摄像头的移动路径上布设的接触式检测点,所述接触式检测点可以是压电材料,每一所述接触式检测点均预设了对应的像距参数,通过获取不同的接触式检测点的状态能够感知所述摄像头的移动位置,从而获取像距。The acquisition of the image distance is the basis for realizing the subsequent steps of calculating the size of the measured object. A first distance sensor 17 is disposed in the mobile terminal 10, and the first distance sensor 17 detects a distance of the camera to an imaging position. The first distance sensor 17 may be an infrared sensor or an ultrasonic sensor, and directly performs distance detection and transmission to the processor 12; or may be a contact detection point disposed on a moving path of the camera, the contact type The detection point may be a piezoelectric material, and each of the contact detection points presets a corresponding image distance parameter, and the moving position of the camera can be perceived by acquiring the state of the different contact detection points, thereby obtaining the image distance.
S103:根据所述移动终端10内预设的焦距及所述像距计算所述被测物体的物距。S103: Calculate an object distance of the measured object according to a preset focal length and the image distance in the mobile terminal 10.
本步骤通过凸透镜成像原理计算所述被测物体的物距,计算公式为:In this step, the object distance of the measured object is calculated by the convex lens imaging principle, and the calculation formula is:
Figure PCTCN2017110095-appb-000001
Figure PCTCN2017110095-appb-000001
其中f为焦距,v为像距,u为物距。本实施例中,所述摄像头的焦距是一常量参数,预设于所述移动终端10内,所述像距已在步骤S102中获取,故可计算得出所述被测物体的物距。Where f is the focal length, v is the image distance, and u is the object distance. In this embodiment, the focal length of the camera is a constant parameter, which is preset in the mobile terminal 10, and the image distance has been acquired in step S102, so the object distance of the measured object can be calculated.
S104:获取所述被测物体的成像图像尺寸。S104: Acquire an image size of the image of the measured object.
所述被测物体发射的光线经所述摄像头后于所述移动终端10内成像,形成一成像图像,这是光学成像,本步骤获取所述光学成像的成像图像的尺寸。所述光学成像的成像图像首先会在所述移动终端10内的感光元件上形成,而后被转换为数字格式的图像形式,以像素点来表示,所述数字格式的成像图像的尺寸与其包含的像素点数有关。所述移动终端10内预设数字格式的成像图像的像素点的范围与光学成像的成像图像的尺寸的对应关系,该对应关系为线性关系。例如数字格式的成像图像的像素点范围为100*100,则其对应的光学成像的成像图像的大小为1厘米*1厘米;同样地,像素点范围为200*200的数字格式成像图像对应的光学成像的成像图像大小为2厘米*2厘米。所述对应关系受所述移动终端10的感光元件、转换电路以及显示屏幕的分辨率的参数影响。The light emitted by the measured object is imaged in the mobile terminal 10 through the camera to form an image, which is optical imaging. In this step, the size of the optically imaged image is acquired. The optically imaged image is first formed on a photosensitive element within the mobile terminal 10 and then converted into an image format in a digital format, represented by pixels, the size of the imaged image of the digital format and its inclusion The number of pixels is related. Corresponding relationship between the range of pixel points of the imaged image of the digital format preset in the mobile terminal 10 and the size of the imaged image of the optical imaging, the correspondence relationship being a linear relationship. For example, in a digital format, the imaged image has a pixel point range of 100*100, and the corresponding optically imaged image has a size of 1 cm*1 cm; similarly, a digital format image corresponding to a pixel range of 200*200 corresponds to The image size of the optical imaging image is 2 cm * 2 cm. The correspondence relationship is affected by parameters of the photosensitive element of the mobile terminal 10, the conversion circuit, and the resolution of the display screen.
为实现获取所述数字格式的成像图像的像素点范围,可通过图像识别来识别所述成像图像的边界轮廓,从而得到其像素点范围。 To achieve the pixel point range of the imaged image in the digital format, the boundary contour of the imaged image can be identified by image recognition, thereby obtaining its pixel point range.
S105:计算所述被测物体的尺寸。S105: Calculate the size of the measured object.
参阅图6,为本实施例中凸透镜成像的原理图,可以看到被测物体的轮廓为线段AB,成像图像的轮廓为线段CD,凸透镜的中心点为O,所述被测物体的物距为线段BO,所述成像图像的像距为线段DO,线段AB平行于线段CD。其中,利用对顶角相似原理可以证明三角形AOB相似于三角形COD,则有以下式子:Referring to FIG. 6 , which is a schematic diagram of the convex lens imaging in the embodiment, it can be seen that the contour of the measured object is the line segment AB, the contour of the image is the line segment CD, the center point of the convex lens is O, and the object distance of the measured object is For the line segment BO, the image distance of the imaged image is the line segment DO, and the line segment AB is parallel to the line segment CD. Among them, using the principle of apex angle similarity can prove that the triangle AOB is similar to the triangle COD, then there is the following formula:
Figure PCTCN2017110095-appb-000002
Figure PCTCN2017110095-appb-000002
其中物距BO在步骤S103中获得,像距DO在步骤S104中获得,成像图像的尺寸CD在步骤S104中获得,最终可求得被测物体的尺寸AB。Wherein the object distance BO is obtained in step S103, the image distance DO is obtained in step S104, and the size CD of the imaged image is obtained in step S104, and finally the size AB of the measured object can be obtained.
所述被测物体的外部轮廓由多组线段组成,可由本步骤计算出所有轮廓线段的长度,或者根据所述被测物体的几何特征求得关键尺寸,例如三角形的高、圆形的半径等尺寸。The outer contour of the measured object is composed of a plurality of sets of line segments, and the length of all the contour segments can be calculated by this step, or the critical dimension can be obtained according to the geometric features of the measured object, such as the height of the triangle, the radius of the circle, and the like. size.
作为所述用于测量物体尺寸的方法的进一步改进,步骤S105之后,所述用户测量物体尺寸的方法还包括以下步骤:As a further improvement of the method for measuring the size of an object, after the step S105, the method for measuring the size of the object by the user further comprises the following steps:
S106:于所述移动终端10的显示界面上显示所述被测物体的成像图像及尺寸。S106: Display an image and size of the image of the measured object on a display interface of the mobile terminal 10.
本步骤执行显示操作,向用户显示所述被测物体的尺寸。所述步骤S105计算出所述被测物体的尺寸之后,还需要让用户知道测量结果,可在所述移动终端10的显示界面上显示所述成像图像的同时,显示所述被测物体的尺寸。所述被测物体的尺寸以数字加上单位的形式显示。This step performs a display operation to display the size of the object to be measured to the user. After the step S105 calculates the size of the measured object, the user needs to know the measurement result, and the size of the measured object can be displayed while displaying the imaged image on the display interface of the mobile terminal 10. . The size of the object to be measured is displayed in the form of a number plus a unit.
参阅图2,为符合本发明另一实施例中用于测量物体尺寸的方法的流程示意图,步骤S103替换为:Referring to FIG. 2, which is a schematic flowchart of a method for measuring an object size according to another embodiment of the present invention, step S103 is replaced by:
步骤S107:所述移动终10上的第二距离传感器18检测所述移动终端10与所述被测物体的距离,得到物距。Step S107: The second distance sensor 18 on the mobile terminal 10 detects the distance between the mobile terminal 10 and the measured object to obtain an object distance.
本实施例采取直接测量的方式获取所述物距,由于用户使用所述移动终端10对所述被测物体拍摄时,所述移动终端10正对着所述被测物体,具备了使用所述第二距离传感器18进行距离检测的条件。所述第二距离传感器18可以是红外传感器、超声波传感器,将检测的所述移动终端10与所述被测物体的距离信息传输给所述处理器12,从而获取所述物距。In this embodiment, the object distance is obtained by using a direct measurement method. When the user uses the mobile terminal 10 to shoot the object to be measured, the mobile terminal 10 is facing the object to be measured, and the use of the object is provided. The second distance sensor 18 performs a condition of distance detection. The second distance sensor 18 may be an infrared sensor, an ultrasonic sensor, and the distance information of the detected mobile terminal 10 and the measured object is transmitted to the processor 12 to acquire the object distance.
参阅图3,为符合本发明一实施例中图1中步骤S101的流程示意图,步骤S101包括:Referring to FIG. 3, which is a schematic flowchart of step S101 in FIG. 1 according to an embodiment of the present invention, step S101 includes:
步骤S101-1:所述移动终端10对所述被测物体执行一次成像操作,得到一成像图像。Step S101-1: The mobile terminal 10 performs an imaging operation on the measured object to obtain an imaged image.
本步骤执行成像操作,即所述被测物体反射的光线经所述移动终端10的摄像头投射 至所述移动终端10内的感光元件上,形成一光学成像的成像图像。再由所述感光元件及转换电路将所述光学成像的成像图像转换为数字格式的成像图像。This step performs an imaging operation, that is, the light reflected by the measured object is projected through the camera of the mobile terminal 10 An optically imaged image is formed onto the photosensitive element within the mobile terminal 10. The optically imaged image is then converted by the photosensitive element and the conversion circuit into an imaged image in digital format.
步骤S101-2:使用调焦评价函数计算所述成像图像的清晰度。Step S101-2: Calculating the sharpness of the imaged image using a focus evaluation function.
本步骤执行清晰度计算,使用所述调焦评价函数对所述步骤S101-1得到的数字格式的成像图像进行清晰度计算。数字格式的成像图像以像素信息来表示图像,相应地,所述调焦评价函数对所述像素信息进行计算,得到清晰度值。所述调焦评价函数可由多种算法实现,例如灰度梯度算法、频域分析法、统计学函数等,其中灰度梯度算法又包括拉普拉斯算子法、灰度方差算子法、梯度向量平方函数、差分绝对值之和法、Robert算子、S0be1算子法等。This step performs a sharpness calculation, and uses the focus evaluation function to perform a sharpness calculation on the imaged image of the digital format obtained in the step S101-1. The imaged image in the digital format represents the image in pixel information, and accordingly, the focus evaluation function calculates the pixel information to obtain a sharpness value. The focus evaluation function can be implemented by various algorithms, such as a gray gradient algorithm, a frequency domain analysis method, a statistical function, etc., wherein the gray gradient algorithm includes a Laplacian algorithm, a gray variance operator method, Gradient vector square function, difference absolute value sum method, Robert operator, S0be1 operator method, etc.
步骤S101-3:判断所述清晰度是否大于或等于一预设于所述移动终端内的清晰度阈值。Step S101-3: determining whether the resolution is greater than or equal to a sharpness threshold preset in the mobile terminal.
所述移动终端内预设一清晰度阈值,用于判断所述成像图像的清晰度是否满足对焦要求。所述步骤S101-2计算的清晰度为一单一量纲的数值,因此可进行数值比较。A resolution threshold is preset in the mobile terminal for determining whether the resolution of the imaged image meets a focus requirement. The resolution calculated in the step S101-2 is a single dimension value, so that numerical comparison can be performed.
步骤S101-4:当所述清晰度大于或等于所述清晰度阈值时,停止自动对焦。Step S101-4: When the sharpness is greater than or equal to the sharpness threshold, the autofocus is stopped.
当所述步骤S101-3判断成立,即所述清晰度大于或等于所述清晰度阈值时,本步骤执行停止自动对焦操作,将当前的成像图像作为最终的成像图像记录,而后执行步骤S102。When the determination of the step S101-3 is established, that is, the sharpness is greater than or equal to the sharpness threshold, this step performs the stop of the autofocus operation, records the current imaged image as the final imaged image, and then performs step S102.
步骤S101-5:当所述清晰度小于所述清晰度阈值时,调整所述被测物体的像距,重复上述步骤S101-1、步骤S101-2及步骤S101-3。Step S101-5: When the sharpness is smaller than the sharpness threshold, adjust the image distance of the measured object, and repeat step S101-1, step S101-2, and step S101-3.
当所述步骤S101-3判断不成立,即所述清晰度小于所述清晰度阈值时,执行本步骤。本步骤调整所述被测物体的像距,也就是调整所述光学成像的成像图像与所述摄像头的距离,以便寻找最佳成像位置。本步骤执行后继续回到所述步骤S101-1,继续下一次的成像、清晰度计算即判断,直至所述清晰度大于所述清晰度阈值,进入步骤步骤S101-4,结束自动对焦。When the step S101-3 determines that the determination is not true, that is, the resolution is less than the resolution threshold, the step is performed. In this step, the image distance of the measured object is adjusted, that is, the distance between the optically imaged image and the camera is adjusted to find the optimal imaging position. After the execution of this step, the process proceeds to step S101-1 to continue the next imaging, definition calculation, that is, until the resolution is greater than the definition threshold, and proceeds to step S101-4 to end the autofocus.
作为所述计算机程序的进一步改进,所述步骤S101-5中调整所述被测物体的像距时,通过调整所述移动终端10的镜头与所述被测物体的成像位置的距离实现。所述移动终端10的摄像头内包含有镜头,调整所述镜头与所述成像位置的距离,也就是调整了像距。本实施例采用定焦调整的方式,即所述镜头的焦距不便,采用改变像距的方式进行对焦。实际上所述成像位置也就是所述感光元件的位置,所述感光元件一般固定于所述移动终端10内,可移动的部件为所述镜头。 As a further improvement of the computer program, when the image distance of the measured object is adjusted in the step S101-5, the distance between the lens of the mobile terminal 10 and the imaging position of the measured object is adjusted. The camera of the mobile terminal 10 includes a lens, and adjusts the distance between the lens and the imaging position, that is, adjusts the image distance. In this embodiment, the method of adjusting the focus is adopted, that is, the focal length of the lens is inconvenient, and the image is changed by changing the image distance. The image forming position is actually the position of the photosensitive member, and the photosensitive member is generally fixed in the mobile terminal 10, and the movable member is the lens.
作为所述用于测量物体尺寸的方法的进一步改进,调整所述移动终端10的镜头与所述被测物体的成像位置的距离时,通过手动机械调整或电动马达调整。本改进实施例给出了调节所述镜头与所述成像位置距离的方式,实际上就是移动所述镜头的方式。一种方式是手动机械的方式,也就是用户手动操作所述镜头,改变所述镜头与所述成像位置的距离,生活中常见的光学相机就采用手动机械方式进行镜头位置调整。另一种是采用电动马达调整,所述移动终端10内置有电动马达,能够驱动所述镜头沿着光路方向拉伸或收缩,从而改变所述镜头与所述感光元件的位置。所述移动终端10提供有操作按钮,允许用户点击按钮进行调整。As a further improvement of the method for measuring the size of an object, when the distance between the lens of the mobile terminal 10 and the imaging position of the object to be measured is adjusted, it is adjusted by manual mechanical adjustment or electric motor. The present modified embodiment provides a way of adjusting the distance between the lens and the imaging position, which is actually the manner in which the lens is moved. One way is manual mechanical mode, that is, the user manually operates the lens to change the distance between the lens and the imaging position. The optical camera commonly used in life adopts manual mechanical mode to adjust the lens position. The other is an electric motor adjustment, and the mobile terminal 10 incorporates an electric motor capable of driving the lens to be stretched or contracted in the optical path direction, thereby changing the position of the lens and the photosensitive member. The mobile terminal 10 is provided with an operation button that allows the user to click a button to make adjustments.
作为所述用于测量物体尺寸的方法的进一步改进,获取所述被测物体的像距时,通过一第一距离传感器17检测所述被测物体的成像位置与所述移动终端10的镜头的距离。本改进实施例通过所述第一距离传感器17检测所述成像位置,也就是所述感光元件与所述镜头的位置。所述第一距离传感器17可以是超声波传感器、红外传感器等非接触式距离传感器,也可以采用接触式传感器,例如于所述镜头的移动轨迹上布设一线型电阻,所述镜头上布设一金属凸起与所述线型电阻接触,当所述镜头移动时,所述线型电阻的一端与所述金属凸起之间的电阻值会发生变化,从而获取所述镜头的移动位置。所述移动终端10内预存所述电阻值与所述镜头位置的对应关系。As a further improvement of the method for measuring an object size, when an image distance of the measured object is acquired, an imaging position of the measured object and a lens of the mobile terminal 10 are detected by a first distance sensor 17 distance. The improved embodiment detects the image forming position, that is, the position of the photosensitive member and the lens, by the first distance sensor 17. The first distance sensor 17 may be a non-contact distance sensor such as an ultrasonic sensor or an infrared sensor, or a touch sensor may be used. For example, a line type resistor is disposed on the movement track of the lens, and a metal protrusion is disposed on the lens. In contact with the linear resistor, when the lens moves, a resistance value between one end of the linear resistor and the metal bump changes, thereby acquiring a moving position of the lens. Corresponding relationship between the resistance value and the lens position is pre-stored in the mobile terminal 10.
参阅图4,为符合本发明一实施例中用于测量物体尺寸的移动终端10的结构框图,所述移动终端10包括:Referring to FIG. 4, which is a structural block diagram of a mobile terminal 10 for measuring an object size according to an embodiment of the present invention, the mobile terminal 10 includes:
-处理器12- processor 12
处理器12为所述移动终端10的核心部件,也就是CPU,可以进行高速运算,处理各种任务,运行计算机程序。The processor 12 is a core component of the mobile terminal 10, that is, a CPU, and can perform high-speed operations, process various tasks, and run a computer program.
-存储器11-Memory 11
存储器11存储所述计算机程序,以及所述计算机程序运行时所需的数据、图片、视频文件、音频文件、联系人等信息。所述处理器12可以从所述存储器11获取运行所需的各种数据。The memory 11 stores the computer program, as well as data, pictures, video files, audio files, contacts, and the like required for the computer program to run. The processor 12 can acquire various data required for operation from the memory 11.
-拍照模块13-Photographing module 13
所述拍照模块13设于所述移动终端10内,包括摄像头、快门等光学部件,其中摄像头包括镜头,所述镜头可以是单镜镜头,也可以是多个透镜组成的镜片组。The camera module 13 is disposed in the mobile terminal 10, and includes an optical component such as a camera and a shutter. The camera includes a lens, and the lens may be a single mirror lens or a lens group composed of a plurality of lenses.
-通讯模块14-Communication module 14
通讯模块14为与外部进行通信连接的模块,可以是无线网卡(wifi模块)、移动蜂 窝通信模块、蓝牙模块等类型,可根据应用场合连接不同的网络。所述通讯模块14可接收外部发来的通信信息,也可向外发送通信信息。The communication module 14 is a module for communication connection with the outside, and may be a wireless network card (wifi module), a mobile bee. The socket communication module, Bluetooth module and other types can be connected to different networks according to the application. The communication module 14 can receive communication information sent from the outside, and can also send the communication information outward.
-显示模块15- display module 15
显示模块15是所述移动终端10的重要组成部分,向用户显示各种功能界面,尤其是所述显示模块15包括触摸屏时,还可以接收用户的输入操作。所述显示模块15向用户显示各种提示信息。所述显示模块15显示所述数字格式的成像图像及所述被测物体的尺寸。The display module 15 is an important component of the mobile terminal 10, and displays various functional interfaces to the user. In particular, when the display module 15 includes a touch screen, it can also receive input operations of the user. The display module 15 displays various prompt information to the user. The display module 15 displays the imaged image in the digital format and the size of the object to be measured.
-成像模块16- imaging module 16
所述成像模块16与所述拍照模块13搭配使用,包括感光元件及转换电路,所述感光元件接收所述拍照模块13形成的光学成像的成像图像,并由所述转换电路转换为数字格式的成像图像。感光元件是成像技术的核心,有两种:一种是广泛使用的CCD(电荷耦合)元件;另一种是CMOS(互补金属氧化物导体)器件。The imaging module 16 is used in combination with the camera module 13 and includes a photosensitive element and a conversion circuit. The photosensitive element receives an optically imaged image formed by the camera module 13 and is converted into a digital format by the conversion circuit. Imaging images. Photosensitive elements are the core of imaging technology. There are two types: one is a widely used CCD (charge-coupled) device; the other is a CMOS (complementary metal oxide conductor) device.
-第一距离传感器17- first distance sensor 17
所述第一距离传感器17用于检测所述被测物体的成像位置与所述移动终端10的镜头的距离。所述第一距离传感器17可以是超声波传感器、红外传感器等非接触式距离传感器,也可以采用接触式传感器,例如于所述镜头的移动轨迹上布设一线型电阻,所述镜头上布设一金属凸起与所述线型电阻接触,当所述镜头移动时,所述线型电阻的一端与所述金属凸起之间的电阻值会发生变化,从而获取所述镜头的移动位置。所述移动终端10内预存所述电阻值与所述镜头位置的对应关系。所述第一距离传感器17将检测到的距离参数传输给所述处理器12,从而获取所述像距。The first distance sensor 17 is configured to detect a distance between an imaging position of the measured object and a lens of the mobile terminal 10. The first distance sensor 17 may be a non-contact distance sensor such as an ultrasonic sensor or an infrared sensor, or a touch sensor may be used. For example, a line type resistor is disposed on the movement track of the lens, and a metal protrusion is disposed on the lens. In contact with the linear resistor, when the lens moves, a resistance value between one end of the linear resistor and the metal bump changes, thereby acquiring a moving position of the lens. Corresponding relationship between the resistance value and the lens position is pre-stored in the mobile terminal 10. The first distance sensor 17 transmits the detected distance parameter to the processor 12 to acquire the image distance.
作为所述移动终端10的进一步改进,所述拍照模块13包括电动马达,所述电动马达调整所述拍照模块中镜头与所述成像模块的距离。As a further improvement of the mobile terminal 10, the photographing module 13 includes an electric motor that adjusts a distance between a lens and the imaging module in the photographing module.
参阅图5,为符合本发明另一实施例中用于测量物体尺寸的移动终端10的结构框图,所述移动终端10还包括:Referring to FIG. 5, which is a structural block diagram of a mobile terminal 10 for measuring an object size according to another embodiment of the present invention, the mobile terminal 10 further includes:
-第二距离传感器18- second distance sensor 18
所述第二距离传感器18采用非接触式方式检测所述被测物体与所述移动终端10的距离。所述第二距离传感器18可以是红外传感器、超声波传感器,将检测的所述移动终端10与所述被测物体的距离信息传输给所述处理器12,从而获取所述物距。The second distance sensor 18 detects the distance between the measured object and the mobile terminal 10 in a non-contact manner. The second distance sensor 18 may be an infrared sensor, an ultrasonic sensor, and the distance information of the detected mobile terminal 10 and the measured object is transmitted to the processor 12 to acquire the object distance.
移动终端10可以以各种形式来实施。例如,本发明中描述的终端可以包括诸如移动电话、智能电话、笔记本电脑、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多 媒体播放器)、导航装置等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。下面,假设终端是移动终端。然而,本领域技术人员将理解的是,除了特别用于移动目的的元件之外,根据本发明的实施方式的构造也能够应用于固定类型的终端。The mobile terminal 10 can be implemented in various forms. For example, the terminal described in the present invention may include, for example, a mobile phone, a smart phone, a notebook computer, a PDA (Personal Digital Assistant), a PAD (Tablet), a PMP (portable multiple Mobile terminals of media players, navigation devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, those skilled in the art will appreciate that configurations in accordance with embodiments of the present invention can be applied to fixed type terminals in addition to components that are specifically for mobile purposes.
应当注意的是,本发明的实施例有较佳的实施性,且并非对本发明作任何形式的限制,任何熟悉该领域的技术人员可能利用上述揭示的技术内容变更或修饰为等同的有效实施例,但凡未脱离本发明技术方案的内容,依据本发明的技术实质对以上实施例所作的任何修改或等同变化及修饰,均仍属于本发明技术方案的范围内。 It should be noted that the embodiments of the present invention are preferred embodiments, and are not intended to limit the scope of the present invention. Any one skilled in the art may use the above-disclosed technical contents to change or modify the equivalent embodiments. Any modification or equivalent changes and modifications of the above embodiments in accordance with the technical spirit of the present invention are still within the scope of the technical solutions of the present invention.

Claims (10)

  1. 一种用于测量物体尺寸的方法,其特征在于,包括以下步骤:A method for measuring an object size, comprising the steps of:
    一移动终端对一被测物体自动对焦并形成一成像图像;A mobile terminal automatically focuses on an object to be measured and forms an image of the image;
    获取所述被测物体的像距;Obtaining an image distance of the measured object;
    根据所述移动终端内预设的焦距及所述像距计算所述被测物体的物距;Calculating an object distance of the measured object according to a preset focal length and the image distance in the mobile terminal;
    获取所述被测物体的成像图像尺寸;Obtaining an image size of the image to be measured;
    计算所述被测物体的尺寸。Calculating the size of the measured object.
  2. 如权利要求1所述的用于测量物体尺寸的方法,其特征在于,A method for measuring an object size according to claim 1, wherein
    一移动终端对一被测物体自动对焦并形成一成像图像的步骤包括:The step of a mobile terminal automatically focusing on an object to be measured and forming an image of the image includes:
    所述移动终端对所述被测物体执行一次成像操作,得到一成像图像;The mobile terminal performs an imaging operation on the measured object to obtain an image of the image;
    使用调焦评价函数计算所述成像图像的清晰度;Calculating the sharpness of the imaged image using a focus evaluation function;
    判断所述清晰度是否大于或等于一预设于所述移动终端内的清晰度阈值;Determining whether the resolution is greater than or equal to a definition threshold preset in the mobile terminal;
    当所述清晰度大于或等于所述清晰度阈值时,停止自动对焦;Stopping the auto focus when the sharpness is greater than or equal to the sharpness threshold;
    当所述清晰度小于所述清晰度阈值时,调整所述被测物体的像距,重复上述成像操作步骤、清晰度计算及判断步骤。When the sharpness is smaller than the sharpness threshold, the image distance of the measured object is adjusted, and the imaging operation step, the sharpness calculation and the determining step are repeated.
  3. 如权利要求2所述的用于测量物体尺寸的方法,其特征在于,A method for measuring an object size according to claim 2, wherein
    调整所述移动终端的像距通过调整所述移动终端的镜头与所述被测物体的成像位置的距离实现。Adjusting the image distance of the mobile terminal is achieved by adjusting a distance between a lens of the mobile terminal and an imaging position of the measured object.
  4. 如权利要求3所述的用于测量物体尺寸的方法,其特征在于,A method for measuring an object size according to claim 3, wherein
    调整所述移动终端的镜头与所述被测物体的成像位置的距离时,通过手动机械调整或电动马达调整。When the distance between the lens of the mobile terminal and the imaging position of the object to be measured is adjusted, it is adjusted by manual mechanical adjustment or electric motor.
  5. 如权利要求1-4任一项所述的用于测量物体尺寸的方法,其特征在于,A method for measuring an object size according to any one of claims 1 to 4, characterized in that
    获取所述被测物体的像距时,通过一第一距离传感器检测所述被测物体的成像位置与所述移动终端的镜头的距离。When acquiring the image distance of the measured object, the distance between the imaging position of the measured object and the lens of the mobile terminal is detected by a first distance sensor.
  6. 如权利要求1-4任一项所述的用于测量物体尺寸的方法,其特征在于,A method for measuring an object size according to any one of claims 1 to 4, characterized in that
    计算所述被测物体的尺寸的步骤之后,所述用于测量物体尺寸的方法还包括以下步骤:After the step of calculating the size of the object to be measured, the method for measuring the size of the object further includes the following steps:
    于所述移动终端的显示界面上显示所述被测物体的成像图像及尺寸。Displaying an image and size of the object to be measured on a display interface of the mobile terminal.
  7. 如权利要求1-4任一项所述的用于测量物体尺寸的方法,其特征在于, A method for measuring an object size according to any one of claims 1 to 4, characterized in that
    根据所述移动终端的焦距及所述像距计算所述被测物体的物距的步骤替换为:The step of calculating the object distance of the measured object according to the focal length of the mobile terminal and the image distance is replaced by:
    所述移动终端上的第二距离传感器检测所述移动终端与所述被测物体的距离,得到物距。A second distance sensor on the mobile terminal detects a distance between the mobile terminal and the measured object to obtain an object distance.
  8. 一种移动终端,包括存储器、处理器、通讯模块、拍照模块、成像模块、显示模块、第一距离传感器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现以下步骤:A mobile terminal includes a memory, a processor, a communication module, a camera module, an imaging module, a display module, a first distance sensor, and a computer program stored on the memory and operable on the processor, wherein the processing The following steps are implemented when the computer program is executed:
    所述拍照模块对一被测物体自动对焦并于所述成像模块上形成一成像图像;The camera module automatically focuses on an object to be measured and forms an image on the imaging module;
    所述处理器从所述拍照模块获取所述被测物体的像距;Obtaining an image distance of the measured object from the camera module;
    所述处理器根据所述移动终端的焦距及所述像距计算所述被测物体的物距;The processor calculates an object distance of the measured object according to a focal length of the mobile terminal and the image distance;
    所述处理器从所述成像模块获取所述被测物体的成像尺寸;Obtaining, by the processor, an imaging size of the measured object from the imaging module;
    所述处理器计算所述被测物体的尺寸。The processor calculates a size of the measured object.
  9. 如权利要求8所述的移动终端,其特征在于,The mobile terminal of claim 8 wherein:
    所述拍照模块包括电动马达,所述电动马达调整所述拍照模块中镜头与所述成像模块的距离。The photographing module includes an electric motor that adjusts a distance between a lens and the imaging module in the photographing module.
  10. 如权利要求8或9所述的移动终端,其特征在于,A mobile terminal according to claim 8 or 9, wherein
    所述移动终端还包括第二距离传感器,所述第二距离传感器检测所述移动终端与所述被测物体的距离,得到物距。 The mobile terminal further includes a second distance sensor, and the second distance sensor detects a distance between the mobile terminal and the measured object to obtain an object distance.
PCT/CN2017/110095 2017-11-09 2017-11-09 Method for measuring size of object and mobile terminal WO2019090556A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/110095 WO2019090556A1 (en) 2017-11-09 2017-11-09 Method for measuring size of object and mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/110095 WO2019090556A1 (en) 2017-11-09 2017-11-09 Method for measuring size of object and mobile terminal

Publications (1)

Publication Number Publication Date
WO2019090556A1 true WO2019090556A1 (en) 2019-05-16

Family

ID=66438187

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/110095 WO2019090556A1 (en) 2017-11-09 2017-11-09 Method for measuring size of object and mobile terminal

Country Status (1)

Country Link
WO (1) WO2019090556A1 (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110157407A1 (en) * 2009-12-29 2011-06-30 Avermedia Information, Inc. Document camera with size-estimating function and size estimation method
CN105136042A (en) * 2015-08-20 2015-12-09 广东欧珀移动通信有限公司 Height measuring method and apparatus, and mobile terminal
CN105547159A (en) * 2015-12-11 2016-05-04 上海卓易科技股份有限公司 Method of measuring object based on mobile terminal and mobile terminal
CN105554247A (en) * 2015-12-07 2016-05-04 魅族科技(中国)有限公司 Measuring method, measuring system and terminal
CN105571495A (en) * 2015-12-30 2016-05-11 青岛海信移动通信技术股份有限公司 Measuring method and device
WO2016184152A1 (en) * 2015-10-23 2016-11-24 中兴通讯股份有限公司 Measuring method and apparatus, mobile terminal and storage medium
CN106595489A (en) * 2016-10-28 2017-04-26 惠州Tcl移动通信有限公司 Mobile terminal for real-time distance measurement and method

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110157407A1 (en) * 2009-12-29 2011-06-30 Avermedia Information, Inc. Document camera with size-estimating function and size estimation method
CN105136042A (en) * 2015-08-20 2015-12-09 广东欧珀移动通信有限公司 Height measuring method and apparatus, and mobile terminal
WO2016184152A1 (en) * 2015-10-23 2016-11-24 中兴通讯股份有限公司 Measuring method and apparatus, mobile terminal and storage medium
CN105554247A (en) * 2015-12-07 2016-05-04 魅族科技(中国)有限公司 Measuring method, measuring system and terminal
CN105547159A (en) * 2015-12-11 2016-05-04 上海卓易科技股份有限公司 Method of measuring object based on mobile terminal and mobile terminal
CN105571495A (en) * 2015-12-30 2016-05-11 青岛海信移动通信技术股份有限公司 Measuring method and device
CN106595489A (en) * 2016-10-28 2017-04-26 惠州Tcl移动通信有限公司 Mobile terminal for real-time distance measurement and method

Similar Documents

Publication Publication Date Title
US10564392B2 (en) Imaging apparatus and focus control method
CN107924104B (en) Depth sensing autofocus multi-camera system
KR102085766B1 (en) Method and Apparatus for controlling Auto Focus of an photographing device
US20140184854A1 (en) Front camera face detection for rear camera zoom function
RU2612892C2 (en) Method and device of auto focus
JP2018510324A (en) Method and apparatus for multi-technology depth map acquisition and fusion
US9491352B2 (en) Imaging device, signal processing method, and signal processing program
EP3544286B1 (en) Focusing method, device and storage medium
JP2012095019A (en) Imaging device
JP5951043B2 (en) Image measuring device
TWI536066B (en) Electronic device and focus adjustment method thereof
US10863077B2 (en) Image photographing method, apparatus, and terminal
KR102382871B1 (en) Electronic Device for controlling lens focus and the controlling Method thereof
CN105190392A (en) Image pickup device and focusing control method
US9781333B2 (en) Imaging device and focus control method
CN106859652A (en) A kind of Human Height measuring method
TWI451184B (en) Focus adjusting method and image capture device thereof
JP6186498B2 (en) Imaging apparatus and focus control method
WO2016197494A1 (en) Method and device for adjusting focusing area
TWI392852B (en) Portable electric device using auto focus for distance measurement and distance measuring method using the same
KR20190085787A (en) Electronic device and method for processing image of the same
CN105180802A (en) Identification method and device of object size information
WO2019090556A1 (en) Method for measuring size of object and mobile terminal
JP5996233B2 (en) Imaging device
US10248859B2 (en) View finder apparatus and method of operating the same

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: 17931420

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: 17931420

Country of ref document: EP

Kind code of ref document: A1