TWI762152B - Method and device for determining plant height, computer device and medium - Google Patents

Method and device for determining plant height, computer device and medium Download PDF

Info

Publication number
TWI762152B
TWI762152B TW110101174A TW110101174A TWI762152B TW I762152 B TWI762152 B TW I762152B TW 110101174 A TW110101174 A TW 110101174A TW 110101174 A TW110101174 A TW 110101174A TW I762152 B TWI762152 B TW I762152B
Authority
TW
Taiwan
Prior art keywords
depth
plant
image
target
detected
Prior art date
Application number
TW110101174A
Other languages
Chinese (zh)
Other versions
TW202228015A (en
Inventor
林子甄
盧志德
郭錦斌
Original Assignee
鴻海精密工業股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 鴻海精密工業股份有限公司 filed Critical 鴻海精密工業股份有限公司
Priority to TW110101174A priority Critical patent/TWI762152B/en
Application granted granted Critical
Publication of TWI762152B publication Critical patent/TWI762152B/en
Publication of TW202228015A publication Critical patent/TW202228015A/en

Links

Images

Abstract

The present application relates to an image analysis technology, and the present application provides a method and a device for determining a plant height, a computer device and a medium. The method obtains a color image and a depth image of a plant to be tested, maps the color image with the depth image to obtain a target image, uses a pre-trained mobilenet-ssd network to detect the color image, and obtains a detection box including the plant to be tested, extracts a target outline of the plant to be tested from the detection box, determines a depth of pixel points in the target outline according to the target image, and de-noises all depths to obtain a target depth, and determines a height of the plant to be tested according to the target depth. The present application can improve a highly determined accuracy of the plant to be tested.

Description

植物高度確定方法、裝置、電腦裝置及介質 Plant height determination method, device, computer device and medium

本申請涉及圖像分析技術領域,尤其涉及一種植物高度確定方法、裝置、電腦裝置及介質。 The present application relates to the technical field of image analysis, and in particular, to a method, device, computer device and medium for determining plant height.

目前,透過分析植物的日生長有利於確定植物的最佳種植方式,以便提高植物的產量和品質,進而降低種植成本,給種植者帶來福音。現有的方式是透過深度學習演算法檢測出帶有待檢測植物的邊界框,進而根據邊界框內的深度值確定待檢測植物的高度,然而,由於邊界框通常是四邊形,而待檢測植物不是四邊形的,導致檢測得到的邊界框內會出現一些不相關的資訊,例如葉子、雜草等,從而造成待檢測植物的計算高度不準確。 At present, by analyzing the daily growth of plants, it is helpful to determine the best way of planting plants, so as to improve the yield and quality of plants, thereby reducing planting costs and bringing good news to growers. The existing method is to detect the bounding box with the plant to be detected through a deep learning algorithm, and then determine the height of the plant to be detected according to the depth value in the bounding box. However, since the bounding box is usually a quadrilateral, and the plant to be detected is not quadrilateral. , resulting in some irrelevant information in the detected bounding box, such as leaves, weeds, etc., resulting in highly inaccurate calculation of the plants to be detected.

鑒於以上內容,有必要提供一種植物高度確定方法、裝置、電腦裝置及介質,能夠提高植物高度的準確度。 In view of the above, it is necessary to provide a method, device, computer device and medium for determining plant height, which can improve the accuracy of plant height.

一種植物高度確定方法,所述植物高度確定方法包括:獲取待檢測植物的彩色圖像及深度圖像;將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像;利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框; 從所述檢測框內提取所述待檢測植物的目標輪廓;根據所述目標圖像確定所述目標輪廓中所有像素點的深度值;對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度。 A method for determining plant height, comprising: acquiring a color image and a depth image of a plant to be detected; performing mapping processing on the color image and the depth image to obtain a target image; The trained mobilenet-ssd network detects the color image, and obtains a detection frame with the plant to be detected; Extract the target contour of the plant to be detected from the detection frame; determine the depth values of all pixels in the target contour according to the target image; perform denoising processing on all the depth values to obtain the target depth value , and determine the height of the plant to be detected according to the target depth value.

根據本申請可選實施例,所述獲取待檢測植物的彩色圖像及深度圖像包括以下一種或者多種方式的組合:利用攝像裝置的第一鏡頭拍攝所述待檢測植物,得到所述彩色圖像,並利用所述攝像裝置的第二鏡頭拍攝所述待檢測植物,得到所述深度圖像;及/或確定所述待檢測植物的標籤,從第一配置庫中獲取帶有所述標籤的圖像作為所述彩色圖像,從第二配置庫中獲取帶有所述標籤的圖像作為所述深度圖像。 According to an optional embodiment of the present application, the acquiring a color image and a depth image of the plant to be detected includes one or a combination of the following: using a first lens of a camera to photograph the plant to be detected, and obtaining the color image image, and use the second lens of the camera device to photograph the plant to be detected to obtain the depth image; and/or determine the label of the plant to be detected, and obtain a label with the label from the first configuration library The image of the color is used as the color image, and the image with the label is obtained from the second configuration library as the depth image.

根據本申請可選實施例,所述對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度包括:從所述所有深度值中獲取等於預設值的深度值,並將獲取到的深度值確定為零值;從所述所有深度值中刪除所述零值,並將剩餘的深度值確定為所述目標深度值;確定所述目標深度值的數量;計算所述目標深度值的總和;將所述總和除以所述數量,得到所述待檢測植物與所述攝像裝置的距離;確定所述攝像裝置所在位置的攝像高度;將所述攝像高度與所述距離進行相減運算,得到所述待檢測植物的高度。 According to an optional embodiment of the present application, performing denoising processing on all the depth values to obtain a target depth value, and determining the height of the plant to be detected according to the target depth value includes: from all the depth values Acquire a depth value equal to a preset value, and determine the acquired depth value as a zero value; delete the zero value from all the depth values, and determine the remaining depth value as the target depth value; determine the The number of the target depth values; Calculate the sum of the target depth values; Divide the sum by the number to obtain the distance between the plant to be detected and the camera device; Determine the camera height at the location of the camera device ; Subtract the height of the camera and the distance to obtain the height of the plant to be detected.

根據本申請可選實施例,所述將所述彩色圖像與所述深度圖像進行 映射處理,得到目標圖像包括:獲取所述深度圖像上的所有深度像素;將所述所有深度像素映射到預設深度座標系中,得到所述所有深度像素的深度座標;根據所有深度座標及預設世界座標系確定所述所有深度像素的世界座標;根據所有世界座標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素;將每個深度像素與每個彩色像素進行融合,得到所述目標圖像。 According to an optional embodiment of the present application, the color image and the depth image are processed by The mapping process to obtain the target image includes: acquiring all the depth pixels on the depth image; mapping all the depth pixels to a preset depth coordinate system to obtain the depth coordinates of all the depth pixels; according to all the depth coordinates and the preset world coordinate system to determine the world coordinates of all the depth pixels; determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color of the positions on the color image pixel; each depth pixel is fused with each color pixel to obtain the target image.

根據本申請可選實施例,所述利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框包括:獲取所述mobilenet-ssd網路中的深度卷積核及點卷積核;利用所述深度卷積核提取所述彩色圖像的特徵,得到第一特徵圖;利用所述點卷積核對所述第一特徵圖進行處理,得到第二特徵圖;根據所述第二特徵圖確定所述檢測框。 According to an optional embodiment of the present application, the detecting the color image by using the pre-trained mobilenet-ssd network, and obtaining the detection frame with the plant to be detected includes: obtaining the information in the mobilenet-ssd network. Depth convolution kernel and point convolution kernel; use the depth convolution kernel to extract the features of the color image to obtain a first feature map; use the point convolution kernel to process the first feature map to obtain the first feature map Two feature maps; the detection frame is determined according to the second feature map.

根據本申請可選實施例,所述從所述檢測框內提取所述待檢測植物的目標輪廓包括:刪除所述檢測框中的背景圖像,得到灰度圖像;檢測所述灰度圖像上所述待檢測植物的輪廓,得到所述目標輪廓。 According to an optional embodiment of the present application, the extracting the target contour of the plant to be detected from the detection frame includes: deleting a background image in the detection frame to obtain a grayscale image; detecting the grayscale image Like the outline of the plant to be detected as described above, the target outline is obtained.

根據本申請可選實施例,所述根據所述目標圖像確定所述目標輪廓中所有像素點的深度值包括:確定每個像素點在所述目標圖像上的目標位置;從所述目標圖像上獲取所述目標位置上的深度值,作為每個像素點的深度值。 According to an optional embodiment of the present application, the determining the depth values of all pixels in the target contour according to the target image includes: determining the target position of each pixel on the target image; The depth value at the target position is obtained on the image as the depth value of each pixel.

一種植物高度確定裝置,所述植物高度確定裝置包括:獲取單元,用於獲取待檢測植物的彩色圖像及深度圖像; 映射單元,用於將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像;檢測單元,用於利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框;提取單元,用於從所述檢測框內提取所述待檢測植物的目標輪廓;確定單元,用於根據所述目標圖像確定所述目標輪廓中所有像素點的深度值;所述確定單元,還用於對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度。 A plant height determination device, the plant height determination device comprising: an acquisition unit for acquiring a color image and a depth image of a plant to be detected; The mapping unit is used to perform mapping processing on the color image and the depth image to obtain a target image; the detection unit is used to detect the color image by using the pre-trained mobilenet-ssd network to obtain a There is a detection frame of the plant to be detected; an extraction unit is used to extract the target outline of the plant to be detected from the detection frame; a determination unit is used to determine all pixels in the target outline according to the target image The depth value of the point; the determining unit is further configured to perform denoising processing on all the depth values to obtain a target depth value, and determine the height of the plant to be detected according to the target depth value.

一種電腦裝置,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,執行所述儲存器中儲存的指令以實現所述植物高度確定方法。 A computer device comprising: a storage for storing at least one instruction; and a processor for executing the instructions stored in the storage to implement the method for determining plant height.

一種電腦可讀儲存介質,所述電腦可讀儲存介質中儲存有至少一個指令,所述至少一個指令被電腦裝置中的處理器執行以實現所述植物高度確定方法。 A computer-readable storage medium having at least one instruction stored in the computer-readable storage medium, the at least one instruction being executed by a processor in a computer device to implement the plant height determination method.

由以上技術方案可以看出,本申請透過將所述彩色圖像與所述深度圖像進行映射處理,能夠得到包含深度值的目標圖像,進而透過預先訓練好的mobilenet-ssd網路能夠快速檢測出所述檢測框,提高檢測效率,從所述檢測框內提取所述待檢測植物的目標輪廓,能夠提取到除無關資訊外的目標輪廓,透過根據所述目標圖像確定所述目標輪廓中所有像素點的深度值,能夠準確快速確定所述所有像素點的深度值,進而透過對所述所有深度值進行去噪處理,得到目標深度值,能夠再次確保所述目標深度值中沒有包含無關資訊的深度值,並根據所述目標深度值能夠準確地確定所述待檢測植物的高度。 It can be seen from the above technical solutions that the present application can obtain the target image containing the depth value by mapping the color image and the depth image, and then the pre-trained mobilenet-ssd network can quickly The detection frame is detected, the detection efficiency is improved, the target contour of the plant to be detected is extracted from the detection frame, and the target contour other than irrelevant information can be extracted, and the target contour is determined according to the target image. The depth values of all the pixels in , can accurately and quickly determine the depth values of all the pixels, and then obtain the target depth value by denoising all the depth values, which can again ensure that the target depth value does not contain The depth value of irrelevant information, and the height of the plant to be detected can be accurately determined according to the target depth value.

S10~S15:步驟 S10~S15: Steps

11:植物高度確定裝置 11: Plant height determination device

110:獲取單元 110: Get Unit

111:映射單元 111: Mapping unit

112:檢測單元 112: Detection unit

113:提取單元 113: Extraction unit

114:確定單元 114: Determine unit

115:融合單元 115: Fusion Unit

116:劃分單元 116: Division Units

117:訓練單元 117: Training Unit

118:調整單元 118: Adjustment unit

119:計算單元 119: Computing Unit

120:增強單元 120: Enhancement unit

121:生成單元 121: Generation unit

122:加密單元 122: encryption unit

123:發送單元 123: sending unit

1:電腦裝置 1: Computer device

12:儲存器 12: Storage

13:處理器 13: Processor

2:攝像裝置 2: Camera device

20:第一鏡頭 20: First Shot

21:第二鏡頭 21: Second Shot

圖1是本申請植物高度確定方法的較佳實施例的應用環境圖。 FIG. 1 is an application environment diagram of a preferred embodiment of the plant height determination method of the present application.

圖2是本申請植物高度確定方法的較佳實施例的流程圖。 Fig. 2 is a flow chart of a preferred embodiment of the method for determining plant height of the present application.

圖3是本申請植物高度確定裝置的較佳實施例的功能模組圖。 FIG. 3 is a functional module diagram of a preferred embodiment of the plant height determination device of the present application.

圖4是本申請實現植物高度確定方法的較佳實施例的電腦裝置的結構示意圖。 FIG. 4 is a schematic structural diagram of a computer device for implementing a preferred embodiment of the method for determining plant height in the present application.

為了使本申請的目的、技術方案和優點更加清楚,下面結合附圖和具體實施例對本申請進行詳細描述。 In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments.

如圖1所示,是本申請植物高度確定方法的較佳實施例的應用環境圖。攝像裝置2與電腦裝置1相通信,所述攝像裝置2包括第一鏡頭20及第二鏡頭21。通過所述第一鏡頭20能夠拍攝彩色圖像,通過所述第二鏡頭21能夠拍攝深度圖像。 As shown in FIG. 1 , it is an application environment diagram of a preferred embodiment of the plant height determination method of the present application. The camera device 2 communicates with the computer device 1 , and the camera device 2 includes a first lens 20 and a second lens 21 . Color images can be captured through the first lens 20 , and depth images can be captured through the second lens 21 .

如圖2所示,是本申請植物高度確定方法的較佳實施例的流程圖。根據不同的需求,該流程圖中步驟的順序可以改變,某些步驟可以省略。 As shown in FIG. 2 , it is a flow chart of a preferred embodiment of the method for determining plant height of the present application. According to different requirements, the order of the steps in this flowchart can be changed, and some steps can be omitted.

所述植物高度確定方法應用於一個或者多個電腦裝置1中,所述電腦裝置1是一種能夠按照事先設定或儲存的指令,自動進行數值計算和/或資訊處理的設備,其硬體包括但不限於微處理器、專用積體電路(Application Specific Integrated Circuit,ASIC)、可程式設計閘陣列(Field-Programmable Gate Array,FPGA)、數位訊號處理器(Digital Signal Processor,DSP)、嵌入式設備等。 The plant height determination method is applied to one or more computer devices 1, and the computer device 1 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions, and its hardware includes but Not limited to microprocessors, Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), Digital Signal Processors (DSPs), embedded devices, etc. .

所述電腦裝置1可以是任何一種可與用戶進行人機交互的電子產品,例如,個人電腦、平板電腦、智慧手機、個人數位助理(Personal Digital Assistant,PDA)、遊戲機、互動式網路電視(Internet Protocol Television,IPTV)、智慧式穿戴式設備等。 The computer device 1 can be any electronic product that can interact with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, and an interactive network television. (Internet Protocol Television, IPTV), smart wearable devices, etc.

所述電腦裝置1還可以包括網路設備和/或使用者設備。其中,所述網路設備包括,但不限於單個網路服務器、多個網路服務器組成的伺服器組或基於雲計算(Cloud Computing)的由大量主機或網路服務器構成的雲。 The computer device 1 may also include network equipment and/or user equipment. Wherein, the network device includes, but is not limited to, a single network server, a server group formed by multiple network servers, or a cloud formed by a large number of hosts or network servers based on cloud computing (Cloud Computing).

所述電腦裝置1所處的網路包括但不限於網際網路、廣域網路、都會區網路、局域網、虛擬私人網路(Virtual Private Network,VPN)等。 The network where the computer device 1 is located includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a virtual private network (Virtual Private Network, VPN), and the like.

步驟S10,獲取待檢測植物的彩色圖像及深度圖像。 Step S10, acquiring a color image and a depth image of the plant to be detected.

在本申請的至少一個實施例中,所述彩色圖像是指RGB三通道彩色圖像,所述深度圖像是指將從圖像採集器到場景中各點的距離作為像素值的圖像。 In at least one embodiment of the present application, the color image refers to an RGB three-channel color image, and the depth image refers to an image in which the distance from the image collector to each point in the scene is taken as the pixel value .

在本申請的至少一個實施例中,所述彩色圖像及所述深度圖像可以從攝像裝置中獲取,也可以從配置庫中獲取。 In at least one embodiment of the present application, the color image and the depth image may be acquired from a camera, or may be acquired from a configuration library.

進一步地,所述彩色圖像及所述深度圖像中都包含所述待檢測植物。 Further, both the color image and the depth image include the plant to be detected.

在本申請的至少一個實施例中,所述電腦裝置獲取待檢測植物的彩色圖像及深度圖像包括以下一種或者多種方式的組合: In at least one embodiment of the present application, obtaining the color image and the depth image of the plant to be detected by the computer device includes one or a combination of the following methods:

(1)所述電腦裝置利用所述攝像裝置的第一鏡頭拍攝所述待檢測植物,得到所述彩色圖像,並利用所述攝像裝置的第二鏡頭拍攝所述待檢測植物,得到所述深度圖像。 (1) The computer device uses the first lens of the camera to photograph the plant to be detected to obtain the color image, and uses the second lens of the camera to photograph the plant to be detected to obtain the depth image.

其中,所述攝像裝置包括雙鏡頭,分別為所述第一鏡頭及所述第二鏡頭。進一步地,所述攝像裝置可以是攝像頭,所述攝像裝置可以安裝在便於拍攝所述檢測植物的正上方。 Wherein, the camera device includes dual lenses, which are the first lens and the second lens respectively. Further, the camera device may be a camera, and the camera device may be installed directly above the detected plant for photographing.

進一步地,所述待檢測植物可以是任意需要進行分析日生長的植物,例如:玫瑰花、向日葵、水稻等。 Further, the plant to be detected can be any plant that needs to be analyzed for daily growth, such as roses, sunflowers, rice and the like.

具體地,當檢測到所述待檢測植物在所述攝像裝置的正前方時,所述電腦裝置開啟所述攝像裝置,並利用所述第一鏡頭拍攝所述待檢測植物, 得到所述彩色圖像;進一步地,所述電腦裝置利用所述第二鏡頭拍攝所述待檢測植物,得到所述深度圖像。 Specifically, when it is detected that the plant to be detected is directly in front of the camera device, the computer device turns on the camera device, and uses the first lens to photograph the plant to be detected, obtaining the color image; further, the computer device uses the second lens to photograph the plant to be detected to obtain the depth image.

透過上述實施方式,能夠快速獲取到包含所述待檢測植物的彩色圖像及深度圖像。 Through the above-mentioned embodiments, a color image and a depth image including the plant to be detected can be quickly acquired.

(2)所述電腦裝置確定所述待檢測植物的標籤,進一步地,所述電腦裝置從第一配置庫中獲取帶有所述標籤的圖像作為所述彩色圖像,更進一步地,所述電腦裝置從第二配置庫中獲取帶有所述標籤的圖像作為所述深度圖像。 (2) The computer device determines the label of the plant to be detected, and further, the computer device obtains an image with the label from the first configuration library as the color image, and further, the The computer device obtains the image with the label from the second configuration library as the depth image.

其中,所述第一配置庫中儲存多張彩色圖像與所述標籤的映射關係,所述第二配置庫中儲存多張深度圖像與所述標籤的映射關係。 Wherein, the first configuration library stores the mapping relationship between a plurality of color images and the label, and the second configuration library stores the mapping relationship between a plurality of depth images and the label.

進一步地,所述標籤可以所述待檢測植物的編號,例如,所述標籤可以是0001。 Further, the label may be the serial number of the plant to be detected, for example, the label may be 0001.

透過標籤與彩色圖像的映射關係,能夠準確地獲取到所述彩色圖像,進而透過標籤與深度圖像的映射關係,能夠準確地獲取所述深度圖像。 The color image can be accurately obtained through the mapping relationship between the label and the color image, and the depth image can be accurately obtained through the mapping relationship between the label and the depth image.

步驟S11,將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像。 Step S11, performing mapping processing on the color image and the depth image to obtain a target image.

在本申請的至少一個實施例中,所述目標圖像是指融合所述彩色圖像的像素與所述深度圖像的像素而生成的圖像。 In at least one embodiment of the present application, the target image refers to an image generated by fusing pixels of the color image and pixels of the depth image.

在本申請的至少一個實施例中,所述電腦裝置將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像包括:所述電腦裝置獲取所述深度圖像上的所有深度像素,進一步地,所述電腦裝置將所述所有深度像素映射到預設深度座標系中,得到所述所有深度像素的深度座標,更進一步地,所述電腦裝置根據所有深度座標及預設世界座標系確定所述所有深度像素的世界座標,進一步地,所述電腦裝置根據所有世界座標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在 所述彩色圖像上的彩色像素,更進一步地,所述電腦裝置將每個深度像素與每個彩色像素進行融合,得到所述目標圖像。 In at least one embodiment of the present application, the computer device performs mapping processing on the color image and the depth image, and obtaining the target image includes: acquiring, by the computer device, all depths on the depth image pixel, further, the computer device maps all the depth pixels to a preset depth coordinate system to obtain the depth coordinates of all the depth pixels, further, the computer device according to all the depth coordinates and the preset world The coordinate system determines the world coordinates of all the depth pixels, and further, the computer device determines the positions of all the depth pixels on the color image according to all the world coordinates, and determines that the positions are in the color image. For the color pixels on the color image, further, the computer device fuses each depth pixel with each color pixel to obtain the target image.

其中,所述預設深度座標系及所述預設世界座標系可以從開源系統上獲取,也可以使用者根據應用場景任意設置,本申請對此不作限制。 Wherein, the preset depth coordinate system and the preset world coordinate system can be obtained from an open source system, or can be arbitrarily set by a user according to an application scenario, which is not limited in this application.

透過上述實施方式,能夠生成包含深度值的目標圖像,以便後續確定所述待檢測植物的高度。 Through the above embodiments, a target image containing depth values can be generated, so as to subsequently determine the height of the plant to be detected.

步驟S12,利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框。 Step S12, using the pre-trained mobilenet-ssd network to detect the color image to obtain a detection frame with the plant to be detected.

在本申請的至少一個實施例中,所述待檢測框是利用所述mobilenet-ssd網路中的卷積核對所述彩色圖像進行特徵提取得到的。 In at least one embodiment of the present application, the frame to be detected is obtained by performing feature extraction on the color image by using a convolution check in the mobilenet-ssd network.

在本申請的至少一個實施例中,在利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框之前,所述方法還包括:所述電腦裝置確定所述待檢測植物所屬的領域,進一步地,所述電腦裝置獲取所述領域上的多張彩色訓練圖像,更進一步地,所述電腦裝置融合獲取到的多張彩色訓練圖像,得到資料集,所述電腦裝置將所述資料集劃分為訓練集及驗證集,進一步地,所述電腦裝置利用所述訓練集中的彩色訓練圖像訓練開源的卷積網路,得到學習器,進一步地,所述電腦裝置利用所述驗證集中的彩色訓練圖像調整所述學習器,得到所述mobilenet-ssd網路。 In at least one embodiment of the present application, before using a pre-trained mobilenet-ssd network to detect the color image and obtain a detection frame with the plant to be detected, the method further includes: the computer The device determines the field to which the plant to be detected belongs, and further, the computer device acquires multiple color training images in the field, and further, the computer device fuses the acquired multiple color training images, Obtaining a data set, the computer device divides the data set into a training set and a verification set, further, the computer device uses the color training images in the training set to train an open-source convolutional network to obtain a learner, Further, the computer device adjusts the learner by using the color training images in the verification set to obtain the mobilenet-ssd network.

在本申請的至少一個實施例中,在將所述資料集劃分為訓練集及驗證集之前,所述方法還包括:所述電腦裝置計算所述資料集中彩色訓練圖像的數量,當所述數量小於預設數量時,所述電腦裝置利用資料增強演算法增加所述資料集中彩色訓練圖像的數量。 In at least one embodiment of the present application, before dividing the data set into a training set and a validation set, the method further includes: the computer device calculates the number of color training images in the data set, when the data set is When the number is less than the preset number, the computer device uses a data enhancement algorithm to increase the number of color training images in the data set.

透過上述實施方式,能夠避免由於彩色訓練圖像的數量不足,導致訓練得到的mobilenet-ssd網路的泛化能力較差。 Through the above implementation, it can be avoided that the generalization ability of the mobilenet-ssd network obtained by training is poor due to the insufficient number of color training images.

在本申請的至少一個實施例中,所述電腦裝置將所述資料集劃分為訓練集及驗證集包括:所述電腦裝置將所述資料集按照預設比例隨機劃分為至少一個資料包,將所述至少一個資料包中的任意一個資料包確定為所述驗證集,其餘的資料包確定為所述訓練集,重複上述步驟,直至所有的資料包全都依次被用作為所述驗證集。 In at least one embodiment of the present application, the computer device dividing the data set into a training set and a verification set includes: the computer device randomly dividing the data set into at least one data package according to a preset ratio, and dividing the data set into at least one data package by the computer device. Any one of the at least one data package is determined as the validation set, and the rest of the data packages are determined as the training set, and the above steps are repeated until all the data packages are sequentially used as the validation set.

其中,所述預設比例可以自訂設置,本申請不作限制。 The preset ratio can be set by yourself, which is not limited in this application.

透過上述實施方式劃分所述資料集,使所述資料集中的每個彩色訓練圖像均參與訓練及驗證,由此,提高訓練所述mobilenet-ssd網路的擬合度。 The data set is divided by the above-mentioned embodiment, so that each color training image in the data set participates in training and verification, thereby improving the fitness of training the mobilenet-ssd network.

在本申請的至少一個實施例中,所述電腦裝置利用所述驗證集中的彩色訓練圖像調整所述學習器,得到所述mobilenet-ssd網路包括:所述電腦裝置採用超參數網格搜索方法從所述驗證集中確定最優超參數點,進一步地,所述電腦裝置透過所述最優超參數點對所述學習器進行調整,得到所述mobilenet-ssd網路。 In at least one embodiment of the present application, the computer device adjusts the learner by using the color training images in the validation set, and obtaining the mobilenet-ssd network includes: the computer device adopts a hyperparameter grid search The method determines the optimal hyperparameter point from the verification set, and further, the computer device adjusts the learner through the optimal hyperparameter point to obtain the mobilenet-ssd network.

具體地,所述電腦裝置將所述驗證集按照固定步長進行拆分,得到目標子集,遍歷所述目標子集上兩端端點的參數,透過所述兩端端點的參數驗證所述學習器,得到每個參數的學習率,將學習率最好的參數確定為第一超參數點,並在所述第一超參數點的鄰域內,縮小所述步長繼續遍歷,直至所述步長為預設步長,即得到的超參數點為所述最優超參數點,更進一步地,所述電腦裝置根據所述最優超參數點調整所述學習器,得到所述mobilenet-ssd網路。 Specifically, the computer device splits the verification set according to a fixed step size to obtain a target subset, traverses the parameters of the endpoints at both ends of the target subset, and verifies all the endpoints through the parameters of the endpoints at both ends. The learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and in the neighborhood of the first hyperparameter point, reduces the step size and continues to traverse until The step size is a preset step size, that is, the obtained hyperparameter point is the optimal hyperparameter point. Further, the computer device adjusts the learner according to the optimal hyperparameter point, and obtains the mobilenet-ssd network.

其中,本申請對所述預設步長不作限制。 Wherein, the present application does not limit the preset step size.

透過上述實施方式,能夠使所述mobilenet-ssd網路更加適合所述領域上的彩色圖像的檢測。 Through the above embodiments, the mobilenet-ssd network can be more suitable for the detection of color images in the field.

在本申請的至少一個實施例中,所述電腦裝置利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框包括: 所述電腦裝置獲取所述mobilenet-ssd網路中的深度卷積核及點卷積核,進一步地,所述電腦裝置利用所述深度卷積核提取所述彩色圖像的特徵,得到第一特徵圖,更進一步地,所述電腦裝置利用所述點卷積核對所述第一特徵圖進行處理,得到所述檢測框。 In at least one embodiment of the present application, the computer device detects the color image by using a pre-trained mobilenet-ssd network, and obtaining a detection frame with the plant to be detected includes: The computer device obtains the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network, and further, the computer device uses the depth convolution kernel to extract the features of the color image to obtain the first Further, the computer device processes the first feature map by using the point convolution kernel to obtain the detection frame.

其中,所述深度卷積核可以是16*16*128的矩陣,進一步地,所述點卷積核可以是1*1*16的矩陣。 Wherein, the depth convolution kernel may be a matrix of 16*16*128, and further, the point convolution kernel may be a matrix of 1*1*16.

透過預先訓練好的mobilenet-ssd網路能夠快速檢測出所述檢測框,提高檢測效率。 The detection frame can be quickly detected through the pre-trained mobilenet-ssd network, which improves the detection efficiency.

步驟S13,從所述檢測框內提取所述待檢測植物的目標輪廓。 Step S13, extracting the target contour of the plant to be detected from the detection frame.

在本申請的至少一個實施例中,所述目標輪廓是指在所述檢測框中去除無關資訊後的輪廓,所述目標輪廓的形狀根據所述待檢測植物的形狀確定。 In at least one embodiment of the present application, the target contour refers to the contour after removing irrelevant information in the detection frame, and the shape of the target contour is determined according to the shape of the plant to be detected.

在本申請的至少一個實施例中,所述電腦裝置從所述檢測框內提取所述待檢測植物的目標輪廓包括:所述電腦裝置刪除所述檢測框中的背景圖像,得到灰度圖像,進一步地,所述電腦裝置檢測所述灰度圖像上所述待檢測植物的輪廓,得到所述目標輪廓。 In at least one embodiment of the present application, the computer device extracting the target contour of the plant to be detected from the detection frame includes: the computer device deletes the background image in the detection frame to obtain a grayscale image Like, further, the computer device detects the outline of the plant to be detected on the grayscale image to obtain the target outline.

透過刪除所述背景圖像,能夠避免背景圖像帶來的干擾,進而提高提取所述目標輪廓的準確性。 By deleting the background image, interference caused by the background image can be avoided, thereby improving the accuracy of extracting the target contour.

步驟S14,根據所述目標圖像確定所述目標輪廓中所有像素點的深度值。 Step S14: Determine the depth values of all pixels in the target contour according to the target image.

在本申請的至少一個實施例中,所述深度值是指像素對應到所述待檢測植物上的特徵點距離攝像裝置的高度。 In at least one embodiment of the present application, the depth value refers to the height of the pixel corresponding to the feature point on the plant to be detected from the camera device.

在本申請的至少一個實施例中,所述電腦裝置根據所述目標圖像確定所述目標輪廓中所有像素點的深度值包括: 所述電腦裝置確定每個像素點在所述目標圖像上的目標位置,進一步地,所述電腦裝置從所述目標圖像上獲取所述目標位置上的深度值,作為每個像素點的深度值。 In at least one embodiment of the present application, the computer device determining the depth values of all pixels in the target contour according to the target image includes: The computer device determines the target position of each pixel on the target image, and further, the computer device obtains the depth value on the target position from the target image, as the value of each pixel. depth value.

透過根據所述目標圖像確定所述目標輪廓中所有像素點的深度值,能夠準確快速確定所述所有像素點的深度值。 By determining the depth values of all pixels in the target contour according to the target image, the depth values of all pixels can be accurately and quickly determined.

步驟S15,對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度。 In step S15, denoising is performed on all the depth values to obtain a target depth value, and the height of the plant to be detected is determined according to the target depth value.

在本申請的至少一個實施例中,所述電腦裝置對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度包括:所述電腦裝置從所述所有深度值中獲取等於預設值的深度值,並將獲取到的深度值確定為零值,進一步地,所述電腦裝置從所述所有深度值中刪除所述零值,並將剩餘的深度值確定為所述目標深度值,更進一步地,所述電腦裝置確定所述目標深度值的數量,所述電腦裝置計算所述目標深度值的總和,並將所述總和除以所述數量,得到所述待檢測植物與所述攝像裝置的距離,更進一步地,所述電腦裝置確定所述攝像裝置所在位置的攝像高度,所述電腦裝置將所述攝像高度與所述距離進行相減運算,得到所述待檢測植物的高度。 In at least one embodiment of the present application, the computer device performs denoising processing on all the depth values to obtain a target depth value, and determines the height of the plant to be detected according to the target depth value, comprising: the computer The device obtains a depth value equal to a preset value from all the depth values, and determines the obtained depth value as a zero value, further, the computer device deletes the zero value from all the depth values, and determining the remaining depth values as the target depth value, further, the computer device determining the number of the target depth values, the computer device calculating a sum of the target depth values and dividing the sum by The number is obtained from the distance between the plant to be detected and the camera device. Further, the computer device determines the camera height of the location where the camera device is located, and the computer device compares the camera height with the distance. Subtraction is performed to obtain the height of the plant to be detected.

透過對所述所有深度值進行去噪處理,得到目標深度值,能夠再次確保所述目標深度值中沒有包含無關資訊的深度值,並根據所述目標深度值能夠準確地確定所述待檢測植物的高度。 By denoising all the depth values to obtain the target depth value, it can be ensured again that there is no depth value containing irrelevant information in the target depth value, and the plant to be detected can be accurately determined according to the target depth value. the height of.

在本申請的至少一個實施例中,在根據所述目標深度值確定所述待檢測植物的高度之後,所述植物高度確定方法還包括:當所述高度小於預設高度時,所述電腦裝置根據所述高度生成告警資訊,進一步地,所述電腦裝置採用對稱加密演算法加密所述告警資訊,得到密文,更進一步地,所述電腦裝置根據所述待檢測植物確定所述密文的告警 等級,所述電腦裝置根據所述告警等級確定告警方式,更進一步地,所述電腦裝置以所述告警方式發送所述密文。 In at least one embodiment of the present application, after determining the height of the plant to be detected according to the target depth value, the method for determining the plant height further includes: when the height is less than a preset height, the computer device Generate alarm information according to the height, further, the computer device encrypts the alarm information using a symmetric encryption algorithm to obtain ciphertext, and further, the computer device determines the ciphertext according to the plant to be detected. alert level, the computer device determines an alarm mode according to the alarm level, and further, the computer device sends the ciphertext in the alarm mode.

其中,所述預設高度可以根據所述待檢測植物的預期生成速率設置,本申請對所述預設高度的取值不作限制。 Wherein, the preset height can be set according to the expected generation rate of the plants to be detected, and the application does not limit the value of the preset height.

進一步地,所述告警等級包括:等級一、等級二等。 Further, the alarm levels include: level one, level two, and the like.

更進一步地,所述告警方式包括:揚聲器的警報聲、郵件方式、電話方式等。 Further, the alarm method includes: the alarm sound of the speaker, the mail method, the telephone method, and the like.

透過上述實施方式,能夠在所述高度小於所述預設高度時,發出告警資訊,此外,透過加密告警資訊,能夠避免告警資訊被篡改,提高告警資訊的安全性,同時,根據告警等級確定告警方式,能夠以合適的告警方式發送告警資訊,使告警資訊的發送更加人性化。 Through the above embodiment, alarm information can be issued when the height is less than the preset height. In addition, by encrypting the alarm information, the alarm information can be prevented from being tampered with, and the security of the alarm information can be improved. At the same time, the alarm is determined according to the alarm level. In this way, the alarm information can be sent in an appropriate alarm mode, so that the sending of the alarm information is more user-friendly.

由以上技術方案可以看出,本申請透過將所述彩色圖像與所述深度圖像進行映射處理,能夠得到包含深度值的目標圖像,進而透過預先訓練好的mobilenet-ssd網路能夠快速檢測出所述檢測框,提高檢測效率,從所述檢測框內提取所述待檢測植物的目標輪廓,能夠提取到除無關資訊外的目標輪廓,透過根據所述目標圖像確定所述目標輪廓中所有像素點的深度值,能夠準確快速確定所述所有像素點的深度值,進而透過對所述所有深度值進行去噪處理,得到目標深度值,能夠再次確保所述目標深度值中沒有包含無關資訊的深度值,並根據所述目標深度值能夠準確地確定所述待檢測植物的高度。 It can be seen from the above technical solutions that the present application can obtain the target image containing the depth value by mapping the color image and the depth image, and then the pre-trained mobilenet-ssd network can quickly The detection frame is detected, the detection efficiency is improved, the target contour of the plant to be detected is extracted from the detection frame, and the target contour other than irrelevant information can be extracted, and the target contour is determined according to the target image. The depth values of all the pixels in , can accurately and quickly determine the depth values of all the pixels, and then obtain the target depth value by denoising all the depth values, which can again ensure that the target depth value does not contain The depth value of irrelevant information, and the height of the plant to be detected can be accurately determined according to the target depth value.

如圖3所示,是本申請植物高度確定裝置的較佳實施例的功能模組圖。所述植物高度確定裝置11包括獲取單元110、映射單元111、檢測單元112、提取單元113、確定單元114、融合單元115、劃分單元116、訓練單元117、調整單元118、計算單元119、增強單元120、生成單元121、加密單元122及發送單元123。本申請所稱的模組/單元是指一種能夠被處理器13所執行,並且能夠完成固定功能的一系列電腦程式段,其儲存在儲存器12中。在本實施例中,關於各模組/單元的功能將在後續的實施例中詳述。 As shown in FIG. 3 , it is a functional module diagram of a preferred embodiment of the plant height determination device of the present application. The plant height determination device 11 includes an acquisition unit 110, a mapping unit 111, a detection unit 112, an extraction unit 113, a determination unit 114, a fusion unit 115, a division unit 116, a training unit 117, an adjustment unit 118, a calculation unit 119, and an enhancement unit 120 , a generating unit 121 , an encryption unit 122 and a sending unit 123 . The module/unit referred to in this application refers to a series of computer program segments that can be executed by the processor 13 and can perform fixed functions, and are stored in the storage 12 . In this embodiment, the functions of each module/unit will be described in detail in subsequent embodiments.

獲取單元110獲取待檢測植物的彩色圖像及深度圖像。 The acquiring unit 110 acquires a color image and a depth image of the plant to be detected.

在本申請的至少一個實施例中,所述彩色圖像是指RGB三通道彩色圖像,所述深度圖像是指將從圖像採集器到場景中各點的距離作為像素值的圖像。 In at least one embodiment of the present application, the color image refers to an RGB three-channel color image, and the depth image refers to an image in which the distance from the image collector to each point in the scene is taken as the pixel value .

在本申請的至少一個實施例中,所述彩色圖像及所述深度圖像可以從攝像裝置中獲取,也可以從配置庫中獲取。 In at least one embodiment of the present application, the color image and the depth image may be acquired from a camera, or may be acquired from a configuration library.

進一步地,所述彩色圖像及所述深度圖像中都包含所述待檢測植物。 Further, both the color image and the depth image include the plant to be detected.

在本申請的至少一個實施例中,所述獲取單元110獲取待檢測植物的彩色圖像及深度圖像包括以下一種或者多種方式的組合: In at least one embodiment of the present application, the acquiring unit 110 acquires the color image and the depth image of the plant to be detected, including one or a combination of the following methods:

(1)所述獲取單元110利用所述攝像裝置的第一鏡頭拍攝所述待檢測植物,得到所述彩色圖像,並利用所述攝像裝置的第二鏡頭拍攝所述待檢測植物,得到所述深度圖像。 (1) The acquiring unit 110 uses the first lens of the camera to photograph the plant to be detected to obtain the color image, and uses the second lens of the camera to photograph the plant to be detected to obtain the described depth image.

其中,所述攝像裝置包括雙鏡頭,分別為所述第一鏡頭及所述第二鏡頭。進一步地,所述攝像裝置可以是攝像頭,所述攝像裝置可以安裝在便於拍攝所述檢測植物的正上方。 Wherein, the camera device includes dual lenses, which are the first lens and the second lens respectively. Further, the camera device may be a camera, and the camera device may be installed directly above the detected plant for photographing.

進一步地,所述待檢測植物可以是任意需要進行分析日生長的植物,例如:玫瑰花、向日葵、水稻等。 Further, the plant to be detected can be any plant that needs to be analyzed for daily growth, such as roses, sunflowers, rice and the like.

具體地,當檢測到所述待檢測植物在所述攝像裝置的正前方時,所述獲取單元110開啟所述攝像裝置,並利用所述第一鏡頭拍攝所述待檢測植物,得到所述彩色圖像;進一步地,所述電腦裝置利用所述第二鏡頭拍攝所述待檢測植物,得到所述深度圖像。 Specifically, when it is detected that the plant to be detected is directly in front of the camera, the acquisition unit 110 turns on the camera, and uses the first lens to photograph the plant to be detected to obtain the color image; further, the computer device uses the second lens to photograph the plant to be detected to obtain the depth image.

透過上述實施方式,能夠快速獲取到包含所述待檢測植物的彩色圖像及深度圖像。 Through the above-mentioned embodiments, a color image and a depth image including the plant to be detected can be quickly acquired.

(2)所述獲取單元110確定所述待檢測植物的標籤,進一步地,所述獲取單元110從第一配置庫中獲取帶有所述標籤的圖像作為所述彩色圖像, 更進一步地,所述獲取單元110從第二配置庫中獲取帶有所述標籤的圖像作為所述深度圖像。 (2) The acquisition unit 110 determines the label of the plant to be detected, and further, the acquisition unit 110 acquires an image with the label from the first configuration library as the color image, Further, the obtaining unit 110 obtains the image with the label from the second configuration library as the depth image.

其中,所述第一配置庫中儲存多張彩色圖像與所述標籤的映射關係,所述第二配置庫中儲存多張深度圖像與所述標籤的映射關係。 Wherein, the first configuration library stores the mapping relationship between a plurality of color images and the label, and the second configuration library stores the mapping relationship between a plurality of depth images and the label.

進一步地,所述標籤可以所述待檢測植物的編號,例如,所述標籤可以是0001。 Further, the label may be the serial number of the plant to be detected, for example, the label may be 0001.

透過標籤與彩色圖像的映射關係,能夠準確地獲取到所述彩色圖像,進而透過標籤與深度圖像的映射關係,能夠準確地獲取所述深度圖像。 The color image can be accurately obtained through the mapping relationship between the label and the color image, and the depth image can be accurately obtained through the mapping relationship between the label and the depth image.

映射單元111將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像。 The mapping unit 111 performs mapping processing on the color image and the depth image to obtain a target image.

在本申請的至少一個實施例中,所述目標圖像是指融合所述彩色圖像的像素與所述深度圖像的像素而生成的圖像。 In at least one embodiment of the present application, the target image refers to an image generated by fusing pixels of the color image and pixels of the depth image.

在本申請的至少一個實施例中,所述映射單元111將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像包括:所述映射單元111獲取所述深度圖像上的所有深度像素,進一步地,所述映射單元111將所述所有深度像素映射到預設深度座標系中,得到所述所有深度像素的深度座標,更進一步地,所述映射單元111根據所有深度座標及預設世界座標系確定所述所有深度像素的世界座標,進一步地,所述映射單元111根據所有世界座標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素,更進一步地,所述電腦裝置將每個深度像素與每個彩色像素進行融合,得到所述目標圖像。 In at least one embodiment of the present application, the mapping unit 111 performs mapping processing on the color image and the depth image, and obtaining the target image includes: the mapping unit 111 obtains the depth image on the depth image. All depth pixels, further, the mapping unit 111 maps all the depth pixels to a preset depth coordinate system to obtain the depth coordinates of all the depth pixels, and further, the mapping unit 111 according to all the depth coordinates and the preset world coordinate system to determine the world coordinates of all the depth pixels, further, the mapping unit 111 determines the positions of all the depth pixels on the color image according to all the world coordinates, and determines that the positions are in For the color pixels on the color image, further, the computer device fuses each depth pixel with each color pixel to obtain the target image.

其中,所述預設深度座標系及所述預設世界座標系可以從開源系統上獲取,也可以使用者根據應用場景任意設置,本申請對此不作限制。 Wherein, the preset depth coordinate system and the preset world coordinate system can be obtained from an open source system, or can be arbitrarily set by a user according to an application scenario, which is not limited in this application.

透過上述實施方式,能夠生成包含深度值的目標圖像,以便後續確定所述待檢測植物的高度。 Through the above embodiments, a target image containing depth values can be generated, so as to subsequently determine the height of the plant to be detected.

檢測單元112利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框。 The detection unit 112 detects the color image by using the pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected.

在本申請的至少一個實施例中,所述待檢測框是利用所述mobilenet-ssd網路中的卷積核對所述彩色圖像進行特徵提取得到的。 In at least one embodiment of the present application, the frame to be detected is obtained by performing feature extraction on the color image by using a convolution check in the mobilenet-ssd network.

在本申請的至少一個實施例中,在利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框之前,確定單元114確定所述待檢測植物所屬的領域,進一步地,所述獲取單元110獲取所述領域上的多張彩色訓練圖像,更進一步地,融合單元115融合獲取到的多張彩色訓練圖像,得到資料集,劃分單元116將所述資料集劃分為訓練集及驗證集,進一步地,訓練單元117利用所述訓練集中的彩色訓練圖像訓練開源的卷積網路,得到學習器,進一步地,調整單元118利用所述驗證集中的彩色訓練圖像調整所述學習器,得到所述mobilenet-ssd網路。 In at least one embodiment of the present application, before using the pre-trained mobilenet-ssd network to detect the color image to obtain a detection frame with the plant to be detected, the determining unit 114 determines the plant to be detected belong to the field, further, the acquisition unit 110 acquires a plurality of color training images in the field, and further, the fusion unit 115 fuses the acquired color training images to obtain a data set, and the division unit 116 The data set is divided into a training set and a verification set, further, the training unit 117 uses the color training images in the training set to train an open-source convolutional network to obtain a learner, and further, the adjustment unit 118 uses the Color training images in the validation set adjust the learner to obtain the mobilenet-ssd network.

在本申請的至少一個實施例中,在將所述資料集劃分為訓練集及驗證集之前,計算單元119計算所述資料集中彩色訓練圖像的數量,當所述數量小於預設數量時,增強單元120利用資料增強演算法增加所述資料集中彩色訓練圖像的數量。 In at least one embodiment of the present application, before dividing the data set into a training set and a validation set, the computing unit 119 calculates the number of color training images in the data set, and when the number is less than a preset number, The augmentation unit 120 utilizes a data augmentation algorithm to augment the number of color training images in the data set.

透過上述實施方式,能夠避免由於彩色訓練圖像的數量不足,導致訓練得到的mobilenet-ssd網路的泛化能力較差。 Through the above implementation, it can be avoided that the generalization ability of the mobilenet-ssd network obtained by training is poor due to the insufficient number of color training images.

在本申請的至少一個實施例中,所述劃分單元116將所述資料集劃分為訓練集及驗證集包括:所述劃分單元116將所述資料集按照預設比例隨機劃分為至少一個資料包,將所述至少一個資料包中的任意一個資料包確定為所述驗證集,其餘的資料包確定為所述訓練集,重複上述步驟,直至所有的資料包全都依次被用作為所述驗證集。 In at least one embodiment of the present application, the dividing unit 116 dividing the data set into a training set and a validation set includes: the dividing unit 116 randomly dividing the data set into at least one data package according to a preset ratio , any one of the at least one data package is determined as the verification set, and the rest of the data packages are determined as the training set, and the above steps are repeated until all the data packages are used as the verification set in turn .

其中,所述預設比例可以自訂設置,本申請不作限制。 The preset ratio can be set by yourself, which is not limited in this application.

透過上述實施方式劃分所述資料集,使所述資料集中的每個彩色訓練圖像均參與訓練及驗證,由此,提高訓練所述mobilenet-ssd網路的擬合度。 The data set is divided by the above-mentioned embodiment, so that each color training image in the data set participates in training and verification, thereby improving the fitness of training the mobilenet-ssd network.

在本申請的至少一個實施例中,所述調整單元118利用所述驗證集中的彩色訓練圖像調整所述學習器,得到所述mobilenet-ssd網路包括:所述調整單元118採用超參數網格搜索方法從所述驗證集中確定最優超參數點,進一步地,所述調整單元118透過所述最優超參數點對所述學習器進行調整,得到所述mobilenet-ssd網路。 In at least one embodiment of the present application, the adjustment unit 118 adjusts the learner by using the color training images in the validation set, and obtaining the mobilenet-ssd network includes: the adjustment unit 118 adopts a hyperparameter network The lattice search method determines the optimal hyperparameter point from the verification set. Further, the adjustment unit 118 adjusts the learner through the optimal hyperparameter point to obtain the mobilenet-ssd network.

具體地,所述調整單元118將所述驗證集按照固定步長進行拆分,得到目標子集,遍歷所述目標子集上兩端端點的參數,透過所述兩端端點的參數驗證所述學習器,得到每個參數的學習率,將學習率最好的參數確定為第一超參數點,並在所述第一超參數點的鄰域內,縮小所述步長繼續遍歷,直至所述步長為預設步長,即得到的超參數點為所述最優超參數點,更進一步地,所述調整單元118根據所述最優超參數點調整所述學習器,得到所述mobilenet-ssd網路。 Specifically, the adjustment unit 118 splits the verification set according to a fixed step size to obtain a target subset, traverses the parameters of the endpoints at both ends of the target subset, and verifies the parameters of the endpoints at the two ends. The learner obtains the learning rate of each parameter, determines the parameter with the best learning rate as the first hyperparameter point, and in the neighborhood of the first hyperparameter point, reduces the step size and continues to traverse, Until the step size is the preset step size, that is, the obtained hyperparameter point is the optimal hyperparameter point. Further, the adjustment unit 118 adjusts the learner according to the optimal hyperparameter point, and obtains The mobilenet-ssd network.

其中,本申請對所述預設步長不作限制。 Wherein, the present application does not limit the preset step size.

透過上述實施方式,能夠使所述mobilenet-ssd網路更加適合所述領域上的彩色圖像的檢測。 Through the above embodiments, the mobilenet-ssd network can be more suitable for the detection of color images in the field.

在本申請的至少一個實施例中,所述檢測單元112利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框包括:所述檢測單元112獲取所述mobilenet-ssd網路中的深度卷積核及點卷積核,進一步地,所述檢測單元112利用所述深度卷積核提取所述彩色圖像的特徵,得到第一特徵圖,更進一步地,所述檢測單元112利用所述點卷積核對所述第一特徵圖進行處理,得到所述檢測框。 In at least one embodiment of the present application, the detection unit 112 uses a pre-trained mobilenet-ssd network to detect the color image, and obtains a detection frame with the plants to be detected, including: the detection unit 112 Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network, further, the detection unit 112 uses the depth convolution kernel to extract the features of the color image to obtain a first feature map, Further, the detection unit 112 uses the point convolution kernel to process the first feature map to obtain the detection frame.

其中,所述深度卷積核可以是16*16*128的矩陣,進一步地,所述點卷積核可以是1*1*16的矩陣。 Wherein, the depth convolution kernel may be a matrix of 16*16*128, and further, the point convolution kernel may be a matrix of 1*1*16.

透過預先訓練好的mobilenet-ssd網路能夠快速檢測出所述檢測框,提高檢測效率。 The detection frame can be quickly detected through the pre-trained mobilenet-ssd network, which improves the detection efficiency.

提取單元113從所述檢測框內提取所述待檢測植物的目標輪廓。 The extraction unit 113 extracts the target contour of the plant to be detected from the detection frame.

在本申請的至少一個實施例中,所述目標輪廓是指在所述檢測框中去除無關資訊後的輪廓,所述目標輪廓的形狀根據所述待檢測植物的形狀確定。 In at least one embodiment of the present application, the target contour refers to the contour after removing irrelevant information in the detection frame, and the shape of the target contour is determined according to the shape of the plant to be detected.

在本申請的至少一個實施例中,所述提取單元113從所述檢測框內提取所述待檢測植物的目標輪廓包括:所述提取單元113刪除所述檢測框中的背景圖像,得到灰度圖像,進一步地,所述提取單元113檢測所述灰度圖像上所述待檢測植物的輪廓,得到所述目標輪廓。 In at least one embodiment of the present application, the extraction unit 113 extracting the target contour of the plant to be detected from the detection frame includes: the extraction unit 113 deletes the background image in the detection frame to obtain grayscale and further, the extraction unit 113 detects the contour of the plant to be detected on the grayscale image to obtain the target contour.

透過刪除所述背景圖像,能夠避免背景圖像帶來的干擾,進而提高提取所述目標輪廓的準確性。 By deleting the background image, interference caused by the background image can be avoided, thereby improving the accuracy of extracting the target contour.

所述確定單元114根據所述目標圖像確定所述目標輪廓中所有像素點的深度值。 The determining unit 114 determines the depth values of all pixels in the target contour according to the target image.

在本申請的至少一個實施例中,所述深度值是指像素對應到所述待檢測植物上的特徵點距離攝像裝置的高度。 In at least one embodiment of the present application, the depth value refers to the height of the pixel corresponding to the feature point on the plant to be detected from the camera device.

在本申請的至少一個實施例中,所述確定單元114根據所述目標圖像確定所述目標輪廓中所有像素點的深度值包括:所述確定單元114確定每個像素點在所述目標圖像上的目標位置,進一步地,所述確定單元114從所述目標圖像上獲取所述目標位置上的深度值,作為每個像素點的深度值。 In at least one embodiment of the present application, the determining unit 114 determining, according to the target image, the depth values of all pixels in the target contour includes: the determining unit 114 determining that each pixel is in the target image The target position on the image, further, the determining unit 114 obtains the depth value on the target position from the target image as the depth value of each pixel point.

透過根據所述目標圖像確定所述目標輪廓中所有像素點的深度值,能夠準確快速確定所述所有像素點的深度值。 By determining the depth values of all pixels in the target contour according to the target image, the depth values of all pixels can be accurately and quickly determined.

所述確定單元114對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度。 The determining unit 114 performs denoising processing on all the depth values to obtain a target depth value, and determines the height of the plant to be detected according to the target depth value.

在本申請的至少一個實施例中,所述確定單元114對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度包括:所述確定單元114從所述所有深度值中獲取等於預設值的深度值,並將獲取到的深度值確定為零值,進一步地,所述確定單元114從所述所有深度值中刪除所述零值,並將剩餘的深度值確定為所述目標深度值,更進一步地,所述確定單元114確定所述目標深度值的數量,所述確定單元114計算所述目標深度值的總和,並將所述總和除以所述數量,得到所述待檢測植物與所述攝像裝置的距離,更進一步地,所述確定單元114確定所述攝像裝置所在位置的攝像高度,所述確定單元114將所述攝像高度與所述距離進行相減運算,得到所述待檢測植物的高度。 In at least one embodiment of the present application, the determining unit 114 performs denoising processing on all the depth values to obtain a target depth value, and determining the height of the plant to be detected according to the target depth value includes: the The determining unit 114 acquires a depth value equal to a preset value from all the depth values, and determines the acquired depth value as a zero value, further, the determining unit 114 deletes the zero value from all the depth values value, and determine the remaining depth values as the target depth value, further, the determining unit 114 determines the number of the target depth values, the determining unit 114 calculates the sum of the target depth values, and sets the The sum is divided by the number to obtain the distance between the plant to be detected and the camera. The camera height and the distance are subtracted to obtain the height of the plant to be detected.

透過對所述所有深度值進行去噪處理,得到目標深度值,能夠再次確保所述目標深度值中沒有包含無關資訊的深度值,並根據所述目標深度值能夠準確地確定所述待檢測植物的高度。 By denoising all the depth values to obtain the target depth value, it can be ensured again that there is no depth value containing irrelevant information in the target depth value, and the plant to be detected can be accurately determined according to the target depth value. the height of.

在本申請的至少一個實施例中,在根據所述目標深度值確定所述待檢測植物的高度之後,當所述高度小於預設高度時,生成單元121根據所述高度生成告警資訊,進一步地,加密單元122採用對稱加密演算法加密所述告警資訊,得到密文,更進一步地,所述確定單元114根據所述待檢測植物確定所述密文的告警等級,所述確定單元114根據所述告警等級確定告警方式,更進一步地,發送單元123以所述告警方式發送所述密文。 In at least one embodiment of the present application, after the height of the plant to be detected is determined according to the target depth value, when the height is less than a preset height, the generating unit 121 generates alarm information according to the height, and further , the encryption unit 122 uses a symmetric encryption algorithm to encrypt the alarm information to obtain a ciphertext. Further, the determining unit 114 determines the alarm level of the ciphertext according to the plant to be detected, and the determining unit 114 determines the alarm level of the ciphertext according to the The alarm level determines an alarm mode, and further, the sending unit 123 sends the ciphertext in the alarm mode.

其中,所述預設高度可以根據所述待檢測植物的預期生成速率設置,本申請對所述預設高度的取值不作限制。 Wherein, the preset height can be set according to the expected generation rate of the plants to be detected, and the application does not limit the value of the preset height.

進一步地,所述告警等級包括:等級一、等級二等。 Further, the alarm levels include: level one, level two, and the like.

更進一步地,所述告警方式包括:揚聲器的警報聲、郵件方式、電話方式等。 Further, the alarm method includes: the alarm sound of the speaker, the mail method, the telephone method, and the like.

透過上述實施方式,能夠在所述高度小於所述預設高度時,發出告警資訊,此外,透過加密告警資訊,能夠避免告警資訊被篡改,提高告警資訊的安全性,同時,根據告警等級確定告警方式,能夠以合適的告警方式發送告警資訊,使告警資訊的發送更加人性化。 Through the above embodiment, when the height is less than the preset height, alarm information can be issued. In addition, by encrypting the alarm information, the alarm information can be prevented from being tampered with, and the security of the alarm information can be improved. At the same time, the alarm is determined according to the alarm level. In this way, the alarm information can be sent in an appropriate alarm mode, so that the sending of the alarm information is more user-friendly.

由以上技術方案可以看出,本申請透過將所述彩色圖像與所述深度圖像進行映射處理,能夠得到包含深度值的目標圖像,進而透過預先訓練好的mobilenet-ssd網路能夠快速檢測出所述檢測框,提高檢測效率,從所述檢測框內提取所述待檢測植物的目標輪廓,能夠提取到除無關資訊外的目標輪廓,透過根據所述目標圖像確定所述目標輪廓中所有像素點的深度值,能夠準確快速確定所述所有像素點的深度值,進而透過對所述所有深度值進行去噪處理,得到目標深度值,能夠再次確保所述目標深度值中沒有包含無關資訊的深度值,並根據所述目標深度值能夠準確地確定所述待檢測植物的高度。 It can be seen from the above technical solutions that the present application can obtain the target image containing the depth value by mapping the color image and the depth image, and then the pre-trained mobilenet-ssd network can quickly The detection frame is detected, the detection efficiency is improved, the target contour of the plant to be detected is extracted from the detection frame, and the target contour other than irrelevant information can be extracted, and the target contour is determined according to the target image. The depth values of all the pixels in , can accurately and quickly determine the depth values of all the pixels, and then obtain the target depth value by denoising all the depth values, which can again ensure that the target depth value does not contain The depth value of irrelevant information, and the height of the plant to be detected can be accurately determined according to the target depth value.

如圖4所示,是本申請實現植物高度確定方法的較佳實施例的電腦裝置的結構示意圖。 As shown in FIG. 4 , it is a schematic structural diagram of a computer device according to a preferred embodiment of the method for determining plant height of the present application.

在本申請的一個實施例中,所述電腦裝置1包括,但不限於,儲存器12、處理器13,以及儲存在所述儲存器12中並可在所述處理器13上運行的電腦程式,例如植物高度確定程式。 In one embodiment of the present application, the computer device 1 includes, but is not limited to, a storage 12 , a processor 13 , and a computer program stored in the storage 12 and running on the processor 13 , such as the plant height determination program.

本領域技術人員可以理解,所述示意圖僅僅是電腦裝置1的示例,並不構成對電腦裝置1的限定,可以包括比圖示更多或更少的部件,或者組合某些部件,或者不同的部件,例如所述電腦裝置1還可以包括輸入輸出設備、網路接入設備、匯流排等。 Those skilled in the art can understand that the schematic diagram is only an example of the computer device 1, and does not constitute a limitation on the computer device 1. It may include more or less components than the one shown, or combine some components, or different Components, such as the computer device 1, may also include input and output devices, network access devices, bus bars, and the like.

所述處理器13可以是中央處理單元(Central Processing Unit,CPU),還可以是其他通用處理器、數位訊號處理器(Digital Signal Processor,DSP)、專用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式設計閘陣列(Field-Programmable Gate Array,FPGA)或者其他可程式設計邏輯器件、分立門或者電晶體邏輯器件、分立硬體元件等。通用處理器可以是微處理器或者該 處理器也可以是任何常規的處理器等,所述處理器13是所述電腦裝置1的運算核心和控制中心,利用各種介面和線路連接整個電腦裝置1的各個部分,及執行所述電腦裝置1的作業系統以及安裝的各類應用程式、程式碼等。 The processor 13 may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), or an Application Specific Integrated Circuit (ASIC). , Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the The processor can also be any conventional processor, etc. The processor 13 is the computing core and control center of the computer device 1, and uses various interfaces and lines to connect various parts of the entire computer device 1, and execute the computer device. 1 operating system and installed various applications, code, etc.

所述處理器13執行所述電腦裝置1的作業系統以及安裝的各類應用程式。所述處理器13執行所述應用程式以實現上述各個植物高度確定方法實施例中的步驟,例如圖2所示的步驟。 The processor 13 executes the operating system of the computer device 1 and various installed applications. The processor 13 executes the application program to implement the steps in each of the above embodiments of the plant height determination method, such as the steps shown in FIG. 2 .

示例性的,所述電腦程式可以被分割成一個或多個模組/單元,所述一個或者多個模組/單元被儲存在所述儲存器12中,並由所述處理器13執行,以完成本申請。所述一個或多個模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,該指令段用於描述所述電腦程式在所述電腦裝置1中的執行過程。例如,所述電腦程式可以被分割成獲取單元110、映射單元111、檢測單元112、提取單元113、確定單元114、融合單元115、劃分單元116、訓練單元117、調整單元118、計算單元119、增強單元120、生成單元121、加密單元122及發送單元123。 Exemplarily, the computer program can be divided into one or more modules/units, and the one or more modules/units are stored in the storage 12 and executed by the processor 13, to complete this application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device 1 . For example, the computer program can be divided into an acquisition unit 110, a mapping unit 111, a detection unit 112, an extraction unit 113, a determination unit 114, a fusion unit 115, a division unit 116, a training unit 117, an adjustment unit 118, a calculation unit 119, Enhancement unit 120 , generation unit 121 , encryption unit 122 and transmission unit 123 .

所述儲存器12可用於儲存所述電腦程式和/或模組,所述處理器13透過運行或執行儲存在所述儲存器12內的電腦程式和/或模組,以及調用儲存在儲存器12內的資料,實現所述電腦裝置1的各種功能。所述儲存器12可主要包括儲存程式區和儲存資料區,其中,儲存程式區可儲存作業系統、至少一個功能所需的應用程式(比如聲音播放功能、圖像播放功能等)等;儲存資料區可儲存根據電腦裝置的使用所創建的資料等。此外,儲存器12可以包括非易失性儲存器,例如硬碟、儲存器、插接式硬碟,智慧儲存卡(Smart Media Card,SMC),安全數位(Secure Digital,SD)卡,快閃儲存器卡(Flash Card)、至少一個磁碟儲存器件、快閃儲存器器件、或其他非易失性固態儲存器件。 The storage 12 can be used to store the computer programs and/or modules. The processor 13 executes or executes the computer programs and/or modules stored in the storage 12, and calls the computer programs and/or modules stored in the storage 12. 12 to realize various functions of the computer device 1 . The storage 12 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; storage data The area can store data etc. created according to the use of the computer device. In addition, the storage 12 may include non-volatile storage such as hard disk, storage, plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, flash memory A memory card (Flash Card), at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device.

所述儲存器12可以是電腦裝置1的外部儲存器和/或內部儲存器。進一步地,所述儲存器12可以是具有實物形式的儲存器,如儲存器條、TF卡(Trans-flash Card)等等。 The storage 12 may be an external storage and/or an internal storage of the computer device 1 . Further, the storage 12 may be a storage in physical form, such as a storage bar, a TF card (Trans-flash Card), and the like.

所述電腦裝置1集成的模組/單元如果以軟體功能單元的形式實現並作為獨立的產品銷售或使用時,可以儲存在一個電腦可讀取儲存介質中。基於這樣的理解,本申請實現上述實施例方法中的全部或部分流程,也可以透過電腦程式來指令相關的硬體來完成,所述的電腦程式可儲存於一電腦可讀儲存介質中,該電腦程式在被處理器執行時,可實現上述各個方法實施例的步驟。 If the modules/units integrated in the computer device 1 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the present application realizes all or part of the processes in the methods of the above embodiments, and can also be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned method embodiments can be implemented.

其中,所述電腦程式包括電腦程式代碼,所述電腦程式代碼可以為原始程式碼形式、物件代碼形式、可執行檔或某些中間形式等。所述電腦可讀介質可以包括:能夠攜帶所述電腦程式代碼的任何實體或裝置、記錄介質、隨身碟、移動硬碟、磁碟、光碟、電腦儲存器、唯讀儲存器(ROM,Read-Only Memory)。 Wherein, the computer program includes computer program code, and the computer program code may be in the form of original code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, pen drive, removable hard disk, magnetic disk, optical disk, computer storage, read-only storage (ROM, Read-only storage) Only Memory).

結合圖2,所述電腦裝置1中的所述儲存器12儲存多個指令以實現一種植物高度確定方法,所述處理器13可執行所述多個指令從而實現:獲取待檢測植物的彩色圖像及深度圖像;將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像;利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框;從所述檢測框內提取所述待檢測植物的目標輪廓;根據所述目標圖像確定所述目標輪廓中所有像素點的深度值;對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度。 Referring to FIG. 2 , the storage 12 in the computer device 1 stores a plurality of instructions to implement a method for determining plant height, and the processor 13 can execute the plurality of instructions to achieve: acquiring a color map of the plant to be detected image and depth image; perform mapping processing on the color image and the depth image to obtain the target image; use the pre-trained mobilenet-ssd network to detect the color image, and obtain the target image with the Detecting the detection frame of the plant; extracting the target contour of the plant to be detected from the detection frame; determining the depth values of all pixels in the target contour according to the target image; denoising all the depth values process to obtain a target depth value, and determine the height of the plant to be detected according to the target depth value.

具體地,所述處理器13對上述指令的具體實現方法可參考圖2對應實施例中相關步驟的描述,在此不贅述。 Specifically, for the specific implementation method of the above-mentioned instruction by the processor 13, reference may be made to the description of the relevant steps in the embodiment corresponding to FIG. 2, and details are not described herein.

在本申請所提供的幾個實施例中,應該理解到,所揭露的系統,裝置和方法,可以透過其它的方式實現。例如,以上所描述的裝置實施例僅僅是示意性的,例如,所述模組的劃分,僅僅為一種邏輯功能劃分,實際實現時可以有另外的劃分方式。 In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the device embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and other division methods may be used in actual implementation.

所述作為分離部件說明的模組可以是或者也可以不是物理上分開的,作為模組顯示的部件可以是或者也可以不是物理單元,即可以位於一個地 方,或者也可以分佈圖像到多個網路單元上。可以根據實際的需要選擇其中的部分或者全部模組來實現本實施例方案的目的。 The modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical units, that is, they may be located in one place. square, or you can distribute the image to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.

另外,在本申請各個實施例中的各功能模組可以集成在一個處理單元中,也可以是各個單元單獨物理存在,也可以兩個或兩個以上單元集成在一個單元中。上述集成的單元既可以採用硬體的形式實現,也可以採用硬體加軟體功能模組的形式實現。 In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.

因此,無論從哪一點來看,均應將實施例看作是示範性的,而且是非限制性的,本申請的範圍由所附請求項而不是上述說明限定,因此旨在將落在請求項的等同要件的含義和範圍內的所有變化涵括在本申請內。不應將請求項中的任何附關聯圖標記視為限制所涉及的請求項。 Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of this application is defined by the appended claims rather than the foregoing description, and is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any associated icon indicia in a claim should not be considered to limit the claim to which it relates.

此外,顯然“包括”一詞不排除其他單元或步驟,單數不排除複數。本申請中陳述的多個單元或裝置也可以由一個單元或裝置透過軟體或者硬體來實現。第一、第二等詞語用來表示名稱,而並不表示任何特定的順序。 Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. A plurality of units or devices stated in this application may also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to denote names and do not denote any particular order.

最後應說明的是,以上實施例僅用以說明本申請的技術方案而非限制,儘管參照較佳實施例對本申請進行了詳細說明,本領域的普通技術人員應當理解,可以對本申請的技術方案進行修改或等同替換,而不脫離本申請技術方案的精神和範圍。 Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application and not to limit them. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

S10~S15:步驟 S10~S15: Steps

Claims (9)

一種植物高度確定方法,應用於電腦裝置,其中,所述植物高度確定方法包括:獲取待檢測植物的彩色圖像及深度圖像;將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像;利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框;從所述檢測框內提取所述待檢測植物的目標輪廓;根據所述目標圖像確定所述目標輪廓中所有像素點的深度值;對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度,包括:從所述所有深度值中獲取等於預設值的深度值,並將獲取到的深度值確定為零值;從所述所有深度值中刪除所述零值,並將剩餘的深度值確定為所述目標深度值;確定所述目標深度值的數量;計算所述目標深度值的總和;將所述總和除以所述數量,得到所述待檢測植物與攝像裝置的距離;確定所述攝像裝置所在位置的攝像高度;將所述攝像高度與所述距離進行相減運算,得到所述待檢測植物的高度。 A plant height determination method, applied to a computer device, wherein the plant height determination method comprises: acquiring a color image and a depth image of a plant to be detected; performing mapping processing on the color image and the depth image, Obtain a target image; use a pre-trained mobilenet-ssd network to detect the color image to obtain a detection frame with the plant to be detected; extract the target contour of the plant to be detected from the detection frame; Determine the depth values of all pixels in the target contour according to the target image; perform denoising on all the depth values to obtain a target depth value, and determine the height of the plant to be detected according to the target depth value , including: obtaining a depth value equal to a preset value from all the depth values, and determining the obtained depth value as a zero value; deleting the zero value from all the depth values, and using the remaining depth values determine the target depth value; determine the number of the target depth values; calculate the sum of the target depth values; divide the sum by the number to obtain the distance between the plant to be detected and the camera device; The imaging height of the location where the imaging device is located; and the height of the plant to be detected is obtained by subtracting the imaging height and the distance. 如請求項1所述的植物高度確定方法,其中,所述獲取待檢測植物的彩色圖像及深度圖像包括以下一種或者多種方式的組合:利用所述攝像裝置的第一鏡頭拍攝所述待檢測植物,得到所述彩色圖像,並利用所述攝像裝置的第二鏡頭拍攝所述待檢測植物,得到所述深度圖像;及/或確定所述待檢測植物的標籤,從第一配置庫中獲取帶有所述標籤的圖像作為所述彩色圖像,從第二配置庫中獲取帶有所述標籤的圖像作為所述深度圖像。 The method for determining plant height according to claim 1, wherein the acquiring a color image and a depth image of the plant to be detected includes one or a combination of the following: using a first lens of the camera to shoot the to-be-detected plant. Detecting a plant, obtaining the color image, and using the second lens of the camera to photograph the plant to be detected to obtain the depth image; and/or determining the label of the plant to be detected, from the first configuration The image with the label is obtained from the library as the color image, and the image with the label is obtained from the second configuration library as the depth image. 如請求項1所述的植物高度確定方法,其中,所述將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像包括: 獲取所述深度圖像上的所有深度像素;將所述所有深度像素映射到預設深度座標系中,得到所述所有深度像素的深度座標;根據所有深度座標及預設世界座標系確定所述所有深度像素的世界座標;根據所有世界座標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素;將每個深度像素與每個彩色像素進行融合,得到所述目標圖像。 The method for determining plant height according to claim 1, wherein the mapping of the color image and the depth image to obtain the target image includes: Acquire all depth pixels on the depth image; map all depth pixels to a preset depth coordinate system to obtain the depth coordinates of all depth pixels; determine the depth coordinates according to all depth coordinates and a preset world coordinate system The world coordinates of all depth pixels; determine the positions of all depth pixels on the color image according to all the world coordinates, and determine the color pixels of the positions on the color image; associate each depth pixel with each depth pixel The color pixels are fused to obtain the target image. 如請求項1所述的植物高度確定方法,其中,所述利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框包括:獲取所述mobilenet-ssd網路中的深度卷積核及點卷積核;利用所述深度卷積核提取所述彩色圖像的特徵,得到第一特徵圖;利用所述點卷積核對所述第一特徵圖進行處理,得到所述檢測框。 The method for determining plant height according to claim 1, wherein the detecting the color image by using a pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected comprises: obtaining the mobilenet - the depth convolution kernel and point convolution kernel in the ssd network; use the depth convolution kernel to extract the features of the color image to obtain the first feature map; use the point convolution kernel to check the first feature The image is processed to obtain the detection frame. 如請求項1所述的植物高度確定方法,其中,所述從所述檢測框內提取所述待檢測植物的目標輪廓包括:刪除所述檢測框中的背景圖像,得到灰度圖像;檢測所述灰度圖像上所述待檢測植物的輪廓,得到所述目標輪廓。 The method for determining plant height according to claim 1, wherein the extracting the target contour of the plant to be detected from the detection frame comprises: deleting a background image in the detection frame to obtain a grayscale image; The contour of the plant to be detected on the grayscale image is detected to obtain the target contour. 如請求項1所述的植物高度確定方法,其中,所述根據所述目標圖像確定所述目標輪廓中所有像素點的深度值包括:確定每個像素點在所述目標圖像上的目標位置;從所述目標圖像上獲取所述目標位置上的深度值,作為每個像素點的深度值。 The method for determining plant height according to claim 1, wherein the determining the depth values of all pixels in the target outline according to the target image comprises: determining the target of each pixel on the target image position; obtain the depth value at the target position from the target image as the depth value of each pixel. 一種植物高度確定裝置,運行於電腦裝置,其中,所述植物高度確定裝置包括:獲取單元,用於獲取待檢測植物的彩色圖像及深度圖像; 映射單元,用於將所述彩色圖像與所述深度圖像進行映射處理,得到目標圖像;檢測單元,用於利用預先訓練好的mobilenet-ssd網路檢測所述彩色圖像,得到帶有所述待檢測植物的檢測框;提取單元,用於從所述檢測框內提取所述待檢測植物的目標輪廓;確定單元,用於根據所述目標圖像確定所述目標輪廓中所有像素點的深度值;所述確定單元,還用於對所述所有深度值進行去噪處理,得到目標深度值,並根據所述目標深度值確定所述待檢測植物的高度,包括:從所述所有深度值中獲取等於預設值的深度值,並將獲取到的深度值確定為零值;從所述所有深度值中刪除所述零值,並將剩餘的深度值確定為所述目標深度值;確定所述目標深度值的數量;計算所述目標深度值的總和;將所述總和除以所述數量,得到所述待檢測植物與攝像裝置的距離;確定所述攝像裝置所在位置的攝像高度;將所述攝像高度與所述距離進行相減運算,得到所述待檢測植物的高度。 A plant height determination device, running on a computer device, wherein the plant height determination device comprises: an acquisition unit for acquiring a color image and a depth image of a plant to be detected; The mapping unit is used to perform mapping processing on the color image and the depth image to obtain a target image; the detection unit is used to detect the color image by using the pre-trained mobilenet-ssd network to obtain a There is a detection frame of the plant to be detected; an extraction unit is used to extract the target outline of the plant to be detected from the detection frame; a determination unit is used to determine all pixels in the target outline according to the target image The depth value of the point; the determining unit is further configured to perform denoising processing on all the depth values to obtain a target depth value, and determine the height of the plant to be detected according to the target depth value, including: from the Acquire a depth value equal to a preset value from all the depth values, and determine the acquired depth value as a zero value; delete the zero value from all the depth values, and determine the remaining depth value as the target depth determine the number of the target depth values; calculate the sum of the target depth values; divide the sum by the number to obtain the distance between the plant to be detected and the camera device; determine the location of the camera device Camera height; subtract the camera height from the distance to obtain the height of the plant to be detected. 一種電腦裝置,其中,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,獲取所述儲存器中儲存的指令以實現如請求項1至6中任意一項所述的植物高度確定方法。 A computer device, wherein the computer device comprises: a storage for storing at least one instruction; and a processor for acquiring the instructions stored in the storage to achieve the plant height according to any one of claim 1 to 6 Determine the method. 一種電腦可讀儲存介質,其中:所述電腦可讀儲存介質中儲存有至少一個指令,所述至少一個指令被電腦裝置中的處理器獲取以實現如請求項1至6中任意一項所述的植物高度確定方法。 A computer-readable storage medium, wherein: the computer-readable storage medium stores at least one instruction, and the at least one instruction is acquired by a processor in a computer device to implement any one of claim 1 to 6. method for determining plant height.
TW110101174A 2021-01-12 2021-01-12 Method and device for determining plant height, computer device and medium TWI762152B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110101174A TWI762152B (en) 2021-01-12 2021-01-12 Method and device for determining plant height, computer device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110101174A TWI762152B (en) 2021-01-12 2021-01-12 Method and device for determining plant height, computer device and medium

Publications (2)

Publication Number Publication Date
TWI762152B true TWI762152B (en) 2022-04-21
TW202228015A TW202228015A (en) 2022-07-16

Family

ID=82198946

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110101174A TWI762152B (en) 2021-01-12 2021-01-12 Method and device for determining plant height, computer device and medium

Country Status (1)

Country Link
TW (1) TWI762152B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI464362B (en) * 2011-06-02 2014-12-11 Asm Tech Singapore Pte Ltd Apparatus for measuring a height and obtaining a focused image of and object and method thereof
TWI542320B (en) * 2013-12-30 2016-07-21 中原大學 Human weight estimating method by using depth images and skeleton characteristic
CN109389589A (en) * 2018-09-28 2019-02-26 百度在线网络技术(北京)有限公司 Method and apparatus for statistical number of person
CN112102391A (en) * 2020-08-31 2020-12-18 北京市商汤科技开发有限公司 Measuring method and device, electronic device and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI464362B (en) * 2011-06-02 2014-12-11 Asm Tech Singapore Pte Ltd Apparatus for measuring a height and obtaining a focused image of and object and method thereof
TWI542320B (en) * 2013-12-30 2016-07-21 中原大學 Human weight estimating method by using depth images and skeleton characteristic
CN109389589A (en) * 2018-09-28 2019-02-26 百度在线网络技术(北京)有限公司 Method and apparatus for statistical number of person
CN112102391A (en) * 2020-08-31 2020-12-18 北京市商汤科技开发有限公司 Measuring method and device, electronic device and storage medium

Also Published As

Publication number Publication date
TW202228015A (en) 2022-07-16

Similar Documents

Publication Publication Date Title
WO2020207191A1 (en) Method and apparatus for determining occluded area of virtual object, and terminal device
CN110427917B (en) Method and device for detecting key points
WO2018176938A1 (en) Method and device for extracting center of infrared light spot, and electronic device
WO2014044158A1 (en) Identification method and device for target object in image
TWI667621B (en) Face recognition method
US20220222837A1 (en) Method for measuring growth height of plant, electronic device, and storage medium
JP2013500536A5 (en)
WO2022134418A1 (en) Video recognition method and related device
KR20220063127A (en) Method, apparatus for face anti-spoofing, electronic device, storage medium, and computer program
CN113160231A (en) Sample generation method, sample generation device and electronic equipment
CN111783593A (en) Human face recognition method and device based on artificial intelligence, electronic equipment and medium
CN108596032B (en) Detection method, device, equipment and medium for fighting behavior in video
CN113240031B (en) Panoramic image feature point matching model training method and device and server
US11954875B2 (en) Method for determining height of plant, electronic device, and storage medium
TWI762152B (en) Method and device for determining plant height, computer device and medium
WO2018036241A1 (en) Method and apparatus for classifying age group
TWI803243B (en) Method for expanding images, computer device and storage medium
TWI759069B (en) Method and device for measuring plant growth height, computer device and medium
TWI795708B (en) Method and device for determining plant growth height, computer device and medium
WO2021139169A1 (en) Method and apparatus for card recognition, device, and storage medium
RU2019132178A (en) Method and device for determining the direction of rotation of a target object, a computer-readable medium and an electronic device
TWI755250B (en) Method for determining plant growth curve, device, electronic equipment and storage medium
US20220222838A1 (en) Method for determining growth height of plant, electronic device, and medium
CN111461971A (en) Image processing method, device, equipment and computer readable storage medium
CN111369612A (en) Three-dimensional point cloud image generation method and equipment