TWI759069B - Method and device for measuring plant growth height, computer device and medium - Google Patents

Method and device for measuring plant growth height, computer device and medium Download PDF

Info

Publication number
TWI759069B
TWI759069B TW110101171A TW110101171A TWI759069B TW I759069 B TWI759069 B TW I759069B TW 110101171 A TW110101171 A TW 110101171A TW 110101171 A TW110101171 A TW 110101171A TW I759069 B TWI759069 B TW I759069B
Authority
TW
Taiwan
Prior art keywords
detected
image
depth
plant
height
Prior art date
Application number
TW110101171A
Other languages
Chinese (zh)
Other versions
TW202228077A (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 TW110101171A priority Critical patent/TWI759069B/en
Application granted granted Critical
Publication of TWI759069B publication Critical patent/TWI759069B/en
Publication of TW202228077A publication Critical patent/TW202228077A/en

Links

Images

Abstract

The present application relates to an image analysis technology, and the present application provides a method and a device for measuring a plant growth height, a computer device and a medium. The method controls a camera device to shoot detected plants to obtain a color image of detected plants and a depth image of detected plants, the color image includes detected plants, the depth image includes detected plants, uses a pre-trained detection model to detect the color image to obtain a plurality of detection frames corresponding to detected plants, uses an image alignment algorithm to align the color image with the depth image to obtain an alignment image, obtains a plurality of target frames corresponding to the plurality of detection frames, and determines a depth of target frames. The method further determines the number of target frames and determines a depth of detected plants based on the depth and quantities. This present application can improve a measurement efficiency of the detected plant.

Description

植物生長高度測量方法、裝置、電腦裝置及介質 Plant growth height measurement 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 measuring plant growth 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 traditional method is to analyze the plant growth by manually measuring and recording the plant growth height. However, the manual measurement method not only brings measurement errors, but also reduces the measurement efficiency and consumes manpower.

鑒於以上內容,有必要提供一種植物生長高度測量方法、裝置、電腦裝置及介質,能夠提高植物生長高度的測量效率。 In view of the above, it is necessary to provide a method, device, computer device and medium for measuring plant growth height, which can improve the measurement efficiency of plant growth height.

一種植物生長高度測量方法,應用於電腦裝置中,所述電腦裝置與攝像裝置相連接,所述植物生長高度測量方法包括:當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物;控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物; 利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框;利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像;從所述對齊圖像中獲取與多個檢測框對應的目標框;從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量;根據多個深度值及所述數量確定所述待檢測植物的高度。 A plant growth height measurement method, which is applied to a computer device, the computer device is connected with a camera device, and the plant growth height measurement method comprises: when a height measurement request is received, determining a to-be-detected from the height measurement request plants; controlling the camera to photograph the plants to be detected, to obtain a color image and a depth image of the plants to be detected, the color image includes a plurality of plants to be detected, and the depth image includes a plurality of Plants to be tested; Use a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected; use an image alignment algorithm to align the color image and the depth image, obtaining an alignment image; obtaining target frames corresponding to multiple detection frames from the aligned image; determining the depth values of multiple target frames from the aligned image, and determining the number of the multiple target frames; The height of the plant to be detected is determined according to a plurality of depth values and the number.

根據本申請可選實施例,所述從所述高度測量請求中確定待檢測植物包括:從預設執行緒連接池中獲取任意閒置執行緒;利用所述任意閒置執行緒解析所述高度測量請求的方法體,得到所述高度測量請求攜帶的所有資訊;獲取預設標籤,從所述所有資訊中獲取與所述預設標籤對應的資訊,作為所述待檢測植物。 According to an optional embodiment of the present application, the determining the plant to be detected from the height measurement request includes: acquiring any idle thread from a preset thread connection pool; parsing the height measurement request by using the arbitrary idle thread The method body is to obtain all the information carried by the height measurement request; obtain a preset label, and obtain information corresponding to the preset label from all the information, as the plant to be detected.

根據本申請可選實施例,所述控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像包括:確定所述待檢測植物所在的第一方位;控制所述攝像裝置的第一鏡頭移動至與所述第一方位對應的第二方位,並控制所述第一鏡頭進行拍攝,得到所述彩色圖像;控制所述攝像裝置的第二鏡頭移動至所述第二方位,並控制所述第二鏡頭進行拍攝,得到所述深度圖像。 According to an optional embodiment of the present application, the controlling the camera to photograph the plant to be detected and obtaining the color image and the depth image of the plant to be detected includes: determining a first orientation where the plant to be detected is located; Controlling the first lens of the camera to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image; controlling the second lens of the camera to move to the second orientation, and controlling the second lens to shoot to obtain the depth image.

根據本申請可選實施例,在利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框之前,所述植物生長高度測量方法還包括:採用網路爬蟲技術獲取歷史資料; 將所述歷史資料登錄到遺忘門層進行遺忘處理,得到訓練資料;採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集;將所述訓練集中的資料登錄到輸入門層進行訓練,得到學習器;根據所述驗證集中的資料調整所述學習器,得到所述檢測模型。 According to an optional embodiment of the present application, before using a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected, the method for measuring plant growth height further includes: using a net Road crawler technology to obtain historical data; Logging the historical data into the forget gate layer for forgetting processing to obtain training data; using the cross-validation method to divide the training data into a training set and a verification set; logging the data in the training set into the input gate layer for training, Obtain a learner; adjust the learner according to the data in the verification set to obtain the detection model.

根據本申請可選實施例,所述利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像包括:獲取所述深度圖像上的所有深度像素;將所述所有深度像素映射到預設深度坐標系中,得到所述所有深度像素的深度坐標;根據所有深度坐標及預設世界坐標系確定所述所有深度像素的世界坐標;根據所有世界坐標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素;將每個深度像素與每個彩色像素進行融合,得到所述對齊圖像。 According to an optional embodiment of the present application, the performing an alignment process on the color image and the depth image by using an image alignment algorithm to obtain an aligned image includes: acquiring all depth pixels on the depth image; Mapping all the depth pixels into a preset depth coordinate system, and obtaining the depth coordinates of all the depth pixels; determining the world coordinates of all the depth pixels according to all the depth coordinates and the preset world coordinate system; determining according to all the world coordinates the positions of all the depth pixels on the color image, and determine the color pixels of the positions on the color image; fuse each depth pixel with each color pixel to obtain the aligned image .

根據本申請可選實施例,所述從所述對齊圖像中獲取與多個檢測框對應的目標框包括:為所述彩色圖像及所述對齊圖像建立相同的坐標系;確定每個檢測框在所述彩色圖像上的坐標;將每個檢測框的坐標映射至所述對齊圖像中,得到與每個檢測框對應的目標框。 According to an optional embodiment of the present application, the acquiring target frames corresponding to multiple detection frames from the alignment image includes: establishing the same coordinate system for the color image and the alignment image; determining each The coordinates of the detection frame on the color image; the coordinates of each detection frame are mapped to the alignment image to obtain a target frame corresponding to each detection frame.

根據本申請可選實施例,所述根據多個深度值及所述數量確定所述待檢測植物的高度包括:確定所述攝像裝置所處的攝像高度;將所述攝像高度與每個深度值進行相減運算,得到多個距離結果;計算所述多個距離結果的總和;將所述總和除以所述數量,得到所述待檢測植物的高度。 According to an optional embodiment of the present application, the determining the height of the plant to be detected according to the plurality of depth values and the quantity includes: determining the imaging height at which the imaging device is located; comparing the imaging height with each depth value Perform a subtraction operation to obtain a plurality of distance results; calculate the sum of the plurality of distance results; and divide the sum by the number to obtain the height of the plant to be detected.

一種植物生長高度測量裝置,運行於電腦裝置中,所述電腦裝置與攝像裝置相連接,其特徵在於,所述植物生長高度測量裝置包括:確定單元,用於當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物;控制單元,用於控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物;檢測單元,用於利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框;處理單元,用於利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像;獲取單元,用於從所述對齊圖像中獲取與多個檢測框對應的目標框;所述確定單元,還用於從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量;所述確定單元,還用於根據多個深度值及所述數量確定所述待檢測植物的高度。 A plant growth height measurement device, running in a computer device, the computer device is connected with a camera device, characterized in that, the plant growth height measurement device comprises: a determining unit, for when receiving a height measurement request, from the The plant to be detected is determined in the height measurement request; the control unit is configured to control the camera to photograph the plant to be detected, and obtain a color image and a depth image of the plant to be detected, and the color image includes multiple plants to be detected, and the depth image includes a plurality of plants to be detected; a detection unit is used to detect the color image by using a pre-trained detection model to obtain detection frames corresponding to the plurality of plants to be detected processing unit, for utilizing the image alignment algorithm to carry out alignment processing on the color image and the depth image to obtain an aligned image; an acquisition unit for obtaining from the aligned image and a plurality of detection The target frame corresponding to the frame; the determining unit is further configured to determine the depth values of multiple target frames from the aligned image, and determine the number of the multiple target frames; the determining unit is also configured to The plurality of depth values and the number determine the height of the plant to be detected.

一種電腦裝置,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,執行所述儲存器中儲存的指令以實現所述植物生長高度測量方法。 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 measuring plant growth 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 method for measuring plant growth height.

由以上技術方案可以看出,本申請從高度測量請求中確定待檢測植物,能夠準確確定所述待檢測植物,控制所述攝像裝置拍攝所述待檢測植物, 能夠快速獲取到彩色圖像及深度圖像,利用預先訓練好的檢測模型檢測所述彩色圖像,提高檢測效率,從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量,根據多個深度值及所述數量確定所述待檢測植物的高度,提高所述待檢測植物的測量效率。 It can be seen from the above technical solutions that the present application determines the plant to be detected from the height measurement request, can accurately determine the plant to be detected, and control the camera to photograph the plant to be detected, A color image and a depth image can be quickly acquired, the color image is detected by a pre-trained detection model, the detection efficiency is improved, the depth values of multiple target frames are determined from the aligned image, and the The number of multiple target frames, the height of the plant to be detected is determined according to the multiple depth values and the number, and the measurement efficiency of the plant to be detected is improved.

S10~S16:步驟 S10~S16: Steps

11:植物生長高度測量裝置 11: Plant growth height measuring device

110:確定單元 110: Determine unit

111:控制單元 111: Control unit

112:檢測單元 112: Detection unit

113:處理單元 113: Processing unit

114:獲取單元 114: Get Unit

115:劃分單元 115: Divide Units

116:訓練單元 116: Training Unit

117:調整單元 117: Adjustment unit

118:計算單元 118: Computing Unit

119:增強單元 119: Enhancement Unit

120:生成單元 120: Generate unit

121:加密單元 121: encryption unit

122:發送單元 122: 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 growth height measurement method of the present application.

圖2是本申請植物生長高度測量方法的較佳實施例的流程圖。 FIG. 2 is a flow chart of a preferred embodiment of the method for measuring plant growth height of the present application.

圖3是本申請植物生長高度測量裝置的較佳實施例的功能模組圖。 FIG. 3 is a functional module diagram of a preferred embodiment of the plant growth height measuring 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 measuring plant growth 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 growth height measurement 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 . A color image can be captured through the first lens 20 , and a depth image 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 measuring plant growth 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 method for measuring plant growth height is applied to one or more computer devices 1. 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), programmable gate arrays (Field-Programmable Gates) Array, FPGA), Digital Signal Processor (DSP), 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 Internet TV. (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.

在本申請的至少一個實施例中,本申請應用於電腦裝置中,所述電腦裝置與攝像裝置相連接。 In at least one embodiment of the present application, the present application is applied to a computer device, and the computer device is connected to a camera device.

步驟S10,當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物。 Step S10, when a height measurement request is received, determine the plant to be detected from the height measurement request.

在本申請的至少一個實施例中,所述高度測量請求攜帶的資訊包括,但不限於:植物標識、所述待檢測植物等。 In at least one embodiment of the present application, the information carried in the height measurement request includes, but is not limited to, a plant identifier, the plant to be detected, and the like.

在本申請的至少一個實施例中,所述待檢測植物可以是任意需要進行分析日生長的植物,例如:玫瑰花、向日葵、水稻等。 In at least one embodiment of the present application, 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.

在本申請的至少一個實施例中,所述電腦裝置從所述高度測量請求中確定待檢測植物包括:從預設執行緒連接池中獲取任意閒置執行緒;利用所述任意閒置執行緒解析所述高度測量請求的方法體,得到所述高度測量請求攜帶的所有資訊;獲取預設標籤,從所述所有資訊中獲取與所述預設標籤對應的資訊,作為所述待檢測植物。 In at least one embodiment of the present application, the computer device determining the plant to be detected from the height measurement request includes: acquiring any idle thread from a preset thread connection pool; parsing all idle threads by using the arbitrary idle thread The method body of the height measurement request, obtains all the information carried by the height measurement request; obtains a preset label, and obtains information corresponding to the preset label from the all the information, as the plant to be detected.

其中,所述預設標籤可以是所述植物標識。 Wherein, the preset label may be the plant identification.

透過從預設執行緒連結池中獲取閒置執行緒解析所述高度測量請求的方法體,不僅能夠減少創建執行緒的時間,還能夠提高解析所述高度測量請求的效率,進而透過預設標籤與待檢測植物的映射關係,能夠準確確定所述待檢測植物。 The method body for parsing the height measurement request by obtaining idle threads from the default thread connection pool can not only reduce the time for creating threads, but also improve the efficiency of parsing the height measurement request. The mapping relationship of the plants to be detected can accurately determine the plants to be detected.

步驟S11,控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物。 Step S11, controlling the camera to photograph the plant to be detected, to obtain a color image and a depth image of the plant to be detected, the color image includes a plurality of plants to be detected, and the depth image includes a plurality of plants to be tested.

在本申請的至少一個實施例中,所述攝像裝置包括雙鏡頭,分別為第一鏡頭及第二鏡頭。進一步地,所述攝像裝置可以安裝在便於拍攝所述檢測植物的正上方。 In at least one embodiment of the present application, the camera device includes dual lenses, which are a first lens and a second lens respectively. Further, the camera device may be installed directly above the detected plant for photographing.

在本申請的至少一個實施例中,所述彩色圖像是指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 camera to each point in the scene is taken as a pixel value .

在本申請的至少一個實施例中,所述電腦裝置控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像包括:確定所述待檢測植物所在的第一方位;控制所述攝像裝置的第一鏡頭移動至與所述第一方位對應的第二方位,並控制所述第一鏡頭進行拍攝,得到所述彩色圖像;控制所述攝像裝置的第二鏡頭移動至所述第二方位,並控制所述第二鏡頭進行拍攝,得到所述深度圖像。 In at least one embodiment of the present application, the computer device controlling the camera device to photograph the plant to be detected, and obtaining a color image and a depth image of the plant to be detected includes: determining where the plant to be detected is located. the first orientation; control the first lens of the camera to move to the second orientation corresponding to the first orientation, and control the first lens to shoot to obtain the color image; control the camera of the camera The second lens moves to the second orientation, and controls the second lens to shoot 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.

步驟S12,利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框。 Step S12, using a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected.

在本申請的至少一個實施例中,所述檢測框是利用所述檢測模型對所述彩色圖像進行特徵提取得到的。 In at least one embodiment of the present application, the detection frame is obtained by using the detection model to perform feature extraction on the color image.

在本申請的至少一個實施例中,在利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框之前,所述植物生長高度測量方法還包括:採用網路爬蟲技術獲取歷史資料;將所述歷史資料登錄到遺忘門層進行遺忘處理,得到訓練資料;採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集;將所述訓練集中的資料登錄到輸入門層進行訓練,得到學習器;根據所述驗證集中的資料調整所述學習器,得到所述檢測模型。 In at least one embodiment of the present application, before using a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected, the method for measuring plant growth height further includes: Use web crawler technology to obtain historical data; log the historical data into the forget gate layer for forgetting processing to obtain training data; use cross-validation method to divide the training data into a training set and a verification set; The data is logged into the input gate layer for training to obtain a learner; the learner is adjusted according to the data in the verification set to obtain the detection model.

透過上述實施方式,能夠生成適用於所述待檢測植物的檢測模型。 Through the above-mentioned embodiments, a detection model suitable for the plant to be detected can be generated.

在本申請的至少一個實施例中,在採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集之前,所述方法還包括:所述電腦裝置計算所述訓練資料中彩色訓練圖像的數量,當所述數量小於預設數量時,所述電腦裝置利用資料增強演算法增加所述訓練資料中彩色訓練圖像的數量。 In at least one embodiment of the present application, before adopting a cross-validation method to divide the training data into a training set and a verification set, the method further includes: calculating, by the computer device, the difference between the color training images in the training data number, 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 training data.

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

在本申請的至少一個實施例中,所述電腦裝置採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集包括:所述電腦裝置將所述訓練資料按照預設比例隨機劃分為至少一個資料包,將所述至少一個資料包中的任意一個資料包確定為所述驗證集,其餘的資料包確定為所述訓練集,重複上述步驟,直至所有的資料包全都依次被用作為所述驗證集。 In at least one embodiment of the present application, the computer device dividing the training data into a training set and a verification set by using a cross-validation method includes: the computer device randomly dividing the training data into at least one set according to a preset ratio Data package, determine any one of the at least one data package as the verification set, and determine the rest of the data packages as the training set, and repeat the above steps 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.

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

在本申請的至少一個實施例中,所述電腦裝置根據所述驗證集中的資料調整所述學習器,得到所述檢測模型包括:所述電腦裝置採用超參數網格搜索方法從所述驗證集中確定最優超參數點,進一步地,所述電腦裝置透過所述最優超參數點對所述學習器進行調整,得到所述檢測模型。 In at least one embodiment of the present application, the computer device adjusts the learner according to the data in the verification set, and obtaining the detection model includes: the computer device uses a hyperparameter grid search method to select from the verification set An optimal hyperparameter point is determined, and further, the computer device adjusts the learner through the optimal hyperparameter point to obtain the detection model.

具體地,所述電腦裝置將所述驗證集按照固定步長進行拆分,得到目標子集,遍歷所述目標子集上兩端端點的參數,透過所述兩端端點的參數驗證所述學習器,得到每個參數的學習率,將學習率最好的參數確定為第一超參數點,並在所述第一超參數點的鄰域內,縮小所述步長繼續遍歷,直至所述步長為預設步長,即得到的超參數點為所述最優超參數點,更進一步地,所述電腦裝置根據所述最優超參數點調整所述學習器,得到所述檢測模型。 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 Detection model.

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

透過上述實施方式,能夠使所述檢測模型更加適合所述待檢測植物的彩色圖像的檢測。 Through the above embodiments, the detection model can be more suitable for the detection of the color image of the plant to be detected.

步驟S13,利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像。 Step S13, using an image alignment algorithm to align the color image and the depth image to obtain an aligned image.

在本申請的至少一個實施例中,所述對齊圖像是指融合所述彩色圖像的像素與所述深度圖像的像素而生成的圖像。 In at least one embodiment of the present application, the aligned 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 an alignment process on the color image and the depth image by using an image alignment algorithm, and obtaining an aligned image includes: acquiring an image on the depth image. All depth pixels; mapping all depth pixels to a preset depth coordinate system to obtain the depth coordinates of all depth pixels; Determine the world coordinates of all the depth pixels according to all the depth coordinates and the preset world coordinate system; determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine that the positions are in the color map color pixels on the image; each depth pixel is fused with each color pixel to obtain the aligned 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-mentioned embodiments, an aligned image containing depth values can be generated, so as to subsequently determine the height of the plant to be detected.

步驟S14,從所述對齊圖像中獲取與多個檢測框對應的目標框。 Step S14, acquiring target frames corresponding to multiple detection frames from the aligned image.

在本申請的至少一個實施例中,所述電腦裝置從所述對齊圖像中獲取與多個檢測框對應的目標框包括:為所述彩色圖像及所述對齊圖像建立相同的坐標系;確定每個檢測框在所述彩色圖像上的坐標;將每個檢測框的坐標映射至所述對齊圖像中,得到與每個檢測框對應的目標框。 In at least one embodiment of the present application, the computer device acquiring target frames corresponding to the plurality of detection frames from the alignment image includes: establishing the same coordinate system for the color image and the alignment image ; determine the coordinates of each detection frame on the color image; map the coordinates of each detection frame to the alignment image to obtain a target frame corresponding to each detection frame.

透過上述實施方式,能夠準確地確定出所述對齊圖像的目標框。 Through the above-mentioned embodiments, the target frame of the aligned image can be accurately determined.

步驟S15,從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量。 Step S15: Determine the depth values of multiple target frames from the aligned image, and determine the number of the multiple target frames.

在本申請的至少一個實施例中,所述電腦裝置從所述對齊圖像中確定多個目標框的深度值包括:對於任意目標框,確定所述任意目標框的所有像素點;從所述對齊圖像中獲取每個像素點的像素深度值;計算所述所有像素點的像素深度值總和,作為所述任意目標框的深度值。 In at least one embodiment of the present application, the computer device determining the depth values of multiple target frames from the aligned image includes: for any target frame, determining all pixels of the arbitrary target frame; from the Acquire the pixel depth value of each pixel in the aligned image; calculate the sum of the pixel depth values of all the pixels as the depth value of the arbitrary target frame.

其中,所述像素深度值是指像素對應到所述待檢測植物上的特徵點距離攝像裝置的高度。 The pixel depth value refers to the height of the pixel corresponding to the feature point on the to-be-detected plant from the camera device.

步驟S16,根據多個深度值及所述數量確定所述待檢測植物的高度。 Step S16, determining the height of the plant to be detected according to the plurality of depth values and the quantity.

在本申請的至少一個實施例中,所述電腦裝置根據多個深度值及所述數量確定所述待檢測植物的高度包括:確定所述攝像裝置所處的攝像高度;將所述攝像高度與每個深度值進行相減運算,得到多個距離結果;計算所述多個距離結果的總和;將所述總和除以所述數量,得到所述待檢測植物的高度。 In at least one embodiment of the present application, the computer device determining the height of the plant to be detected according to a plurality of depth values and the quantity includes: determining a camera height at which the camera device is located; comparing the camera height with Subtract each depth value to obtain a plurality of distance results; calculate the sum of the plurality of distance results; and divide the sum by the number to obtain the height of the plant to be detected.

透過上述實施方式,無需手動測量所述待檢測植物,能夠提高所述待檢測植物的測量效率。 Through the above embodiments, it is unnecessary to manually measure the plants to be detected, and the measurement efficiency of the plants to be detected can be improved.

在本申請的至少一個實施例中,在根據多個深度值及所述數量確定所述待檢測植物的高度之後,所述植物生長高度測量方法還包括:當所述高度小於預設高度時,所述電腦裝置根據所述高度生成告警資訊,進一步地,所述電腦裝置採用對稱加密演算法加密所述告警資訊,得到密文,更進一步地,所述電腦裝置根據所述待檢測植物確定所述密文的告警等級,所述電腦裝置根據所述告警等級確定告警方式,更進一步地,所述電腦裝置以所述告警方式發送所述密文。 In at least one embodiment of the present application, after determining the height of the plant to be detected according to a plurality of depth values and the quantity, the method for measuring plant growth height further includes: when the height is less than a preset height, The computer device generates alarm information according to the height. Further, the computer device encrypts the alarm information by using a symmetric encryption algorithm to obtain ciphertext. Further, the computer device determines the alarm information according to the plant to be detected. the alarm level of the ciphertext, 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-mentioned 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 alarm information can be improved. At the same time, the alarm mode is determined according to the alarm level, and the alarm information can be sent in an appropriate alarm mode, which makes the sending of the alarm information more humanized.

由以上技術方案可以看出,本申請從高度測量請求中確定待檢測植物,能夠準確確定所述待檢測植物,控制所述攝像裝置拍攝所述待檢測植物,能夠快速獲取到彩色圖像及深度圖像,利用預先訓練好的檢測模型檢測所述彩色圖像,提高檢測效率,從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量,根據多個深度值及所述數量確定所述待檢測植物的高度,提高所述待檢測植物的測量效率。 It can be seen from the above technical solutions that the present application can determine the plant to be detected from the height measurement request, can accurately determine the plant to be detected, control the camera device to photograph the plant to be detected, and can quickly obtain color images and depths. image, use the pre-trained detection model to detect the color image, improve the detection efficiency, determine the depth values of multiple target frames from the aligned image, and determine the number of the multiple target frames, according to the number of target frames. The depth value and the number determine the height of the plant to be detected, so as to improve the measurement efficiency of the plant to be detected.

如圖3所示,是本申請植物生長高度測量裝置的較佳實施例的功能模組圖。所述植物生長高度測量裝置11包括確定單元110、控制單元111、檢測單元112、處理單元113、獲取單元114、劃分單元115、訓練單元116、調整單元117、計算單元118、增強單元119、生成單元120、加密單元121及發送單元122。本申請所稱的模組/單元是指一種能夠被處理器13所執行,並且能夠完成固定功能的一系列電腦程式段,其儲存在儲存器12中。在本實施例中,關於各模組/單元的功能將在後續的實施例中詳述。 As shown in FIG. 3 , it is a functional module diagram of a preferred embodiment of the plant growth height measuring device of the present application. The plant growth height measuring device 11 includes a determination unit 110, a control unit 111, a detection unit 112, a processing unit 113, an acquisition unit 114, a division unit 115, a training unit 116, an adjustment unit 117, a calculation unit 118, an enhancement unit 119, a generation unit unit 120 , encryption unit 121 and sending unit 122 . 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從所述高度測量請求中確定待檢測植物。 When receiving the height measurement request, the determination unit 110 determines the plant to be detected from the height measurement request.

在本申請的至少一個實施例中,所述高度測量請求攜帶的資訊包括,但不限於:植物標識、所述待檢測植物等。 In at least one embodiment of the present application, the information carried in the height measurement request includes, but is not limited to, a plant identifier, the plant to be detected, and the like.

在本申請的至少一個實施例中,所述待檢測植物可以是任意需要進行分析日生長的植物,例如:玫瑰花、向日葵、水稻等。 In at least one embodiment of the present application, 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從所述高度測量請求中確定待檢測植物包括:從預設執行緒連接池中獲取任意閒置執行緒;利用所述任意閒置執行緒解析所述高度測量請求的方法體,得到所述高度測量請求攜帶的所有資訊; 獲取預設標籤,從所述所有資訊中獲取與所述預設標籤對應的資訊,作為所述待檢測植物。 In at least one embodiment of the present application, the determining unit 110 determining the plant to be detected from the height measurement request includes: acquiring any idle thread from a preset thread connection pool; using the arbitrary idle thread to parse The method body of the altitude measurement request, obtains all the information carried by the altitude measurement request; Acquire a preset tag, and acquire information corresponding to the preset tag from all the information as the plant to be detected.

其中,所述預設標籤可以是所述植物標識。 Wherein, the preset label may be the plant identification.

透過從預設執行緒連結池中獲取閒置執行緒解析所述高度測量請求的方法體,不僅能夠減少創建執行緒的時間,還能夠提高解析所述高度測量請求的效率,進而透過預設標籤與待檢測植物的映射關係,能夠準確確定所述待檢測植物。 The method body for parsing the height measurement request by obtaining idle threads from the default thread connection pool can not only reduce the time for creating threads, but also improve the efficiency of parsing the height measurement request. The mapping relationship of the plants to be detected can accurately determine the plants to be detected.

控制單元111控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物。 The control unit 111 controls the camera to photograph the plant to be detected, and obtains a color image and a depth image of the plant to be detected, where the color image includes a plurality of plants to be detected, and the depth image includes a plurality of plants to be tested.

在本申請的至少一個實施例中,所述攝像裝置包括雙鏡頭,分別為第一鏡頭及第二鏡頭。進一步地,所述攝像裝置可以安裝在便於拍攝所述檢測植物的正上方。 In at least one embodiment of the present application, the camera device includes dual lenses, which are a first lens and a second lens respectively. Further, the camera device may be installed directly above the detected plant for photographing.

在本申請的至少一個實施例中,所述彩色圖像是指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 camera to each point in the scene is taken as a pixel value .

在本申請的至少一個實施例中,所述控制單元111控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像包括:確定所述待檢測植物所在的第一方位;控制所述攝像裝置的第一鏡頭移動至與所述第一方位對應的第二方位,並控制所述第一鏡頭進行拍攝,得到所述彩色圖像;控制所述攝像裝置的第二鏡頭移動至所述第二方位,並控制所述第二鏡頭進行拍攝,得到所述深度圖像。 In at least one embodiment of the present application, the control unit 111 controls the camera device to photograph the plant to be detected, and obtaining a color image and a depth image of the plant to be detected includes: determining where the plant to be detected is located the first orientation of the camera; control the first lens of the camera to move to the second orientation corresponding to the first orientation, and control the first lens to shoot to obtain the color image; control the camera The second lens is moved to the second orientation, and the second lens is controlled to shoot 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.

檢測單元112利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框。 The detection unit 112 detects the color image by using the pre-trained detection model, and obtains detection frames corresponding to the plurality of plants to be detected.

在本申請的至少一個實施例中,所述檢測框是利用所述檢測模型對所述彩色圖像進行特徵提取得到的。 In at least one embodiment of the present application, the detection frame is obtained by using the detection model to perform feature extraction on the color image.

在本申請的至少一個實施例中,在利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框之前,獲取單元114採用網路爬蟲技術獲取歷史資料,處理單元113將所述歷史資料登錄到遺忘門層進行遺忘處理,得到訓練資料,劃分單元115採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集,訓練單元116將所述訓練集中的資料登錄到輸入門層進行訓練,得到學習器,調整單元117根據所述驗證集中的資料調整所述學習器,得到所述檢測模型。 In at least one embodiment of the present application, before using a pre-trained detection model to detect the color image and obtain detection frames corresponding to the plurality of plants to be detected, the acquisition unit 114 acquires the history by using a web crawler technology data, the processing unit 113 logs the historical data into the forget gate layer for forgetting processing, and obtains training data, the dividing unit 115 adopts the cross-validation method to divide the training data into a training set and a verification set, and the training unit 116 divides the training data into The centralized data is logged into the input gate layer for training to obtain a learner, and the adjustment unit 117 adjusts the learner according to the data in the verification set to obtain the detection model.

透過上述實施方式,能夠生成適用於所述待檢測植物的檢測模型。 Through the above-mentioned embodiments, a detection model suitable for the plant to be detected can be generated.

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

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

在本申請的至少一個實施例中,所述劃分單元115採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集包括:所述劃分單元115將所述訓練資料按照預設比例隨機劃分為至少一個資料包,將所述至少一個資料包中的任意一個資料包確定為所述驗證集,其餘的資料包確定為所述訓練集,重複上述步驟,直至所有的資料包全都依次被用作為所述驗證集。 In at least one embodiment of the present application, the dividing unit 115 adopts a cross-validation method to divide the training data into a training set and a validation set, including: the dividing unit 115 randomly divides the training data into two parts according to a preset ratio. For at least one data package, any one data package in 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 in turn. the validation set.

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

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

在本申請的至少一個實施例中,所述調整單元117根據所述驗證集中的資料調整所述學習器,得到所述檢測模型包括:所述調整單元117採用超參數網格搜索方法從所述驗證集中確定最優超參數點,進一步地,所述調整單元117透過所述最優超參數點對所述學習器進行調整,得到所述檢測模型。 In at least one embodiment of the present application, the adjustment unit 117 adjusts the learner according to the data in the verification set, and obtaining the detection model includes: the adjustment unit 117 uses a hyperparameter grid search method to obtain the detection model from the The optimal hyperparameter point is determined in the verification set, and further, the adjustment unit 117 adjusts the learner through the optimal hyperparameter point to obtain the detection model.

具體地,所述調整單元117將所述驗證集按照固定步長進行拆分,得到目標子集,遍歷所述目標子集上兩端端點的參數,透過所述兩端端點的參數驗證所述學習器,得到每個參數的學習率,將學習率最好的參數確定為第一超參數點,並在所述第一超參數點的鄰域內,縮小所述步長繼續遍歷,直至所述步長為預設步長,即得到的超參數點為所述最優超參數點,更進一步地,所述調整單元117根據所述最優超參數點調整所述學習器,得到所述檢測模型。 Specifically, the adjustment unit 117 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 117 adjusts the learner according to the optimal hyperparameter point, and obtains the detection model.

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

透過上述實施方式,能夠使所述檢測模型更加適合所述待檢測植物的彩色圖像的檢測。 Through the above embodiments, the detection model can be more suitable for the detection of the color image of the plant to be detected.

所述處理單元113利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像。 The processing unit 113 uses an image alignment algorithm to perform alignment processing on the color image and the depth image to obtain an aligned image.

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

在本申請的至少一個實施例中,所述處理單元113利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像包括:獲取所述深度圖像上的所有深度像素;將所述所有深度像素映射到預設深度坐標系中,得到所述所有深度像素的深度坐標; 根據所有深度坐標及預設世界坐標系確定所述所有深度像素的世界坐標;根據所有世界坐標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素;將每個深度像素與每個彩色像素進行融合,得到所述對齊圖像。 In at least one embodiment of the present application, the processing unit 113 performs an alignment process on the color image and the depth image by using an image alignment algorithm, and obtaining an aligned image includes: acquiring an image on the depth image All the depth pixels of ; map all the depth pixels to a preset depth coordinate system to obtain the depth coordinates of all the depth pixels; Determine the world coordinates of all the depth pixels according to all the depth coordinates and the preset world coordinate system; determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the positions in the color map color pixels on the image; each depth pixel is fused with each color pixel to obtain the aligned 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-mentioned embodiments, an aligned image containing depth values can be generated, so as to subsequently determine the height of the plant to be detected.

所述獲取單元114從所述對齊圖像中獲取與多個檢測框對應的目標框。 The obtaining unit 114 obtains target frames corresponding to a plurality of detection frames from the aligned image.

在本申請的至少一個實施例中,所述獲取單元114從所述對齊圖像中獲取與多個檢測框對應的目標框包括:為所述彩色圖像及所述對齊圖像建立相同的坐標系;確定每個檢測框在所述彩色圖像上的坐標;將每個檢測框的坐標映射至所述對齊圖像中,得到與每個檢測框對應的目標框。 In at least one embodiment of the present application, the acquiring unit 114 acquiring target frames corresponding to multiple detection frames from the alignment image includes: establishing the same coordinates for the color image and the alignment image determine the coordinates of each detection frame on the color image; map the coordinates of each detection frame to the alignment image to obtain a target frame corresponding to each detection frame.

透過上述實施方式,能夠準確地確定出所述對齊圖像的目標框。 Through the above-mentioned embodiments, the target frame of the aligned image can be accurately determined.

所述確定單元110從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量。 The determining unit 110 determines depth values of multiple target frames from the aligned image, and determines the number of the multiple target frames.

在本申請的至少一個實施例中,所述確定單元110從所述對齊圖像中確定多個目標框的深度值包括:對於任意目標框,確定所述任意目標框的所有像素點;從所述對齊圖像中獲取每個像素點的像素深度值;計算所述所有像素點的像素深度值總和,作為所述任意目標框的深度值。 In at least one embodiment of the present application, the determining unit 110 determining the depth values of multiple target frames from the aligned image includes: for any target frame, determining all pixels of the arbitrary target frame; Obtain the pixel depth value of each pixel in the aligned image; calculate the sum of the pixel depth values of all the pixels as the depth value of the arbitrary target frame.

其中,所述像素深度值是指像素對應到所述待檢測植物上的特徵點距離攝像裝置的高度。 The pixel depth value refers to the height of the pixel corresponding to the feature point on the to-be-detected plant from the camera device.

所述確定單元110根據多個深度值及所述數量確定所述待檢測植物的高度。 The determining unit 110 determines the height of the plant to be detected according to a plurality of depth values and the number.

在本申請的至少一個實施例中,所述確定單元110根據多個深度值及所述數量確定所述待檢測植物的高度包括:確定所述攝像裝置所處的攝像高度;將所述攝像高度與每個深度值進行相減運算,得到多個距離結果;計算所述多個距離結果的總和;將所述總和除以所述數量,得到所述待檢測植物的高度。 In at least one embodiment of the present application, the determining unit 110 determining the height of the plant to be detected according to a plurality of depth values and the quantity includes: determining the imaging height at which the imaging device is located; Perform a subtraction operation with each depth value to obtain a plurality of distance results; calculate the sum of the plurality of distance results; and divide the sum by the number to obtain the height of the plant to be detected.

透過上述實施方式,無需手動測量所述待檢測植物,能夠提高所述待檢測植物的測量效率。 Through the above embodiments, it is unnecessary to manually measure the plants to be detected, and the measurement efficiency of the plants to be detected can be improved.

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

其中,所述預設高度可以根據所述待檢測植物的預期生成速率設置,本申請對所述預設高度的取值不作限制。 Wherein, the preset height may 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-mentioned 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 alarm information can be improved. At the same time, the alarm mode is determined according to the alarm level, and the alarm information can be sent in an appropriate alarm mode, which makes the sending of the alarm information more humanized.

由以上技術方案可以看出,本申請從高度測量請求中確定待檢測植物,能夠準確確定所述待檢測植物,控制所述攝像裝置拍攝所述待檢測植物,能夠快速獲取到彩色圖像及深度圖像,利用預先訓練好的檢測模型檢測所述彩色圖像,提高檢測效率,從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量,根據多個深度值及所述數量確定所述待檢測植物的高度,提高所述待檢測植物的測量效率。 It can be seen from the above technical solutions that the present application can determine the plant to be detected from the height measurement request, can accurately determine the plant to be detected, control the camera device to photograph the plant to be detected, and can quickly obtain color images and depths. image, use the pre-trained detection model to detect the color image, improve the detection efficiency, determine the depth values of multiple target frames from the aligned image, and determine the number of the multiple target frames, according to the number of target frames. The depth value and the number determine the height of the plant to be detected, so as to improve the measurement efficiency of the plant to be detected.

如圖4所示,是本申請實現植物生長高度測量方法的較佳實施例的電腦裝置的結構示意圖。 As shown in FIG. 4 , it is a schematic structural diagram of a computer device for realizing a preferred embodiment of the plant growth height measurement method 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 measurement 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. The general-purpose processor can be a microprocessor or 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 the entire computer device 1 various parts of the computer device 1, and the operating system that executes the computer device 1, as well as various installed applications, code, and the like.

所述處理器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 method for measuring plant growth height, for example, the steps shown in FIG. 2 .

示例性的,所述電腦程式可以被分割成一個或多個模組/單元,所述一個或者多個模組/單元被儲存在所述儲存器12中,並由所述處理器13執行,以完成本申請。所述一個或多個模組/單元可以是能夠完成特定功能的一系列電腦程式指令段,該指令段用於描述所述電腦程式在所述電腦裝置1中的執行過程。例如,所述電腦程式可以被分割成確定單元110、控制單元111、檢測單元112、處理單元113、獲取單元114、劃分單元115、訓練單元116、調整單元117、計算單元118、增強單元119、生成單元120、加密單元121及發送單元122。 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 a determination unit 110, a control unit 111, a detection unit 112, a processing unit 113, an acquisition unit 114, a division unit 115, a training unit 116, an adjustment unit 117, a calculation unit 118, an enhancement unit 119, Generation unit 120 , encryption unit 121 and transmission unit 122 .

所述儲存器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 implements all or part of the processes in the methods of the above embodiments, and can also use The computer program instructs the relevant hardware to complete, 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 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可執行所述多個指令從而實現:當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物;控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物;利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框;利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像;從所述對齊圖像中獲取與多個檢測框對應的目標框;從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量;根據多個深度值及所述數量確定所述待檢測植物的高度。 Referring to FIG. 2 , the storage 12 in the computer device 1 stores a plurality of instructions to implement a method for measuring plant growth height, and the processor 13 can execute the plurality of instructions to implement: when a height measurement request is received At the time of detection, determine the plant to be detected from the height measurement request; control the camera to photograph the plant to be detected, and obtain a color image and a depth image of the plant to be detected, and the color image includes a plurality of to-be-detected plants. Detecting plants, and the depth image includes a plurality of plants to be detected; using a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected; using an image alignment algorithm Aligning the color image and the depth image to obtain an aligned image; acquiring target frames corresponding to multiple detection frames from the aligned image; determining multiple targets from the aligned image The depth value of the frame is determined, and the number of the multiple target frames is determined; the height of the plant to be detected is determined according to the multiple depth values and the number.

具體地,所述處理器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 apparatus embodiments described above are only It is illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods 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, or may distribute images to multiple on the network unit. 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~S16:步驟 S10~S16: Steps

Claims (9)

一種植物生長高度測量方法,應用於電腦裝置中,所述電腦裝置與攝像裝置相連接,其中,所述植物生長高度測量方法包括:當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物;控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物;利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框;利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像;從所述對齊圖像中獲取與多個檢測框對應的目標框;從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量;根據多個深度值及所述數量確定所述待檢測植物的高度,包括:確定所述攝像裝置所處的攝像高度;將所述攝像高度與每個深度值進行相減運算,得到多個距離結果,其中,每個深度值是指每個目標框中所有像素點的像素深度值的總和,所述像素深度值是指像素點對應到所述待檢測植物上的特徵點距離攝像裝置的高度;計算所述多個距離結果的總和;將所述總和除以所述數量,得到所述待檢測植物的高度。 A method for measuring plant growth height, which is applied to a computer device, wherein the computer device is connected with a camera device, wherein the method for measuring plant growth height comprises: when a height measurement request is received, determining from the height measurement request Plants to be detected; control the camera to photograph the plants to be detected, to obtain a color image and a depth image of the plants to be detected, the color image includes a plurality of plants to be detected, and the depth image includes a plurality of plants to be detected; use a pre-trained detection model to detect the color image to obtain detection frames corresponding to the plurality of plants to be detected; use an image alignment algorithm to align the color image with the depth The images are aligned to obtain an aligned image; target frames corresponding to multiple detection frames are obtained from the aligned image; depth values of multiple target frames are determined from the aligned image, and the multiple target frames are determined from the aligned images. The number of target frames; determining the height of the plant to be detected according to a plurality of depth values and the number, including: determining the camera height where the camera is located; subtracting the camera height from each depth value Operation to obtain multiple distance results, wherein each depth value refers to the sum of the pixel depth values of all pixels in each target frame, and the pixel depth value refers to the pixel corresponding to the feature on the plant to be detected The height of the point from the camera device; calculating the sum of the plurality of distance results; dividing the sum by the number to obtain the height of the plant to be detected. 如請求項1所述的植物生長高度測量方法,其中,所述從所述高度測量請求中確定待檢測植物包括:從預設執行緒連接池中獲取任意閒置執行緒;利用所述任意閒置執行緒解析所述高度測量請求的方法體,得到所述高度測量請求攜帶的所有資訊; 獲取預設標籤,從所述所有資訊中獲取與所述預設標籤對應的資訊,作為所述待檢測植物。 The method for measuring plant growth height according to claim 1, wherein the determining the plant to be detected from the height measurement request comprises: acquiring any idle thread from a preset thread connection pool; using the arbitrary idle thread to execute thread to parse the method body of the altitude measurement request, and obtain all the information carried by the altitude measurement request; Acquire a preset tag, and acquire information corresponding to the preset tag from all the information as the plant to be detected. 如請求項1所述的植物生長高度測量方法,其中,所述控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像包括:確定所述待檢測植物所在的第一方位;控制所述攝像裝置的第一鏡頭移動至與所述第一方位對應的第二方位,並控制所述第一鏡頭進行拍攝,得到所述彩色圖像;控制所述攝像裝置的第二鏡頭移動至所述第二方位,並控制所述第二鏡頭進行拍攝,得到所述深度圖像。 The method for measuring plant growth height according to claim 1, wherein the controlling the camera device to photograph the plant to be detected to obtain a color image and a depth image of the plant to be detected comprises: determining the to-be-detected plant the first orientation of the plant; control the first lens of the camera to move to the second orientation corresponding to the first orientation, and control the first lens to shoot to obtain the color image; control the The second lens of the camera is moved to the second orientation, and the second lens is controlled to shoot to obtain the depth image. 如請求項1所述的植物生長高度測量方法,其中,在利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框之前,所述植物生長高度測量方法還包括:採用網路爬蟲技術獲取歷史資料;將所述歷史資料登錄到遺忘門層進行遺忘處理,得到訓練資料;採用交叉驗證法將所述訓練資料劃分為訓練集及驗證集;將所述訓練集中的資料登錄到輸入門層進行訓練,得到學習器;根據所述驗證集中的資料調整所述學習器,得到所述檢測模型。 The method for measuring plant growth height according to claim 1, wherein before detecting the color image by using a pre-trained detection model to obtain detection frames corresponding to the plurality of plants to be detected, the plant growth height The measurement method further includes: using a web crawler technology to obtain historical data; logging the historical data into the forget gate layer for forgetting processing to obtain training data; using a cross-validation method to divide the training data into a training set and a verification set; The data in the training set is logged into the input gate layer for training to obtain a learner; the learner is adjusted according to the data in the verification set to obtain the detection model. 如請求項1所述的植物生長高度測量方法,其中,所述利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像包括:獲取所述深度圖像上的所有深度像素;將所述所有深度像素映射到預設深度坐標系中,得到所述所有深度像素的深度坐標;根據所有深度坐標及預設世界坐標系確定所述所有深度像素的世界坐標; 根據所有世界坐標確定所述所有深度像素在所述彩色圖像上的位置,並確定所述位置在所述彩色圖像上的彩色像素;將每個深度像素與每個彩色像素進行融合,得到所述對齊圖像。 The method for measuring plant growth height according to claim 1, wherein said using an image alignment algorithm to align the color image and the depth image to obtain the aligned image comprises: acquiring the depth map All the depth pixels on the image; map all the depth pixels to a preset depth coordinate system to obtain the depth coordinates of all the depth pixels; determine the world of all the depth pixels according to all the depth coordinates and the preset world coordinate system coordinate; Determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color pixels of the positions on the color image; fuse each depth pixel with each color pixel to obtain the aligned image. 如請求項1所述的植物生長高度測量方法,其中,所述從所述對齊圖像中獲取與多個檢測框對應的目標框包括:為所述彩色圖像及所述對齊圖像建立相同的坐標系;確定每個檢測框在所述彩色圖像上的坐標;將每個檢測框的坐標映射至所述對齊圖像中,得到與每個檢測框對應的目標框。 The method for measuring plant growth height according to claim 1, wherein the obtaining target frames corresponding to a plurality of detection frames from the aligned image comprises: establishing an identical image for the color image and the aligned image determine the coordinates of each detection frame on the color image; map the coordinates of each detection frame to the alignment image to obtain a target frame corresponding to each detection frame. 一種植物生長高度測量裝置,運行於電腦裝置中,所述電腦裝置與攝像裝置相連接,其中,所述植物生長高度測量裝置包括:確定單元,用於當接收到高度測量請求時,從所述高度測量請求中確定待檢測植物;控制單元,用於控制所述攝像裝置拍攝所述待檢測植物,得到所述待檢測植物的彩色圖像及深度圖像,所述彩色圖像包括多個待檢測植物,及所述深度圖像包括多個待檢測植物;檢測單元,用於利用預先訓練好的檢測模型檢測所述彩色圖像,得到與所述多個待檢測植物對應的檢測框;處理單元,用於利用圖像對齊演算法將所述彩色圖像與所述深度圖像進行對齊處理,得到對齊圖像;獲取單元,用於從所述對齊圖像中獲取與多個檢測框對應的目標框;所述確定單元,還用於從所述對齊圖像中確定多個目標框的深度值,並確定所述多個目標框的數量;所述確定單元,還用於根據多個深度值及所述數量確定所述待檢測植物的高度,包括:確定所述攝像裝置所處的攝像高度;將所述攝像高度與每個深度值進行相減運算,得到多個距離結果,其中,每個深度值是指每個目標框中所 有像素點的像素深度值的總和,所述像素深度值是指像素點對應到所述待檢測植物上的特徵點距離攝像裝置的高度;計算所述多個距離結果的總和;將所述總和除以所述數量,得到所述待檢測植物的高度。 A plant growth height measurement device, which runs in a computer device, the computer device is connected with a camera device, wherein the plant growth height measurement device comprises: a determination unit, for receiving a height measurement request, from the The plant to be detected is determined in the height measurement request; the control unit is configured to control the camera to photograph the plant to be detected, and obtain a color image and a depth image of the plant to be detected, and the color image includes a plurality of to-be-detected plants. Detecting plants, and the depth image includes a plurality of plants to be detected; a detection unit is used to detect the color image by using a pre-trained detection model to obtain detection frames corresponding to the plurality of plants to be detected; processing a unit for aligning the color image and the depth image using an image alignment algorithm to obtain an aligned image; an acquiring unit for acquiring from the aligned image corresponding to a plurality of detection frames The target frame of the The depth value and the quantity determine the height of the plant to be detected, including: determining the imaging height at which the imaging device is located; subtracting the imaging height and each depth value to obtain a plurality of distance results, wherein , each depth value refers to the There is the sum of the pixel depth values of the pixel points, and the pixel depth value refers to the height of the pixel point corresponding to the feature point on the plant to be detected from the camera device; calculate the sum of the plurality of distance results; Divide by the number to obtain the height of the plant to be detected. 一種電腦裝置,其中,所述電腦裝置包括:儲存器,儲存至少一個指令;及處理器,獲取所述儲存器中儲存的指令以實現如請求項1至6中任意一項所述的植物生長高度測量方法。 A computer device, wherein the computer device comprises: a storage, storing at least one instruction; and a processor, acquiring the instructions stored in the storage to realize the plant growth according to any one of claim 1 to 6 Height measurement 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 measuring plant growth height.
TW110101171A 2021-01-12 2021-01-12 Method and device for measuring plant growth height, computer device and medium TWI759069B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW110101171A TWI759069B (en) 2021-01-12 2021-01-12 Method and device for measuring plant growth height, computer device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW110101171A TWI759069B (en) 2021-01-12 2021-01-12 Method and device for measuring plant growth height, computer device and medium

Publications (2)

Publication Number Publication Date
TWI759069B true TWI759069B (en) 2022-03-21
TW202228077A TW202228077A (en) 2022-07-16

Family

ID=81710831

Family Applications (1)

Application Number Title Priority Date Filing Date
TW110101171A TWI759069B (en) 2021-01-12 2021-01-12 Method and device for measuring plant growth height, computer device and medium

Country Status (1)

Country Link
TW (1) TWI759069B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016697A (en) * 2017-04-11 2017-08-04 杭州光珀智能科技有限公司 A kind of height measurement method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107016697A (en) * 2017-04-11 2017-08-04 杭州光珀智能科技有限公司 A kind of height measurement method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Syed, Tabinda Naz, et al. "Seedling-lump integrated non-destructive monitoring for automatic transplanting with Intel RealSense depth camera." Artificial Intelligence in Agriculture 3 (2019): 18-32.; *
Yin, Fukun, and Shizhe Zhou. "Accurate Estimation of Body Height From a Single Depth Image via a Four-Stage Developing Network." Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition. 2020. *

Also Published As

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

Similar Documents

Publication Publication Date Title
US20220222837A1 (en) Method for measuring growth height of plant, electronic device, and storage medium
CN110427917B (en) Method and device for detecting key points
WO2019223782A1 (en) Game scene description method and apparatus, device, and storage medium
US10217227B2 (en) Feature trackability ranking, systems and methods
US11928800B2 (en) Image coordinate system transformation method and apparatus, device, and storage medium
US10699431B2 (en) Method and apparatus for generating image generative model
US20130010079A1 (en) Calibration between depth and color sensors for depth cameras
WO2022134418A1 (en) Video recognition method and related device
CN112733820B (en) Obstacle information generation method and device, electronic equipment and computer readable medium
WO2016110012A1 (en) Focus region selection method and apparatus, and computer-readable storage medium
WO2021253186A1 (en) Information processing method and device, and imaging system
US20200272524A1 (en) Method and system for auto-setting of image acquisition and processing modules and of sharing resources in large scale video systems
US11288543B1 (en) Systems and methods for depth refinement using machine learning
WO2020151156A1 (en) Video stream playing method and system, computer apparatus and readable storage medium
WO2019056503A1 (en) Store monitoring evaluation method, device and storage medium
CN111383204A (en) Video image fusion method, fusion device, panoramic monitoring system and storage medium
CN108665541A (en) A kind of ground drawing generating method and device and robot based on laser sensor
US20230186562A1 (en) Method and system for 3d modeling based on volume estimation
TWI759069B (en) Method and device for measuring plant growth height, computer device and medium
US20200043227A1 (en) Optimizing images for three-dimensional model construction
US11954875B2 (en) Method for determining height of plant, electronic device, and storage medium
CN110598785B (en) Training sample image generation method and device
TWI762152B (en) Method and device for determining plant height, computer device and medium
TWI795708B (en) Method and device for determining plant growth height, computer device and medium
US20210150745A1 (en) Image processing method, device, electronic apparatus, and computer readable storage medium