| The livestock and poultry breeding industry in our country has developed rapidly,but the "welfare" of livestock and poultry has not been guaranteed.The environment of poultry houses has been neglected for a long time.At the same time,the frequent epidemics of livestock and poultry have also impacted the whole industry.If the environment of poultry houses and the health problems of livestock and poultry are not handled well,it will not only cause huge economic losses to farmers,but also be detrimental to our human health.Based on the above problems,this thesis started from two aspects,taking laying hens as an example,put forward the environmental detection methods of hen house and the health detection methods of laying hens.In the aspect of protecting the environment of henhouse,intelligent detection technology is introduced and the environmental monitoring system of henhouse is designed.The machine vision technology was introduced into the health inspection of laying hens.This topic is the innovative application of intelligent inspection and machine vision in agriculture.Specific research work is as follows:(1)Design appropriate environmental detection methods for Henhouses.The environment monitoring system of the chicken house is designed to realize automatic detection and regulation of the environment of the Henhouses.In terms of hardware,the environmental factors affecting the growth of laying hens were investigated and analyzed,and the influence of five environmental parameters,temperature,humidity,carbon dioxide,ammonia and hydrogen sulfide,on each stage of laying hens was learned,so as to determine the direction of detection.Carry out modular design,select the hardware of each module according to the requirements,DHT11 sensor is selected for temperature and humidity detection,MH-Z19 B infrared sensor for carbon dioxide detection,MQ137 semiconductor sensor for ammonia detection,MQ136 semiconductor sensor for hydrogen sulfide detection,STM32f103C8T6 microcontroller for central processing unit,relay,buzzer and display for control module and alarm module OLED screen was selected for display screen,and CH340 chip was selected for asynchronous communication model.After the selection is completed,the corresponding circuit is designed.Filtering and conditioning circuit is added to some modules to increase the stability.The power supply adopts 5V and 3.3V partial voltage power supply.In terms of software,KEIL MDK5 software is used to design the driver of each module,multi-channel data acquisition is used,and Kalman filter is used to filter the data.Develop upper computer software based on LVGL graphics library,build projects and configure macros of widgets,design page management,function interaction and function program code,and finally generate upper computer software in Code Blocks under Windows system.It has realized a variety of functions such as serial communication,data display,threshold setting,control device regulation,data storage and curve drawing.(2)Design an appropriate health detection method for laying hens.First explored a variety of health detection methods,such as infrared non-contact temperature measurement,based on machine vision of the comb color recognition method,but these two methods are their own limitations,not suitable for promotion.After analysis,a health detection method of laying hens’ posture features based on machine vision was proposed,and a background segmentation algorithm based on K-Means clustering and ellipse model was designed,which could accurately segment the target laying hens.Hilditch refinement algorithm and Douglas-Purk algorithm are used to extract and simplify the laying hens’ skeleton,and find the barycenter points.Finally,feature extraction was carried out for laying hens,and the differences of posturing characteristics between healthy and sick hens were analyzed from five feature dimensions including back upright degree,skeleton branch inclination Angle,three appearance features(contour area circumference ratio,elongation and complexity),and these features were used to predict and judge the health of laying hens.(3)The environmental detection method of henhouses and the health detection method of laying hens were verified and analyzed.First,verify the environment detection method of the chicken house,draw PCB board,and make the physical diagram of the system hardware.First,test the hardware and software of the system,and after the test meets the requirements,test the system performance.The test results show that the response time of the system is within 30 seconds,the error of temperature is within 1℃,the error of humidity is within 3%RH,the concentration errors of ammonia and hydrogen sulfide are within 1ppm,and the concentration error of carbon dioxide is within 20 ppm.The relay and buzzer can be started normally and have good stability.In the aspect of verifying the testing method the health of laying hens,five characteristic dimensions of discriminating the health of laying hens were verified by selecting test samples,and it was found that these characteristics were highly distinguishaable to the health of laying hens.Through comparative analysis,Gaussian kernel function was selected in SVM model to test the accuracy of samples.Finally,the accuracy was98.05% in the test set,and the optimal parameters were c=10,γ =0.001.Through verification and analysis,the two methods have achieved good results,suitable for application and promotion. |