CN106482641B - Size measuring device and method - Google Patents

Size measuring device and method Download PDF

Info

Publication number
CN106482641B
CN106482641B CN201611223542.0A CN201611223542A CN106482641B CN 106482641 B CN106482641 B CN 106482641B CN 201611223542 A CN201611223542 A CN 201611223542A CN 106482641 B CN106482641 B CN 106482641B
Authority
CN
China
Prior art keywords
camera
horizontal distance
detected
image
measured
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611223542.0A
Other languages
Chinese (zh)
Other versions
CN106482641A (en
Inventor
钟明云
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nubia Technology Co Ltd
Original Assignee
Nubia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nubia Technology Co Ltd filed Critical Nubia Technology Co Ltd
Priority to CN201611223542.0A priority Critical patent/CN106482641B/en
Publication of CN106482641A publication Critical patent/CN106482641A/en
Application granted granted Critical
Publication of CN106482641B publication Critical patent/CN106482641B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Telephone Function (AREA)

Abstract

The invention discloses a size measuring device and a method, wherein the device comprises: the shooting module is used for shooting an image of an object to be detected through the camera; the first acquisition module is used for acquiring the horizontal distance between the camera and the object to be detected and the inclination angle of the camera when the camera shoots the object to be detected; the second acquisition module is used for acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image; and the calculation module is used for calculating to obtain the size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel points and preset reference data. By the scheme of the invention, the technical effect of simply and accurately determining the size of the object to be measured is achieved.

Description

Size measuring device and method
Technical Field
The invention relates to the field of camera shooting, in particular to a size measuring device and method.
Background
At present, with the wide spread of mobile phones and cameras, more people originally use mobile phones or cameras to take pictures, and interested contents are recorded by taking pictures.
However, most of the existing camera shooting technologies are only limited to shooting, and some functions desired by people are not available in shooting. For example: currently, when a building is photographed, the length and the width of the current building are expected to be known, and the current photographing technology cannot be achieved frequently.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The invention mainly aims to provide a size measuring device and a size measuring method, and aims to solve the technical problem that the size of an object to be measured cannot be determined in real time during photographing in the prior art.
To achieve the above object, the present invention provides a dimension measuring apparatus comprising:
the shooting module is used for shooting an image of an object to be detected through the camera;
the first acquisition module is used for acquiring the horizontal distance between the camera and the object to be detected and the inclination angle of the camera when the camera shoots the object to be detected;
the second acquisition module is used for acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image;
and the calculation module is used for calculating to obtain the size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel points and preset reference data.
Optionally, the first obtaining module is specifically configured to detect the horizontal distance by using a laser range finder.
Optionally, the first obtaining module is specifically configured to detect the tilt angle through an acceleration sensor and a gyroscope.
Optionally, the calculation module comprises: the length calculation unit is used for dividing the product of the number of pixels of the object to be detected in the longitudinal direction of the image, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system to obtain a result which is used as the length of the object to be detected; and the width calculation unit is used for dividing the product of the number of pixels of the object to be detected in the transverse direction in the image, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system to obtain a result, and taking the result as the width of the object to be detected.
Optionally, the second obtaining module is specifically configured to determine, through marginalization calculation, a pixel point between an upper edge and a lower edge of the object to be detected in the image.
In addition, in order to achieve the above object, the present invention further provides a dimension measuring method, including:
shooting an image of an object to be detected through a camera;
acquiring a horizontal distance between the camera and the object to be detected and an inclination angle of the camera when the camera shoots the object to be detected;
acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image;
and calculating to obtain the size data of the object to be detected according to the horizontal distance, the inclination angle, the pixel points and preset reference data.
Optionally, when obtaining the camera shoots the object to be measured, the horizontal distance between the camera and the object to be measured includes: the horizontal distance is detected by a laser rangefinder.
Optionally, when obtaining that the camera shoots the object to be measured, the inclination angle of the camera includes: the tilt angle is detected by an acceleration sensor and a gyroscope.
Optionally, calculating size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel point and preset reference data, and including: dividing the product of the number of pixels of the object to be detected in the longitudinal direction of the image, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system to obtain a result, and taking the result as the length of the object to be detected; dividing the product of the number of pixels of the object to be detected in the image in the transverse direction, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in the preset reference coordinate system to obtain a result, wherein the result is used as the width option of the object to be detected, and the object to be detected is an area defined by a user by clicking a starting point and an end point in an image preview area.
The invention provides a size measuring device and a size measuring method, wherein in the method, by means of presetting reference data in a system, when in shooting, the size of a target object can be simply and accurately determined only by acquiring pixel points between the upper edge and the lower edge of an object to be measured in an image, the distance between a camera and the object during shooting, the inclination angle of the camera and the like, and the technical effect of simply and accurately determining the size of the object to be measured is achieved by the above means.
Drawings
Fig. 1 is a schematic diagram of a hardware structure of an optional mobile terminal for implementing various embodiments of the present invention;
FIG. 2 is a diagram of a wireless communication system for the mobile terminal shown in FIG. 1;
FIG. 3 is a block diagram of a dimension measuring device according to an embodiment of the present invention;
FIG. 4 is a method flow diagram of a dimensional measurement method according to an embodiment of the invention;
FIG. 5 is a flow chart of a method of displaying dimensions and recording dimensions while shooting according to an embodiment of the present invention;
FIG. 6 is a flow chart of a human-computer interaction method according to an embodiment of the invention;
FIG. 7 is a schematic diagram of human-machine interaction according to an embodiment of the invention;
FIG. 8 is another schematic diagram of human-machine interaction according to an embodiment of the invention;
FIG. 9 is yet another schematic diagram of human-computer interaction according to an embodiment of the invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
A mobile terminal implementing various embodiments of the present invention will now be described with reference to the accompanying drawings. In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in themselves. Thus, "module" and "component" may be used in a mixture.
The mobile terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a smart phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. In the following, it is assumed that the terminal is a mobile terminal. However, it will be understood by those skilled in the art that the configuration according to the embodiment of the present invention can be applied to a fixed type terminal in addition to elements particularly used for moving purposes.
Fig. 1 is a schematic hardware configuration of a mobile terminal implementing various embodiments of the present invention. Of course, the hardware structure of the mobile terminal will be fully described in the first embodiment of the present invention, and in the following embodiments, if the mobile terminal is also referred to, the hardware structure description in the first embodiment may also be used, and repeated explanation will not be performed in the following embodiments, and the following description should be applied to each embodiment of the present invention.
The mobile terminal 100 may include a wireless communication unit 110, an a/V (audio/video) input unit 120, a user input unit 130, a sensing unit 140, an output unit 150, a memory 160, an interface unit 170, a controller 180, and a power supply unit 190, etc. Fig. 1 illustrates a mobile terminal having various components, but it is to be understood that not all illustrated components are required to be implemented. More or fewer components may alternatively be implemented. Elements of the mobile terminal will be described in detail below.
The wireless communication unit 110 typically includes one or more components that allow radio communication between the mobile terminal 100 and a wireless communication system or network. For example, the wireless communication unit may include at least one of a broadcast receiving module 111, a mobile communication module 112, a wireless internet module 113, a short-range communication module 114, and a location information module 115.
The broadcast receiving module 111 receives a broadcast signal and/or broadcast associated information from an external broadcast management server via a broadcast channel. The broadcast channel may include a satellite channel and/or a terrestrial channel. The broadcast management server may be a server that generates and transmits a broadcast signal and/or broadcast associated information or a server that receives a previously generated broadcast signal and/or broadcast associated information and transmits it to a terminal. The broadcast signal may include a TV broadcast signal, a radio broadcast signal, a data broadcast signal, and the like. Also, the broadcast signal may further include a broadcast signal combined with a TV or radio broadcast signal. The broadcast associated information may also be provided via a mobile communication network, and in this case, the broadcast associated information may be received by the mobile communication module 112. The broadcast signal may exist in various forms, for example, it may exist in the form of an Electronic Program Guide (EPG) of Digital Multimedia Broadcasting (DMB), an Electronic Service Guide (ESG) of digital video broadcasting-handheld (DVB-H), and the like. The broadcast receiving module 111 may receive a signal broadcast by using various types of broadcasting systems. In particular, the broadcast receiving module 111 may receive a broadcast signal by using a digital broadcasting-terrestrial (DMB-T), such as multimedia broadcasting-terrestrial (DMB-T)Multimedia broadcast-satellite (DMB-S), digital video broadcast-handheld (DVB-H), forward link media (MediaFLO)@) A digital broadcasting system of a terrestrial digital broadcasting integrated service (ISDB-T), etc. receives digital broadcasting. The broadcast receiving module 111 may be constructed to be suitable for various broadcasting systems that provide broadcast signals as well as the above-mentioned digital broadcasting systems. The broadcast signal and/or broadcast associated information received via the broadcast receiving module 111 may be stored in the memory 160 (or other type of storage medium).
The mobile communication module 112 transmits and/or receives radio signals to and/or from at least one of a base station (e.g., access point, node B, etc.), an external terminal, and a server. Such radio signals may include voice call signals, video call signals, or various types of data transmitted and/or received according to text and/or multimedia messages.
The wireless internet module 113 supports wireless internet access of the mobile terminal. The module may be internally or externally coupled to the terminal. The wireless internet access technology to which the module relates may include WLAN (wireless LAN) (Wi-Fi), Wibro (wireless broadband), Wimax (worldwide interoperability for microwave access), HSDPA (high speed downlink packet access), and the like.
The short-range communication module 114 is a module for supporting short-range communication. Some examples of short-range communication technologies include bluetoothTMRadio Frequency Identification (RFID), infrared data association (IrDA), Ultra Wideband (UWB), zigbeeTMAnd so on.
The location information module 115 is a module for checking or acquiring location information of the mobile terminal. A typical example of the location information module is a GPS (global positioning system). According to the current technology, the GPS module 115 calculates distance information and accurate time information from three or more satellites and applies triangulation to the calculated information, thereby accurately calculating three-dimensional current location information according to longitude, latitude, and altitude. Currently, a method for calculating position and time information uses three satellites and corrects an error of the calculated position and time information by using another satellite. In addition, the GPS module 115 can calculate speed information by continuously calculating current position information in real time.
The a/V input unit 120 is used to receive an audio or video signal. The a/V input unit 120 may include a camera 121 and a microphone 122, and the camera 121 processes image data of still pictures or video obtained by an image capturing apparatus in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 151. The image frames processed by the cameras 121 may be stored in the memory 160 (or other storage medium) or transmitted via the wireless communication unit 110, and two or more cameras 121 may be provided according to the construction of the mobile terminal. The microphone 122 may receive sounds (audio data) via the microphone in a phone call mode, a recording mode, a voice recognition mode, or the like, and can process such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the mobile communication module 112 in case of a phone call mode. The microphone 122 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The user input unit 130 may generate key input data according to a command input by a user to control various operations of the mobile terminal. The user input unit 130 allows a user to input various types of information, and may include a keyboard, dome sheet, touch pad (e.g., a touch-sensitive member that detects changes in resistance, pressure, capacitance, and the like due to being touched), scroll wheel, joystick, and the like. In particular, when the touch pad is superimposed on the display unit 151 in the form of a layer, a touch screen may be formed.
The sensing unit 140 detects a current state of the mobile terminal 100 (e.g., an open or closed state of the mobile terminal 100), a position of the mobile terminal 100, presence or absence of contact (i.e., touch input) by a user with the mobile terminal 100, an orientation of the mobile terminal 100, acceleration or deceleration movement and direction of the mobile terminal 100, and the like, and generates a command or signal for controlling an operation of the mobile terminal 100. For example, when the mobile terminal 100 is implemented as a slide-type mobile phone, the sensing unit 140 may sense whether the slide-type phone is opened or closed. In addition, the sensing unit 140 can detect whether the power supply unit 190 supplies power or whether the interface unit 170 is coupled with an external device. The sensing unit 140 may include a proximity sensor 1410 as will be described below in connection with a touch screen.
The interface unit 170 serves as an interface through which at least one external device is connected to the mobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The identification module may store various information for authenticating a user using the mobile terminal 100 and may include a User Identity Module (UIM), a Subscriber Identity Module (SIM), a Universal Subscriber Identity Module (USIM), and the like. In addition, a device having an identification module (hereinafter, referred to as an "identification device") may take the form of a smart card, and thus, the identification device may be connected with the mobile terminal 100 via a port or other connection means. The interface unit 170 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the mobile terminal 100 or may be used to transmit data between the mobile terminal and the external device.
In addition, when the mobile terminal 100 is connected with an external cradle, the interface unit 170 may serve as a path through which power is supplied from the cradle to the mobile terminal 100 or may serve as a path through which various command signals input from the cradle are transmitted to the mobile terminal. Various command signals or power input from the cradle may be used as signals for recognizing whether the mobile terminal is accurately mounted on the cradle. The output unit 150 is configured to provide output signals (e.g., audio signals, video signals, alarm signals, vibration signals, etc.) in a visual, audio, and/or tactile manner. The output unit 150 may include a display unit 151, an audio output module 152, an alarm unit 153, and the like.
The display unit 151 may display information processed in the mobile terminal 100. For example, when the mobile terminal 100 is in a phone call mode, the display unit 151 may display a User Interface (UI) or a Graphical User Interface (GUI) related to a call or other communication (e.g., text messaging, multimedia file downloading, etc.). When the mobile terminal 100 is in a video call mode or an image capturing mode, the display unit 151 may display a captured image and/or a received image, a UI or GUI showing a video or an image and related functions, and the like.
Meanwhile, when the display unit 151 and the touch pad are overlapped with each other in the form of a layer to form a touch screen, the display unit 151 may serve as an input device and an output device. The display unit 151 may include at least one of a Liquid Crystal Display (LCD), a thin film transistor LCD (TFT-LCD), an Organic Light Emitting Diode (OLED) display, a flexible display, a three-dimensional (3D) display, and the like. Some of these displays may be configured to be transparent to allow a user to view from the outside, which may be referred to as transparent displays, and a typical transparent display may be, for example, a TOLED (transparent organic light emitting diode) display or the like. Depending on the particular desired implementation, the mobile terminal 100 may include two or more display units (or other display devices), for example, the mobile terminal may include an external display unit (not shown) and an internal display unit (not shown). The touch screen may be used to detect a touch input pressure as well as a touch input position and a touch input area.
The audio output module 152 may convert audio data received by the wireless communication unit 110 or stored in the memory 160 into an audio signal and output as sound when the mobile terminal is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output module 152 may provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output module 152 may include a speaker, a buzzer, and the like.
The alarm unit 153 may provide an output to notify the mobile terminal 100 of the occurrence of an event. Typical events may include call reception, message reception, key signal input, touch input, and the like. In addition to audio or video output, the alarm unit 153 may provide output in different ways to notify the occurrence of an event. For example, the alarm unit 153 may provide an output in the form of vibration, and when a call, a message, or some other incoming communication (incomingmunication) is received, the alarm unit 153 may provide a tactile output (i.e., vibration) to inform the user thereof. By providing such a tactile output, the user can recognize the occurrence of various events even when the user's mobile phone is in the user's pocket. The alarm unit 153 may also provide an output notifying the occurrence of an event via the display unit 151 or the audio output module 152.
The memory 160 may store software programs and the like for processing and controlling operations performed by the controller 180, or may temporarily store data (e.g., a phonebook, messages, still images, videos, and the like) that has been or will be output. Also, the memory 160 may store data regarding various ways of vibration and audio signals output when a touch is applied to the touch screen.
The memory 160 may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. Also, the mobile terminal 100 may cooperate with a network storage device that performs a storage function of the memory 160 through a network connection.
The controller 180 generally controls the overall operation of the mobile terminal. For example, the controller 180 performs control and processing related to voice calls, data communications, video calls, and the like. In addition, the controller 180 may include a multimedia module 181 for reproducing (or playing back) multimedia data, and the multimedia module 181 may be constructed within the controller 180 or may be constructed separately from the controller 180. The controller 180 may perform a pattern recognition process to recognize a handwriting input or a picture drawing input performed on the touch screen as a character or an image.
The power supply unit 190 receives external power or internal power and provides appropriate power required to operate various elements and components under the control of the controller 180.
The various embodiments described herein may be implemented in a computer-readable medium using, for example, computer software, hardware, or any combination thereof. For a hardware implementation, the embodiments described herein may be implemented using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, an electronic unit designed to perform the functions described herein, and in some cases, such embodiments may be implemented in the controller 180. For a software implementation, the implementation such as a process or a function may be implemented with a separate software module that allows performing at least one function or operation. The software codes may be implemented by software applications (or programs) written in any suitable programming language, which may be stored in the memory 160 and executed by the controller 180.
Up to this point, mobile terminals have been described in terms of their functionality. Hereinafter, a slide-type mobile terminal among various types of mobile terminals, such as a folder-type, bar-type, swing-type, slide-type mobile terminal, and the like, will be described as an example for the sake of brevity. Accordingly, the present invention can be applied to any type of mobile terminal, and is not limited to a slide type mobile terminal.
The mobile terminal 100 as shown in fig. 1 may be configured to operate with communication systems such as wired and wireless communication systems and satellite-based communication systems that transmit data via frames or packets.
A communication system in which a mobile terminal according to the present invention is operable will now be described with reference to fig. 2.
Such communication systems may use different air interfaces and/or physical layers. For example, the air interface used by the communication system includes, for example, Frequency Division Multiple Access (FDMA), Time Division Multiple Access (TDMA), Code Division Multiple Access (CDMA), and Universal Mobile Telecommunications System (UMTS) (in particular, Long Term Evolution (LTE)), global system for mobile communications (GSM), and the like. By way of non-limiting example, the following description relates to a CDMA communication system, but such teachings are equally applicable to other types of systems.
Referring to fig. 2, the CDMA wireless communication system may include a plurality of mobile terminals 100, a plurality of Base Stations (BSs) 270, Base Station Controllers (BSCs) 275, and a Mobile Switching Center (MSC) 280. The MSC280 is configured to interface with a Public Switched Telephone Network (PSTN) 290. The MSC280 is also configured to interface with a BSC275, which may be coupled to the base station 270 via a backhaul. The backhaul may be constructed according to any of several known interfaces including, for example, E1/T1, ATM, IP, PPP, frame Relay, HDSL, ADSL, or xDSL. It will be understood that a system as shown in fig. 2 may include multiple BSCs 275.
Each BS270 may serve one or more sectors (or regions), each sector covered by a multi-directional antenna or an antenna pointing in a particular direction being radially distant from the BS 270. Alternatively, each partition may be covered by two or more antennas for diversity reception. Each BS270 may be configured to support multiple frequency allocations, with each frequency allocation having a particular frequency spectrum (e.g., 1.25MHz,5MHz, etc.).
The intersection of partitions with frequency allocations may be referred to as a CDMA channel. The BS270 may also be referred to as a Base Transceiver Subsystem (BTS) or other equivalent terminology. In such a case, the term "base station" may be used to generically refer to a single BSC275 and at least one BS 270. The base stations may also be referred to as "cells". Alternatively, each sector of a particular BS270 may be referred to as a plurality of cell sites.
As shown in fig. 2, a Broadcast Transmitter (BT)295 transmits a broadcast signal to the mobile terminal 100 operating within the system. A broadcast receiving module 111 as shown in fig. 1 is provided at the mobile terminal 100 to receive a broadcast signal transmitted by the BT 295. In fig. 2, several Global Positioning System (GPS) satellites 300 are shown. The satellite 300 assists in locating at least one of the plurality of mobile terminals 100.
In fig. 2, a plurality of satellites 300 are depicted, but it is understood that useful positioning information may be obtained with any number of satellites. The GPS module 115 as shown in fig. 1 is generally configured to cooperate with satellites 300 to obtain desired positioning information. Other techniques that can track the location of the mobile terminal may be used instead of or in addition to GPS tracking techniques. In addition, at least one GPS satellite 300 may selectively or additionally process satellite DMB transmission.
As a typical operation of the wireless communication system, the BS270 receives reverse link signals from various mobile terminals 100. The mobile terminal 100 is generally engaged in conversations, messaging, and other types of communications. Each reverse link signal received by a particular base station 270 is processed within the particular BS 270. The obtained data is forwarded to the associated BSC 275. The BSC provides call resource allocation and mobility management functions including coordination of soft handoff procedures between BSs 270. The BSCs 275 also route the received data to the MSC280, which provides additional routing services for interfacing with the PSTN 290. Similarly, the PSTN290 interfaces with the MSC280, the MSC interfaces with the BSCs 275, and the BSCs 275 accordingly control the BS270 to transmit forward link signals to the mobile terminal 100.
Based on the above hardware structure of the mobile terminal and the communication system, the size measuring apparatus according to the first embodiment of the present invention is proposed, and as shown in fig. 3, the size measuring apparatus according to the first embodiment of the present invention may include:
a shooting module 301, configured to shoot an image of an object to be detected through a camera;
in order to make the measurement result more accurate, the whole picture of the object to be measured is shot as much as possible while the object to be measured is shot. Furthermore, the inclination angle, the shake and the like of the camera can influence the accuracy of the result, so that the camera can be kept horizontal as much as possible when the camera is used for taking a picture, and the shake of the camera is reduced.
For example, when a user goes out, the user may choose to photograph an iron tower through the iron tower, and the iron tower is the object to be measured.
A first obtaining module 302, configured to obtain a horizontal distance between the camera and the object to be detected and an inclination angle of the camera when the camera shoots the object to be detected;
in the time of actual implementation, can be when shooing, the horizontal distance between real-time detection camera and the object that awaits measuring, for example: the horizontal distance may be detected by a laser rangefinder. If the camera is a camera on a mobile phone, a laser range finder can be arranged near the camera, and the lower end of the camera and the flash lamp can be combined into a module. The laser range finder is used for measuring the horizontal distance.
Considering that real-time horizontal and vertical can not be kept when manual photographing is carried out, therefore, the angle can be fed back through the acceleration sensor and stored in the database, random photographing is carried out sometimes and hands can shake inevitably, at the moment, the direction and the degree of shaking can be fed back quickly through the gyroscope, measured data are stored in a cache after analog-to-digital conversion, and data reverse compensation is carried out through an algorithm, so that the precision can be effectively improved, errors are reduced, and further, the gyroscope and the acceleration sensor can be matched for use to form negative feedback and mutual correction data. That is, in one embodiment, the first obtaining module may be specifically configured to detect the tilt angle through an acceleration sensor and a gyroscope.
Further, with the development of lens technology, it is considered that the optical zoom technology can be applied to a mobile phone, so that the auxiliary equipment for laser ranging is not added.
The optical zooming is an important parameter of a digital camera lens, and the initial digital zooming is changed into the optical zooming in the mobile phone lens, so that the imaging effect is greatly improved, and the imaging effect of long-distance shooting can be improved. Of course, this requires a relatively high lens.
Optical zooming is to change the angle of the incoming light, so that the object to be photographed at the same distance becomes larger on the photosensitive element. In the optical imaging, the position of a focal point is changed by moving the lens in the lens, so that the length of the focal length of the lens is changed, and the size of the visual angle of the lens is correspondingly changed. By using the principle, the system can default to take a picture with a focal length of 1 time, wherein the focal length is XX when the focal length is 1 time, the pixel point occupied in the screen is AA, then the picture is taken with high power quickly, and the focal length is YY when the focal length is N times, and the pixel occupied in the screen is BB when the focal length is N times.
A second obtaining module 303, configured to obtain a pixel point between an upper edge and a lower edge of the object to be detected in the image;
specifically, the second obtaining module may be specifically configured to determine, through marginalization calculation, a pixel point between an upper edge and a lower edge of the object to be detected in the image. Furthermore, the starting position of the measurement is required to be given, and after confirmation, the end position is input and the tracking record is carried out. And performing marginalization calculation to obtain pixel points of the upper edge and pixel points of the lower edge.
And the calculating module 304 is configured to calculate to obtain size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel point, and preset reference data.
The calculation module may be specifically configured to calculate the size data according to the following formula:
B2=A2*D1/D/Sina,
B3=A3*D1/D/Sina,
the method comprises the following steps of obtaining a reference coordinate system, obtaining a reference object, obtaining a horizontal distance between the reference object and a camera, and obtaining a tilt angle, wherein B2 represents the length of the object to be measured, B3 represents the width of the object to be measured, A2 represents the number of pixels of the object to be measured in the longitudinal direction of an image, A3 represents the number of pixels of the object to be measured in the transverse direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and the camera in a preset reference.
The above-mentioned reference coordinate system may be established as follows: during development and debugging, an object with a specific size can be selected as a reference length element, and a picture can be taken at 1-time focal length.
Assuming that the selected object is a cylindrical object, the diameter of the selected object is R, and the distance from the surface of the object to the lens is D, the object and the lens are ensured to be parallel in the photographing process. Firstly, the mobile phone is supported by a support, a level meter is used for detecting whether the mobile phone is level or not until the mobile phone is adjusted to be in a level state, the object to be detected is also adjusted to be level at a distance D by the same method, and the cylindrical object is required to be displayed in the screen. Then, the data acquisition module is responsible for providing image acquisition data by the camera and entering the data cache.
And calculating the selected object in the data buffer area, determining that the pixel point occupied by the object in the screen is A, A1, the whole resolution of the screen is M × N, the length and width dimensions are L and W respectively, and calculating the sizes B and B1 of the effective pixel points occupied by the circular reference object in the length and width in the screen. (the data of this reference frame is only used in the development and debugging to be stored in the database for subsequent calculations, and the user may not need to know).
The relationship is as follows:
and at the distance D, the radius is R, the length B in the screen is A × L/M, and the width B1 is A1 × W/N. And storing the data into a memory so as to carry out data participation calculation in the following process.
In an embodiment of the present invention, a size measuring method is further provided, as shown in fig. 4, the method may include the following steps:
s401: shooting an image of an object to be detected through a camera;
s402: acquiring a horizontal distance between the camera and the object to be detected and an inclination angle of the camera when the camera shoots the object to be detected;
optionally, when the camera is used for shooting the object to be measured, the horizontal distance between the camera and the object to be measured may include: the horizontal distance is detected by a laser rangefinder.
Optionally, when the object to be measured is shot by the camera, the obtaining of the inclination angle of the camera may include: the tilt angle is detected by an acceleration sensor and a gyroscope.
S403: acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image;
s404: and calculating to obtain the size data of the object to be detected according to the horizontal distance, the inclination angle, the pixel points and preset reference data.
Optionally, the calculating the distance between the camera and the object to be measured according to the horizontal distance, the inclination angle, the pixel point, and preset reference data to obtain size data of the object to be measured may include: the dimensional data is calculated according to the following formula:
B2=A2*D1/D/Sina,
B3=A3*D1/D/Sina,
the method comprises the following steps of obtaining a reference coordinate system, wherein B2 represents the length of the object to be measured, B3 represents the width of the object to be measured, A2 represents the number of pixels of the object to be measured in the longitudinal direction of an image, A3 represents the number of pixels of the object to be measured in the transverse direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and a camera when shooting is carried out in a preset reference coordinate system at 1-time focal length, and a represents the inclination angle.
In the above embodiments, the object to be measured may be an area defined by the user by clicking a start point and an end point in the image preview area.
The above size determination method is described below with reference to a specific embodiment, however, it should be noted that the specific embodiment is only for better illustration of the present invention and is not to be construed as a limitation of the present invention.
In this example, a method is provided that can display the size and record the size at the time of shooting at will, and the display size can be realized during the shooting preview, so that the user can know the size of the specific thing that the user wants to know.
Specifically, as shown in fig. 5, the method includes the following steps:
s1: establishing a standard reference system database:
firstly, during research and development and debugging, an object with a specific size can be selected as a reference length element, and a picture can be taken with a focal length of 1 time.
Assuming that the selected object is a cylindrical object, the diameter of the selected object is R, and the distance from the surface of the object to the lens is D, the object and the lens are ensured to be parallel in the photographing process. Firstly, the mobile phone is supported by a support, a level meter is used for detecting whether the mobile phone is level or not until the mobile phone is adjusted to be in a level state, the object to be detected is also adjusted to be level at a distance D by the same method, and the cylindrical object is required to be displayed in the screen. Then, the data acquisition module is responsible for providing image acquisition data by the camera and entering the data cache.
And calculating the selected object in the data buffer area, determining that the pixel point occupied by the object in the screen is A, A1, the whole resolution of the screen is M × N, the length and width dimensions are L and W respectively, and calculating the sizes B and B1 of the effective pixel points occupied by the circular reference object in the length and width in the screen. (the data of the reference system can be only used for subsequent calculation when developing and debugging by using the stored database, and the user does not need to operate).
The relationship is as follows:
and at the distance D, the radius is R, the length B in the screen is A × L/M, and the width B1 is A1 × W/N.
And storing the data into a memory so as to carry out data participation calculation in the following process.
S2: and (3) receiving data algorithm processing:
as an auxiliary device, a laser range finder can be arranged near the camera, the laser range finder can be combined with the flash lamp on a module at the lower end of the camera, the horizontal distance between the measured object and the lens needs to be accurately measured, and after the horizontal distance D1 is measured, the horizontal distance can be stored in the database D1.
With the development of lens technology, the optical zoom technology can be applied to mobile phones, so that auxiliary equipment for laser ranging is not added.
The optical zooming is an important parameter of a digital camera lens, and the initial digital zooming is changed into the optical zooming in the mobile phone lens, so that the imaging effect is greatly improved, and the imaging effect of long-distance shooting can be improved. Of course, this requires a relatively high lens.
The optical zooming is to change the angle of the light entering, so that the shot object at the same distance becomes larger on the photosensitive element, and the focal length of the lens is changed by moving the lens inside the lens to change the position of the focal point, so that the size of the visual angle of the lens is correspondingly changed. By using the principle, the system can default to take a picture with a focal length of 1 time, wherein the focal length is XX when the focal length is 1 time, the pixel point occupied in the screen is AA, then the picture is taken with high power quickly, and the focal length is YY when the focal length is N times, and the pixel occupied in the screen is BB when the focal length is N times. Specifically, in the case of distance measurement, the distance D1 is T focal length (T-T), and the average value is obtained by 1 time and N times to reduce the error.
In order to accurately feed back an included angle a between the shot image and the horizontal plane, the angle can be fed back through the acceleration sensor and stored in the database, the shot image can be taken at any time in operation, the hand can shake difficultly, the direction and the degree of shake can be fed back quickly through the gyroscope at the moment, and the measured data are stored in a cache after analog-to-digital conversion.
Therefore, a data inverse compensation can be performed through an algorithm, which can play an important role in improving the precision and reducing the error. In order to solve the accuracy problem for a longer time, the acceleration sensor and the gyroscope can be used together to form negative feedback and mutually correct data, and in the comprehensive calculation, in order to better express the specific size which people want to measure when taking a picture, the real-time preview can be provided.
Further, a prompt for human-computer interaction may be provided, as shown in fig. 6, which may include:
s2-1: image data reception, distance data measurement reception, and angle measurement reception.
S2-2: entering a cache region for data processing;
s2-3: performing preview and marginalization processing constantly, specifically, the method may include: giving a starting position to be measured, prompting to give an end position after confirmation, tracking and recording, and giving whether to continue, if not, pressing a shutter key to display the size in a screen. Through the marginalization calculation, the pixel points from the upper edge to the lower edge are respectively A2 and A3. It should be noted that all parts of the object to be measured are photographed on the screen during photographing.
S3: and displaying size data:
through the data recording, the length of the object size is B2-A2-D1/D/Sina, and the width is B3-A3-D1/D/Sina, and finally the data is displayed on a screen and recorded and stored.
In the above embodiment, a method for measuring and previewing the size of the object by using the camera is provided, the size can be effectively and accurately provided, the randomness is strong, the use of a user is increased, the size of the object is curious, convenience is provided for some bridge engineers, the defect that a measuring instrument is heavy and large is avoided, and the method plays a great role particularly in mountain construction.
The following describes the practical use of the above method with reference to a specific scenario, however, it should be noted that this specific use example is only for better describing the present application and is not to be construed as a limitation of the present application.
As shown in fig. 7, after the user points the camera at the target object on the photo page, the user may select one target object by clicking, for example, select a high building in front of the face.
After clicking, a "selection starting point" may be displayed as shown in fig. 7, and the user may select the starting point by clicking, and in order to make it possible to know whether the appropriate position is selected, a parallel line may be drawn for the starting point after the user selects the starting point to indicate that the position is started. Of course, if it is the width measured, it may be parallel to the vertical, and if it is the height measured, it may be parallel to the lateral.
After the selection of the starting point is completed, the selection end point can be displayed as shown in fig. 8, and at this time, the user can click the end point, and of course, the end point can also be identified in a parallel line manner. Specifically, as shown in fig. 9, two lines are marked at the end point and the start point, and after the pixel points of the end point and the start point are determined, the height of the measured object can be determined and displayed.
In the displaying, as shown in fig. 9, the height of the object to be measured may be displayed by marking the height in the vertical direction.
Specifically, assume that the preselected reference is a reference having a height of 1 meter and a distance from the lens of 5 meters. The distance between the currently detected camera and the target object is 20 meters, and the horizontal inclination angle of the determined pixel point relative to the starting point and the end point is 30 degrees, so that the height of the target object can be correspondingly calculated as follows:
h20 × 5/1/sin30 ° -50 m
I.e. the resulting height of the target object is 50 meters.
The actual building height of the target object is 51 meters, and the error is relatively small. Of course, because the above-mentioned approaches involve parameters of distance, accuracy of positioning, processing accuracy of the camera itself, and the like, and a view angle of the camera, and the like, the accuracy of the final result can be improved by improving the accuracy of the components of the camera with respect to the accuracy of the result.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (8)

1. A dimensional measurement device, comprising:
the shooting module is used for shooting an image of an object to be detected through the camera;
the first acquisition module is used for acquiring the horizontal distance between the camera and the object to be detected and the inclination angle of the camera when the camera shoots the object to be detected;
the second acquisition module is used for acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image;
the calculation module is used for calculating to obtain size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel points and preset reference data;
the calculation module comprises:
the length calculation unit is used for dividing the product of the number of pixels of the object to be detected in the longitudinal direction of the image, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system, and taking the obtained result as the length of the object to be detected, so that the following requirements are met:
B2=A2*D1/D/Sina
wherein, B2 represents the length of the object to be measured, a2 represents the number of pixels of the object to be measured in the longitudinal direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and the camera in the preset reference coordinate system, and a represents the inclination angle;
and the width calculation unit is used for dividing the product of the number of pixels of the object to be detected in the image in the transverse direction, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system, and taking the obtained result as the width of the object to be detected, so that the requirements of:
B3=A3*D1/D/Sina
wherein, B3 represents the width of the object to be measured, A3 represents the number of pixels of the object to be measured in the transverse direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and the camera in the preset reference coordinate system, and a represents the inclination angle.
2. The apparatus of claim 1, wherein the first acquisition module is specifically configured to detect the horizontal distance by a laser range finder.
3. The device according to claim 1, characterized in that said first acquisition module is particularly adapted to detect said inclination by means of an acceleration sensor and a gyroscope.
4. The apparatus according to any one of claims 1 to 3, wherein the second obtaining module is specifically configured to determine, through marginalization calculation, pixel points between an upper edge and a lower edge of the object to be measured in the image.
5. A dimensional measurement method, comprising:
shooting an image of an object to be detected through a camera;
acquiring a horizontal distance between the camera and the object to be detected and an inclination angle of the camera when the camera shoots the object to be detected;
acquiring pixel points between the upper edge and the lower edge of the object to be detected in the image;
calculating to obtain size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel points and preset reference data;
calculating to obtain size data of the object to be measured according to the horizontal distance, the inclination angle, the pixel points and preset reference data, wherein the size data comprises:
dividing the product of the number of pixels of the object to be detected in the longitudinal direction in the image, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system, and taking the obtained result as the length of the object to be detected, wherein the length of the object to be detected satisfies the following requirements:
B2=A2*D1/D/Sina
wherein, B2 represents the length of the object to be measured, a2 represents the number of pixels of the object to be measured in the longitudinal direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and the camera in the preset reference coordinate system, and a represents the inclination angle;
dividing the product of the number of pixels of the object to be detected in the image in the transverse direction, the horizontal distance and the inclination angle by the horizontal distance between the reference object and the camera in a preset reference coordinate system, and taking the obtained result as the width of the object to be detected, wherein the width of the object to be detected satisfies the following requirements:
B3=A3*D1/D/Sina
wherein, B3 represents the width of the object to be measured, A3 represents the number of pixels of the object to be measured in the transverse direction of the image, D1 represents the horizontal distance, D represents the horizontal distance between the reference object and the camera in the preset reference coordinate system, and a represents the inclination angle.
6. The method of claim 5, wherein obtaining the horizontal distance between the camera and the object to be measured when the camera shoots the object to be measured comprises:
the horizontal distance is detected by a laser rangefinder.
7. The method of claim 5, wherein obtaining the tilt angle of the camera when the camera shoots the object to be measured comprises:
the tilt angle is detected by an acceleration sensor and a gyroscope.
8. The method according to any one of claims 5 to 7, wherein the object under test is an area defined by a user by clicking a start point and an end point in an image preview area.
CN201611223542.0A 2016-12-27 2016-12-27 Size measuring device and method Active CN106482641B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611223542.0A CN106482641B (en) 2016-12-27 2016-12-27 Size measuring device and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611223542.0A CN106482641B (en) 2016-12-27 2016-12-27 Size measuring device and method

Publications (2)

Publication Number Publication Date
CN106482641A CN106482641A (en) 2017-03-08
CN106482641B true CN106482641B (en) 2020-10-16

Family

ID=58285590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611223542.0A Active CN106482641B (en) 2016-12-27 2016-12-27 Size measuring device and method

Country Status (1)

Country Link
CN (1) CN106482641B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107796319A (en) * 2017-10-31 2018-03-13 国网江苏省电力公司南通供电公司 A kind of wire measuring device and its measuring method
CN110278369A (en) * 2019-05-28 2019-09-24 北京智形天下科技有限责任公司 A kind of photo intercept method preventing camera distortion
CN112153320B (en) * 2020-09-23 2022-11-08 北京京东振世信息技术有限公司 Method and device for measuring size of article, electronic equipment and storage medium
CN117292416A (en) * 2021-01-25 2023-12-26 天津怡和嘉业医疗科技有限公司 Face size determining method and device
CN113008142B (en) * 2021-03-25 2024-07-09 珠海市运泰利自动化设备有限公司 Earphone middle frame size detection equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2746705A1 (en) * 1996-03-27 1997-10-03 Heidelberg Harris Sa Contactless measurement device for shifts of continuous sheet
CN105043269A (en) * 2015-07-08 2015-11-11 上海与德通讯技术有限公司 Method for measuring size of object and electronic apparatus
CN105387807A (en) * 2014-09-04 2016-03-09 富泰华工业(深圳)有限公司 System and method for measuring height of object
CN105486233A (en) * 2015-11-11 2016-04-13 丁克金 Method for measuring size of object by using relation of camera pixel and object distance
CN105910540A (en) * 2016-06-23 2016-08-31 吴江市建设工程质量检测中心有限公司 Building wall crack field detection method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013059599A1 (en) * 2011-10-19 2013-04-25 The Regents Of The University Of California Image-based measurement tools
JP5861218B2 (en) * 2013-03-28 2016-02-16 株式会社東芝 Portable terminal device, display control method, and program
CN106225687A (en) * 2016-09-06 2016-12-14 乐视控股(北京)有限公司 The measuring method of dimension of object and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
FR2746705A1 (en) * 1996-03-27 1997-10-03 Heidelberg Harris Sa Contactless measurement device for shifts of continuous sheet
CN105387807A (en) * 2014-09-04 2016-03-09 富泰华工业(深圳)有限公司 System and method for measuring height of object
CN105043269A (en) * 2015-07-08 2015-11-11 上海与德通讯技术有限公司 Method for measuring size of object and electronic apparatus
CN105486233A (en) * 2015-11-11 2016-04-13 丁克金 Method for measuring size of object by using relation of camera pixel and object distance
CN105910540A (en) * 2016-06-23 2016-08-31 吴江市建设工程质量检测中心有限公司 Building wall crack field detection method

Also Published As

Publication number Publication date
CN106482641A (en) 2017-03-08

Similar Documents

Publication Publication Date Title
CN106454121B (en) Double-camera shooting method and device
CN106482641B (en) Size measuring device and method
CN106909274B (en) Image display method and device
WO2018019124A1 (en) Image processing method and electronic device and storage medium
CN105163042B (en) A kind of apparatus and method for blurring processing depth image
CN106713716B (en) Shooting control method and device for double cameras
CN106878949B (en) Positioning terminal, system and method based on double cameras
CN104731480B (en) Image display method and device based on touch screen
CN105430258B (en) A kind of method and apparatus of self-timer group photo
CN106911881B (en) Dynamic photo shooting device and method based on double cameras and terminal
CN104951229B (en) Screenshot method and device
CN106372264B (en) Map data migration device and method
CN105120403B (en) A kind of noise reduction system and method
CN107018326B (en) Shooting method and device
CN106937056B (en) Focusing processing method and device for double cameras and mobile terminal
CN106851114B (en) Photo display device, photo generation device, photo display method, photo generation method and terminal
CN105338244B (en) A kind of information processing method and mobile terminal
WO2018032917A1 (en) Mobile terminal, method for obtaining focus value, and computer readable storage medium
WO2017071471A1 (en) Mobile terminal and shooting control method therefor
CN106990896B (en) Stereo photo display method and device based on double cameras and mobile terminal
CN106254783B (en) Moving object shooting method and device
CN107071275B (en) Image synthesis method and terminal
CN106646442A (en) Distance measurement method and terminal
CN106780408B (en) Picture processing method and device
CN106775069B (en) Pressure compensation method and system

Legal Events

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