[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN113920138A - An RGB-D camera-based detection device for cow body size and its detection method - Google Patents

An RGB-D camera-based detection device for cow body size and its detection method Download PDF

Info

Publication number
CN113920138A
CN113920138A CN202111211000.2A CN202111211000A CN113920138A CN 113920138 A CN113920138 A CN 113920138A CN 202111211000 A CN202111211000 A CN 202111211000A CN 113920138 A CN113920138 A CN 113920138A
Authority
CN
China
Prior art keywords
cow
rgb
camera
image
point cloud
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111211000.2A
Other languages
Chinese (zh)
Inventor
张红涛
谭联
王宇
张震
闫跃飞
李忠洋
邴丕彬
顾波
刘新宇
翟浩然
张雨鑫
罗一铭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Henan Cow Performance Test Co ltd
North China University of Water Resources and Electric Power
Original Assignee
Henan Cow Performance Test Co ltd
North China University of Water Resources and Electric Power
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 Henan Cow Performance Test Co ltd, North China University of Water Resources and Electric Power filed Critical Henan Cow Performance Test Co ltd
Priority to CN202111211000.2A priority Critical patent/CN113920138A/en
Publication of CN113920138A publication Critical patent/CN113920138A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/213Feature extraction, e.g. by transforming the feature space; Summarisation; Mappings, e.g. subspace methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2411Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/25Fusion techniques
    • G06F18/253Fusion techniques of extracted features
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/12Edge-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/13Edge detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/30Determination of transform parameters for the alignment of images, i.e. image registration
    • G06T7/33Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods
    • G06T7/344Determination of transform parameters for the alignment of images, i.e. image registration using feature-based methods involving models
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10028Range image; Depth image; 3D point clouds
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)

Abstract

本发明公开了一种基于RGB‑D相机的奶牛体尺检测装置及其检测方法,属于畜牧信息化技术领域,包括下述步骤:在实验场地中搭建奶牛图像采集平台,获取目标图像;对RGB图像进行处理,实现奶牛的身份识别;对RGB图像、点云图像进行处理,实现RGB和点云的配准融合;对上述步骤的融合点云图像进行处理,实现奶牛体尺的自动检测。本发明通过构建RGB‑D相机的奶牛图像采集平台,基于图像处理、模式识别实现非接触式的奶牛体尺自动检测。提高了检测的自动化程度,大大缓解了人工检测的工作量,解决了奶牛体尺和身份准确对应的问题。

Figure 202111211000

The invention discloses an RGB-D camera-based dairy cow body size detection device and a detection method thereof, belonging to the technical field of animal husbandry information technology. The image is processed to realize the identification of the cow; the RGB image and the point cloud image are processed to realize the registration and fusion of the RGB and the point cloud; the fusion point cloud image of the above steps is processed to realize the automatic detection of the cow's body size. The present invention realizes non-contact automatic detection of cow body size based on image processing and pattern recognition by constructing a cow image acquisition platform of RGB-D camera. The automation degree of detection is improved, the workload of manual detection is greatly relieved, and the problem of accurate correspondence between cow body size and identity is solved.

Figure 202111211000

Description

Cow body size detection device based on RGB-D camera and detection method thereof
Technical Field
The invention belongs to the technical field of livestock informatization, and particularly relates to a cow body size detection device and method based on an RGB-D camera.
Background
China is a developing agricultural kingdom, and animal husbandry is an important component of modern agriculture and plays an important role in promoting the adjustment of agricultural industry structure and improving the quality of life of urban and rural residents. The dairy cow breeding industry is rapidly developed in recent years, and the traditional free-ranging mode is gradually transited to a large-scale intensive breeding mode. The method mainly depends on manpower to obtain various body size data of the dairy cows in the traditional breeding mode, needs a large amount of time and manpower input, can not meet the development requirement of the modern dairy cow breeding industry far away, and needs to depend on accurate breeding supported by an information technology, so that the automation of dairy cow breeding is the development trend of modern large-scale dairy cow breeding.
The automatic detection of the body size of the dairy cattle is the inevitable development direction of the modern technology of dairy cattle breeding. In the process of breeding the dairy cows, the body size parameters of the dairy cows can reflect the growth and development conditions of the dairy cows and can also reflect various performance indexes of the reproductive capacity, the milk production capacity and the like of the dairy cows.
At present, the method for measuring the body size parameters of the dairy cows comprises contact measurement and non-contact measurement. In the traditional contact measurement, professionals measure the body size characters of the dairy cows by using tools such as tape rulers, measuring sticks, circular touch detectors and the like, and the method has the defects of high workload, time and labor waste and even the situation that the dairy cows attack people; in addition, the measurement result is greatly deviated due to the difference of the measurement experience of workers. The non-contact measurement usually mainly uses a common monocular camera to detect the body size of the cow, the measurement method is limited by external illumination, environment and cow pose, the curved surface data of the body shape of the cow are not easy to obtain, and the measurable body size indexes are few.
In recent years, with the rapid development of computers, electronic industries and stereoscopic vision technologies, the body size of the dairy cows is detected based on the stereoscopic vision technology in non-contact measurement, and compared with manual detection, the measuring method has higher efficiency, can avoid the influence of subjective factors in the measuring process, and can avoid the stress reaction of the dairy cows. In the non-contact body size measurement of the milk cow, the situations of the dropping of an ear tag of the milk cow, the swinging of the head of the milk cow and the like often occur, so that the defects of failure in identity identification, inaccurate identification and the like of the milk cow are caused. With the rapid development of computer vision technology, the related scholars propose an automatic cow identification mode based on an image algorithm, but the identification accuracy is still at a low level.
Disclosure of Invention
The invention aims to provide a cow body size detection device and a detection method based on an RGB-D camera.
In order to achieve the purpose, the invention provides the following technical scheme:
a milk cow body chi detection device based on RGB-D camera:
the system comprises a cow channel, an RGB-D camera, an infrared sensor and a computer;
the milk cow channel is composed of a left cross rod fence and a right cross rod fence, and only one milk cow is allowed to pass through the milk cow channel once;
the RGB-D camera is arranged on one side of the cow channel and is formed by combining a 3D camera and an RGB camera, and is connected with a computer to upload the acquired point cloud image and the RGB image to the computer;
the infrared sensor is arranged on an upper cross bar fence of the cow channel, is connected with computer equipment and is used for judging whether the cow is in the best shooting position or not and sending an image acquisition signal;
the computer identifies the identity of the cow by using the black-white pattern characteristics of the cow for the received RGB image, and performs fusion processing analysis on the point cloud image and the RGB image according to the body type and color characteristics of the cow for the received point cloud image so as to realize non-contact cow body size detection.
Preferably, the positive direction of the x axis of the coordinate system imaged by the 3D camera is horizontally towards the right, the positive direction of the y axis is vertically downwards, and the positive direction of the z axis is vertically backwards.
A cow body size detection method based on an RGB-D camera comprises the following steps:
A. the method comprises the following steps of constructing a cow image acquisition platform in an experimental field to acquire a target image, and specifically comprising the following steps:
a 1: constructing a cow collecting channel: the cow collecting channel only allows one cow to pass through once; installing an infrared sensor on a cow channel to judge whether the cow is in the best shooting position, and sending an image acquisition instruction when the infrared sensor detects that the cow passes through the channel;
a 2: constructing an image acquisition device: installing an RGB-D camera on the bracket and arranged on one side of the cow channel, and connecting the RGB-D camera to a computer; receiving an image acquisition instruction, acquiring RGB images by using an RGB camera, transmitting the RGB images to computer equipment, acquiring point cloud images by using a 3D camera, and transmitting the point cloud images to the computer equipment;
B. processing the RGB image of the step a2 to realize the identification of the dairy cow;
C. processing the RGB image and the point cloud image of the step a2 to realize registration fusion of the RGB and the point cloud;
D. and C, processing the fused point cloud image obtained in the step C to realize automatic detection of the milk cow body size.
Wherein, the step B specifically comprises the following steps:
b 1: image preprocessing: performing image normalization and filtering preprocessing on the RGB image of the step a 2;
b 2: image segmentation: performing operations such as edge segmentation and region segmentation on the RGB image of the step a2 to extract the abdominal region of the cow;
b 3: image feature extraction: extracting feature data of the RGB image in the step b2 through an intelligent algorithm, performing dimensionality reduction optimization on the feature data, and constructing a feature space for classification and identification of the dairy cow individuals;
b 4: and constructing a relationship model of the extracted cow black-white pattern feature space and the cow individuals through a neural network classifier, a support vector machine classifier or a deep learning technology, and ensuring that the model identification precision is over 95 percent.
Wherein, the characteristic data in the step b3 comprises texture characteristics and color characteristics of black and white patterns of the dairy cows.
Wherein, the step C specifically comprises the following steps:
c 1: calibrating a camera: calibrating the RGB camera and the 3D camera based on OpenCV, and solving parameters and relative positions of the two cameras;
c 2: and (3) registration fusion of images: and c1, converting the coordinate systems of the RGB camera and the 3D camera by using the parameters of the camera in the step c1, and directly projecting the 3D camera point cloud onto the RGB camera.
6. The cow body size detection method based on the RGB-D camera as claimed in claim 3, wherein the step D specifically comprises the following steps:
d 1: image preprocessing: c, removing ground noise, milk cow channels and preprocessing of background environment discrete points from the fused point cloud image in the step C, and extracting parameters of a ground model;
d 2: extracting a point cloud of the dairy cow: extracting color features, depth features and three-dimensional surface normal features of the fused point cloud image obtained in the step d1, removing interferences such as complex background, discrete points and the like in the step d1, and segmenting and extracting the point cloud of the dairy cow;
d 3: extracting the characteristic points of the dairy cows: and d, extracting the characteristic points of the cow body from the point cloud image of the step d2 according to the geometric shape and the color characteristics of the cow body.
d 4: detecting a milk cow body size: through the calculation of the space distance, the automatic detection of the body size of the dairy cow can be realized.
Wherein, the feature points of the cow body extracted in the step d3 are as follows:
2.1: extracting a target area by using a straight-through filtering method: through three-dimensional visualization discovery of the whole cow point cloud, the characteristic points of the cow body are basically located in the shoulder, abdomen, tail and hind limb areas of the cow, and the point cloud data of the four parts are extracted by using a straight-through filtering method;
2.2: extracting characteristic points such as milk cow milkvetch points, body depth upper points, body depth lower points and the like in shoulder, abdomen, tail and hind limb areas of the milk cow point cloud based on color characteristics, depth characteristics and three-dimensional surface normal characteristics; extracting feature points including shoulder end points, abdomen width points, waist corner points, ischial node nodes and hind limb flying nodes of the dairy cows by utilizing a method for searching extreme points based on depth features and morphological features;
2.3: extracting the astragalus membranaceus points, the upper points of body depth and the lower points of body depth in the step 2.2, and constructing a plane equation of the symmetrical plane of the cow body;
2.4: calculating the body ruler parameters of the cow by using a distance equation in space: and D, performing corresponding cow body size detection by calculating the distance in space by using the ground plane equation of the step D, the plane equation of the cow body symmetry plane of the step 2.3 and the characteristic points of the cow body of the step 2.2.
Advantageous effects
The invention provides a cow body ruler detection device and a detection method based on an RGB-D camera, and compared with the prior art, the cow body ruler detection device has the following beneficial effects:
(1) according to the method, the RGB image of the milk cow is acquired by using the visible light camera, the identity of the milk cow is identified through the black-white pattern characteristics of the milk cow, the model identification precision is over 95%, and identity information is provided for the body size detection of the individual milk cow; meanwhile, the problem of failure in milk cow identity identification caused by ear tag falling off, milk cow head swinging and the like is solved.
(2) According to the invention, the high-resolution pixel information acquired by the RGB camera and the point cloud information acquired by the 3D camera are subjected to image fusion, and the individual point cloud data of the dairy cow can be more accurately extracted based on the color characteristics, the depth characteristics and the three-dimensional curved surface normal characteristics of the dairy cow, so that the defects that the RGB camera is easily illuminated, and a moving target and a background color are close to each other, and cannot be detected, and the like, are overcome, and the defects that the 3D camera is low in resolution, high in target edge noise and the like are overcome.
(3) The method utilizes the 3D imaging technology to automatically measure the body size parameters of the dairy cow, solves the problems of large workload, dairy cow aggressors and the like of the traditional method for measuring the body size of the dairy cow by utilizing tools such as a tape, a measuring stick, a circular touch sensor and the like, also protects the normal life habit of the dairy cow, and also solves the defect that the body size index is less in measurement because only single-side image data is obtained by measuring the body size of the dairy cow by a monocular camera.
(4) Compared with the existing milk cow body ruler detection based on the stereoscopic vision technology, the milk cow body ruler automatic detection method based on the three-dimensional vision technology has the advantages that the milk cow body ruler parameters are automatically measured by utilizing the 3D imaging technology, the automatic calculation of a plurality of index parameters of the milk cow body height, the body depth, the waist strength and the like is realized through the fusion of the milk cow RGB and the point cloud images based on the color characteristics, the depth characteristics and the three-dimensional curved surface normal characteristics, and the automatic calculation of a plurality of index parameters of the milk cow body length, the body diagonal length, the shoulder width, the abdomen width, the nojiri angle, the hind limb side view and the like is realized based on the depth characteristics and the morphological characteristics. The invention has more measurement parameters, and a plurality of indexes are measured by adopting fused data of RGB and point cloud images, so that the average relative error of the body size parameters is controlled within 3 percent.
(5) The device is simple and convenient to operate, complete in function, stable and reliable. The method can realize the identification and the body size detection of the milk cow under the non-contact condition, and enable the milk cow identification and the body size information to correspond one to one, thereby improving the automation degree of detection, greatly relieving the workload of manual detection and solving the problem of accurate correspondence of the milk cow body size and the identity.
Drawings
FIG. 1 is a schematic structural diagram of a detecting device according to the present invention.
FIG. 2 is a block diagram of the detection method of the present invention.
FIG. 3 is a schematic diagram of the measuring points of the cow body measuring method.
In fig. 1, 1-infrared sensor, 2-cow tunnel, 3-RGB camera, 4-3D camera, 5-camera support, 6-computer.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
As shown in fig. 1, the present embodiment provides a cow body size detection device based on RGB-D camera:
the system comprises a cow channel 2, an RGB-D camera, an infrared sensor 1 and a computer 6;
the milk cow channel 2 is composed of left and right cross rod fences, and only one milk cow is allowed to pass through the milk cow channel 2 once; the cow channel 2 is composed of left and right cross bar fences, the heights of the upper and lower cross bar fences on one side are 1.2 m and 0.6 m in sequence, and the widths of the cross bar fences on the two sides are 1 m.
The RGB-D camera is fixed on an machine support 5 and is installed on one side of the cow channel 2, the RGB-D camera is formed by combining a 3D camera 4 and an RGB camera 3 and is connected with a computer 6, and the collected point cloud image and the collected RGB image are uploaded to the computer 6; the RGB-D camera is 1 meter higher than the ground and 21.9 meters away from the cow channel; the positive direction of the x axis of the coordinate system imaged by the 3D camera 4 is horizontally rightward, the positive direction of the y axis is vertically downward, the positive direction of the z axis is vertically backward, and the resolution of the 3D camera 4 is 640 multiplied by 480; the resolution size of the RGB camera 3 is 2048 × 1536.
The infrared sensor 1 is arranged on an upper cross bar fence of the cow channel 2, is connected with a computer 6 and is used for judging whether the cow is in the best shooting position or not and sending an image acquisition signal; the infrared sensor 1 is installed at a position 0.75 m to the right from the horizontal direction of the RGB-D camera.
The computer 6 identifies the identity of the cow by using the black and white pattern characteristics of the cow for the received RGB image, and performs fusion processing analysis on the point cloud image and the RGB image according to the body shape and color characteristics of the cow for the received point cloud image so as to realize non-contact cow body size detection.
Corresponding to the cow body size detection device based on the RGB-D camera provided by the embodiment, the invention also provides an embodiment of the cow body size detection method based on the RGB-D camera. FIG. 2 is a block diagram of the detection method of the present invention, including the following steps:
A. the method comprises the following steps of constructing a cow image acquisition platform in an experimental field to acquire a target image, and specifically comprising the following steps:
a 1: constructing a cow collecting channel: the cow collecting channel only allows one cow to pass through once; installing an infrared sensor on a cow channel to judge whether the cow is in the best shooting position, and sending an image acquisition instruction when the infrared sensor detects that the cow passes through the channel;
a 2: constructing an image acquisition device: installing an RGB-D camera on the bracket and arranged on one side of the cow channel, and connecting the RGB-D camera to a computer; receiving an image acquisition instruction, acquiring RGB images by using an RGB camera, transmitting the RGB images to computer equipment, acquiring point cloud images by using a 3D camera, and transmitting the point cloud images to the computer equipment;
B. the RGB image of the step a2 is processed to realize the identification of the dairy cow, and the method comprises the following steps:
b 1: image preprocessing: performing image normalization and filtering preprocessing on the RGB image of the step a 2;
b 2: image segmentation: performing operations such as edge segmentation and region segmentation on the RGB image of the step a2 to extract the abdominal region of the cow;
b 3: image feature extraction: extracting feature data of the RGB image in the step b2 through an intelligent algorithm, performing dimensionality reduction optimization on the feature data, and constructing a feature space for classification and identification of the dairy cow individuals; the characteristic data in the step b3 comprises texture characteristics and color characteristics of black and white patterns of the dairy cows;
b 4: and constructing a relation model of the extracted cow black-white pattern feature space and the cow individual through technologies such as a neural network classifier, a support vector machine classifier or deep learning, and ensuring that the model identification accuracy is over 95 percent.
C. Processing the RGB image and the point cloud image of the step a2 to realize registration fusion of RGB and point cloud, comprising the following steps:
c 1: calibrating a camera: calibrating the RGB camera and the 3D camera based on OpenCV, and solving parameters and relative positions of the two cameras;
c 2: and (3) registration fusion of images: and c1, converting the coordinate systems of the RGB camera and the 3D camera by using the parameters of the camera in the step c1, and directly projecting the 3D camera point cloud onto the RGB camera.
D. And C, processing the fused point cloud image obtained in the step C to realize automatic detection of the milk cow body size. The method specifically comprises the following steps:
d 1: image preprocessing: c, removing ground noise, milk cow channels and preprocessing of background environment discrete points from the fused point cloud image in the step C, and extracting parameters of a ground model;
d 2: extracting a point cloud of the dairy cow: extracting color features, depth features and three-dimensional surface normal features of the fused point cloud image obtained in the step d1, removing interferences such as complex background, discrete points and the like in the step d1, and segmenting and extracting the point cloud of the dairy cow;
d 3: extracting the characteristic points of the dairy cows: and d, extracting the characteristic points of the cow body from the point cloud image of the step d2 according to the geometric shape and the color characteristics of the cow body.
d 4: detecting a milk cow body size: through the calculation of the space distance, the automatic detection of the body size of the dairy cow can be realized.
The feature points of the cow body extracted in the step d3 are as follows:
2.1: extracting a target area by using a straight-through filtering method: through three-dimensional visualization discovery of the whole cow point cloud, the characteristic points of the cow body are basically located in the shoulder, abdomen, tail and hind limb areas of the cow, and the point cloud data of the four parts are extracted by using a straight-through filtering method.
2.1, extracting the target area by adopting a direct filtering method: on the premise of defining the target area, a threshold range is set on a specified space dimension, and data on the dimension is divided into the threshold range and the range which is not in the threshold range, so that whether filtering is performed or not is selected, and the point cloud of the target area can be quickly acquired.
2.2: extracting characteristic points such as milk cow milkvetch points, body depth upper points, body depth lower points and the like in shoulder, abdomen, tail and hind limb areas of the milk cow point cloud based on color characteristics, depth characteristics and three-dimensional surface normal characteristics; and extracting the characteristic points of the shoulder end point, the abdomen width point, the waist angular point, the ischial node, the hind limb flying node and the like of the cow by using a method for searching the extreme point based on the depth characteristic and the morphological characteristic.
Step 2.2, extracting the points of astragalus membranaceus and shoulder: in the step 2.1, the RGB color features of the cow are extracted from the shoulder area of the cow, and the color difference value between adjacent or similar pixel points is calculated. Performing a loop N1 times, and continuously searching the minimum value and color difference point of the point cloud coordinate y (i.e. the point M of Astragalus)1) And N1 is the number of the point clouds in the shoulder area of the cow. On the basis of extracting the astragalus membranaceus point, 5 point clouds are expanded left and right by taking the x coordinate of the astragalus membranaceus point as a reference to perform straight-through filtering to reduce the shoulder area of the cow, and circulation is performed for N2 times to continuously search the minimum value of the point cloud coordinate z (namely the shoulder end point M)2) And N2 is the number of the point clouds in the shoulder area of the reduced cow.
2.2, extracting body depth upper points, body depth lower points and abdomen width points: in the step 2.1, the RGB color features of the cow are extracted from the belly region of the cow, and the color difference between adjacent or similar pixel points is calculated. The circulation is performed for N3 times, and the minimum value, the maximum value and the color difference value point of the point cloud coordinate y are continuously searched ((namely the point M on the body depth)3Body depth point M4) While continuously finding the minimum value of the point cloud coordinate z (i.e. the abdominal end point M)5) And N3 is the number of the point clouds in the abdominal region of the cow.
Step 2.2, extraction of ischial node: in the step 2.1, in the cow tail area extraction, loop N4 times is performed, the highest point column of the tail area is extracted, and two extreme points (namely waist angle point M) of the y coordinate of the highest point column are calculated6Ischial node M7) Wherein N4 is the number of the point clouds in the tail area of the cow.
Step 2.2, extracting hind limb flying nodes: in the area of cow hind limbs extracted in the step 2.1, the circulation is performed for N5 times, and the maximum point cloud coordinate x is continuously searchedValue (i.e. hind limb flying node M)8) And N5 is the number of the point clouds in the hind limb area of the dairy cow.
2.3: and (3) extracting the astragalus membranaceus points, the upper body depth points and the lower body depth points in the step 2.2, and constructing a plane equation of the symmetrical plane of the cow body.
Step 2.3, coordinates of the milkvetch point, the body depth upper point and the body depth lower point are selected to establish a plane equation of the symmetrical plane of the cow body: three point cloud coordinates P1(x1,y1,z1)、P2(x2,y2,z2)、P3(x3,y3,z3) The plane equation of the symmetrical plane of the cow body can be set as follows:
A1(x-x1)+B1(y-y1)+C1(z-z1)=0。
wherein: a. the1=(y3-y1)×(z3-z1)-(z2-z1)×(y3-y1)B1=(x3-x1)×(z2-z1)-(x2-x1)×(z3-z1)
C1=(y3-y1)×(x2-x1)-(x3-x1)×(y2-y1)
The plane equation of the symmetrical plane of the cow body is as follows: a. the1x+B1y+C1z+D10. Wherein D is1=-(A1x1+B1y1+C1z1)。
2.4: calculating the body ruler parameters of the cow by using a distance equation in space: by using the ground plane equation A of said step D1x+B1y+C1z+D1The plane equation A of the symmetrical plane of the cow body in the step 2.3 is 02x+B2y+C2z+D20, the characteristic point of the cow body of step 2.2 is the milkvetch point M1(x1,y1,z1) Shoulder end point M2(x2,y2,z2) Upper point of body depthM3(x3,y3,z3) Body depth point M4(x4,y4,z4) Point of abdominal fate M5(x5,y5,z5) Waist corner point M6(x6,y6,z6) Ischial node M7(x7,y7,z7) Hind limb flying node M8(x8,y8,z8) And carrying out corresponding cow body size detection by calculating the distance in the space.
Cow height W1: the vertical distance from the milkvetch point to the ground,
Figure BDA0003308925520000091
cow body length W2: horizontal distance, W, from the milkvetch point to the ischial node2=|x6-x1|
Oblique length W of milk cow body3: the distance between the shoulder end point of the cow and the ischial node,
Figure BDA0003308925520000092
depth of cow body W4: vertical distance, W, from the top to the bottom of the cow's belly4=|y3-y4|
Cow shoulder width W5: twice the distance from the shoulder point of the cow to the symmetrical plane of the body,
Figure BDA0003308925520000093
cow abdomen width W6: twice the distance from the abdominal end point of the cow to the symmetrical plane of the body,
Figure BDA0003308925520000101
nojirima W of dairy cattle7: dairy cowThe ischial node is twice the distance from the body plane of symmetry,
Figure BDA0003308925520000102
nojiri angle W of milk cow8: the relative height difference between the ischial node and the waist angle of the cow,
Figure BDA0003308925520000103
cow waist strength W9: the degree of curvature of the transverse process of the lumbar vertebrae of the cow is determined by the point M of the lumbar angle of the cow6(x6,y6,z6) And point M on the depth of body3(x3,y3,z3) Ischial node M7(x7,y7,z7) Form a vector
Figure BDA0003308925520000104
Computing vectors
Figure BDA0003308925520000105
Figure BDA0003308925520000106
Angle theta therebetween1
Figure BDA0003308925520000107
Figure BDA0003308925520000108
Figure RE-GDA0003370281700000109
Cow hind limb side view W10: the bending degree of the hind limb flying node of the milk cow is determined by the hind limb flying node M of the milk cow8(x8,y8,z8) For reference, searching 5 field points in the positive direction of the z-axis of the coordinate to form a vector
Figure RE-GDA00033702817000001010
Searching
5 field points in the negative direction of the z-axis to form a vector
Figure RE-GDA00033702817000001011
Calculating the bending degree theta of the hind limb flying node of the cow2
Figure RE-GDA00033702817000001012
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (8)

1.一种基于RGB-D相机的奶牛体尺检测装置,其特征在于:1. a cow body measurement device based on RGB-D camera, is characterized in that: 包括奶牛通道、RGB-D相机、红外传感器和计算机;Includes cow channel, RGB-D camera, IR sensor and computer; 所述奶牛通道由左右两侧横杆围栏构成,所述奶牛通道单次只允许一头奶牛通过;The cow passage is constituted by the left and right side rail fences, and the cow passage allows only one cow to pass through at a time; 所述RGB-D相机安装在所述奶牛通道的一侧,所述RGB-D相机是由3D相机和RGB相机组合构成,并与计算机相连,将采集的点云图像和RGB图像上传计算机;The RGB-D camera is installed on one side of the cow channel, and the RGB-D camera is composed of a combination of a 3D camera and an RGB camera, and is connected to a computer to upload the collected point cloud images and RGB images to the computer; 所述红外传感器安装在所述奶牛通道的上横杆围栏上,与计算机设备相连,用于判断奶牛是否处于最佳拍摄位置,发出采集图像信号;The infrared sensor is installed on the upper rail fence of the cow passage, connected with the computer equipment, and used for judging whether the cow is in the best shooting position, and sending out the acquisition image signal; 所述计算机对接收到的RGB图像,利用奶牛的黑白花纹特征进行奶牛的身份识别,对接收到的点云图像,依据奶牛体型和颜色特征,对点云图像和RGB图像进行融合处理分析实现非接触式的奶牛体尺检测。The computer uses the black and white pattern features of the cows to identify the cows on the received RGB images, and performs fusion processing and analysis on the point cloud images and the RGB images based on the received point cloud images according to the cow's body shape and color characteristics to achieve non-identification. Contact-based cow body measurement. 2.根据权利要求1所述的一种基于RGB-D相机的奶牛体尺检测装置,其特征在于:所述3D相机成像的坐标系统x轴正方向水平向右、y轴正方向竖直向下、z轴正方向垂直向后。2. The RGB-D camera-based dairy cow body size detection device according to claim 1, wherein the coordinate system imaged by the 3D camera has the positive direction of the x-axis horizontally to the right, and the positive direction of the y-axis is vertically to the right. Down, the positive z-axis is vertically backward. 3.一种基于RGB-D相机的奶牛体尺检测方法,其特征在于包括下述步骤:3. a cow body measurement method based on RGB-D camera is characterized in that comprising the following steps: A、在实验场地中搭建奶牛图像采集平台,获取目标图像,具体包括以下步骤:A. Set up a cow image acquisition platform in the experimental site to obtain the target image, which includes the following steps: a1:搭建采集奶牛通道:所述采集奶牛通道单次只允许一头奶牛通过;在奶牛通道上安装红外传感器来判断奶牛是否处于最佳拍摄位置,当红外传感器检测到奶牛通过通道时,发出采集图像指令;a1: Build a cow channel for collecting cows: The cow channel for collecting cows only allows one cow to pass through at a time; an infrared sensor is installed on the cow channel to determine whether the cow is in the best shooting position. When the infrared sensor detects that the cow passes through the channel, the collected image is sent instruction; a2:搭建采集图像设备:将RGB-D相机安装在支架上并设置于奶牛通道的一侧,并将RGB-D相机连接于计算机上;接收到采集图像指令,利用RGB相机获取RGB图像,并将RGB图像传输给计算机设备,利用3D相机进行获取点云图像,并将点云图像传输给计算机设备;a2: Build the image acquisition equipment: install the RGB-D camera on the bracket and set it on one side of the cow channel, and connect the RGB-D camera to the computer; after receiving the image acquisition instruction, use the RGB camera to acquire RGB images, and Transfer the RGB image to the computer device, use the 3D camera to acquire the point cloud image, and transmit the point cloud image to the computer device; B、对所述步骤a2的RGB图像进行处理,实现奶牛的身份识别;B, the RGB image of described step a2 is processed to realize the identification of dairy cows; C、对所述步骤a2的RGB图像、点云图像进行处理,实现RGB和点云的配准融合;C, process the RGB image and point cloud image of the step a2 to realize the registration and fusion of RGB and point cloud; D、对所述步骤C的融合点云图像进行处理,实现奶牛体尺的自动检测。D. Process the fused point cloud image in step C to realize automatic detection of the cow's body size. 4.根据权利要求3所述的一种基于RGB-D相机的奶牛体尺检测方法,其特征在于所述步骤B具体包括以下步骤:4. a kind of cow body measurement method based on RGB-D camera according to claim 3 is characterized in that described step B specifically comprises the following steps: b1:图像预处理:对所述步骤a2的RGB图像进行图像归一化和滤波预处理;b1: image preprocessing: image normalization and filtering preprocessing are performed on the RGB image in step a2; b2:图像分割:对所述步骤a2的RGB图像进行边缘分割、区域分割等操作,提取奶牛腹部区域;b2: Image segmentation: perform edge segmentation, region segmentation and other operations on the RGB image in step a2 to extract the cow abdomen area; b3:图像特征提取:对步骤b2的RGB图像经过智能算法进行特征数据的提取,并对特征数据进行降维优化,构建奶牛个体分类识别的特征空间;b3: Image feature extraction: extract feature data from the RGB image in step b2 through an intelligent algorithm, and perform dimension reduction and optimization on the feature data to construct a feature space for individual classification and identification of dairy cows; b4:通过神经网络分类器、支持向量机分类器或深度学习技术,构建所提取的奶牛黑白花纹特征空间与奶牛个体的关系模型,并保证模型识别精度在95%以上。b4: Through neural network classifier, support vector machine classifier or deep learning technology, construct the relationship model between the extracted black and white pattern feature space of cows and individual cows, and ensure that the recognition accuracy of the model is above 95%. 5.根据权利要求4所述的一种基于RGB-D相机的奶牛体尺检测方法,其特征在于:所述b3步骤中特征数据包括奶牛黑白花纹的纹理特征和颜色特征。5 . The method for detecting the body size of dairy cows based on an RGB-D camera according to claim 4 , wherein the feature data in the step b3 includes texture features and color features of black and white patterns of dairy cows. 6 . 6.根据权利要求3所述的一种基于RGB-D相机的奶牛体尺检测方法,其特征在于所述步骤C具体包括以下步骤:6. a kind of cow body measurement method based on RGB-D camera according to claim 3 is characterized in that described step C specifically comprises the following steps: c1:相机标定:基于OpenCV进行对RGB相机和3D相机的标定,求取两个相机的参数和相对位置;c1: Camera calibration: Based on OpenCV, the RGB camera and the 3D camera are calibrated, and the parameters and relative positions of the two cameras are obtained; c2:图像的配准融合:利用c1步骤相机的参数,进行RGB相机和3D相机坐标系间的转换,可将3D相机点云直接投影到RGB相机上。c2: Image registration and fusion: Using the parameters of the camera in step c1 to convert between the RGB camera and the 3D camera coordinate system, the 3D camera point cloud can be directly projected onto the RGB camera. 7.根据权利要求3所述的一种基于RGB-D相机的奶牛体尺检测方法,其特征在于所述步骤D具体包括以下步骤:7. a kind of cow body measurement method based on RGB-D camera according to claim 3 is characterized in that described step D specifically comprises the following steps: d1:图像预处理:对所述步骤C的融合点云图像去除地面噪声、奶牛通道、背景环境离散点的预处理,并提取出地面模型的参数;d1: Image preprocessing: preprocessing to remove ground noise, cow channels, and discrete points of the background environment from the fusion point cloud image in step C, and extract the parameters of the ground model; d2:提取奶牛点云:对所述步骤d1的融合点云图像提取其颜色特征、深度特征和三维曲面法线特征,去除所述步骤d1的复杂背景、离散点等干扰,并分割提取出奶牛的点云;d2: Extract cow point cloud: extract the color feature, depth feature and three-dimensional surface normal feature of the fusion point cloud image in step d1, remove the interference of complex background and discrete points in step d1, and segment and extract the cow the point cloud; d3:奶牛特征点提取:对所述步骤d2的点云图像,依据奶牛身体几何外形和颜色特征,提取奶牛身体的特征点。d3: Extraction of cow feature points: From the point cloud image in step d2, the feature points of the cow's body are extracted according to the geometric shape and color features of the cow's body. d4:奶牛体尺检测:通过空间距离的计算,可实现奶牛体尺的自动检测。d4: cow body size detection: through the calculation of the spatial distance, the cow body size can be automatically detected. 8.根据权利要求7所述的基于RGB-D相机的奶牛体尺检测方法,其特征在于:所述步骤d3的提取奶牛身体的特征点如下:8. The method for detecting the body size of a cow based on an RGB-D camera according to claim 7, wherein the feature points of the extracted cow body in the step d3 are as follows: 2.1:利用直通滤波方法提取目标区域:通过对整体奶牛点云进行三维可视化发现,奶牛身体的特征点基本位于奶牛的肩部、腹部、尾部、后肢区域,利用直通滤波方法提取这四部分的点云数据;2.1: Extract the target area by using the pass-through filtering method: Through the three-dimensional visualization of the overall cow point cloud, it is found that the feature points of the cow's body are basically located in the cow's shoulder, abdomen, tail, and hindlimb areas, and the straight-through filtering method is used to extract the points of these four parts. cloud data; 2.2:在奶牛点云的肩部、腹部、尾部、后肢区域,基于颜色特征、深度特征和三维曲面法线特征提取奶牛耆甲点、体深上点、体深下点等特征点;基于深度特征、形态特征利用寻找极值点的方法提取特征点,包括奶牛肩端点、腹宽点、腰角点、坐骨结节点和后肢飞节点;2.2: In the shoulder, abdomen, tail, and hindlimb regions of the cow point cloud, feature points such as the senior point, the upper body depth point, and the lower body depth point of the cow are extracted based on the color feature, depth feature and 3D surface normal feature; based on the depth Features and morphological features Extract feature points by using the method of finding extreme points, including cow shoulder point, belly width point, waist point, ischial node node and hind limb fly node; 2.3:提取所述步骤2.2中的耆甲点、体深上点和体深下点,构建奶牛身体对称面的平面方程;2.3: Extract the senior point, the upper body depth point and the lower body depth point in the step 2.2 to construct the plane equation of the cow body symmetry plane; 2.4:利用空间中距离方程进行计算奶牛的体尺参数:通过利用所述步骤D的地面平面方程、所述步骤2.3的奶牛身体对称面的平面方程、所述步骤2.2的奶牛身体的特征点,通过计算空间中的距离来进行相对应的奶牛体尺检测。2.4: Use the distance equation in space to calculate the body size parameters of the cow: by using the ground plane equation of the step D, the plane equation of the symmetry plane of the cow's body in the step 2.3, and the feature points of the cow's body in the step 2.2, The corresponding cow body size detection is performed by calculating the distance in the space.
CN202111211000.2A 2021-10-18 2021-10-18 An RGB-D camera-based detection device for cow body size and its detection method Pending CN113920138A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111211000.2A CN113920138A (en) 2021-10-18 2021-10-18 An RGB-D camera-based detection device for cow body size and its detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111211000.2A CN113920138A (en) 2021-10-18 2021-10-18 An RGB-D camera-based detection device for cow body size and its detection method

Publications (1)

Publication Number Publication Date
CN113920138A true CN113920138A (en) 2022-01-11

Family

ID=79241707

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111211000.2A Pending CN113920138A (en) 2021-10-18 2021-10-18 An RGB-D camera-based detection device for cow body size and its detection method

Country Status (1)

Country Link
CN (1) CN113920138A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972472A (en) * 2022-04-21 2022-08-30 北京福通互联科技集团有限公司 Beef cattle three-dimensional depth image acquisition method based on laser array and monocular camera
CN114966733A (en) * 2022-04-21 2022-08-30 北京福通互联科技集团有限公司 Beef cattle three-dimensional depth image acquisition system based on laser array and monocular camera
CN115294181A (en) * 2022-08-18 2022-11-04 东北农业大学 Cow body shape assessment index measuring method based on two-stage key point positioning
CN119049118A (en) * 2024-07-09 2024-11-29 中国农业科学院北京畜牧兽医研究所 Cow lameness warning method and related equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114972472A (en) * 2022-04-21 2022-08-30 北京福通互联科技集团有限公司 Beef cattle three-dimensional depth image acquisition method based on laser array and monocular camera
CN114966733A (en) * 2022-04-21 2022-08-30 北京福通互联科技集团有限公司 Beef cattle three-dimensional depth image acquisition system based on laser array and monocular camera
CN115294181A (en) * 2022-08-18 2022-11-04 东北农业大学 Cow body shape assessment index measuring method based on two-stage key point positioning
CN119049118A (en) * 2024-07-09 2024-11-29 中国农业科学院北京畜牧兽医研究所 Cow lameness warning method and related equipment

Similar Documents

Publication Publication Date Title
CN113920138A (en) An RGB-D camera-based detection device for cow body size and its detection method
Yu et al. Segmentation and measurement scheme for fish morphological features based on Mask R-CNN
Hao et al. An improved PointNet++ point cloud segmentation model applied to automatic measurement method of pig body size
CN109141248A (en) Pig weight measuring method and system based on image
CN103177261B (en) A kind of milk production of cow automatic metering system based on image recognition technology and image-recognizing method thereof
CN107657639A (en) A kind of method and apparatus of quickly positioning target
CN108961330A (en) The long measuring method of pig body and system based on image
CN108133471B (en) Robot navigation path extraction method and device based on artificial bee colony algorithm
CN113808156B (en) Outdoor cattle body ruler detection method and device
CN113706512B (en) Live pig weight measurement method based on deep learning and depth camera
CN112907546B (en) Non-contact measuring device and method for beef scale
CN114677322B (en) Milk cow body condition automatic scoring method based on attention-guided point cloud feature learning
CN116071517A (en) Multi-dimensional information sensing dairy cow body ruler parameter measurement method and system
CN113180640B (en) A size measuring method and system for livestock breeding
CN104809688B (en) Sheep body body measurement method and system based on affine transformation registration Algorithm
CN103471514B (en) A kind of garlic stage division based on machine vision and simple linear regression analysis
CN115294181B (en) Measuring method of dairy cow size evaluation index based on two-stage key point positioning
CN114972477B (en) Low-cost fish growth monitoring method used in farm
CN115100126A (en) An Intelligent Sensing Method for Plane Displacement Field of Bridge Structure
CN115147736A (en) A full-cycle health detection system for dairy cows based on visual recognition
CN114973321A (en) Feature point selection and measurement method for live pig body ruler vision measurement
CN115330751A (en) A bolt detection and positioning method based on YOLOv5 and Realsense
CN118865451B (en) Automatic measurement method of cattle body size based on key point detection and unilateral depth imaging
CN115439526B (en) Tree breast diameter measurement method based on halcon binocular stereo vision
CN118710656B (en) Animal body shape feature recognition method for livestock breeding management

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination