Plant growth height determination method, device, electronic equipment and medium
By aligning and denoising the color image and depth image of plants, combined with mobilenet-ssd network and normal distribution algorithm, the problem of inaccurate plant growth height determination in the prior art is solved, and higher measurement accuracy is achieved.
Patent Information
- Application Number
- CN202110036324.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-01-12
AI Technical Summary
Existing methods for determining plant growth height are prone to image damage and noise during image alignment processing, resulting in inaccurate determination of plant growth height.
By receiving a height determination request, the camera device controls to take color images and depth images of the plants, performs image alignment processing, uses the pre-trained mobilenet-ssd network to detect images, determines the depth value of pixel points in the detection box, performs denoising processing, and uses a normal distribution algorithm to determine the mean value and standard deviation to calculate the height of the plants.
Accurate determination of plant growth height is achieved, noise interference during image alignment processing is reduced, and measurement accuracy is improved.
Smart Images

Figure CN114820743B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image analysis technology, and in particular to a method, device, electronic device and medium for determining plant growth height. Background Art
[0002] At present, analyzing the daily growth of plants is helpful to determine the best way to plant, so as to improve the yield and quality of plants, thereby reducing the cost of planting and bringing good news to growers. Since the existing plant growth height determination method is prone to image damage and noise during image alignment processing, which leads to inaccurate determination of plant growth height, how to accurately determine the plant growth height has become an urgent problem to be solved. Summary of the invention
[0003] In view of the above, it is necessary to provide a method, device, electronic device and medium for determining the growth height of a plant, which can accurately determine the growth height of a plant.
[0004] A method for determining plant growth height is applied to an electronic device, wherein the electronic device is connected to a camera device, and the method for determining plant growth height comprises:
[0005] When receiving a height determination request, determining a plant to be detected according to the height determination request;
[0006] 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;
[0007] Aligning the color image with the depth image to obtain an aligned image;
[0008] Using a pre-trained mobilenet-ssd network to detect the color image, and obtain a detection frame with the plant to be detected;
[0009] Determine the depth values of all pixels in the detection frame according to the aligned image;
[0010] Performing denoising on the depth value to obtain a target depth value;
[0011] Determine the mean and standard deviation of the target depth values using a normal distribution algorithm;
[0012] The height of the plant to be detected is determined according to the mean value and the standard deviation.
[0013] According to an optional embodiment of the present application, determining the plant to be detected according to the height determination request includes:
[0014] Get all idle threads from the preset thread connection pool;
[0015] Determine the processing rate of each idle thread, and determine the idle thread with the highest processing rate as the target idle thread;
[0016] Parsing the method body of the height determination request using the target idle thread to obtain all information carried by the height determination request;
[0017] Obtaining a preset tag, and obtaining information corresponding to the preset tag from all the information as a plant identifier;
[0018] The plant to be detected is determined according to the plant identifier.
[0019] According to an optional embodiment of the present application, 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 includes:
[0020] Determine a first position where the plant to be detected is located;
[0021] Controlling the first lens of the camera device to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image;
[0022] The second lens of the camera device is controlled to move to the second position, and the second lens is controlled to shoot to obtain the depth image.
[0023] According to an optional embodiment of the present application, aligning the color image with the depth image to obtain the aligned image includes:
[0024] Obtaining all depth pixels on the depth image;
[0025] Mapping all the depth pixels into a preset depth coordinate system to obtain depth coordinates of all the depth pixels;
[0026] Determine the world coordinates of all the depth pixels according to all the depth coordinates and a preset world coordinate system;
[0027] Determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color pixels at the positions on the color image;
[0028] Each depth pixel is fused with each color pixel to obtain the aligned image.
[0029] According to an optional embodiment of the present application, the method of detecting the color image using a pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected includes:
[0030] Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network;
[0031] Extracting features of the color image using the deep convolution kernel to obtain a feature map;
[0032] The feature map is processed using the point convolution kernel to obtain the detection frame.
[0033] According to an optional embodiment of the present application, performing denoising on the depth value to obtain a target depth value includes:
[0034] Acquire a depth value equal to a preset value from the depth values, and determine the acquired depth value as a zero value;
[0035] The zero value is deleted from the depth value, and the remaining depth value is determined as the target depth value.
[0036] According to an optional embodiment of the present application, determining the height of the plant to be detected according to the mean value and the standard deviation includes:
[0037] Adding the mean value to the standard deviation to obtain a first value;
[0038] Subtracting the mean value from the standard deviation to obtain a second value;
[0039] Calculate the average of the first value and the second value to obtain a target value;
[0040] Determining the camera height of the camera device;
[0041] The camera height is subtracted from the target value to obtain the height of the plant to be detected.
[0042] A plant growth height determination device is operated in an electronic device, the electronic device is connected to a camera device, and the plant growth height determination device comprises:
[0043] a determination unit, configured to determine the plant to be detected according to the height determination request when receiving the height determination request;
[0044] A control unit, used for controlling the camera to shoot the plant to be detected, so as to obtain a color image and a depth image of the plant to be detected;
[0045] A processing unit, configured to align the color image with the depth image to obtain an aligned image;
[0046] A detection unit, used to detect the color image using a pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected;
[0047] The determining unit is further used to determine the depth values of all pixels in the detection frame according to the aligned image;
[0048] The processing unit is further used to perform denoising on the depth value to obtain a target depth value;
[0049] The determining unit is further used to determine the mean value and standard deviation of the target depth value using a normal distribution algorithm;
[0050] The determination unit is further used to determine the height of the plant to be detected according to the average value and the standard deviation.
[0051] According to an optional embodiment of the present application, the determining unit determines the plant to be detected according to the height determination request, including:
[0052] Get all idle threads from the preset thread connection pool;
[0053] Determine the processing rate of each idle thread, and determine the idle thread with the highest processing rate as the target idle thread;
[0054] Parsing the method body of the height determination request using the target idle thread to obtain all information carried by the height determination request;
[0055] Obtaining a preset tag, and obtaining information corresponding to the preset tag from all the information as a plant identifier;
[0056] The plant to be detected is determined according to the plant identifier.
[0057] According to an optional embodiment of the present application, the control unit is specifically used for:
[0058] Determine a first position where the plant to be detected is located;
[0059] Controlling the first lens of the camera device to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image;
[0060] The second lens of the camera device is controlled to move to the second position, and the second lens is controlled to shoot to obtain the depth image.
[0061] According to an optional embodiment of the present application, the processing unit aligns the color image with the depth image to obtain the aligned image, including:
[0062] Obtaining all depth pixels on the depth image;
[0063] Mapping all the depth pixels into a preset depth coordinate system to obtain depth coordinates of all the depth pixels;
[0064] Determine the world coordinates of all the depth pixels according to all the depth coordinates and a preset world coordinate system;
[0065] Determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color pixels at the positions on the color image;
[0066] Each depth pixel is fused with each color pixel to obtain the aligned image.
[0067] According to an optional embodiment of the present application, the detection unit is specifically used for:
[0068] Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network;
[0069] Extracting features of the color image using the deep convolution kernel to obtain a feature map;
[0070] The feature map is processed using the point convolution kernel to obtain the detection frame.
[0071] According to an optional embodiment of the present application, the processing unit performs denoising on the depth value to obtain a target depth value including:
[0072] Acquire a depth value equal to a preset value from the depth values, and determine the acquired depth value as a zero value;
[0073] The zero value is deleted from the depth value, and the remaining depth value is determined as the target depth value.
[0074] According to an optional embodiment of the present application, the determining unit determines the height of the plant to be detected according to the average value and the standard deviation, including:
[0075] Adding the mean value to the standard deviation to obtain a first value;
[0076] Subtracting the mean value from the standard deviation to obtain a second value;
[0077] Calculate the average of the first value and the second value to obtain a target value;
[0078] Determining the camera height of the camera device;
[0079] The camera height is subtracted from the target value to obtain the height of the plant to be detected.
[0080] An electronic device, comprising:
[0081] a memory storing at least one instruction; and
[0082] A processor executes the instructions stored in the memory to implement the method for determining the plant growth height.
[0083] A computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the method for determining the plant growth height.
[0084] It can be seen from the above technical scheme that the present application determines the plant to be detected according to the height determination request, can accurately determine the plant to be detected that needs to be measured in height, and then control the camera device to shoot the plant to be detected, and obtain the color image and depth image of the plant to be detected, which is beneficial to the determination of the plant to be detected. By denoising the depth value, a target depth value that does not contain noise can be obtained, and the interference caused by image damage during image alignment is reduced. Then, the normal distribution algorithm is used to determine the mean value and standard deviation of the target depth value, and the height of the plant to be detected is determined according to the mean value and the standard deviation, which can improve the accuracy of determining the growth height of the plant to be detected. BRIEF DESCRIPTION OF THE DRAWINGS
[0085] Figure 1 This is an application environment diagram of a preferred embodiment of the method for determining plant growth height of the present application.
[0086] Figure 2 It is a flow chart of a preferred embodiment of the method for determining plant growth height of the present application.
[0087] Figure 3 It is a functional module diagram of a preferred embodiment of the plant growth height determination device of the present application.
[0088] Figure 4 It is a schematic diagram of the structure of an electronic device of a preferred embodiment of the present application for implementing the method for determining plant growth height. DETAILED DESCRIPTION
[0089] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application is described in detail below with reference to the accompanying drawings and specific embodiments.
[0090] like Figure 1, which is an application environment diagram of a preferred embodiment of the plant growth height determination method of the present application. The camera device 2 communicates with the electronic device 1, and the camera device 2 includes a first lens 20 and a second lens 21. The first lens 20 can capture color images, and the second lens 21 can capture depth images.
[0091] like Figure 2 FIG. 1 is a flow chart of a preferred embodiment of the method for determining plant growth height of the present invention. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted.
[0092] The method for determining plant growth height is applied to one or more electronic devices 1, and the electronic device 1 is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA), digital signal processors (Digital Signal Processor, DSP), embedded devices, etc.
[0093] The electronic device 1 can be any electronic product that can perform human-computer interaction with a user, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive network television (IPTV), a smart wearable device, etc.
[0094] The electronic device 1 may also include a network device and / or a user device, wherein the network device includes, but is not limited to, a single network server, a server group consisting of multiple network servers, or a cloud consisting of a large number of hosts or network servers based on cloud computing.
[0095] The network where the electronic 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 (VPN), etc.
[0096] In at least one embodiment of the present application, the present application is applied to an electronic device, and the electronic device is connected to a camera device.
[0097] S10, when a height determination request is received, determining a plant to be detected according to the height determination request.
[0098] In at least one embodiment of the present application, the information carried in the height determination request includes: a preset tag, a plant identifier, etc.
[0099] Furthermore, the plant to be detected can be any plant whose daily growth needs to be analyzed, such as rose, sunflower, rice, etc.
[0100] In at least one embodiment of the present application, the electronic device determining the plant to be detected according to the height determination request includes:
[0101] Get all idle threads from the preset thread connection pool;
[0102] Determine the processing rate of each idle thread, and determine the idle thread with the highest processing rate as the target idle thread;
[0103] Parsing the method body of the height determination request using the target idle thread to obtain all information carried by the height determination request;
[0104] Obtaining a preset tag, and obtaining information corresponding to the preset tag from all the information as a plant identifier;
[0105] The plant to be detected is determined according to the plant identifier.
[0106] By means of the mapping relationship between the preset tag and the plant identifier, the plant identifier can be accurately acquired, and further the plant to be detected can be accurately determined.
[0107] S11, controlling the camera device to shoot the plant to be detected to obtain a color image and a depth image of the plant to be detected.
[0108] 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 that uses the distance from the camera device to each point in the scene as a pixel value.
[0109] In at least one embodiment of the present application, the electronic device controls 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:
[0110] Determine a first position where the plant to be detected is located;
[0111] Controlling the first lens of the camera device to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image;
[0112] The second lens of the camera device is controlled to move to the second position, and the second lens is controlled to shoot to obtain the depth image.
[0113] The camera device includes dual lenses, namely the first lens and the second lens. The camera device can be installed just above the detected plant for easy photographing.
[0114] Through the above implementation, a color image and a depth image containing the plant to be detected can be quickly acquired.
[0115] S12: align the color image with the depth image to obtain an aligned image.
[0116] 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.
[0117] In at least one embodiment of the present application, the electronic device aligns the color image with the depth image to obtain the aligned image, including:
[0118] Obtaining all depth pixels on the depth image;
[0119] Mapping all the depth pixels into a preset depth coordinate system to obtain depth coordinates of all the depth pixels;
[0120] Determine the world coordinates of all the depth pixels according to all the depth coordinates and a preset world coordinate system;
[0121] Determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color pixels at the positions on the color image;
[0122] Each depth pixel is fused with each color pixel to obtain the aligned image.
[0123] Among them, 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 the user according to the application scenario, and this application does not impose any restrictions on this.
[0124] Through the above implementation, an aligned image containing a depth value can be generated, so as to subsequently determine the height of the plant to be detected.
[0125] S13, using a pre-trained mobilenet-ssd network to detect the color image, and obtain a detection frame with the plant to be detected.
[0126] In at least one embodiment of the present application, the detection frame is obtained by performing feature extraction on the color image using a convolution kernel in the mobilenet-ssd network.
[0127] In at least one embodiment of the present application, the electronic device detects the color image using a pre-trained mobilenet-ssd network, and obtaining a detection frame with the plant to be detected includes:
[0128] Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network;
[0129] Extracting features of the color image using the deep convolution kernel to obtain a feature map;
[0130] The feature map is processed using the point convolution kernel to obtain the detection frame.
[0131] Among them, the depth convolution kernel can be a 16*16*128 matrix, and further, the point convolution kernel can be a 1*1*16 matrix.
[0132] The detection frame can be quickly detected through the pre-trained mobilenet-ssd network, thereby improving the detection efficiency.
[0133] S14, determining depth values of all pixels in the detection frame according to the aligned image.
[0134] In at least one embodiment of the present application, the depth value refers to the height of a feature point on the plant to be detected corresponding to a pixel from a camera device.
[0135] In at least one embodiment of the present application, the electronic device determining the depth values of all pixels in the detection frame according to the aligned image includes:
[0136] The electronic device determines a target position of each pixel point on the aligned image. Further, the electronic device obtains a depth value at the target position from the aligned image as a depth value of each pixel point.
[0137] The depth values of all the pixels can be determined accurately and quickly through the aligned image.
[0138] S15, performing denoising processing on the depth value to obtain a target depth value.
[0139] In at least one embodiment of the present application, the electronic device performs denoising on the depth value to obtain a target depth value, including:
[0140] Acquire a depth value equal to a preset value from the depth values, and determine the acquired depth value as a zero value;
[0141] The zero value is deleted from the depth value, and the remaining depth value is determined as the target depth value.
[0142] By performing denoising on the depth value to obtain a target depth value, it is possible to ensure that the target depth value does not contain interference information, thereby accurately determining the growth height of the plant to be detected.
[0143] S16, using a normal distribution algorithm to determine the mean value and standard deviation of the target depth value.
[0144] In at least one embodiment of the present application, the electronic device performs normal distribution processing on the target depth value to obtain a normal distribution curve. Further, the electronic device determines the mean value and the standard deviation from the normal distribution curve.
[0145] S17, determining the height of the plant to be detected according to the average value and the standard deviation.
[0146] In at least one embodiment of the present application, the electronic device determines the height of the plant to be detected according to the average value and the standard deviation, including:
[0147] Adding the mean value to the standard deviation to obtain a first value;
[0148] Subtracting the mean value from the standard deviation to obtain a second value;
[0149] Calculate the average of the first value and the second value to obtain a target value;
[0150] Determining the camera height of the camera device;
[0151] The camera height is subtracted from the target value to obtain the height of the plant to be detected.
[0152] Through the above implementation, the height of the plant to be detected can be accurately determined.
[0153] In at least one embodiment of the present application, the method for determining plant growth height further comprises:
[0154] When the height is less than a preset height, the electronic device generates an alarm message according to the height. Further, the electronic device encrypts the alarm message using a symmetric encryption algorithm to obtain a ciphertext. Further, the electronic device determines an alarm level of the ciphertext according to the plant to be detected. The electronic device determines an alarm mode according to the alarm level. Further, the electronic device sends the ciphertext in the alarm mode.
[0155] Among them, the preset height can be set according to the expected growth rate of the plant to be detected, and the present application does not limit the value of the preset height.
[0156] Furthermore, the alarm levels include: level one, level two, etc.
[0157] Furthermore, the alarm method includes: an alarm sound from a speaker, an email, a telephone call, etc.
[0158] Through the above implementation, an alarm message can be issued when the height is less than the preset height. In addition, by encrypting the alarm message, it is possible to prevent the alarm message from being tampered with, thereby improving the security of the alarm message. At the same time, the alarm mode is determined according to the alarm level, and the alarm message can be sent in an appropriate alarm mode, making the sending of the alarm message more humane.
[0159] It can be seen from the above technical scheme that the present application determines the plant to be detected according to the height determination request, can accurately determine the plant to be detected that needs to be measured in height, and then control the camera device to shoot the plant to be detected, and obtain the color image and depth image of the plant to be detected, which is beneficial to the determination of the plant to be detected. By denoising the depth value, a target depth value that does not contain noise can be obtained, and the interference caused by image damage during image alignment is reduced. Then, the normal distribution algorithm is used to determine the mean value and standard deviation of the target depth value, and the height of the plant to be detected is determined according to the mean value and the standard deviation, which can improve the accuracy of determining the growth height of the plant to be detected.
[0160] like Figure 3 , which is a functional module diagram of a preferred embodiment of the plant growth height determination device of the present application. The plant growth height determination device 11 includes a determination unit 110, a control unit 111, a processing unit 112, a detection unit 113, a generation unit 114, an encryption unit 115 and a sending unit 116. The module / unit referred to in the present application refers to a series of computer program segments that can be executed by the processor 13 and can complete fixed functions, which are stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in subsequent embodiments.
[0161] In at least one embodiment of the present application, the present application is run in an electronic device, and the electronic device is connected to a camera device.
[0162] When receiving the height determination request, the determination unit 110 determines the plant to be detected according to the height determination request.
[0163] In at least one embodiment of the present application, the information carried in the height determination request includes: a preset tag, a plant identifier, etc.
[0164] Furthermore, the plant to be detected can be any plant whose daily growth needs to be analyzed, such as rose, sunflower, rice, etc.
[0165] In at least one embodiment of the present application, the determining unit 110 determines the plant to be detected according to the height determination request, including:
[0166] Get all idle threads from the preset thread connection pool;
[0167] Determine the processing rate of each idle thread, and determine the idle thread with the highest processing rate as the target idle thread;
[0168] Parsing the method body of the height determination request using the target idle thread to obtain all information carried by the height determination request;
[0169] Obtaining a preset tag, and obtaining information corresponding to the preset tag from all the information as a plant identifier;
[0170] The plant to be detected is determined according to the plant identifier.
[0171] By means of the mapping relationship between the preset tag and the plant identifier, the plant identifier can be accurately acquired, and further the plant to be detected can be accurately determined.
[0172] The control unit 111 controls the camera to shoot the plant to be detected, so as to obtain a color image and a depth image of the plant to be detected.
[0173] 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 that uses the distance from the camera device to each point in the scene as a pixel value.
[0174] In at least one embodiment of the present application, the control unit 111 controls the camera to shoot the plant to be detected, and obtaining the color image and depth image of the plant to be detected includes:
[0175] Determine a first position where the plant to be detected is located;
[0176] Controlling the first lens of the camera device to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image;
[0177] The second lens of the camera device is controlled to move to the second position, and the second lens is controlled to shoot to obtain the depth image.
[0178] The camera device includes dual lenses, namely the first lens and the second lens. The camera device can be installed just above the detected plant for easy photographing.
[0179] Through the above implementation, a color image and a depth image containing the plant to be detected can be quickly acquired.
[0180] The processing unit 112 performs alignment processing on the color image and the depth image to obtain an aligned image.
[0181] 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.
[0182] In at least one embodiment of the present application, the processing unit 112 performs alignment processing on the color image and the depth image to obtain the aligned image, including:
[0183] Obtaining all depth pixels on the depth image;
[0184] Mapping all the depth pixels into a preset depth coordinate system to obtain depth coordinates of all the depth pixels;
[0185] Determine the world coordinates of all the depth pixels according to all the depth coordinates and a preset world coordinate system;
[0186] Determine the positions of all the depth pixels on the color image according to all the world coordinates, and determine the color pixels at the positions on the color image;
[0187] Each depth pixel is fused with each color pixel to obtain the aligned image.
[0188] Among them, 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 the user according to the application scenario, and this application does not impose any restrictions on this.
[0189] Through the above implementation, an aligned image containing a depth value can be generated, so as to subsequently determine the height of the plant to be detected.
[0190] The detection unit 113 detects the color image using a pre-trained MobileNet-SSD network to obtain a detection frame with the plant to be detected.
[0191] In at least one embodiment of the present application, the detection frame is obtained by performing feature extraction on the color image using a convolution kernel in the mobilenet-ssd network.
[0192] In at least one embodiment of the present application, the detection unit 113 detects the color image using a pre-trained mobilenet-ssd network, and obtaining a detection frame with the plant to be detected includes:
[0193] Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network;
[0194] Extracting features of the color image using the deep convolution kernel to obtain a feature map;
[0195] The feature map is processed using the point convolution kernel to obtain the detection frame.
[0196] Among them, the depth convolution kernel can be a 16*16*128 matrix, and further, the point convolution kernel can be a 1*1*16 matrix.
[0197] The detection frame can be quickly detected through the pre-trained mobilenet-ssd network, thereby improving the detection efficiency.
[0198] The determining unit 110 determines the depth values of all pixels in the detection frame according to the aligned image.
[0199] In at least one embodiment of the present application, the depth value refers to the height of a feature point on the plant to be detected corresponding to a pixel from a camera device.
[0200] In at least one embodiment of the present application, the determining unit 110 determines the depth values of all pixels in the detection frame according to the aligned image, including:
[0201] The determining unit 110 determines a target position of each pixel point on the aligned image. Further, the determining unit 110 obtains a depth value at the target position from the aligned image as a depth value of each pixel point.
[0202] The depth values of all the pixels can be determined accurately and quickly through the aligned image.
[0203] The processing unit 112 performs denoising on the depth value to obtain a target depth value.
[0204] In at least one embodiment of the present application, the processing unit 112 performs denoising on the depth value to obtain a target depth value including:
[0205] Acquire a depth value equal to a preset value from the depth values, and determine the acquired depth value as a zero value;
[0206] The zero value is deleted from the depth value, and the remaining depth value is determined as the target depth value.
[0207] By performing denoising on the depth value to obtain a target depth value, it is possible to ensure that the target depth value does not contain interference information, thereby accurately determining the growth height of the plant to be detected.
[0208] The determination unit 110 determines the mean value and the standard deviation of the target depth values using a normal distribution algorithm.
[0209] In at least one embodiment of the present application, the determination unit 110 performs normal distribution processing on the target depth value to obtain a normal distribution curve. Further, the determination unit 110 determines the mean value and the standard deviation from the normal distribution curve.
[0210] The determining unit 110 determines the height of the plant to be detected according to the average value and the standard deviation.
[0211] In at least one embodiment of the present application, the determining unit 110 determines the height of the plant to be detected according to the average value and the standard deviation, including:
[0212] Adding the mean value to the standard deviation to obtain a first value;
[0213] Subtracting the mean value from the standard deviation to obtain a second value;
[0214] Calculate the average of the first value and the second value to obtain a target value;
[0215] Determining the camera height of the camera device;
[0216] The camera height is subtracted from the target value to obtain the height of the plant to be detected.
[0217] Through the above implementation, the height of the plant to be detected can be accurately determined.
[0218] In at least one embodiment of the present application, when the height is less than a preset height, the generation unit 114 generates an alarm message according to the height. Furthermore, the encryption unit 115 encrypts the alarm message using a symmetric encryption algorithm to obtain a ciphertext. Furthermore, the determination unit 110 determines an alarm level of the ciphertext according to the plant to be detected. The determination unit 110 determines an alarm mode according to the alarm level. Furthermore, the sending unit 116 sends the ciphertext in the alarm mode.
[0219] Among them, the preset height can be set according to the expected growth rate of the plant to be detected, and the present application does not limit the value of the preset height.
[0220] Furthermore, the alarm levels include: level one, level two, etc.
[0221] Furthermore, the alarm method includes: an alarm sound from a speaker, an email, a telephone call, etc.
[0222] Through the above implementation, an alarm message can be issued when the height is less than the preset height. In addition, by encrypting the alarm message, it is possible to prevent the alarm message from being tampered with, thereby improving the security of the alarm message. At the same time, the alarm mode is determined according to the alarm level, and the alarm message can be sent in an appropriate alarm mode, making the sending of the alarm message more humane.
[0223] It can be seen from the above technical scheme that the present application determines the plant to be detected according to the height determination request, can accurately determine the plant to be detected that needs to be measured in height, and then control the camera device to shoot the plant to be detected, and obtain the color image and depth image of the plant to be detected, which is beneficial to the determination of the plant to be detected. By denoising the depth value, a target depth value that does not contain noise can be obtained, and the interference caused by image damage during image alignment is reduced. Then, the normal distribution algorithm is used to determine the mean value and standard deviation of the target depth value, and the height of the plant to be detected is determined according to the mean value and the standard deviation, which can improve the accuracy of determining the growth height of the plant to be detected.
[0224] like Figure 4 , which is a schematic diagram of the structure of an electronic device of a preferred embodiment of the present application for implementing the method for determining plant growth height.
[0225] In one embodiment of the present application, the electronic device 1 includes, but is not limited to, a memory 12, a processor 13, and a computer program stored in the memory 12 and executable on the processor 13, such as a plant growth height determination program.
[0226] Those skilled in the art will understand that the schematic diagram is merely an example of the electronic device 1 and does not constitute a limitation on the electronic device 1. The electronic device 1 may include more or fewer components than shown in the diagram, or a combination of certain components, or different components. For example, the electronic device 1 may also include input and output devices, network access devices, buses, etc.
[0227] The processor 13 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (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 any conventional processor, etc. The processor 13 is the computing core and control center of the electronic device 1, and uses various interfaces and lines to connect various parts of the entire electronic device 1, and executes the operating system of the electronic device 1 and various installed applications, program codes, etc.
[0228] The processor 13 executes the operating system of the electronic device 1 and various installed applications. The processor 13 executes the applications to implement the steps in the above-mentioned various plant growth height determination method embodiments, for example Figure 2 Steps shown.
[0229] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program may be divided into a determination unit 110, a control unit 111, a processing unit 112, a detection unit 113, a generation unit 114, an encryption unit 115, and a sending unit 116.
[0230] The memory 12 can be used to store the computer program and / or module, and the processor 13 realizes various functions of the electronic device 1 by running or executing the computer program and / or module stored in the memory 12, and calling the data stored in the memory 12. The memory 12 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the electronic device, etc. In addition, the memory 12 can include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other non-volatile solid-state storage devices.
[0231] The memory 12 may be an external memory and / or an internal memory of the electronic device 1. Furthermore, the memory 12 may be a memory in a physical form, such as a memory stick, a TF card (Trans-flash Card), and the like.
[0232] If the module / unit integrated in the electronic device 1 is implemented in the form of a software functional unit and sold or used as an independent product, it 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 above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of each of the above-mentioned method embodiments can be implemented.
[0233] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM).
[0234] Combination Figure 2 The memory 12 in the electronic device 1 stores a plurality of instructions to implement a method for determining a plant growth height, and the processor 13 can execute the plurality of instructions to implement:
[0235] When receiving a height determination request, determining a plant to be detected according to the height determination request;
[0236] 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;
[0237] Aligning the color image with the depth image to obtain an aligned image;
[0238] Using a pre-trained mobilenet-ssd network to detect the color image, and obtain a detection frame with the plant to be detected;
[0239] Determine the depth values of all pixels in the detection frame according to the aligned image;
[0240] Performing denoising on the depth value to obtain a target depth value;
[0241] Determine the mean and standard deviation of the target depth values using a normal distribution algorithm;
[0242] The height of the plant to be detected is determined according to the mean value and the standard deviation.
[0243] Specifically, the specific implementation method of the processor 13 for the above instructions can refer to Figure 2 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0244] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative, for example, the division of the modules is only a logical function division, and there may be other division methods in actual implementation.
[0245] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, they may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment.
[0246] In addition, each functional module in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional modules.
[0247] Therefore, no matter from which point of view, the embodiments should be regarded as illustrative and non-restrictive, and the scope of the present application is limited by the appended claims rather than the above description, so it is intended that all changes falling within the meaning and scope of the equivalent elements of the claims are included in the present application. Any attached figure mark in the claims should not be regarded as limiting the claims involved.
[0248] In addition, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices stated in this application can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, and do not indicate any particular order.
[0249] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present application and are not intended to limit it. Although the present application has been described in detail with reference to the preferred embodiments, a person of ordinary skill in the art should understand that the technical solution of the present application may be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present application.
Claims
1. A method for determining plant growth height, applied to an electronic device, wherein the electronic device is connected to a camera device, characterized in that: The method for determining plant growth height comprises: When receiving a height determination request, determining a plant to be detected according to the height determination request; 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; Aligning the color image with the depth image to obtain an aligned image; Using a pre-trained mobilenet-ssd network to detect the color image, and obtain a detection frame with the plant to be detected; Determine the depth values of all pixels in the detection frame according to the aligned image; Performing denoising on the depth value to obtain a target depth value; Determine the mean and standard deviation of the target depth values using a normal distribution algorithm; The height of the plant to be detected is determined according to the mean value and the standard deviation.
2. The method for determining plant growth height according to claim 1, characterized in that: Determining the plant to be detected according to the height determination request comprises: Get all idle threads from the preset thread connection pool; Determine the processing rate of each idle thread, and determine the idle thread with the highest processing rate as the target idle thread; Parsing the method body of the height determination request using the target idle thread to obtain all information carried by the height determination request; Obtaining a preset tag, and obtaining information corresponding to the preset tag from all the information as a plant identifier; The plant to be detected is determined according to the plant identifier.
3. The method for determining plant growth height according to claim 1, characterized in that: The step of 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 includes: Determine a first position where the plant to be detected is located; Controlling the first lens of the camera device to move to a second position corresponding to the first position, and controlling the first lens to shoot to obtain the color image; The second lens of the camera device is controlled to move to the second position, and the second lens is controlled to shoot to obtain the depth image.
4. The method for determining plant growth height according to claim 1, wherein: The aligning the color image with the depth image to obtain an aligned image comprises: Obtaining all depth pixels on the depth image; Mapping all the depth pixels into a preset depth coordinate system to obtain depth coordinates of all the depth pixels; Determine the world coordinates of all the depth pixels according to all the depth coordinates and a 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 color pixels at the positions on the color image; Each depth pixel is fused with each color pixel to obtain the aligned image.
5. The method for determining plant growth height according to claim 1, wherein: The method of detecting the color image using a pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected includes: Obtain the depth convolution kernel and the point convolution kernel in the mobilenet-ssd network; Extracting features of the color image using the deep convolution kernel to obtain a feature map; The feature map is processed using the point convolution kernel to obtain the detection frame.
6. The method for determining plant growth height according to claim 1, wherein: The performing denoising on the depth value to obtain a target depth value comprises: Acquire a depth value equal to a preset value from the depth values, and determine the acquired depth value as a zero value; The zero value is deleted from the depth value, and the remaining depth value is determined as the target depth value.
7. The method for determining plant growth height according to claim 1, wherein: Determining the height of the plant to be detected according to the mean value and the standard deviation includes: Adding the mean value to the standard deviation to obtain a first value; Subtracting the mean value from the standard deviation to obtain a second value; Calculate the average of the first value and the second value to obtain a target value; Determining the camera height of the camera device; The camera height is subtracted from the target value to obtain the height of the plant to be detected.
8. A device for determining plant growth height, running in an electronic device, the electronic device being connected to a camera device, characterized in that: The plant growth height determination device comprises: a determination unit, configured to determine the plant to be detected according to the height determination request when receiving the height determination request; A control unit, used for controlling the camera to shoot the plant to be detected, so as to obtain a color image and a depth image of the plant to be detected; A processing unit, configured to align the color image with the depth image to obtain an aligned image; A detection unit, used to detect the color image using a pre-trained mobilenet-ssd network to obtain a detection frame with the plant to be detected; The determining unit is further used to determine the depth values of all pixels in the detection frame according to the aligned image; The processing unit is further used to perform denoising on the depth value to obtain a target depth value; The determining unit is further used to determine the mean value and standard deviation of the target depth value using a normal distribution algorithm; The determination unit is further used to determine the height of the plant to be detected according to the average value and the standard deviation.
9. An electronic device, characterized in that: The electronic device comprises: a memory storing at least one instruction; and A processor executes instructions stored in the memory to implement the method for determining the plant growth height as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the method for determining the plant growth height as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Track type modern standardized orchard information perception system based on depth camera
CN107748886A
Suspension type high-throughput greenhouse plant phenotypic measuring system based on multi-perspective RGB-D fusion technology
CN109556511A