Non-contact tree breast height diameter measuring method and system based on computer vision

文档序号:1293988 发布日期:2020-08-07 浏览:13次 中文

阅读说明:本技术 一种基于计算机视觉的非接触式树木胸径测量方法及系统 (Non-contact tree breast height diameter measuring method and system based on computer vision ) 是由 任桐炜 孙旭 王博 于 2020-05-21 设计创作,主要内容包括:一种基于计算机视觉的非接触式树木胸径测量方法及系统,硬件设备包括:RFID标签、智能手机、RFID读写设备、手持设备;通过智能手机拍得带有彩色标签的树木躯干照片,将该照片传至服务器进行图像处理,处理后获得待测树木的胸径,所述彩色标签附有RFID标签,同时由RFID读写设备识别树木RFID标签,并在服务器中将测得的树木胸径与该树木的RFID标签对应存储。本发明实施例中设备装置简单、便于携带,整个系统可提升树木测量与管理的效率。(A non-contact tree breast height diameter measuring method and system based on computer vision, the hardware equipment includes: the system comprises an RFID tag, a smart phone, an RFID read-write device and a handheld device; the tree trunk photo with the color tag is shot through the smart phone and is transmitted to the server for image processing, the breast diameter of the tree to be measured is obtained after the image processing, the color tag is attached with the RFID tag, meanwhile, the RFID tag of the tree is identified through the RFID reading and writing equipment, and the measured breast diameter of the tree and the RFID tag of the tree are correspondingly stored in the server. The device in the embodiment of the invention is simple and convenient to carry, and the whole system can improve the efficiency of tree measurement and management.)

1. A non-contact tree breast height diameter measuring method based on computer vision is characterized in that a tree trunk photo with a color tag is shot through a smart phone, the photo is transmitted to a server to be subjected to image processing, the breast height diameter of a tree to be measured is obtained after the image processing, the color tag is attached with an RFID tag, meanwhile, an RFID reading and writing device identifies the tree RFID tag, and the measured tree breast height diameter and the RFID tag of the tree are correspondingly stored in the server.

2. The non-contact tree breast diameter measuring method based on the computer vision is characterized in that the method is realized through a software program, the software module comprises an inclination checking module, a picture collecting module, a label reading module, a vision measuring module and a web end system, the inclination checking module is configured in a smart phone, the vision measuring module and the web end system are configured in a server, the inclination checking module obtains the current inclination of the smart phone through a gyroscope inside the smart phone, when the inclination is within an allowable range and a camera of the smart phone is aligned with a color label on a trunk of a tree, the picture collecting module is triggered to collect a tree photo to be measured, the label reading module sends a command to an RFID read-write device through a serial port, reads an RFID label of the tree to be measured and receives return data, and the smart phone transmits the tree photo to be measured and the RFID label data to the server, processing the photograph by the vision measurement module using a vision measurement algorithm to obtain a tree breast diameter; the web-side system is used for providing a human-computer interaction interface, providing an information query port for tree growth conditions and staff measurement conditions, displaying historical growth information of each tree, measurement workload completed by staff corresponding to each smart phone and soil fertility conditions of a tree growth area, and performing quantifiable management.

3. The non-contact tree breast diameter measuring method based on computer vision as claimed in claim 1, wherein the vision measuring module realizes camera calibration, trunk segmentation and breast diameter calculation; the camera is marked to detect a color label in the acquired image, the size of the color label in the image is calculated, and the distance between the center of the color label and the lens during shooting is calculated according to the size and the known focal length of the camera; the trunk segmentation is to detect a trunk region in an image through an image segmentation algorithm; the breast-height diameter calculation is to calculate the actual breast-height diameter of the trunk according to the distance between the lens and the center of the color label during shooting, which is obtained by calibrating the camera.

4. The method as claimed in claim 3, wherein the camera calibration is implemented by obtaining an area where a color label is located in an image according to color, obtaining two long sides and one short side of the area by applying L SD straight line detection algorithm to the area, calculating the maximum length of the color label in the direction parallel to the long sides, namely the length of the long axis, calculating the maximum length of the color label in the direction parallel to the short sides, namely the length of the short axis, and obtaining the distance between the camera lens and the center of the color label during shooting according to the length of the long axis, the length of the short axis and the known camera focal length.

5. The method as claimed in claim 3, wherein the trunk segmentation is as follows: the method comprises the steps of marking a tree trunk area above and below a detected color label area by a camera to cover the color label area, cutting an image area surrounding the position of an original color label, designating the area of the original color label position in the covered and cut image as a foreground area, designating the areas of the left upper corner, the left lower corner, the right upper corner and the right lower corner of the covered and cut image as a background area, inputting the covered and cut image, the designated foreground area position and the background area position into an interactive image segmentation algorithm based on a depth convolution neural network, and obtaining the area of the tree trunk in the covered and cut image, namely the tree trunk area.

6. The method for measuring the breast diameter of the tree based on the computer vision as claimed in claim 3, wherein the breast diameter is calculated by: extracting left and right edges of a trunk from a trunk region, dividing an image containing the left and right edges of the trunk into a plurality of rectangular small regions with the same height along the vertical direction, fitting the left and right edges of the trunk in each small region into two straight lines by utilizing linear regression, calculating the mean square error between the original trunk edge and the fitted straight line, and calculating the included angle between the two fitted straight lines; if the mean square error is larger than a specified threshold or the included angle is larger than a specified threshold, discarding the small area, otherwise, approximating the two straight lines as parallel lines and calculating the distance between the two straight lines; then, averaging the distances obtained by calculating each small area to be used as the breast diameter of the trunk in the image; and finally, calculating the actual trunk diameter according to the diameter of breast in the image of the trunk and the distance between the lens and the center of the color label during shooting, which is obtained in the camera calibration module, by utilizing the geometric relationship.

7. A non-contact tree breast height diameter measuring system based on computer vision is characterized by comprising color tags, a smart phone, RFID reading and writing equipment, handheld equipment and a server, wherein the handheld equipment is used for loading the smart phone and the RFID reading and writing equipment, the color tags are arranged on trees to be measured, the color tags of all the trees have the same size, each color tag is attached with an RFID tag and used for recording a unique tree number, the smart phone is in communication connection with the server, software programs are configured in the smart phone and the server, and when the software programs are executed, the measuring method of any one of claims 1-6 is achieved.

8. The system of claim 7, wherein the smart phone supplies power to the RFID reader/writer device through a serial port and receives data from the RFID reader/writer device.

9. The system of claim 7, wherein the hand-held device is equipped with an adjustable cell phone holder adapted to be carried by a cell phone of the same model; the handheld device is provided with serial ports at the loading positions of the smart phone and the RFID read-write equipment, the serial ports are connected through serial ports, and a switch is arranged on the serial ports and used for controlling the on-off of a circuit of the RFID read-write equipment.

10. The system of claim 9, wherein the handheld device further comprises a charging jack, the charging jack is connected to a serial line, and the charging jack is used for charging the smart phone with an external power source.

Technical Field

The invention belongs to the technical field of forestry measurement, and particularly relates to a non-contact tree breast height diameter measurement method and system based on computer vision.

Background

The breast height is an important basis for measuring the price of the nursery stock, and the measurement of the breast height of the tree is extremely important in the breast height inventory of the tree in the nursery.

Existing measurement techniques can be divided into two broad categories: contact measurement and non-contact measurement. The contact measurement mainly passes through the breast diameter chi, and around the trunk a week, the person of measuring must be close to the trunk, and measurement efficiency is very low, for many hundreds of thousands of nursery stocks quantity, the measurement of nursery stock breast diameter is difficult to accomplish. In a non-contact measuring device, a measuring system using the principles of triangulation, laser ranging and the like needs a relatively stable platform for measurement; in addition, the measuring device using image acquisition and processing cannot avoid measuring the distance between the image acquisition point and the tree to be measured by using a ranging rod, the measuring speed is relatively slow, and the measuring device cannot be applied to the measuring environment with large nursery stock quantity.

Disclosure of Invention

Aiming at the defects of the prior art, the invention provides a method and a system for non-contact tree breast height diameter measurement, which can accurately measure the tree breast height diameter without a fixed platform, a laser range finder and a ranging rod and realize automatic data arrangement for large-scale measurement.

The technical scheme of the invention is as follows: a non-contact tree breast height diameter measuring method based on computer vision is characterized in that a tree trunk photo with a color tag is shot through a smart phone, the photo is transmitted to a server to be subjected to image processing, the breast height diameter of a tree to be measured is obtained after the image processing, the color tag is attached with an RFID tag, meanwhile, the RFID tag of the tree is identified through RFID reading and writing equipment, and the measured breast height diameter of the tree and the RFID tag of the tree are correspondingly stored in the server.

Preferably, the measuring method is implemented by a software program, the software module comprises a gradient checking module, a picture collecting module and a label reading module which are configured in the smart phone, the inclination checking module acquires the current inclination of the smart phone through a gyroscope inside the smart phone, when the inclination is within the allowed interval and the camera of the smart phone is aligned with the color label on the trunk of the tree, triggering the picture acquisition module to acquire the picture of the tree to be measured, the label reading module sends a command to the RFID reading and writing equipment through a serial port to read the RFID label of the tree to be detected, receiving the return data, transmitting the picture of the tree to be measured and the RFID tag data to a server by the smart phone, and processing the picture by the vision measurement module by using a vision measurement algorithm to obtain the breast height diameter of the tree; the web-side system is used for providing a human-computer interaction interface, providing an information query port for tree growth conditions and staff measurement conditions, displaying historical growth information of each tree, measurement workload completed by staff corresponding to each smart phone and soil fertility conditions of a tree growth area, and performing quantifiable management.

Further, the vision measurement module realizes camera calibration, trunk segmentation and breast diameter calculation; the camera is marked to detect a color label in the acquired image, the size of the color label in the image is calculated, and the distance between the center of the color label and the lens during shooting is calculated according to the size and the known focal length of the camera; the trunk segmentation is to detect a trunk region in an image through an image segmentation algorithm; the breast-height diameter calculation is to calculate the actual breast-height diameter of the trunk according to the distance between the lens and the center of the color label during shooting, which is obtained by calibrating the camera.

The camera calibration specifically comprises the steps of obtaining an area where a color label is located in an image according to colors, applying L SD (secure digital) straight line detection algorithm to the area to obtain two long sides and one short side of the area, calculating the maximum length of the color label in the direction parallel to the long sides, namely the length of a long shaft, calculating the maximum length of the color label in the direction parallel to the short sides, namely the length of a short shaft, and obtaining the distance between a camera lens and the center of the color label during shooting according to the length of the long shaft, the length of the short shaft and the known camera focal length.

The trunk segmentation specifically comprises the following steps: the method comprises the steps of marking a tree trunk area above and below a detected color label area by a camera to cover the color label area, cutting an image area surrounding the position of an original color label, designating the area of the original color label position in the covered and cut image as a foreground area, designating the areas of the left upper corner, the left lower corner, the right upper corner and the right lower corner of the covered and cut image as a background area, inputting the covered and cut image, the designated foreground area position and the background area position into an interactive image segmentation algorithm based on a depth convolution neural network, and obtaining the area of the tree trunk in the covered and cut image, namely the tree trunk area.

The chest diameter calculation specifically comprises the following steps: extracting left and right edges of a trunk from a trunk region, dividing an image containing the left and right edges of the trunk into a plurality of rectangular small regions with the same height along the vertical direction, fitting the left and right edges of the trunk in each small region into two straight lines by utilizing linear regression, calculating the mean square error between the original trunk edge and the fitted straight line, and calculating the included angle between the two fitted straight lines; if the mean square error is larger than a specified threshold or the included angle is larger than a specified threshold, discarding the small area, otherwise, approximating the two straight lines as parallel lines and calculating the distance between the two straight lines; then, averaging the distances obtained by calculating each small area to be used as the breast diameter of the trunk in the image; and finally, calculating the actual trunk diameter according to the diameter of breast in the image of the trunk and the distance between the lens and the center of the color label during shooting, which is obtained in the camera calibration module, by utilizing the geometric relationship.

The invention also provides a non-contact tree breast height diameter measuring system based on computer vision, which comprises color tags, a smart phone, RFID read-write equipment, handheld equipment and a server, wherein the handheld equipment is used for loading the smart phone and the RFID read-write equipment, the color tags are arranged on the tree to be measured, the color tags of all the trees have the same size, each color tag is attached with an RFID tag and used for recording the unique tree number, the smart phone is in communication connection with the server, software programs are configured in the smart phone and the server, and the measuring method is realized when the software programs are executed.

Furthermore, the smart phone supplies power to the RFID read-write equipment through the serial port and receives data from the RFID read-write equipment.

Furthermore, the handheld device is provided with an adjustable mobile phone support which is suitable for bearing mobile phones of the same model; the handheld device is provided with serial ports at the loading positions of the smart phone and the RFID read-write equipment, the serial ports are connected through a serial port line, and a switch is arranged on the serial port line and used for controlling the on-off of a circuit of the RFID read-write equipment;

furthermore, the handheld device is also provided with a charging socket, and the charging socket is connected with a serial port circuit and used for charging the smart phone by an external power supply.

The existing contact type measuring method is inconvenient in the scene of measuring a large number of trees, and the partial non-contact type measuring method has poor adaptability to partial weather. In order to solve the problem, the tree diameter at breast height can be measured under the condition of not contacting the tree by installing the specific color label on the tree and calculating the size of the color label by software, the measurement result is stored, and meanwhile, a matching system is provided for inquiring the growth condition of the tree and the measurement condition of staff. The tree measuring and managing device is simple and convenient to carry, and the whole system can improve the tree measuring and managing efficiency.

Drawings

Fig. 1 is a schematic view of a device for measuring the breast height diameter of a tree according to an embodiment of the present invention.

Fig. 2 is a schematic flow chart of a method for measuring the breast height diameter of a tree according to an embodiment of the present invention.

Fig. 3 is a schematic flow chart of image processing in tree breast-height diameter measurement according to an embodiment of the present invention.

Detailed Description

The invention provides a device, a system and a method for measuring the breast height diameter of a tree in a non-contact manner, the device is simple and convenient to carry, the breast height diameter of the tree is measured by using a computer vision method, redundant auxiliary devices are not needed, and great convenience is provided for measuring the breast height diameter of the tree.

The technical solutions in the embodiments of the present invention are clearly and completely described with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.

Fig. 1 is a schematic structural diagram of a part of a device of a handheld apparatus for measuring the breast diameter of a tree according to an embodiment of the present invention, and the embodiment of the present invention is described in detail below with reference to fig. 1.

As shown in fig. 1, the mobile measurement end of the present embodiment includes a smart phone 1, an RFID read-write device 4, and a handheld device 3, where the smart phone 1 and the RFID read-write device 4 are disposed on the handheld device 3; the camera 2 on the smart phone 1 faces the same direction as the RFID reading and writing device 4, and the RFID reading and writing device 4 is used for reading tree number information of a label on a tree when the smart phone 1 collects a tree diameter at breast height photo to be measured.

Specifically, the handheld device 3 of the embodiment of the invention is provided with an adjustable mobile phone support 6 for placing the smart mobile phones 1 with different sizes. As shown in fig. 1, the RFID read-write device is disposed inside the device on the back side of the smart phone, as long as it is ensured that the RFID read-write device can read the tag information, and the specific location of the RFID read-write device is not specifically limited in the embodiment of the present invention.

In addition, in the embodiment of the invention, the handheld device is provided with serial interfaces at the loading positions of the smart phone and the RFID read-write device, the serial interfaces are connected through a serial line, and the smart phone 1 supplies power to the whole hardware circuit through a serial port. And a switch 5 is arranged on the serial port circuit and used for controlling the on-off of the RFID read-write equipment circuit. The serial port can complete the data transmission function while supplying power. (ii) a Furthermore, the handheld device is also provided with a charging socket, and the charging socket is connected with a serial port circuit and used for charging the smart phone by an external power supply.

The invention realizes a non-contact tree breast-height diameter measuring method based on computer vision by configuring a software program on the basis of the hardware equipment, a tree trunk photo with a color label is shot by a smart phone, the photo is transmitted to a server for image processing, the breast-height diameter of a tree to be measured is obtained after the image processing, the color label is attached with an RFID label, meanwhile, the RFID label of the tree is identified by RFID reading and writing equipment, and the measured breast-height diameter of the tree and the RFID label of the tree are correspondingly stored in the server.

Preferably, the measuring method is implemented by a software program, the software module comprises a gradient checking module, a picture collecting module and a label reading module which are configured in the smart phone, the inclination checking module acquires the current inclination of the smart phone through a gyroscope inside the smart phone, when the inclination is within the allowed interval and the camera of the smart phone is aligned with the color label on the trunk of the tree, triggering the picture acquisition module to acquire the picture of the tree to be measured, the label reading module sends a command to the RFID reading and writing equipment through a serial port to read the RFID label of the tree to be detected, receiving the return data, transmitting the picture of the tree to be measured and the RFID tag data to a server by the smart phone, and processing the picture by the vision measurement module by using a vision measurement algorithm to obtain the breast height diameter of the tree; the web-side system is used for providing a human-computer interaction interface, providing an information query port for tree growth conditions and staff measurement conditions, displaying historical growth information of each tree, measurement workload completed by staff corresponding to each smart phone and soil fertility conditions of a tree growth area, and performing quantifiable management.

Fig. 2 is a schematic flow chart of a method for measuring the breast height diameter of a tree in an embodiment of the present invention, a color label is blue, and the method for measuring the breast height diameter of a tree in the embodiment of the present invention includes: the method comprises the following steps that measuring software in the smart phone conducts gradient calibration, and when gradient is within a specified range and shooting is performed with a collimation center aligned with a blue label, a tree breast diameter picture to be measured is collected; and the measurement software transmits the picture to a server to perform visual measurement on the picture, obtains the size of the blue label image and the outline of the tree to be measured, and calculates the actual diameter at breast height of the tree according to the blue label image and the outline of the tree.

Further, at the server side, the vision measurement module realizes camera calibration, trunk segmentation and breast diameter calculation; the camera is marked to detect a color label in the acquired image, the size of the color label in the image is calculated, and the distance between the center of the color label and the lens during shooting is calculated according to the size and the known focal length of the camera; the trunk segmentation is to detect a trunk region in an image through an image segmentation algorithm; the breast-height diameter calculation is to calculate the actual breast-height diameter of the trunk according to the distance between the lens and the center of the color label during shooting, which is obtained by calibrating the camera.

If the camera calibration is carried out in a color space, obtaining an area where a color label is located in an image according to colors, applying L SD (secure digital) straight line detection algorithm to the area to obtain two long sides and one short side of the area, calculating the maximum length of the color label in the direction parallel to the long sides, namely the length of a long axis, calculating the maximum length of the color label in the direction parallel to the short sides, namely the length of a short axis, and obtaining the distance between a camera lens and the center of the color label during shooting according to the length of the long axis, the length of the short axis and the known camera focal distance.

The trunk segmentation is specifically that a camera is used for calibrating trunk regions above and below a detected color label region to cover the color label region, an image region surrounding the position of an original color label is cut, the region covering and cutting the position of the original color label in the image is designated as a foreground region, the regions of the upper left corner, the lower left corner, the upper right corner and the lower right corner of the covered and cut image are designated as background regions, the covered and cut image, the designated foreground region position and the background region position are input into an Interactive image segmentation algorithm (CVPR2018, an MIT license is commercially available) based on a depth convolution neural network, and the region of the trunk in the covered and cut image, namely the trunk region, is obtained.

The chest diameter calculation specifically comprises the following steps: extracting left and right edges of a trunk from a trunk region, dividing an image containing the left and right edges of the trunk into a plurality of rectangular small regions with the same height along the vertical direction, fitting the left and right edges of the trunk in each small region into two straight lines by utilizing linear regression, calculating the mean square error between the original trunk edge and the fitted straight line, and calculating the included angle between the two fitted straight lines; if the mean square error is larger than a specified threshold or the included angle is larger than a specified threshold, discarding the small area, otherwise, approximating the two straight lines as parallel lines and calculating the distance between the two straight lines; then, averaging the distances obtained by calculating each small area to be used as the breast diameter of the trunk in the image; and finally, calculating the actual trunk diameter according to the diameter of breast in the image of the trunk and the distance between the lens and the center of the color label during shooting, which is obtained in the camera calibration module, by utilizing the geometric relationship.

The method, the device and the system for measuring the breast height diameter of the tree provided by the embodiment of the invention have the advantages that the structure is simple, the carrying is convenient, the breast height diameter of the tree to be measured can be quickly and accurately obtained after the smart phone collects the breast height diameter picture of the tree to be measured, and the measuring efficiency and the measuring precision of the breast height diameter of the tree are improved.

10页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:高精度扁线测径设备及其测径方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!