WO2016184152A1 - Measuring method and apparatus, mobile terminal and storage medium - Google Patents
Measuring method and apparatus, mobile terminal and storage medium Download PDFInfo
- Publication number
- WO2016184152A1 WO2016184152A1 PCT/CN2016/071191 CN2016071191W WO2016184152A1 WO 2016184152 A1 WO2016184152 A1 WO 2016184152A1 CN 2016071191 W CN2016071191 W CN 2016071191W WO 2016184152 A1 WO2016184152 A1 WO 2016184152A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- image
- measured
- lens
- distance
- size
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000005259 measurement Methods 0.000 claims description 33
- 238000000691 measurement method Methods 0.000 claims description 13
- 238000006243 chemical reaction Methods 0.000 claims description 12
- 230000006870 function Effects 0.000 description 8
- 238000003384 imaging method Methods 0.000 description 5
- 238000010586 diagram Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 238000004806 packaging method and process Methods 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/02—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
- G01B11/06—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness for measuring thickness ; e.g. of sheet material
- G01B11/0608—Height gauges
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/02—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B11/00—Measuring arrangements characterised by the use of optical techniques
- G01B11/02—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness
- G01B11/022—Measuring arrangements characterised by the use of optical techniques for measuring length, width or thickness by means of tv-camera scanning
Definitions
- the present invention relates to measurement technology, and in particular, to a measurement method, apparatus, mobile terminal and storage medium for performing measurement by an image acquisition device.
- embodiments of the present invention are directed to providing a measurement method, apparatus, mobile terminal, and storage medium, which are capable of measuring object length, width/height by an image acquisition device in an intelligent mobile terminal.
- An embodiment of the present invention provides a measurement method, where the method includes:
- the prepared distance determines a first actual length and/or a second actual length of the measured object.
- the first actual length is the length of the image collection surface of the object to be measured
- the second actual length is the width/height of the image collection surface of the object to be measured
- the determining the size of the collected object image includes: determining the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the size of a single photosensitive device of the image capturing device. The size of the collected object image of the measured object.
- the position of the object image is the distance between the object image and the lens of the image capturing device
- the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device
- the method further includes: determining a position of the object image, comprising: determining a position of the object image according to one or more of the following parameters:
- the starting point of the lens the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
- the method further includes: determining a distance between the measured object and the image capturing device, including: determining a distance between the measured object and the image capturing device according to the position of the object image and the focal length of the lens of the image capturing device.
- the embodiment of the invention further provides a measuring device, the device comprising: an image collecting module, an object size determining module, a length determining module, wherein
- the image acquisition module is configured to perform image collection on the object to be tested
- the object size determining module is configured to determine a size of the collected object image of the measured object
- the length determining module is configured to determine, according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device, the first actual length of the object to be tested and/or the second actual length.
- the object size determining module is configured to: according to the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the large size of a single photosensitive device of the image capturing device. Small, determine the size of the object image of the measured object.
- the apparatus further includes a first distance determining module configured to determine the position of the object image according to one or more of the following parameters:
- the starting point of the lens the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
- the device further includes a second distance determining module configured to determine a distance between the measured object and the image capturing device according to the position of the object image and the focal length of the lens of the image capturing device.
- the embodiment of the invention further provides a mobile terminal, wherein the mobile terminal comprises the above measuring device.
- the embodiment of the invention further provides a computer storage medium storing a computer program for performing the measurement method of the embodiment of the invention.
- the measurement method, the device, the mobile terminal and the storage medium provided by the embodiments of the present invention first perform image collection on the measured object, determine the size of the collected object image of the measured object, and then according to the size of the object image of the measured object. And determining a first actual length and/or a second actual length of the object to be measured, and a distance between the object and the image capturing device. In this way, the measurement of the length and width/height of the object can be achieved by the image acquisition device of the smart mobile terminal.
- FIG. 1 is a schematic flow chart of a measurement method according to an embodiment of the present invention.
- FIG. 2 is a schematic diagram of an image acquisition principle according to an embodiment of the present invention.
- FIG. 3 is a schematic diagram of a measurement range according to an embodiment of the present invention.
- FIG. 4 is a schematic structural flow chart of a measuring device according to an embodiment of the present invention.
- image acquisition is performed on the object to be measured, and the size of the object image of the measured object is determined; and then according to the size of the object image of the object to be measured, the position of the object image, and the measured pair
- the first actual length and/or the second actual length of the measured object is determined as the distance from the image acquisition device.
- the first actual length is the length of the image collection surface of the object to be measured
- the second actual length is the width/height of the image collection surface of the object to be measured. That is, when the image collection surface of the measured object is perpendicular to the horizontal plane, the first actual length is the length of the image collection surface of the measured object, and the second actual length is the image collection surface of the measured object.
- a height when the image collection surface of the object to be measured is parallel to a horizontal plane, the first actual length is a length of the image collection surface of the object to be measured, and the second actual length is an image collection surface of the object to be measured The width.
- FIG. 1 is a schematic flowchart of a measurement method according to an embodiment of the present invention. As shown in FIG. 1 , the measurement method in this embodiment includes the following steps:
- Step 101 Perform image acquisition on the measured object to determine the size of the collected object image of the measured object.
- the basic data and calibration data of the current image acquisition device module are first read. If the image acquisition device is an auto focus module, the basic reading can be directly performed.
- the data and calibration data include: horizontal resolution w0, vertical resolution h0, size p of a single photosensitive spot, distance e of hyperfocal distance, single-step lens moving distance d0, lens shift and object distance correspondence table u, lens starting point v0, The focal length f of the lens, the maximum number of movements n, the refractive index r, and the like. Then, the read information is saved, and the module is calibrated so that the lens of the image acquisition device can move linearly, thereby ensuring that the focal length can be calculated by using the moving distance.
- the basic data and calibration data that can be directly read include: horizontal resolution w, vertical resolution h, size p of a single photosensitive spot, starting point of the lens v0, lens The focal length f and so on.
- the fixed focus module does not involve lens movement and does not require module calibration.
- the autofocus group mode it is also required to follow the focus command of the platform. Line focusing operation.
- the focus is triggered according to the sharpness of the current picture, and the control module moves the lens to cause the image capture device to present a clear picture.
- the number of single moving steps can also be configured according to the performance requirement. The more the single moving step, the faster the focusing speed is, and the faster the measurement is completed, but the accuracy may be reduced because the single moving step is larger. Indicates that the image distance changes more clearly.
- the method further includes: reading a maximum size supported by the image collection device, and setting a preview mode.
- the maximum size supported by the image acquisition device can be considered as an image acquisition device that outputs a pixel corresponding to a single photosensor. If the image capture device supports the maximum size preview, set the preview to the maximum size. If the maximum size preview is not supported, you can configure the preview to be 1/2, 1/4, etc., but you need to record the conversion ratio.
- the conversion ratio is one pixel for several sensory devices, for example, when configured as a 1/4 size preview, that is, four photosensitive devices correspond to one pixel. Configure the focus function to start while opening the preview for the preview size. After the focus function is activated, the image capture device adjusts the camera in real time according to the currently previewed screen to make the preview image clear.
- determining the size of the collected object image includes: a number of pixels occupied by the object image, and a lens of the image acquisition device.
- the conversion rate and the size of a single photosensitive device of the image acquisition device determine the size of the image of the object to be measured.
- the edge of the automatically acquired object may be used to achieve the effect of the automatically configured measuring range;
- the user can determine the measurement range by dragging the cursor on the screen according to the position of the object to be measured in the image, so that the measured object is within the measurement range, and the measurement configuration is completed.
- the final determined measurement range is shown in FIG. Show, arrow For cursors, dashed boxes For the measurement range.
- the size of the object includes the image height in the horizontal direction and the image height in the vertical direction.
- the imaging height above the optical device can be calculated according to the number of imaging occupied pixels, that is, the horizontal measurement range w and the vertical measurement range h.
- the imaging height m is equal to the number of pixels (horizontal measurement)
- the range/vertical measurement range is multiplied by the conversion ratio r and multiplied by the size p of a single photosensitive device. which is:
- Step 102 Determine a first actual length and/or a second actual length of the object to be tested according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device.
- the first actual length is the length of the image collection surface of the object to be measured
- the second actual length is the width/height of the image collection surface of the object to be measured.
- the position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
- the method before determining the first actual length and/or the second actual length of the measured object, the method further includes: determining a position of the object image, including: according to one or more of the following parameters Kind, determine the position of the object image: the starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
- the position of the object image and the distance v between the object image and the lens of the image capturing device are the starting point v0 of the lens, namely:
- the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens
- the sum of the product of the moving distance d0 and the number of movements c namely:
- the distance v between the object image and the lens of the image capturing device is the sum of the product of the starting point v0 of the lens and the moving distance d0 of the single step lens and the maximum number of movements n, namely:
- the method before determining the first actual length and/or the second actual length of the measured object, the method further includes: determining a distance between the measured object and the image capturing device, including: according to the object image The position and the focal length of the lens of the image acquisition device determine the distance between the object under test and the image acquisition device.
- the object to be measured is determined according to the position v of the object image and the focal length f of the lens of the image capturing device.
- Distance u from the image acquisition device is determined according to the position v of the object image and the focal length f of the lens of the image capturing device.
- the first actual length and/or the second actual length of the measured object is determined according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device.
- the second actual length x of the measured pair is determined as an example. According to the geometric principle, it can be known that: then
- the code to extend the Qualcomm kernel part includes: reading and storing the camera OTP information; providing an IO interface for the HAL to read data.
- the interface of the Qualcomm HAL layer is extended, including: reading the camera OTP information initialized by the kernel; and packaging the Param for the upper layer application to read the data.
- the Qualcomm platform supports 13M full-size preview, so this example uses Sony's full-size preview. According to the information provided by Sony, it can be determined:
- Other camera information also includes:
- n 60;
- the size of the measurement area obtained from the measurement configuration is:
- w width of the user configuration
- h The height of the user configuration.
- FIG. 4 is a schematic structural diagram of a measuring device according to an embodiment of the present invention. As shown in FIG. 4, the device includes an image capturing module 41 and an object size determining module. 42. A length determining module 43, wherein
- the image acquisition module 41 is configured to perform image collection on the measured object
- the device further includes a calibration module 44 configured to first read basic data and calibration data of the current image acquisition device module before starting image acquisition, if the image acquisition device is automatically
- the focus module the basic data and calibration data that can be directly read include: horizontal resolution w0, vertical resolution h0, size p of a single photosensitive spot, distance e of hyperfocal distance, single-step lens moving distance d0, lens movement and The object distance correspondence table u, the starting point v0 of the lens, the focal length f of the lens, the maximum number of movements n, the refractive index r, and the like.
- the read information is saved, and the module is calibrated, so that the camera of the image acquisition device can move linearly, thereby ensuring that the focal length can be calculated by using the moving distance.
- the basic data and calibration data that can be directly read include: horizontal resolution w, vertical resolution h, size p of a single photosensitive spot, starting point of the lens v0, lens The focal length f and so on.
- the fixed focus module does not involve lens movement and does not require module calibration.
- the device further includes a focusing module 45 configured to perform a focusing operation on the AF group mode according to a focus instruction of the platform.
- the focus is triggered according to the sharpness of the current picture, and the control module moves the lens to cause the image capture device to present a clear picture.
- the number of single moving steps can also be configured according to the performance requirement. The more the single moving step, the faster the focusing speed is, and the faster the measurement is completed, but the accuracy may be reduced because the single moving step is larger. Indicates that the image distance changes more clearly.
- the device further includes a control module 46 configured to read the maximum size supported by the image collection device and set a preview mode.
- the maximum size supported by the image acquisition device can be considered as an image acquisition device that outputs a pixel corresponding to a single photosensor. If the image capture device supports the maximum size preview, set the preview to the maximum size. If the maximum size preview is not supported, you can configure the preview to be 1/2, 1/4, etc., but you need to record the conversion ratio.
- the conversion ratio is corresponding to one pixel of several photosensitive devices. For example, when configured as a 1/4 size preview, four photosensitive devices correspond to one pixel. Configure the focus function to start while opening the preview for the preview size. After the focus function is activated, the image capture device will be based on the current Preview the picture and adjust the camera in real time to make the preview picture clear.
- the object size determining module 42 is configured to determine the size of the collected object image of the measured object
- the object size determining module 42 is configured to determine the collected image according to the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the size of a single photosensitive device of the image capturing device. The size of the object image of the object.
- the object size determination module 42 can achieve the automatically configured measurement range by automatically acquiring the edge of the object.
- the image size determining module 42 can also be manually configured. The user can determine the measuring range by dragging the cursor on the screen according to the position of the measured object in the image, so that the measured object is within the measuring range, and the measurement configuration is completed. .
- the size of the object image includes the image height in the horizontal direction and the image height in the vertical direction.
- the image height is the imaging height of the object above the photosensitive device.
- the height can be measured according to the number of pixels occupied by the image, that is, the horizontal measurement range w and The vertical measurement range h is calculated.
- the imaging height m is equal to the number of pixels (horizontal measurement range/vertical measurement range) multiplied by the conversion ratio r and multiplied by the size p of a single photosensitive device. which is:
- the length determining module 43 is configured to determine a first actual length and/or a second of the measured object according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device. Actual length.
- the first actual length is the length of the image collection surface of the object to be measured
- the second actual length is the width/height of the image collection surface of the object to be measured.
- the position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
- the device further includes a first distance determining module 47 configured to determine the position of the object image according to one or more of the following parameters: a starting point of the lens, a single-step lens moving distance, and a single-step lens The number of moves, the maximum number of moves for a single-step lens.
- the position of the object image and the distance v between the object image and the lens of the image capturing device are the starting point v0 of the lens, namely:
- the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens
- the sum of the product of the moving distance d0 and the number of movements c namely:
- the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens
- the sum of the product of the moving distance d0 and the maximum number of movements n namely:
- the device further includes a second distance determining module 48 configured to determine a distance between the measured object and the image capturing device. In an embodiment, according to the position of the object image and the focal length of the lens of the image capturing device, Determine the distance between the measured object and the image acquisition device.
- the object to be measured is determined according to the position v of the object image and the focal length f of the lens of the image capturing device.
- Distance u from the image acquisition device is determined according to the position v of the object image and the focal length f of the lens of the image capturing device.
- the length determining module 43 determines the first actual length of the measured object according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device.
- the second actual length of the process is:
- the device further includes an output module 47 configured to output the measurement result through the display.
- the measurement method and device according to the embodiment of the invention can realize the measurement function without additional hardware, has good implementability, and significantly improves the user experience.
- the embodiment of the invention further provides a mobile terminal, which comprises the measuring device of FIG.
- Each module in the measurement device provided in the embodiment of the present invention may be implemented by a processor, and may also be implemented by a specific logic circuit; wherein the processor may be a processor on a mobile terminal or a server, in practical applications.
- the processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
- the foregoing method for supporting multiple wireless network access is implemented in the form of a software function module and sold or used as a standalone product, it may also be stored in a computer readable storage medium.
- the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. Make a calculation
- the device (which may be a personal computer, server, or network device, etc.) performs all or part of the methods described in various embodiments of the present invention.
- the foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
- program codes such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk.
- the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above measurement method of the embodiment of the present invention.
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Length Measuring Devices By Optical Means (AREA)
Abstract
A measuring method, comprising: performing image collection on a measured object, and determining the size of a collected objective image of the measured object (101); and determining, according to the size of the objective image of the measured object, a position of the objective image and a distance between the measured object and an image collection device, a first actual length and/or a second actual length of the measured object (102). An image measuring apparatus, a mobile terminal and a storage medium.
Description
本发明涉及测量技术,尤其涉及一种通过图像采集设备进行测量的测量方法、装置、移动终端及存储介质。The present invention relates to measurement technology, and in particular, to a measurement method, apparatus, mobile terminal and storage medium for performing measurement by an image acquisition device.
人们在日常生活中总会遇到需要测量长宽高的问题,但是作为普通的移动终端用户,不可能都随身携带尺子等测量工具。而目前使用相机进行测量的方法中,需要使用到多个相机、电脑、距离测量工具等,有时还需要设置参考对象,并拍摄多张照片,然后利用电脑的图像运算分析多张照片的参考对象,同时结合距离测量工具测量的距离以及多张照片的拍摄距离差等信息,综合对目标物体进行测量。People often encounter the problem of measuring the length, width and height in daily life, but as an ordinary mobile terminal user, it is impossible to carry measurement tools such as rulers with them. At present, in the method of measuring with a camera, it is necessary to use a plurality of cameras, computers, distance measuring tools, etc., and sometimes it is necessary to set a reference object, take a plurality of photos, and then use the image calculation of the computer to analyze the reference objects of the plurality of photos. At the same time, combined with the distance measured by the distance measuring tool and the difference in shooting distance of multiple photos, the target object is measured comprehensively.
虽然现有的测量方法具备测量远距离、大物体的优势,但是使用非常不方便,实现测量需要很多额外设备,比如测距工具、电脑、多个相机等等,同时对测量操作有很高要求。Although the existing measurement methods have the advantage of measuring long distances and large objects, they are very inconvenient to use, and many additional devices are required to realize the measurement, such as ranging tools, computers, multiple cameras, etc., and high requirements for measurement operations. .
发明内容Summary of the invention
有鉴于此,本发明实施例期望提供一种测量方法、装置、移动终端及存储介质,能够通过智能移动终端中的图像采集设备实现物体长度、宽度/高度的测量。In view of this, embodiments of the present invention are directed to providing a measurement method, apparatus, mobile terminal, and storage medium, which are capable of measuring object length, width/height by an image acquisition device in an intelligent mobile terminal.
为达到上述目的,本发明实施例的技术方案是这样实现的:To achieve the above objective, the technical solution of the embodiment of the present invention is implemented as follows:
本发明实施例提供了一种测量方法,所述方法包括:An embodiment of the present invention provides a measurement method, where the method includes:
对被测对象进行图像采集,确定采集到的被测对象的物像的大小;Perform image acquisition on the measured object to determine the size of the collected object image;
根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设
备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。According to the size of the object image of the object to be measured, the position of the object image, and the object to be measured and the image collection device
The prepared distance determines a first actual length and/or a second actual length of the measured object.
上述方案中,所述第一实际长度为被测对象图像采集面的的长度,所述第二实际长度为所述被测对象图像采集面的宽度/高度。In the above solution, the first actual length is the length of the image collection surface of the object to be measured, and the second actual length is the width/height of the image collection surface of the object to be measured.
上述方案中,所述确定采集到的被测对象的物像的大小包括:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大小,确定采集到的被测对象的物像的大小。In the above solution, the determining the size of the collected object image includes: determining the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the size of a single photosensitive device of the image capturing device. The size of the collected object image of the measured object.
上述方案中,所述物像的位置为物像与图像采集设备透镜的距离,所述被测对象与图像采集设备的距离为被测对象与图像采集设备透镜的距离。In the above solution, the position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
上述方案中,所述方法还包括:确定物像的位置,包括:根据以下参数中的一种或几种,确定物像的位置:In the above solution, the method further includes: determining a position of the object image, comprising: determining a position of the object image according to one or more of the following parameters:
镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。The starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
上述方案中,所述方法还包括:确定被测对象与图像采集设备的距离,包括:根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。In the above solution, the method further includes: determining a distance between the measured object and the image capturing device, including: determining a distance between the measured object and the image capturing device according to the position of the object image and the focal length of the lens of the image capturing device.
本发明实施例还提供了一种测量装置,所述装置包括:图像采集模块、物象大小确定模块、长度确定模块、其中,The embodiment of the invention further provides a measuring device, the device comprising: an image collecting module, an object size determining module, a length determining module, wherein
所述图像采集模块,配置为对被测对象进行图像采集;The image acquisition module is configured to perform image collection on the object to be tested;
所述物象大小确定模块,配置为确定采集到的被测对象的物像的大小;The object size determining module is configured to determine a size of the collected object image of the measured object;
所述长度确定模块,配置为根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。The length determining module is configured to determine, according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device, the first actual length of the object to be tested and/or the second actual length.
上述方案中,所述物象大小确定模块配置为:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大
小,确定采集到的被测对象的物像的大小。In the above solution, the object size determining module is configured to: according to the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the large size of a single photosensitive device of the image capturing device.
Small, determine the size of the object image of the measured object.
上述方案中,所述装置还包括第一距离确定模块,配置为根据以下参数中的一种或几种,确定物像的位置:In the above solution, the apparatus further includes a first distance determining module configured to determine the position of the object image according to one or more of the following parameters:
镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。The starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
上述方案中,所述装置还包括第二距离确定模块,配置为根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。In the above solution, the device further includes a second distance determining module configured to determine a distance between the measured object and the image capturing device according to the position of the object image and the focal length of the lens of the image capturing device.
本发明实施例还提供了一种移动终端,所述移动终端包括上述测量装置。The embodiment of the invention further provides a mobile terminal, wherein the mobile terminal comprises the above measuring device.
本发明实施例还提供了一种计算机存储介质,所述计算机存储介质存储有计算机程序,该计算机程序用于执行本发明实施例的测量方法。The embodiment of the invention further provides a computer storage medium storing a computer program for performing the measurement method of the embodiment of the invention.
本发明实施例所提供的测量方法、装置、移动终端及存储介质,先对被测对象进行图像采集,确定采集到的被测对象的物像的大小;再根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。如此,能够通过智能移动终端的图像采集设备,实现物体长度和宽度/高度的测量。The measurement method, the device, the mobile terminal and the storage medium provided by the embodiments of the present invention first perform image collection on the measured object, determine the size of the collected object image of the measured object, and then according to the size of the object image of the measured object. And determining a first actual length and/or a second actual length of the object to be measured, and a distance between the object and the image capturing device. In this way, the measurement of the length and width/height of the object can be achieved by the image acquisition device of the smart mobile terminal.
图1为本发明实施例测量方法流程示意图;1 is a schematic flow chart of a measurement method according to an embodiment of the present invention;
图2为本发明实施例图像采集原理示意图;2 is a schematic diagram of an image acquisition principle according to an embodiment of the present invention;
图3为本发明实施例测量范围示意图;3 is a schematic diagram of a measurement range according to an embodiment of the present invention;
图4为本发明实施例测量装置结构流程示意图。4 is a schematic structural flow chart of a measuring device according to an embodiment of the present invention.
本发明实施例中,先对被测对象进行图像采集,确定采集到的被测对象的物像的大小;再根据被测对象的物像的大小、物像的位置以及被测对
象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。In the embodiment of the present invention, image acquisition is performed on the object to be measured, and the size of the object image of the measured object is determined; and then according to the size of the object image of the object to be measured, the position of the object image, and the measured pair
The first actual length and/or the second actual length of the measured object is determined as the distance from the image acquisition device.
其中,所述第一实际长度为被测对象图像采集面的的长度,所述第二实际长度为所述被测对象图像采集面的宽度/高度。即当所述被测对象的图像采集面垂直与水平面时,所述第一实际长度为所述被测对象图像采集面的长度,所述第二实际长度为所述被测对象图像采集面的高度,当所述被测对象的图像采集面平行于水平面时,所述第一实际长度为所述被测对象图像采集面的长度,所述第二实际长度为所述被测对象图像采集面的宽度。The first actual length is the length of the image collection surface of the object to be measured, and the second actual length is the width/height of the image collection surface of the object to be measured. That is, when the image collection surface of the measured object is perpendicular to the horizontal plane, the first actual length is the length of the image collection surface of the measured object, and the second actual length is the image collection surface of the measured object. a height, when the image collection surface of the object to be measured is parallel to a horizontal plane, the first actual length is a length of the image collection surface of the object to be measured, and the second actual length is an image collection surface of the object to be measured The width.
下面结合附图及实施例,对本发明实施例技术方案的实施作详细描述。图1为本发明实施例测量方法流程示意图,如图1所示,本实施例测量方法包括以下步骤:The implementation of the technical solution of the embodiment of the present invention is described in detail below with reference to the accompanying drawings and embodiments. FIG. 1 is a schematic flowchart of a measurement method according to an embodiment of the present invention. As shown in FIG. 1 , the measurement method in this embodiment includes the following steps:
步骤101:对被测对象进行图像采集,确定采集到的被测对象的物像的大小;Step 101: Perform image acquisition on the measured object to determine the size of the collected object image of the measured object.
本发明实施例中,在开始进行图像采集时,首先读取当前图像采集设备模组的基础数据和校准数据,如果所述图像采集设备采用的是自动对焦模组,则能够直接读取的基础数据和校准数据包括:水平分辨率w0、垂直分辨率h0、单个感光点的尺寸p、超焦距的距离e、单步镜头移动距离d0、镜头移动与物距对应表u、镜头的起点v0、镜头的焦距f,最大移动次数n、折射率r等。然后,将读取的信息进行保存,同时对模组进行校准,使得图像采集设备的镜头能够线性移动,从而保证可以利用移动距离计算焦距。如果所述图像采集设备采用的是定焦模组,则能够直接读取的基础数据和校准数据包括:水平分辨率w、垂直分辨率h、单个感光点的尺寸p、镜头的起点v0、镜头的焦距f等。定焦模组不涉及镜头移动,不需要进行模组校准。In the embodiment of the present invention, when starting image acquisition, the basic data and calibration data of the current image acquisition device module are first read. If the image acquisition device is an auto focus module, the basic reading can be directly performed. The data and calibration data include: horizontal resolution w0, vertical resolution h0, size p of a single photosensitive spot, distance e of hyperfocal distance, single-step lens moving distance d0, lens shift and object distance correspondence table u, lens starting point v0, The focal length f of the lens, the maximum number of movements n, the refractive index r, and the like. Then, the read information is saved, and the module is calibrated so that the lens of the image acquisition device can move linearly, thereby ensuring that the focal length can be calculated by using the moving distance. If the image capturing device adopts a fixed focus module, the basic data and calibration data that can be directly read include: horizontal resolution w, vertical resolution h, size p of a single photosensitive spot, starting point of the lens v0, lens The focal length f and so on. The fixed focus module does not involve lens movement and does not require module calibration.
本发明实施例中,对于自动对焦组模,还需要根据平台的对焦指令进
行对焦操作。在一实施例中,根据当前画面的清晰度触发对焦,控制模组移动镜头,使图像采集设备呈现清晰画面。本发明实施例中,还可以根据性能要求,配置单次移动步数,单次移动步数越多对焦速度越快,越快完成测量,但是可能导致精度下降,因为单次移动步数越大表示像距变化越明显。In the embodiment of the present invention, for the autofocus group mode, it is also required to follow the focus command of the platform.
Line focusing operation. In an embodiment, the focus is triggered according to the sharpness of the current picture, and the control module moves the lens to cause the image capture device to present a clear picture. In the embodiment of the present invention, the number of single moving steps can also be configured according to the performance requirement. The more the single moving step, the faster the focusing speed is, and the faster the measurement is completed, but the accuracy may be reduced because the single moving step is larger. Indicates that the image distance changes more clearly.
本发明实施例中,所述方法还包括,读取图像采集设备支持的最大尺寸,并设置预览方式。图像采集设备支持的最大尺寸,可以认为图像采集设备在单个感光器件对应一个像素在输出。如果所述图像采集设备支持最大尺寸预览,则设置为最大尺寸启动预览,如果不支持最大尺寸预览,则可以配置为1/2、1/4等尺寸启动预览,但是需要记录折算比率。所述折算比率为几个感官器件对应一个像素,例如,当配置为1/4尺寸预览时,就是4个感光器件对应一个像素。在对应预览尺寸打开预览的同时配置对焦功能启动。对焦功能启动后所述图像采集设备会根据当前预览的画面,实时调节摄像头使得预览画面清晰。In the embodiment of the present invention, the method further includes: reading a maximum size supported by the image collection device, and setting a preview mode. The maximum size supported by the image acquisition device can be considered as an image acquisition device that outputs a pixel corresponding to a single photosensor. If the image capture device supports the maximum size preview, set the preview to the maximum size. If the maximum size preview is not supported, you can configure the preview to be 1/2, 1/4, etc., but you need to record the conversion ratio. The conversion ratio is one pixel for several sensory devices, for example, when configured as a 1/4 size preview, that is, four photosensitive devices correspond to one pixel. Configure the focus function to start while opening the preview for the preview size. After the focus function is activated, the image capture device adjusts the camera in real time according to the currently previewed screen to make the preview image clear.
图2为本发明实施例图像采集原理示意图,本发明实施例中,所述确定采集到的被测对象的物像的大小包括:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大小,确定采集到的被测对象的物像的大小。2 is a schematic diagram of an image acquisition principle according to an embodiment of the present invention. In the embodiment of the present invention, determining the size of the collected object image includes: a number of pixels occupied by the object image, and a lens of the image acquisition device. The conversion rate and the size of a single photosensitive device of the image acquisition device determine the size of the image of the object to be measured.
在一实施例中,在图像采集设备采集到被测对象的图像后,如果终端设备具有物体识别的功能,则可以通过自动获取的物体的边缘以达到自动配置的测量范围的效果;也可以通过手动进行配置,用户可以根据图像中被测对象的位置,通过在屏幕上拖动游标来确定测量范围,使得被测对象位于测量范围内,完成测量配置,最终确定的测量范围示意图如图3所示,箭头为游标,虚线框为测量范围。In an embodiment, after the image collecting device collects the image of the measured object, if the terminal device has the function of object recognition, the edge of the automatically acquired object may be used to achieve the effect of the automatically configured measuring range; By manually configuring, the user can determine the measurement range by dragging the cursor on the screen according to the position of the object to be measured in the image, so that the measured object is within the measurement range, and the measurement configuration is completed. The final determined measurement range is shown in FIG. Show, arrow For cursors, dashed boxes For the measurement range.
物象的大小包括水平方向的像高和垂直方向的像高,像高是物体在感
光器件上面的成像高度,如图2中m所示,这个高度可以按照成像占用像素数即水平测量范围w和垂直测量范围h来计算,图2中,即成像高度m等于像素数(水平测量范围/垂直测量范围)乘以折算比率r再乘以单个感光器件的尺寸p。即:The size of the object includes the image height in the horizontal direction and the image height in the vertical direction.
The imaging height above the optical device, as shown by m in Fig. 2, can be calculated according to the number of imaging occupied pixels, that is, the horizontal measurement range w and the vertical measurement range h. In Fig. 2, the imaging height m is equal to the number of pixels (horizontal measurement) The range/vertical measurement range is multiplied by the conversion ratio r and multiplied by the size p of a single photosensitive device. which is:
步骤102:根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。Step 102: Determine a first actual length and/or a second actual length of the object to be tested according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device.
所述第一实际长度为被测对象图像采集面的的长度,所述第二实际长度为所述被测对象图像采集面的宽度/高度。The first actual length is the length of the image collection surface of the object to be measured, and the second actual length is the width/height of the image collection surface of the object to be measured.
所述物像的位置为物像与图像采集设备透镜的距离,所述被测对象与图像采集设备的距离为被测对象与图像采集设备透镜的距离。The position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
本发明实施例中,在确定所述被测对象的第一实际长度和/或第二实际长度之前,所述方法还包括:确定物像的位置,包括:根据以下参数中的一种或几种,确定物像的位置:镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。In the embodiment of the present invention, before determining the first actual length and/or the second actual length of the measured object, the method further includes: determining a position of the object image, including: according to one or more of the following parameters Kind, determine the position of the object image: the starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
如图2所示,当所述图像采集设备采用定焦组模时,所述物象的位置及物像与图像采集设备透镜的距离v即为镜头的起点v0,即:As shown in FIG. 2, when the image capturing device adopts a fixed focus mode, the position of the object image and the distance v between the object image and the lens of the image capturing device are the starting point v0 of the lens, namely:
v=v0;v=v0;
当所述图像采集设备采用自动对焦组模、且被测对象与图像采集设备的距离在超焦距范围内时,所述物像与图像采集设备透镜的距离v为镜头的起点v0与单步镜头移动距离d0和移动次数c乘积的加和,即:When the image capturing device adopts an autofocus group mode, and the distance between the measured object and the image capturing device is within a hyperfocal range, the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens The sum of the product of the moving distance d0 and the number of movements c, namely:
v=v0+c×d0;v=v0+c×d0;
当所述图像采集设备采用自动对焦组模、且被测对象与图像采集设备
的距离在超焦距范围外时,所述物像与图像采集设备透镜的距离v为镜头的起点v0与单步镜头移动距离d0和最大移动次数n乘积的加和,即:When the image capturing device adopts an autofocus group mode, and the measured object and the image collecting device
When the distance is outside the range of the hyperfocal distance, the distance v between the object image and the lens of the image capturing device is the sum of the product of the starting point v0 of the lens and the moving distance d0 of the single step lens and the maximum number of movements n, namely:
v=v0+n×d0;v=v0+n×d0;
本发明实施例中,在确定所述被测对象的第一实际长度和/或第二实际长度之前,所述方法还包括:确定被测对象与图像采集设备的距离,包括:根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。In the embodiment of the present invention, before determining the first actual length and/or the second actual length of the measured object, the method further includes: determining a distance between the measured object and the image capturing device, including: according to the object image The position and the focal length of the lens of the image acquisition device determine the distance between the object under test and the image acquisition device.
如图2所示,当所述图像采集设备采用对焦模组、且被测对象与图像采集设备的距离在超焦距范围内时,直接从校准表就可以查询到被测对象与图像采集设备的距离u;As shown in FIG. 2, when the image capturing device adopts a focusing module and the distance between the measured object and the image capturing device is within a hyperfocal range, the object to be measured and the image capturing device can be directly queried from the calibration table. Distance u;
当被测对象与图像采集设备的距离在超焦距范围外时、或者所述图像采集设备采用定焦组模时,则根据物像的位置v以及图像采集设备透镜的焦距f,确定被测对象与图像采集设备的距离u:When the distance between the measured object and the image capturing device is outside the hyperfocal range, or when the image capturing device adopts the fixed focus mode, the object to be measured is determined according to the position v of the object image and the focal length f of the lens of the image capturing device. Distance u from the image acquisition device:
最后,根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。Finally, the first actual length and/or the second actual length of the measured object is determined according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device.
如图2所示,以确定所述被测对对称的第二实际长度x为例,根据几何原理可知: 则
As shown in FIG. 2, the second actual length x of the measured pair is determined as an example. According to the geometric principle, it can be known that: then
最后,将测量结果通过显示器进行输出。Finally, the measurement results are output through the display.
下面结合实例,说明本发明实施例所述测量方法。The measurement method according to the embodiment of the present invention will be described below with reference to examples.
使用现有的移动终端设备,搭载高通8939平台和Android 4.4系统,在高通平台集成自动对焦算法,图像采集设备使用索尼13M的摄像头。
Using existing mobile terminal equipment, equipped with Qualcomm 8939 platform and Android 4.4 system, integrated autofocus algorithm on Qualcomm platform, image acquisition equipment using Sony 13M camera.
首先,扩展高通kernel部分的代码包括:读取、存储摄像头OTP信息;提供IO接口供HAL进行数据读取。First, the code to extend the Qualcomm kernel part includes: reading and storing the camera OTP information; providing an IO interface for the HAL to read data.
然后,扩展了高通HAL层的接口,包括:读取kernel初始化的摄像头OTP信息;打包Param供上层应用读取数据。Then, the interface of the Qualcomm HAL layer is extended, including: reading the camera OTP information initialized by the kernel; and packaging the Param for the upper layer application to read the data.
最后,在应用层实现测量范围配置和测量结果展示。Finally, the measurement range configuration and measurement results are displayed at the application layer.
实际实现过程中:In the actual implementation process:
高通平台支持13M的全尺寸预览,所以本实施例使用了索尼的全尺寸预览。根据索尼提供的资料可以确定:The Qualcomm platform supports 13M full-size preview, so this example uses Sony's full-size preview. According to the information provided by Sony, it can be determined:
w0=4208;W0=4208;
h0=3120;H0=3120;
其他摄像头信息还包括:Other camera information also includes:
p=1.12μm;p=1.12 μm;
f=3.81;f=3.81;
d0=2.24μm;D0 = 2.24 μm;
e=2m;e=2m;
v0=1.2mm;V0=1.2mm;
n=60;n=60;
r=1;r=1;
从测量配置获取到测量区域的大小为:The size of the measurement area obtained from the measurement configuration is:
w=用户配置的宽度;w = width of the user configuration;
h=用户配置的高度。h=The height of the user configuration.
本发明实施例还提供了一种测量装置,所述装置位于移动终端,图4为本发明实施例测量装置结构示意图,如图4所示,所述装置包括图像采集模块41、物象大小确定模块42、长度确定模块43、其中,The embodiment of the present invention further provides a measuring device, which is located in a mobile terminal. FIG. 4 is a schematic structural diagram of a measuring device according to an embodiment of the present invention. As shown in FIG. 4, the device includes an image capturing module 41 and an object size determining module. 42. A length determining module 43, wherein
所述图像采集模块41,配置为对被测对象进行图像采集;
The image acquisition module 41 is configured to perform image collection on the measured object;
本发明实施例中,所述装置还包括校准模块44,配置为在开始进行图像采集前,首先读取当前图像采集设备模组的基础数据和校准数据,如果所述图像采集设备采用的是自动对焦模组,则能够直接读取的基础数据和校准数据包括:水平分辨率w0、垂直分辨率h0、单个感光点的尺寸p、超焦距的距离e、单步镜头移动距离d0、镜头移动与物距对应表u、镜头的起点v0、镜头的焦距f,最大移动次数n、折射率r等。然后,将读取的信息进行保存,同时对模组进行校准,使得图像采集设备的摄像头能够线性移动,从而保证可以利用移动距离计算焦距。如果所述图像采集设备采用的是定焦模组,则能够直接读取的基础数据和校准数据包括:水平分辨率w、垂直分辨率h、单个感光点的尺寸p、镜头的起点v0、镜头的焦距f等。定焦模组不涉及镜头移动,不需要进行模组校准。In the embodiment of the present invention, the device further includes a calibration module 44 configured to first read basic data and calibration data of the current image acquisition device module before starting image acquisition, if the image acquisition device is automatically The focus module, the basic data and calibration data that can be directly read include: horizontal resolution w0, vertical resolution h0, size p of a single photosensitive spot, distance e of hyperfocal distance, single-step lens moving distance d0, lens movement and The object distance correspondence table u, the starting point v0 of the lens, the focal length f of the lens, the maximum number of movements n, the refractive index r, and the like. Then, the read information is saved, and the module is calibrated, so that the camera of the image acquisition device can move linearly, thereby ensuring that the focal length can be calculated by using the moving distance. If the image capturing device adopts a fixed focus module, the basic data and calibration data that can be directly read include: horizontal resolution w, vertical resolution h, size p of a single photosensitive spot, starting point of the lens v0, lens The focal length f and so on. The fixed focus module does not involve lens movement and does not require module calibration.
本发明实施例中,所述装置还包括对焦模块45,配置为对于自动对焦组模根据平台的对焦指令进行对焦操作。在一实施例中,根据当前画面的清晰度触发对焦,控制模组移动镜头,使图像采集设备呈现清晰画面。本发明实施例中,还可以根据性能要求,配置单次移动步数,单次移动步数越多对焦速度越快,越快完成测量,但是可能导致精度下降,因为单次移动步数越大表示像距变化越明显。In the embodiment of the present invention, the device further includes a focusing module 45 configured to perform a focusing operation on the AF group mode according to a focus instruction of the platform. In an embodiment, the focus is triggered according to the sharpness of the current picture, and the control module moves the lens to cause the image capture device to present a clear picture. In the embodiment of the present invention, the number of single moving steps can also be configured according to the performance requirement. The more the single moving step, the faster the focusing speed is, and the faster the measurement is completed, but the accuracy may be reduced because the single moving step is larger. Indicates that the image distance changes more clearly.
本发明实施例中,所述装置还包括控制模块46,配置为读取图像采集设备支持的最大尺寸,并设置预览方式。图像采集设备支持的最大尺寸,可以认为图像采集设备在单个感光器件对应一个像素在输出。如果所述图像采集设备支持最大尺寸预览,则设置为最大尺寸启动预览,如果不支持最大尺寸预览,则可以配置为1/2、1/4等尺寸启动预览,但是需要记录折算比率。所述折算比率为几个感光器件对应一个像素,例如,当配置为1/4尺寸预览时,就是4个感光器件对应一个像素。在对应预览尺寸打开预览的同时配置对焦功能启动。对焦功能启动后所述图像采集设备会根据当前
预览的画面,实时调节摄像头使得预览画面清晰。In the embodiment of the present invention, the device further includes a control module 46 configured to read the maximum size supported by the image collection device and set a preview mode. The maximum size supported by the image acquisition device can be considered as an image acquisition device that outputs a pixel corresponding to a single photosensor. If the image capture device supports the maximum size preview, set the preview to the maximum size. If the maximum size preview is not supported, you can configure the preview to be 1/2, 1/4, etc., but you need to record the conversion ratio. The conversion ratio is corresponding to one pixel of several photosensitive devices. For example, when configured as a 1/4 size preview, four photosensitive devices correspond to one pixel. Configure the focus function to start while opening the preview for the preview size. After the focus function is activated, the image capture device will be based on the current
Preview the picture and adjust the camera in real time to make the preview picture clear.
所述物象大小确定模块42,配置为确定采集到的被测对象的物像的大小;The object size determining module 42 is configured to determine the size of the collected object image of the measured object;
本发明实施例中,所述物象大小确定模块42配置为:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大小,确定采集到的被测对象的物像的大小。In the embodiment of the present invention, the object size determining module 42 is configured to determine the collected image according to the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the size of a single photosensitive device of the image capturing device. The size of the object image of the object.
在一实施例中,在图像采集模块41采集到被测对象的图像后,如果终端设备具有物体识别的功能,物象大小确定模块42则可以通过自动获取的物体的边缘以达到自动配置的测量范围的效果;物象大小确定模块42也可以通过手动进行配置,用户可以根据图像中被测对象的位置,通过在屏幕上拖动游标来确定测量范围,使得被测对象位于测量范围内,完成测量配置。In an embodiment, after the image acquisition module 41 acquires the image of the object under test, if the terminal device has the function of object recognition, the object size determination module 42 can achieve the automatically configured measurement range by automatically acquiring the edge of the object. The image size determining module 42 can also be manually configured. The user can determine the measuring range by dragging the cursor on the screen according to the position of the measured object in the image, so that the measured object is within the measuring range, and the measurement configuration is completed. .
物象的大小包括水平方向的像高和垂直方向的像高,像高是物体在感光器件上面的成像高度,如图2中m所示,这个高度可以按照成像占用像素数即水平测量范围w和垂直测量范围h来计算,图2中,即成像高度m等于像素数(水平测量范围/垂直测量范围)乘以折算比率r再乘以单个感光器件的尺寸p。即:The size of the object image includes the image height in the horizontal direction and the image height in the vertical direction. The image height is the imaging height of the object above the photosensitive device. As shown by m in Fig. 2, the height can be measured according to the number of pixels occupied by the image, that is, the horizontal measurement range w and The vertical measurement range h is calculated. In Fig. 2, the imaging height m is equal to the number of pixels (horizontal measurement range/vertical measurement range) multiplied by the conversion ratio r and multiplied by the size p of a single photosensitive device. which is:
所述长度确定模块43,配置为根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。The length determining module 43 is configured to determine a first actual length and/or a second of the measured object according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device. Actual length.
所述第一实际长度为被测对象图像采集面的的长度,所述第二实际长度为所述被测对象图像采集面的宽度/高度。
The first actual length is the length of the image collection surface of the object to be measured, and the second actual length is the width/height of the image collection surface of the object to be measured.
所述物像的位置为物像与图像采集设备透镜的距离,所述被测对象与图像采集设备的距离为被测对象与图像采集设备透镜的距离。The position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
本发明实施例中,所述装置还包括第一距离确定模块47,配置为根据以下参数中的一种或几种,确定物像的位置:镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。In the embodiment of the present invention, the device further includes a first distance determining module 47 configured to determine the position of the object image according to one or more of the following parameters: a starting point of the lens, a single-step lens moving distance, and a single-step lens The number of moves, the maximum number of moves for a single-step lens.
如图2所示,当所述图像采集设备采用定焦组模时,所述物象的位置及物像与图像采集设备透镜的距离v即为镜头的起点v0,即:As shown in FIG. 2, when the image capturing device adopts a fixed focus mode, the position of the object image and the distance v between the object image and the lens of the image capturing device are the starting point v0 of the lens, namely:
v=v0;v=v0;
当所述图像采集设备采用自动对焦组模、且被测对象与图像采集设备的距离在超焦距范围内时,所述物像与图像采集设备透镜的距离v为镜头的起点v0与单步镜头移动距离d0和移动次数c乘积的加和,即:When the image capturing device adopts an autofocus group mode, and the distance between the measured object and the image capturing device is within a hyperfocal range, the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens The sum of the product of the moving distance d0 and the number of movements c, namely:
v=v0+c×d0;v=v0+c×d0;
当所述图像采集设备采用自动对焦组模、且被测对象与图像采集设备的距离在超焦距范围外时,所述物像与图像采集设备透镜的距离v为镜头的起点v0与单步镜头移动距离d0和最大移动次数n乘积的加和,即:When the image capturing device adopts an autofocus group mode and the distance between the measured object and the image capturing device is outside the hyperfocal range, the distance v between the object image and the lens of the image capturing device is the starting point of the lens v0 and the single step lens The sum of the product of the moving distance d0 and the maximum number of movements n, namely:
v=v0+n×d0;v=v0+n×d0;
本发明实施例中,所述装置还包括第二距离确定模块48,配置为确定被测对象与图像采集设备的距离,在一实施例中,根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。In the embodiment of the present invention, the device further includes a second distance determining module 48 configured to determine a distance between the measured object and the image capturing device. In an embodiment, according to the position of the object image and the focal length of the lens of the image capturing device, Determine the distance between the measured object and the image acquisition device.
如图2所示,当所述图像采集设备采用对焦模组、且被测对象与图像采集设备的距离在超焦距范围内时,直接从校准表就可以查询到被测对象与图像采集设备的距离u;As shown in FIG. 2, when the image capturing device adopts a focusing module and the distance between the measured object and the image capturing device is within a hyperfocal range, the object to be measured and the image capturing device can be directly queried from the calibration table. Distance u;
当被测对象与图像采集设备的距离在超焦距范围外时、或者所述图像采集设备采用定焦组模时,则根据物像的位置v以及图像采集设备透镜的焦距f,确定被测对象与图像采集设备的距离u:
When the distance between the measured object and the image capturing device is outside the hyperfocal range, or when the image capturing device adopts the fixed focus mode, the object to be measured is determined according to the position v of the object image and the focal length f of the lens of the image capturing device. Distance u from the image acquisition device:
本发明实施例中,所述长度确定模块43根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度的过程为:In the embodiment of the present invention, the length determining module 43 determines the first actual length of the measured object according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device. Or the second actual length of the process is:
以确定所述被测对对称的第二实际长度x为例,根据几何原理可知: 则
For example, to determine the second actual length x of the measured pair of symmetry, according to the geometric principle: then
本发明实施例中,所述装置还包括输出模块47,配置为将测量结果通过显示器进行输出。In the embodiment of the present invention, the device further includes an output module 47 configured to output the measurement result through the display.
本发明实施例所述测量方法和装置,不需要额外增加硬件,即可实现测量功能,具备良好的可实施性,显著提高了用户体验。The measurement method and device according to the embodiment of the invention can realize the measurement function without additional hardware, has good implementability, and significantly improves the user experience.
本发明实施例还提供了一种移动终端,所述移动终端包括图4所述测量装置。The embodiment of the invention further provides a mobile terminal, which comprises the measuring device of FIG.
本发明实施例中提出的测量装置中的各个模块都可以通过处理器来实现,当然也可通过具体的逻辑电路实现;其中所述处理器可以是移动终端或服务器上的处理器,在实际应用中,处理器可以为中央处理器(CPU)、微处理器(MPU)、数字信号处理器(DSP)或现场可编程门阵列(FPGA)等。Each module in the measurement device provided in the embodiment of the present invention may be implemented by a processor, and may also be implemented by a specific logic circuit; wherein the processor may be a processor on a mobile terminal or a server, in practical applications. The processor may be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP), or a field programmable gate array (FPGA).
本发明实施例中,如果以软件功能模块的形式实现上述支持多种无线网络接入的方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算
机设备(可以是个人计算机、服务器、或者网络设备等)执行本发明各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本发明实施例不限制于任何特定的硬件和软件结合。In the embodiment of the present invention, if the foregoing method for supporting multiple wireless network access is implemented in the form of a software function module and sold or used as a standalone product, it may also be stored in a computer readable storage medium. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium, including a plurality of instructions. Make a calculation
The device (which may be a personal computer, server, or network device, etc.) performs all or part of the methods described in various embodiments of the present invention. The foregoing storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read only memory (ROM), a magnetic disk, or an optical disk. Thus, embodiments of the invention are not limited to any specific combination of hardware and software.
相应地,本发明实施例还提供一种计算机存储介质,该计算机存储介质中存储有计算机程序,该计算机程序用于执行本发明实施例的上述测量方法。Correspondingly, the embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program for performing the above measurement method of the embodiment of the present invention.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
The above is only the preferred embodiment of the present invention and is not intended to limit the scope of the present invention.
Claims (12)
- 一种测量方法,所述方法包括:A method of measurement, the method comprising:对被测对象进行图像采集,确定采集到的被测对象的物像的大小;Perform image acquisition on the measured object to determine the size of the collected object image;根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。The first actual length and/or the second actual length of the object to be measured is determined according to the size of the object image of the object to be measured, the position of the object image, and the distance of the object to be measured from the image capturing device.
- 根据权利要求1所述方法,其中,所述第一实际长度为被测对象图像采集面的的长度,所述第二实际长度为所述被测对象图像采集面的宽度/高度。The method according to claim 1, wherein said first actual length is a length of an image collection surface of the object to be measured, and said second actual length is a width/height of an image collection surface of said object to be measured.
- 根据权利要求1所述方法,其中,所述确定采集到的被测对象的物像的大小包括:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大小,确定采集到的被测对象的物像的大小。The method according to claim 1, wherein the determining the size of the collected object image includes: a number of pixels occupied by the object image, a conversion rate of a lens of the image capturing device, and a single image capturing device. The size of the photosensitive device determines the size of the image of the object to be measured.
- 根据权利要求1所述方法,其中,所述物像的位置为物像与图像采集设备透镜的距离,所述被测对象与图像采集设备的距离为被测对象与图像采集设备透镜的距离。The method according to claim 1, wherein the position of the object image is the distance between the object image and the lens of the image capturing device, and the distance between the object to be measured and the image capturing device is the distance between the object to be measured and the lens of the image capturing device.
- 根据权利要求1或4所述方法,其中,所述方法还包括:确定物像的位置,包括:根据以下参数中的一种或几种,确定物像的位置:The method according to claim 1 or 4, wherein the method further comprises: determining the position of the object image, comprising: determining the position of the object image according to one or more of the following parameters:镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。The starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
- 根据权利要求1或4所述方法,其中,所述方法还包括:确定被测对象与图像采集设备的距离,包括:根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。The method according to claim 1 or 4, wherein the method further comprises: determining a distance between the measured object and the image capturing device, comprising: determining the measured object and the image according to the position of the object image and the focal length of the lens of the image capturing device; The distance from the collection device.
- 一种测量装置,所述装置包括:图像采集模块、物象大小确定模块、长度确定模块、其中, A measuring device, comprising: an image collecting module, an object size determining module, a length determining module, wherein所述图像采集模块,配置为对被测对象进行图像采集;The image acquisition module is configured to perform image collection on the object to be tested;所述物象大小确定模块,配置为确定采集到的被测对象的物像的大小;The object size determining module is configured to determine a size of the collected object image of the measured object;所述长度确定模块,配置为根据被测对象的物像的大小、物像的位置以及被测对象与图像采集设备的距离,确定所述被测对象的第一实际长度和/或第二实际长度。The length determining module is configured to determine, according to the size of the object image of the object to be measured, the position of the object image, and the distance between the object to be measured and the image capturing device, the first actual length of the object to be tested and/or the second actual length.
- 根据权利要求7所述装置,其中,所述物象大小确定模块配置为:根据所述物像所占的像素数、图像采集设备的透镜的折算率以及图像采集设备单个感光器件的大小,确定采集到的被测对象的物像的大小。The apparatus according to claim 7, wherein the object size determining module is configured to determine the acquisition according to the number of pixels occupied by the object image, the conversion rate of the lens of the image capturing device, and the size of a single photosensitive device of the image capturing device. The size of the object image of the object to be measured.
- 根据权利要求7所述装置,其中,所述装置还包括第一距离确定模块,配置为根据以下参数中的一种或几种,确定物像的位置:The apparatus of claim 7 wherein said apparatus further comprises a first distance determination module configured to determine the location of the object image based on one or more of the following parameters:镜头的起点、单步镜头移动距离、单步镜头移动次数、单步镜头最大移动次数。The starting point of the lens, the moving distance of the single-step lens, the number of single-step lens movements, and the maximum number of movements of the single-step lens.
- 根据权利要求7所述装置,其中,所述装置还包括第二距离确定模块,配置为根据物像的位置以及图像采集设备透镜的焦距,确定被测对象与图像采集设备的距离。The apparatus of claim 7, wherein said apparatus further comprises a second distance determining module configured to determine a distance of the object to be measured from the image capture device based on the position of the object image and the focal length of the lens of the image capture device.
- 一种移动终端,所述移动终端包括权利要求7至10任一项所述测量装置。A mobile terminal comprising the measuring device according to any one of claims 7 to 10.
- 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,该计算机可执行指令用于执行权利要求1至6任一项所述的测量方法。 A computer storage medium having stored therein computer executable instructions for performing the measurement method of any one of claims 1 to 6.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510696167.0A CN106610270A (en) | 2015-10-23 | 2015-10-23 | Measurement method, measurement device and mobile terminal |
CN201510696167.0 | 2015-10-23 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2016184152A1 true WO2016184152A1 (en) | 2016-11-24 |
Family
ID=57319301
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2016/071191 WO2016184152A1 (en) | 2015-10-23 | 2016-01-18 | Measuring method and apparatus, mobile terminal and storage medium |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN106610270A (en) |
WO (1) | WO2016184152A1 (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019090556A1 (en) * | 2017-11-09 | 2019-05-16 | 深圳传音通讯有限公司 | Method for measuring size of object and mobile terminal |
WO2021058841A1 (en) * | 2019-09-27 | 2021-04-01 | Sigma Technologies, S.L. | Method for the unsupervised measurement of the dimensions of an object using a view obtained with a single camera |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108151657A (en) * | 2017-12-28 | 2018-06-12 | 上海传英信息技术有限公司 | A kind of dimension of object measuring method and measuring device based on intelligent terminal |
CN108195288A (en) * | 2017-12-28 | 2018-06-22 | 上海传英信息技术有限公司 | A kind of dimension of object measuring method and measuring device based on intelligent terminal |
CN109931870A (en) * | 2019-04-03 | 2019-06-25 | 山东大学 | A kind of height detection method and device of view-based access control model detection |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102447942A (en) * | 2010-10-09 | 2012-05-09 | 索尼公司 | Imaging device parameter estimation method and method, device and system using same |
CN102607423A (en) * | 2011-03-03 | 2012-07-25 | 裵相模 | Method for measuring real size of object using mobile terminal camera |
CN103206919A (en) * | 2012-07-31 | 2013-07-17 | 广州三星通信技术研究有限公司 | Device and method used for measuring object size in portable terminal |
CN103591894A (en) * | 2013-11-05 | 2014-02-19 | 广东欧珀移动通信有限公司 | Method and device for measuring length of object through camera |
CN103604371A (en) * | 2013-12-06 | 2014-02-26 | 上海华勤通讯技术有限公司 | Mobile terminal and object measurement method thereof |
US20140307086A1 (en) * | 2011-12-28 | 2014-10-16 | Yamada Electric Ind. Co., Ltd. | Method for determining dimension of subject by using camera-equipped electronic apparatus |
CN104279960A (en) * | 2014-10-14 | 2015-01-14 | 安徽大学 | Method for measuring size of object by mobile equipment |
-
2015
- 2015-10-23 CN CN201510696167.0A patent/CN106610270A/en active Pending
-
2016
- 2016-01-18 WO PCT/CN2016/071191 patent/WO2016184152A1/en active Application Filing
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102447942A (en) * | 2010-10-09 | 2012-05-09 | 索尼公司 | Imaging device parameter estimation method and method, device and system using same |
CN102607423A (en) * | 2011-03-03 | 2012-07-25 | 裵相模 | Method for measuring real size of object using mobile terminal camera |
US20140307086A1 (en) * | 2011-12-28 | 2014-10-16 | Yamada Electric Ind. Co., Ltd. | Method for determining dimension of subject by using camera-equipped electronic apparatus |
CN103206919A (en) * | 2012-07-31 | 2013-07-17 | 广州三星通信技术研究有限公司 | Device and method used for measuring object size in portable terminal |
CN103591894A (en) * | 2013-11-05 | 2014-02-19 | 广东欧珀移动通信有限公司 | Method and device for measuring length of object through camera |
CN103604371A (en) * | 2013-12-06 | 2014-02-26 | 上海华勤通讯技术有限公司 | Mobile terminal and object measurement method thereof |
CN104279960A (en) * | 2014-10-14 | 2015-01-14 | 安徽大学 | Method for measuring size of object by mobile equipment |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019090556A1 (en) * | 2017-11-09 | 2019-05-16 | 深圳传音通讯有限公司 | Method for measuring size of object and mobile terminal |
WO2021058841A1 (en) * | 2019-09-27 | 2021-04-01 | Sigma Technologies, S.L. | Method for the unsupervised measurement of the dimensions of an object using a view obtained with a single camera |
US11257238B2 (en) | 2019-09-27 | 2022-02-22 | Sigma Technologies, S.L. | Unsupervised object sizing method for single camera viewing |
Also Published As
Publication number | Publication date |
---|---|
CN106610270A (en) | 2017-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10511758B2 (en) | Image capturing apparatus with autofocus and method of operating the same | |
US10334151B2 (en) | Phase detection autofocus using subaperture images | |
CN104038690B (en) | Image processing apparatus, image capturing device and image processing method | |
CN108076278B (en) | A kind of automatic focusing method, device and electronic equipment | |
US10061182B2 (en) | Systems and methods for autofocus trigger | |
US10915998B2 (en) | Image processing method and device | |
US20170076430A1 (en) | Image Processing Method and Image Processing Apparatus | |
WO2016184152A1 (en) | Measuring method and apparatus, mobile terminal and storage medium | |
CN107302658B (en) | Realize face clearly focusing method, device and computer equipment | |
US9727585B2 (en) | Image processing apparatus and method for controlling the same | |
US20130083990A1 (en) | Using Videogrammetry to Fabricate Parts | |
CN110213491B (en) | A focusing method, device and storage medium | |
BR102012020775B1 (en) | image capture device, image processing device and image processing method for generating auxiliary information for the captured image | |
CN110335302A (en) | Depth map generated from a single sensor | |
US10109036B2 (en) | Image processing apparatus, control method for same, and program that performs image processing for image data having a focus state that is changeable | |
CN111368944B (en) | Method and device for recognizing copied image and certificate photo and training model and electronic equipment | |
CN107465877A (en) | Track focusing method and device and related media production | |
CN114913121A (en) | Screen defect detection system and method, electronic device and readable storage medium | |
JP2016212784A (en) | Image processing apparatus and image processing method | |
JP2017103688A5 (en) | ||
CN105180802A (en) | Identification method and device of object size information | |
TW202309923A (en) | Portable electronic device and method of measuring size of wound | |
JP2017192114A5 (en) | ||
JP2015005221A (en) | Information processing device, method, and computer program | |
CN108769538B (en) | Automatic focusing method and device, storage medium and terminal |
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: 16795639 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: 16795639 Country of ref document: EP Kind code of ref document: A1 |