WO2020006899A1 - 牲畜体重测量方法及装置 - Google Patents

牲畜体重测量方法及装置 Download PDF

Info

Publication number
WO2020006899A1
WO2020006899A1 PCT/CN2018/108289 CN2018108289W WO2020006899A1 WO 2020006899 A1 WO2020006899 A1 WO 2020006899A1 CN 2018108289 W CN2018108289 W CN 2018108289W WO 2020006899 A1 WO2020006899 A1 WO 2020006899A1
Authority
WO
WIPO (PCT)
Prior art keywords
livestock
image data
picture
view angle
area
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.)
Ceased
Application number
PCT/CN2018/108289
Other languages
English (en)
French (fr)
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.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020006899A1 publication Critical patent/WO2020006899A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01GWEIGHING
    • G01G17/00Apparatus for or methods of weighing material of special form or property
    • G01G17/08Apparatus for or methods of weighing material of special form or property for weighing livestock

Definitions

  • the present application relates to the field of animal husbandry, and in particular, to a method and device for measuring livestock weight.
  • an object of the present application is to provide a method and a device for measuring livestock weight.
  • a method for measuring livestock weight includes: acquiring image data, which is generated by shooting the livestock at different angles; performing image segmentation on the image data of the livestock to obtain a segmented picture; and according to the Pixels representing the animal in the divided picture calculate the projection area of the animal at different shooting angles; input the projection area of the animal at different shooting angles into a weight measurement function to perform weight measurement of the animal.
  • a livestock weight measurement device includes: a data receiving module for acquiring image data, where the image data is generated by shooting the livestock at different angles; and an image segmentation module for The image data is subjected to image segmentation to obtain a segmented picture; an area calculation module is configured to calculate a projection area of the livestock at different shooting angles according to the pixels representing the livestock in the segmented picture; a weight measurement module is used to convert the livestock A weight measurement function is input at projection areas at different shooting angles to perform weight measurement of the livestock.
  • a livestock weight measurement device in another aspect, includes a processor and a memory, and the memory stores computer-readable instructions, and the computer-readable instructions implement the livestock weight measurement method as described above when executed by the processor. .
  • a computer-readable storage medium having stored thereon a computer program that, when executed by a processor, implements a method for measuring livestock weight as described above.
  • the image data generated by shooting livestock at different angles is used to perform image segmentation to obtain a segmented picture, so as to calculate the projection area of the livestock at different shooting angles based on the pixels representing the livestock in the segmented picture, and further
  • the projected area of different shooting angles is input into the weight measurement function to measure the weight of the livestock, avoiding manual measurement or manual estimation of the weight of the livestock, thereby solving the problems of low efficiency and accuracy of the weight measurement of livestock in the prior art.
  • FIG. 1 is a schematic diagram of an implementation environment according to the present application.
  • Fig. 2 is a block diagram showing a hardware structure of a server according to an exemplary embodiment.
  • Fig. 3 is a flow chart showing a method for measuring livestock weight according to an exemplary embodiment.
  • FIG. 4 is a flowchart of step 330 in an embodiment corresponding to FIG. 3.
  • FIG. 5 is a schematic diagram of photographing a livestock according to a bird's-eye view according to the present application.
  • FIG. 6 is a schematic diagram of photographing livestock according to a side view angle involved in the present application.
  • FIG. 7 is a schematic diagram of segmenting a picture according to a top view angle according to the present application.
  • FIG. 8 is a schematic diagram of segmenting a picture corresponding to a side view angle according to the present application.
  • Fig. 9 is a flow chart showing another method for measuring body weight of a livestock according to an exemplary embodiment.
  • FIG. 10 is a flowchart of step 330 in the embodiment corresponding to FIG. 3 in another embodiment.
  • FIG. 11 is a flowchart of an embodiment of step 350 in the embodiment corresponding to FIG. 3.
  • Fig. 12 is a block diagram of a livestock weight measurement device according to an exemplary embodiment.
  • Fig. 13 is a block diagram of a hardware structure of a livestock weight measurement device according to an exemplary embodiment.
  • FIG. 1 is a schematic diagram of an implementation environment involved in a method for measuring livestock weight.
  • the implementation environment includes livestock 110, a collection device 130 for shooting livestock 110 at different angles, and a server 150 for weight measurement of livestock.
  • the acquisition device 130 may be an independent camera device, for example, an electronic device with an image data acquisition function, such as a video camera or a video recorder, or an electronic device with a camera, such as a smartphone, a tablet, or a notebook computer. It is not limited.
  • the collecting device 130 is arranged around the livestock 110 according to the angle actually required for photographing the livestock 110, for example, it is arranged on the top of the livestock 110 to photograph the livestock 110 from a top-down angle, or it is arranged on the side of the livestock 110 To photograph the livestock 110 from a side view angle, or to arrange the front end of the livestock 110 to photograph the livestock 110 from a front view angle.
  • a wireless or wired network connection is established in advance between the acquisition device 130 and the server 150, and data transmission between the acquisition device 130 and the server 150 is achieved through the network connection.
  • the data is image data generated by shooting animals from different angles. .
  • the server 150 can obtain image data, and then use this image data to automatically measure the weight of the livestock, thereby avoiding manual measurement or manual estimation of the weight of the livestock. It is simple, convenient, and effective. It has improved the efficiency of livestock weight measurement, and fully guaranteed the accuracy of livestock weight measurement.
  • Fig. 2 is a block diagram showing a hardware structure of a server according to an exemplary embodiment.
  • the server with this hardware structure can be used to measure the weight of livestock and is deployed in the implementation environment shown in FIG. 1.
  • server is only an example adapted to the present application and cannot be considered as providing any limitation on the scope of use of the present application. This server also cannot be interpreted as needing to rely on or having to have one or more components in the exemplary server 200 shown in FIG. 2.
  • the server 200 includes: a power supply 210, an interface 230, at least one memory 250, and at least one central processing unit (CPU, Central). Processing Units) 270.
  • the power supply 210 is used to provide working voltages for each hardware device on the server 200.
  • the interface 230 includes at least one wired or wireless network interface 231, at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc., for communicating with external devices.
  • the memory 250 serves as a carrier for resource storage, and may be a read-only memory, a random access memory, a magnetic disk, or an optical disk.
  • the resources stored on the memory 250 include an operating system 251, an application program 253, and data 255.
  • the storage method may be temporary storage or permanent storage.
  • the operating system 251 is used to manage and control various hardware devices and application programs 253 on the server 200 to implement the calculation and processing of the massive data 255 by the central processing unit 270. It can be Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM , FreeBSDTM, etc.
  • the application program 253 is a computer program that completes at least one specific task based on the operating system 251. It may include at least one module (not shown in FIG. 2), and each module may respectively contain a series of computers for the server 200. Readable instructions.
  • the data 255 may be photos, pictures, and the like stored on the disk.
  • the central processing unit 270 may include one or more processors, and is configured to communicate with the memory 250 through a bus, for calculating and processing the massive data 255 in the memory 250.
  • the server 200 to which the present application is applied will complete the livestock weight measurement method in the form of a series of computer-readable instructions stored in the memory 250 by the central processing unit 270.
  • the present application can also be implemented by a hardware circuit or a hardware circuit in combination with software. Therefore, the implementation of the present application is not limited to any specific hardware circuit, software, or a combination of the two.
  • a method for measuring livestock weight is applicable to a server in the implementation environment shown in FIG. 1, and the structure of the server may be shown in FIG. 2.
  • This kind of livestock weight measurement method can be executed by a server and can include the following steps:
  • Step 310 Acquire image data.
  • the image data is generated by photographing livestock at different angles.
  • the image data can be sourced from the real-time image data collected by the acquisition device, or it can be image data stored in advance in the server.
  • the server can process the image data in real time, or store the image data in advance for processing. For example, processing is performed when the server has fewer processing tasks, or processing is performed at a time specified by the operator.
  • the acquired image data may be the image data currently collected by the acquisition device, or the image data stored in the server in advance, that is, acquired by the acquisition device by fetching a historical time.
  • the image data is not limited here.
  • the image data acquired by the server is collected by the acquisition device. It can either be the acquisition device actively uploading the acquired image data, or it can be in response to the image data initiated by the server to the acquisition device. Get the request, and upload the collected image data to the server, which is not limited here.
  • the collection equipment can be arranged around the livestock, for example, at the top, side, front, etc. of the livestock.
  • the image data is an image taken according to the angle set by the collection equipment.
  • This image can be a livestock from a bird's-eye view. It can also be a livestock with a side view angle, or a livestock with a front view angle, which is not limited here.
  • the angles set by the collecting device are the top and sides of the livestock, and correspondingly, shooting the animals at different angles means that the shooting angle is a top view angle and a side view angle.
  • the acquired image data includes image data corresponding to a top view angle and image data corresponding to a side view angle.
  • the image data includes moving image data and still image data.
  • the moving image data refers to a moving image including a plurality of frames, such as a video.
  • the still image data may be a still image including a frame image, such as a picture.
  • the livestock weight measurement of the execution candidate in this embodiment may be performed based on videos of multiple frames of images, or may be performed based on pictures of single frames of images.
  • the image data is a video of multiple frames or a picture of a single frame image
  • the image data is used to perform subsequent livestock weight measurement in units of frames.
  • Step 330 Perform image segmentation on the image data of the livestock to obtain a segmented picture.
  • Image segmentation is to divide the picture represented by the image data into the area where the animal is located and the area where the background is located. This area where the background is located refers to the area that does not include the animal. It can also be understood that image segmentation essentially assigns pixels in the same area to the same gray value, so that pixels in different areas have different gray values, thereby separating the livestock in the picture represented by the image data from the background .
  • a segmented picture refers to a picture composed of the area where the animal is located and the area where the background is located, that is, the gray value of the pixel in the area where the animal is located is different from the gray value of the pixel in the area where the background is located.
  • the surroundings of the livestock dwelling and the ground are pre-painted with colors different from the body color of the livestock, so that the animals in the picture represented by the image data can be contrasted with the background.
  • the empty pens and the ground are pre-painted with green. Then, the pigs and the background in the pictures are contrasted in color, that is, white and green, which is helpful to separate the pigs from the background in the picture.
  • the image segmentation may be a binarization process, that is, the gray value of the pixels in the picture represented by the image data is set to 0 (black) or 255 (white), so that the segmented picture appears black and white. Effect, the final separation of livestock from the background.
  • step 330 may include the following steps:
  • step 331 the image data generated by photographing the livestock from a bird's-eye view is binarized to obtain a segmented picture corresponding to the bird's-eye view.
  • step 333 the image data generated by photographing the livestock from the side view angle is subjected to binarization processing to obtain a segmented picture corresponding to the side view angle.
  • a segmented picture corresponding to the bird's-eye view angle can be obtained through a binarization process, as shown in FIG. 7.
  • a segmented picture corresponding to the side view angle can be obtained through a binarization process, as shown in FIG. 8.
  • Step 350 Calculate the projection area of the animal at different shooting angles according to the pixels representing the animal in the segmented picture.
  • weight volume ⁇ density.
  • mass per unit volume is the same density. Then, the effect of density on the weight of the same type of livestock can be ignored. In fact, there is a close relationship with the volume of livestock, that is, the larger the volume of the livestock, the heavier the weight of the livestock.
  • the volume of the animal In order to perform subsequent animal weight measurement, the volume of the animal needs to be known.
  • the volume of the animal is represented by the projection area of the animal at different shooting angles.
  • the projected area of the animal at the top angle the length of the animal ⁇ the width of the animal
  • the projected area of the animal at the side angle the length of the animal ⁇ the height
  • the volume of the livestock is represented by a projection area of the livestock at a top view angle and a side view angle.
  • the segmented pictures corresponding to different shooting angles essentially refer to the area areas of the animals in the divided pictures corresponding to the different shooting angles.
  • a picture is usually expressed as a pixel, that is, a picture is composed of thousands of pixels, and the color of the picture is formed by the color represented by the gray value of the pixel.
  • the projected area of the livestock at different shooting angles that is, the area area of the area where the livestock is located in the divided pictures corresponding to the different shooting angles, can be calculated from the pixels representing the animals in the corresponding pictures.
  • the acquired image data is not limited to a single frame, corresponding to multi-frame image data, there are also multiple frames of segmented pictures corresponding to different shooting angles, and the calculated projection area of livestock at different shooting angles is bound to be necessary. There are multiple.
  • the acquisition equipment may have a single point of failure, or that the image data collected by the acquisition equipment has a sharpness problem, which may cause the image segmentation to be incorrect, which may cause the calculated projection area of livestock at different shooting angles to be unqualified .
  • the animals shot at different shooting angles may not be complete individuals, so the calculated projection areas of the animals at different shooting angles cannot fully reflect the volume of the animals, that is, unqualified.
  • the projection area of livestock at different shooting angles is also screened, and the projection area that does not reach the specified threshold is discarded, that is, the unqualified projection area is discarded, so that only the qualified projection area can be executed. Subsequent livestock weight measurement.
  • the specified threshold can be flexibly set according to the actual application scenario. For example, in application scenarios that require high accuracy in measuring the weight of livestock, set a larger specified threshold to make the projection area of the animal at different shooting angles Maximize as much as possible.
  • step 370 the projection areas of the livestock at different shooting angles are input into a weight measurement function to measure the weight of the livestock.
  • the weight measurement function is used to calculate the weight of the animal according to the projection area of the animal at different shooting angles. That is, for the weight measurement function, the projection area of the animal at different shooting angles is input, and the weight of the animal is output.
  • the weight measurement function is expressed as the following calculation formula (1):
  • a 'and b' are optimal fitting parameters
  • x1 represents the projected area of the livestock at the top view angle
  • x2 represents the projected area of the livestock at the side view angle
  • y represents the weight of the livestock.
  • the weight of the livestock can be calculated according to the calculation formula (1).
  • this construction process may include the following steps:
  • Step 410 Obtain sample image data carrying a weight tag.
  • the sample image data is generated by photographing livestock samples from different angles, and the weight label indicates the actual weight of the livestock sample.
  • Step 430 Fit the unknown fitting parameters in the linear regression equation according to the sample image data to obtain the optimal fitting parameters.
  • Step 450 Input the optimal fitting parameters instead of the unknown fitting parameters into a linear regression equation to obtain a weight measurement function.
  • the weight measurement function is substantially obtained by fitting an unknown fitting parameter in a linear regression equation.
  • a and b are unknown fitting parameters
  • m1 represents the projected area of the livestock sample at the top angle
  • m2 represents the projected area of the livestock at the side angle
  • n represents the actual weight of the livestock sample.
  • the fitting is to use the actual weight n of a large number of livestock samples and the projection areas m1 and m2 of the corresponding livestock samples at the top and side angles to continuously adjust the unknown fitting parameters a and b to make the unknown
  • the fitting parameters a and b gradually converge to the optimal fitting parameters a 'and b'.
  • the curve represented by the linear regression equation is realized, and the projection area of the livestock sample at the top and side angles and the corresponding livestock sample A collection of curves made up of actual weight.
  • the optimal fitting parameters a 'and b' can be substituted into the unknown formulas a and b and input into the calculation formula (2) to form the calculation formula (1 ) To get the weight measurement function.
  • fitting is a process of solving unknown fitting parameters based on the known projected area and weight of livestock samples
  • measurement is a process of solving animal weights based on known optimal fitting parameters and the projected area of livestock.
  • the actual weight of the livestock sample may be manually measured or manually estimated, which is not limited herein.
  • the calculation process of the projection area of the livestock sample at the top angle and the side view angle is basically the same as the calculation process of the projection area of the animal at the top angle and side view angle in the foregoing embodiment, and it will not be described in detail here.
  • step 330 the method described above may further include the following steps:
  • the filter is called to denoise the image data so that the image segmentation is based on the denoised image data.
  • the image data will be uploaded to the server by the acquisition device. It can be understood that during the transmission of image data, there must be interference from other signals, for example, other signals are noise.
  • a filter is called for denoising processing, so as to ensure the accuracy of subsequent image segmentation.
  • This filter is built into the server, including but not limited to: mean filter, median filter, bilateral filter, single-sided filter, Gaussian filter, and so on.
  • the image data is prevented from being distorted by noise, thereby avoiding the error of subsequent image segmentation, and thereby fully ensuring the accuracy of subsequent weight measurement of livestock.
  • step 330 may include the following steps:
  • step 332 outline the livestock in the picture represented by the image data generated at different shooting angles to obtain the outline of the livestock in the picture.
  • the binarization process essentially sets the gray value of the pixels in the picture represented by the image data to 0 (black) or 255 (white), so that the segmented picture shows a clear black and white effect, which is finally completed. Livestock isolated from background.
  • the picture represented by the image data needs to be first divided into a region where the livestock is located and a region where the background is located, thereby facilitating subsequent subsequent gray value conversion of pixels in different regions.
  • the area division is implemented by contour positioning, that is, the area inside the outline is the area where the livestock is located, and the area outside the outline is the area where the background is located.
  • contour positioning that is, the area inside the outline is the area where the livestock is located, and the area outside the outline is the area where the background is located.
  • the outline is the dividing line between the livestock and the background in the segmented picture.
  • the outline of the livestock in the picture can be obtained.
  • the image segmentation function is the findContours function.
  • This findContours function can be called by the server through the operation of the openCV application.
  • the image segmentation functions called by the server are correspondingly different, which is not limited in this embodiment.
  • the outline of the livestock in the picture needs to fully reflect the volume of the livestock, that is, this outline can also be understood as the largest outline of the livestock in the picture, for example, the largest outline when viewed from an angle, as shown in Figure 7. As shown in Figure 8, the maximum profile at the side view angle is sufficient to ensure the accuracy of livestock weight measurement.
  • step 334 the picture is divided into a region where the animal is located and a region where the background is located according to the contour of the animal in the picture.
  • Step 336 traverse the pixels in the picture, convert the grayscale values of the pixels located in the area where the livestock is located to the first specified grayscale value, and convert the grayscale values of pixels located in the area where the background is located to the second specified grayscale value.
  • pixels in the picture are arranged in a matrix, that is, pixels are first arranged in columns in the first row, then pixels are arranged in columns in the second row, and so on, until the last row is arranged in columns.
  • the traversal of pixels in a picture means that the pixels in the picture are scanned sequentially in rows and columns.
  • the gray value of the pixel is converted into the first specified gray value.
  • the first specified gray value is 255; if the pixel is located in the area where the background is located, the gray value of the pixel is converted into a second specified gray value.
  • the second specified gray value is 0.
  • the first specified gray value and the second specified gray value can be flexibly set according to the actual application scenario, as long as the gray value of the pixel in the area where the livestock is located is different from the gray value of the pixel in the area where the background is located.
  • the degree value is sufficient, and this embodiment is not limited thereto.
  • step 338 the traversal of pixels in the picture is to be completed to form segmented pictures corresponding to different shooting angles.
  • the shooting angle may also be a bottom-up angle, a rear-view angle, a front-view angle, etc., and is not limited to a top-view angle and a side-view angle, which is not limited in this embodiment.
  • segmented pictures corresponding to different shooting angles include segmented pictures corresponding to a top view angle and segmented pictures corresponding to a side view angle.
  • step 350 may include the following steps:
  • Step 351 Count the number of pixels whose gray value is the first specified gray value for the divided picture corresponding to the top view angle and the divided picture corresponding to the side view angle to obtain the total number of pixels corresponding to the top view angle and pixels corresponding to the side view angle. total.
  • step 353 the total number of pixels corresponding to the top view angle is used as the projected area of the livestock in the top view angle, and the total number of pixels corresponding to the side view angle is used as the projected area of the livestock in the side view angle.
  • the description is still shown in Figs. 7 and 8.
  • the white area that is, the number of pixels with a gray value of 255 in the area where the animal is located
  • the total number of pixels in the area where the animal is located is used to represent the area where the livestock is area.
  • the black area that is, the number of pixels with a gray value of 0 in the area where the background is located is counted to obtain the total number of pixels in the area where the background is located, thereby representing the area area of the area where the background is located.
  • the area area is essentially the projection area of the livestock for different shooting angles.
  • the projection area of the livestock at the corresponding shooting angle can be obtained, and then the weight of the livestock can be obtained by inputting it into the weight measurement function.
  • the following is a device embodiment of the present application, which can be used to implement a method for measuring the weight of livestock involved in the present application.
  • a device embodiment of the present application can be used to implement a method for measuring the weight of livestock involved in the present application.
  • the method embodiment of the livestock weight measurement method involved in the present application please refer to the method embodiment of the livestock weight measurement method involved in the present application.
  • a livestock weight measurement device 900 includes, but is not limited to, a data receiving module 910, an image segmentation module 930, an area calculation module 950, and a weight measurement module 970.
  • the data receiving module 910 is used to obtain image data, and the image data is generated by photographing livestock at different angles.
  • the image segmentation module 930 is configured to perform image segmentation on the image data of the livestock to obtain a segmented picture.
  • the area calculation module 950 is configured to calculate a projection area of the livestock at different shooting angles according to the pixels representing the livestock in the segmented picture.
  • the weight measurement module 970 is used to input the projection areas of the livestock at different shooting angles into a weight measurement function to measure the weight of the livestock.
  • a livestock weight measurement device 1000 includes a processor 1001 and a memory 1002, and further includes at least one communication bus 1003.
  • the memory 1002 stores computer-readable instructions, and the processor 1001 reads the computer-readable instructions from the memory 1002 through at least one communication bus 1003.
  • a computer-readable storage medium stores a computer program thereon, and the computer program, when executed by a processor, implements the livestock weight measurement methods in the above embodiments.
  • the livestock weight measurement device provided in the foregoing embodiment only uses the division of the foregoing functional modules as an example when performing livestock weight measurement processing.
  • the above functions may be allocated by different functions according to needs.
  • the function module is completed, that is, the internal structure of the livestock weight measurement device will be divided into different function modules to complete all or part of the functions described above.
  • livestock weight measurement device and the livestock weight measurement method provided by the foregoing embodiments belong to the same concept.
  • the specific manner in which each module performs operations has been described in detail in the method embodiment, and is not repeated here.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Image Processing (AREA)
  • Image Analysis (AREA)

Abstract

一种牲畜体重测量方法,包括:获取图像数据,图像数据是对牲畜进行不同角度拍摄生成的(310);对牲畜的图像数据进行图像分割,得到分割图片(330);根据分割图片中表示牲畜的像素计算牲畜在不同拍摄角度的投影面积(350);将牲畜在不同拍摄角度的投影面积输入体重测量函数进行牲畜的体重测量(370)。该牲畜体重测量方法解决了牲畜体重测量的效率和准确率不高的问题。还公开了一种牲畜体重测量装置。

Description

牲畜体重测量方法及装置 技术领域
 本申请要求2018年7月6日递交、申请名称为“牲畜体重测量方法及装置”的中国专利申请201810735603.4的优先权,在此通过引用将其全部内容合并于此。
本申请涉及畜牧业领域,尤其涉及一种牲畜体重测量方法及装置。
背景技术
在畜牧业领域,为了能够及时地掌握牲畜的体重变化和成长情况,通常是采取人工测量或者人工估算牲畜体重的方法,然而,在上述测量过程中,发明人意识到:该方法不仅效率低下,准确率不高,而且人工测量还容易对牲畜产生物理伤害。
技术问题
为此,如何提高牲畜体重测量的效率和准确率仍有待解决。
技术解决方案
为了解决上述技术问题,本申请的一个目的在于提供一种牲畜体重测量方法及装置。
其中,本申请所采用的技术方案为:
一方面,一种牲畜体重测量方法,包括:获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;对所述牲畜的图像数据进行图像分割,得到分割图片;根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
另一方面,一种牲畜体重测量装置,包括:数据接收模块,用于获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;图像分割模块,用于对所述牲畜的图像数据进行图像分割,得到分割图片;面积计算模块,用于根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;体重测量模块,用于将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
另一方面,一种牲畜体重测量装置,包括处理器及存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时实现如上所述的牲畜体重测量方法。
另一方面,一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的牲畜体重测量方法。
有益效果
在上述技术方案中,利用对牲畜进行不同角度拍摄所生成的图像数据进行图像分割,得到分割图片,以根据此分割图片中表示牲畜的像素计算牲畜在不同拍摄角度的投影面积,进而将牲畜在不同拍摄角度的投影面积输入体重测量函数进行牲畜的体重测量,避免人工测量或者人工估算牲畜的体重,从而解决了现有技术中牲畜体重测量的效率和准确率不高的问题。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并于说明书一起用于解释本申请的原理。
图1是根据本申请所涉及的实施环境的示意图。
图2是根据一示例性实施例示出的一种服务器的硬件结构框图。
图3是根据一示例性实施例示出的一种牲畜体重测量方法的流程图。
图4是图3对应实施例中步骤330在一个实施例的流程图。
图5是根据本申请所涉及的俯视角度拍摄牲畜的示意图。
图6是根据本申请所涉及的侧视角度拍摄牲畜的示意图。
图7是根据本申请所涉及的俯视角度对应分割图片的示意图。
图8是根据本申请所涉及的侧视角度对应分割图片的示意图。
图9是根据一示例性实施例示出的另一种牲畜体重测量方法的流程图。
图10是图3对应实施例中步骤330在另一个实施例的流程图。
图11是图3对应实施例中步骤350在一个实施例的流程图。
图12是根据一示例性实施例示出的一种牲畜体重测量装置的框图。
图13是根据一示例性实施例示出的一种牲畜体重测量装置的硬件结构框图。
通过上述附图,已示出本申请明确的实施例,后文中将有更详细的描述,这些附图和文字描述并不是为了通过任何方式限制本申请构思的范围,而是通过参考特定实施例为本领域技术人员说明本申请的概念。
本发明的实施方式
这里将详细地对示例性实施例执行说明,其示例表示在附图中。下面的描述涉及附图时,除非另有表示,不同附图中的相同数字表示相同或相似的要素。以下示例性实施例中所描述的实施方式并不代表与本申请相一致的所有实施方式。相反,它们仅是与如所附权利要求书中所详述的、本申请的一些方面相一致的装置和方法的例子。
图1为一种牲畜体重测量方法所涉及的实施环境的示意图。该实施环境包括牲畜110、对牲畜110进行不同角度拍摄的采集设备130、以及对牲畜进行体重测量的服务器150。
其中,采集设备130可以是独立的摄像设备,例如,摄像机、录像机等具有图像数据采集功能的电子设备,还可以是携带摄像头的电子设备,例如,智能手机、平板电脑、笔记本电脑等,在此并不进行限定。
进一步地,采集设备130针对拍摄牲畜110实际所需的角度而布设在牲畜110的四周,例如,布设于牲畜110的顶端,以对牲畜110进行俯视角度的拍摄,或者,布设于牲畜110的侧面,以对牲畜110进行侧视角度的拍摄,又或者,布设于牲畜110的前端,以对牲畜110进行正视角度的拍摄。
采集设备130与服务器150之间预先建立了无线或者有线的网络连接,进而通过网络连接实现采集设备130与服务器150之间的数据传输,例如,数据是对牲畜进行不同角度拍摄所生成的图像数据。
基于服务器150与采集设备130之间的交互,服务器150便可获取到图像数据,进而利用此图像数据自动进行牲畜的体重测量,由此避免人工测量或者人工估算牲畜的体重,简单便捷,不仅有效地提高了牲畜体重测量的效率,而且充分地保证了牲畜体重测量的准确率。
图2是根据一示例性实施例示出的一种服务器的硬件结构框图。具有此硬件结构的服务器可用于测量牲畜的体重而部署在图1所示的实施环境中。
需要说明的是,该服务器只是一个适配于本申请的示例,不能认为是提供了对本申请的使用范围的任何限制。该服务器也不能解释为需要依赖于或者必须具有图2中示出的示例性的服务器200中的一个或者多个组件。
该服务器的硬件结构可因配置或者性能的不同而产生较大的差异,如图2所示,服务器200包括:电源210、接口230、至少一存储器250、以及至少一中央处理器(CPU, Central Processing Units)270。
其中,电源210用于为服务器200上的各硬件设备提供工作电压。
接口230包括至少一有线或无线网络接口231、至少一串并转换接口233、至少一输入输出接口235以及至少一USB接口237等,用于与外部设备通信。
存储器250作为资源存储的载体,可以是只读存储器、随机存储器、磁盘或者光盘等,其上所存储的资源包括操作系统251、应用程序253及数据255等,存储方式可以是短暂存储或者永久存储。其中,操作系统251用于管理与控制服务器200上的各硬件设备以及应用程序253,以实现中央处理器270对海量数据255的计算与处理,其可以是Windows ServerTM、Mac OS XTM、UnixTM、LinuxTM、FreeBSDTM等。应用程序253是基于操作系统251之上完成至少一项特定工作的计算机程序,其可以包括至少一模块(图2中未示出),每个模块都可以分别包含有对服务器200的一系列计算机可读指令。数据255可以是存储于磁盘中的照片、图片等。
中央处理器270可以包括一个或多个以上的处理器,并设置为通过总线与存储器250通信,用于运算与处理存储器250中的海量数据255。
如上面所详细描述的,适用本申请的服务器200将通过中央处理器270读取存储器250中存储的一系列计算机可读指令的形式来完成牲畜体重测量方法。
此外,通过硬件电路或者硬件电路结合软件也能同样实现本申请,因此,实现本申请并不限于任何特定硬件电路、软件以及两者的组合。
请参阅图3,在一示例性实施例中,一种牲畜体重测量方法适用于图1所示实施环境的服务器,该服务器的结构可以如图2所示。
该种牲畜体重测量方法可以由服务器执行,可以包括以下步骤:
步骤310,获取图像数据。
其中,图像数据是对牲畜进行不同角度拍摄生成的。
图像数据可以来源于采集设备实时采集的图像数据,也可以是服务器中预先存储的图像数据。也就是说,采集设备采集到图像数据之后,服务器可以对该图像数据进行实时处理,也可以预先存储了再处理。例如,在服务器处理任务较少的时候进行处理,或者,在操作人员的指定时间进行处理。
由此,对于服务器而言,所获取到的图像数据,可以是采集设备当前采集到的图像数据,也可以是服务器中预先存储的图像数据,即通过调取一历史时间的由采集设备采集到的图像数据,在此不进行限定。
而就采集设备来说,服务器所获取到的图像数据均是由采集设备采集的,既可以是采集设备主动将采集到的图像数据上传,也可以是响应于服务器向采集设备所发起的图像数据获取请求,而将采集到的图像数据上传至服务器,在此也不加以限定。
采集设备可以布设于牲畜的四周,例如,布设于牲畜的顶端、侧面、前端等,相应地,图像数据则是按照采集设备所布设的角度而拍摄生成的图像,此图像可以是俯视角度的牲畜,也可以是侧视角度的牲畜,或者是正视角度的牲畜,在此也不加以限定。
在一实施例的具体实现中,采集设备所布设的角度是牲畜的顶端和侧面,相应地,对牲畜进行不同角度的拍摄,即是指拍摄角度为俯视角度和侧视角度,由此,所获取的图像数据包括俯视角度对应的图像数据和侧视角度对应的图像数据。
进一步地,图像数据包括动态图像数据和静态图像数据。动态图像数据是指视频等包括多帧图像的动态图像,相对于动态图像数据,静态图像数据则可以是图片等包含一帧图像的静态图像。基于此,本实施例中执行候选的牲畜体重测量可以是基于多帧图像的视频进行,也可以基于单帧图像的图片进行。
应当说明的是,无论图像数据是多帧图像的视频,还是单帧图像的图片,图像数据均是以帧为单位执行后续的牲畜体重测量。
那么,所获取图像数据越多,则帧数越多,以此充分地保证后续牲畜体重测量的精准度。
步骤330,对牲畜的图像数据进行图像分割,得到分割图片。
图像分割,是为了将图像数据所表示图片划分成牲畜所在区域和背景所在区域,此背景所在区域即是指不包含牲畜的区域。也可以理解为,图像分割实质上是将同一区域中的像素赋予相同的灰度值,以使不同区域中的像素具有不同的灰度值,进而使得图像数据所表示图片中的牲畜与背景分离。
由此,分割图片,指的是由牲畜所在区域和背景所在区域构成的图片,即牲畜所在区域中像素的灰度值区别于背景所在区域中像素的灰度值。
在此补充说明的是,为了方便于图像分割,牲畜居所的四周以及地面均预先涂上了区别于牲畜自身体色的颜色,以使图像数据所表示图片中的牲畜与背景能够形成颜色对比。
例如,空栏猪圈以及地面被预先涂上绿色,那么,所拍摄图片中猪与背景则形成了颜色对比,即白色与绿色,进而有利于分离图片中的猪与背景。
在一实施例的具体实现中,图像分割可以是二值化处理,即将图像数据所表示图片中像素的灰度值设置为0(黑色)或者255(白色),进而使得分割图片呈现出黑白分明的效果,最终完成牲畜与背景的分离。
具体地,假设拍摄角度包括俯视角度和侧视角度,如图4所示,步骤330可以包括以下步骤:
步骤331,由俯视角度拍摄牲畜生成的图像数据经二值化处理,得到俯视角度对应的分割图片。
步骤333,由侧视角度拍摄牲畜生成的图像数据经二值化处理,得到侧视角度对应的分割图片。
仍以牲畜为猪举例说明,如图5所示,针对俯视角度拍摄的猪,通过二值化处理,即可得到俯视角度对应的分割图片,如图7所示。
如图6所示,针对侧视角度拍摄的猪,通过二值化处理,即可得到侧视角度对应的分割图片,如图8所示。
步骤350,根据分割图片中表示牲畜的像素计算牲畜在不同拍摄角度的投影面积。
应当理解,体重=体积×密度,对于相同环境中生长的同一种类牲畜而言,单位体积的质量即密度相同,那么,可以忽略密度对此同一种类牲畜的体重的影响,此同一种类牲畜的体重实质上与牲畜的体积存在着密切的关系,即牲畜的体积越大,则牲畜的体重越重。
为了执行后续的牲畜体重测量,需要获知牲畜的体积,本实施例中,牲畜的体积由牲畜在不同拍摄角度的投影面积进行表示。
也就是说,对于牲畜在俯视角度的投影面积=牲畜的长×宽,对于牲畜在侧视角度的投影面积=牲畜的长×高,或者,对于牲畜在正视角度的投影面积=牲畜的宽×高,即可相应地表示牲畜的体积=牲畜的长×宽×高。
在一实施例的具体实现中,通过牲畜在俯视角度、侧视角度的投影面积表示牲畜的体积。
进一步地,由于牲畜在不同拍摄角度的投影面积,对于不同拍摄角度所对应的分割图片而言,实质上指的是不同拍摄角度对应分割图片中牲畜所在区域的区域面积。
可以理解,图片通常被表示为像素,即通过成千上万个像素组成图片,并以像素灰度值所代表的颜色形成图片所具有的色彩。
由此,本实施例中,牲畜在不同拍摄角度的投影面积,即不同拍摄角度所对应分割图片中牲畜所在区域的区域面积,可由相应图片中表示牲畜的像素计算得到。
更进一步地,由于所获取图像数据不仅限于单帧,则对应于多帧图像数据,不同拍摄角度所对应的分割图片也存在多帧,由此计算得到的牲畜在不同拍摄角度的投影面积也势必存在多个。
那么,考虑采集设备可能出现单点故障,或者,采集设备所采集的图像数据存在清晰度的问题,均有可能造成图像分割有误,进而导致所计算的牲畜在不同拍摄角度的投影面积不合格。
此外,由于牲畜的移动性,不同拍摄角度所拍摄的牲畜可能并非完整个体,则所计算的牲畜在不同拍摄角度的投影面积不能完全体现牲畜的体积,即不合格。
为此,本实施例中,还将对牲畜在不同拍摄角度的投影面积进行筛选,舍弃未达到指定阈值的投影面积,即丢弃不合格的投影面积,进而使得仅有合格的投影面积才能够执行后续的牲畜体重测量。
当然,指定阈值可以根据实际应用场景进行灵活地设定,例如,在对牲畜体重的测量精度要求较高的应用场景中,设定较大的指定阈值,以使牲畜在不同拍摄角度的投影面积尽可能最大化。
通过如此设置,进一步地提高了牲畜体重测量的准确率。
步骤370,将牲畜在不同拍摄角度的投影面积输入体重测量函数进行牲畜的体重测量。
体重测量函数,用于根据牲畜在不同拍摄角度的投影面积计算牲畜的体重,即对于体重测量函数而言,牲畜在不同拍摄角度的投影面积为输入,而牲畜的体重则为输出。
具体地,假设拍摄角度包括俯视角度和侧视角度,则体重测量函数被表示为如下计算公式(1):
  
Figure 906682dest_path_image001
其中,a’、b’为最优拟合参数,x1表示牲畜在俯视角度的投影面积,x2表示牲畜在侧视角度的投影面积,y表示牲畜的体重。
由此,在得到牲畜在俯视角度、侧视角度的投影面积之后,即可按照计算公式(1),计算得到牲畜的体重。
进一步地,如前所述,如果存在牲畜在俯视角度、侧视角度的多个投影面积,则势必能够计算得到牲畜的多个体重。
为此,本实施例中,针对牲畜的多个体重,将对牲畜的多个体重进行平均运算,并以运算得到的平均值作为牲畜最终的体重,进而充分地保证了牲畜体重测量的准确率。
在此对体重测量函数的构建过程加以说明如下。
在一实施例的具体实现中,如图9所示,此构建过程可以包括以下步骤:
步骤410,获取携带体重标签的样本图像数据。
其中,样本图像数据是对牲畜样本进行不同角度拍摄生成的,体重标签指示了牲畜样本的实际体重。
步骤430,根据样本图像数据对线性回归方程式中的未知拟合参数进行拟合,得到最优拟合参数。
步骤450,将最优拟合参数替代未知拟合参数输入至线性回归方程式,得到体重测量函数。
本实施例中,体重测量函数,实质上是对线性回归方程式中的未知拟合参数进行拟合得到的。
具体地,线性回归方程式如计算公式(2)所示:
  
Figure 206951dest_path_image002
其中,a、b为未知拟合参数,m1表示牲畜样本在俯视角度的投影面积,m2表示牲畜在侧视角度的投影面积,n表示牲畜样本的实际体重。
由上可知,拟合,即是利用大量牲畜样本的实际体重n、以及对应牲畜样本在俯视角度、侧视角度的投影面积m1、m2,不断地调整未知拟合参数a、b,以使未知拟合参数a、b逐渐收敛为最优拟合参数a’、b’,最终实现线性回归方程式所表示的曲线,无限逼近由牲畜样本在俯视角度、侧视角度的投影面积与对应牲畜样本的实际体重所构成的曲线集合。
在确定最优拟合参数a’、b’之后,即可将此最优拟合参数a’、b’替代未知拟合参数a、b输入至计算公式(2),进而形成计算公式(1),即得到体重测量函数。
简言之,拟合,是基于牲畜样本已知的投影面积和体重求解未知拟合参数的过程,而测量,则是基于已知的最优拟合参数和牲畜的投影面积求解牲畜体重的过程。
需要说明的是,在体重测量函数未构建之前,牲畜样本的实际体重可以是人工测量得到,也可以是人工估算得到,在此并不进行限定。
而牲畜样本在俯视角度、侧视角度的投影面积的计算过程,与前述实施例中牲畜在俯视角度、侧视角度的投影面积的计算过程基本一致,在此不再详细地描述。
通过如上所述的过程,实现自动化测量牲畜体重,避免人工实现,以此有效地提高了牲畜体重测量的效率和准确率。
此外,不仅不会对牲畜造成物理伤害,而且方便于实时掌握牲畜的体重变化和成长情况。
在一示例性实施例中,步骤330之前,如上所述的方法还可以包括以下步骤:
调用滤波器对图像数据进行去噪处理,以使图像分割是基于去噪处理的图像数据。
如前所述,随着采集设备与服务器之间的交互,图像数据将由采集设备上传至服务器。可以理解,图像数据的传输过程中,势必存在着其他信号的干扰,例如,其他信号为噪声。
为此,本实施例中,针对图像数据,调用滤波器进行去噪处理,以此保证后续图像分割的精准度。此滤波器内置于服务器中,包括但不限于:均值滤波器、中值滤波器、双边滤波器、单边滤波器、高斯滤波器等等。
在上述实施例的作用下,避免图像数据受噪声干扰而失真,以此避免后续图像分割有误,进而充分地保证了后续牲畜体重测量的准确率。
请参阅图10,在一示例性实施例中,步骤330可以包括以下步骤:
步骤332,对不同拍摄角度所生成图像数据所表示图片中的牲畜进行轮廓定位,得到牲畜在图片中的轮廓。
如前所述,二值化处理,实质上是将图像数据所表示图片中像素的灰度值设置为0(黑色)或者255(白色),进而使得分割图片呈现出黑白分明的效果,最终完成牲畜与背景的分离。
由此,在进行灰度值转化之前,首先需要将图像数据所表示的图片划分为牲畜所在区域和背景所在区域,进而方便于后续分别对不同区域中的像素进行灰度值转化。
本实施例中,区域划分是通过轮廓定位实现的,即轮廓内区域为牲畜所在区域,而轮廓外区域为背景所在区域。例如,如图7、图8所示,轮廓即是牲畜和背景在分割图片中的分界线。
具体地,调用图像分割函数对图像数据所表示的图片进行轮廓定位,即可得到此图片中牲畜的轮廓。
例如,图像分割函数是findContours函数,此findContours函数可以通过openCV应用程序的运行而被服务器所调用。
当然,在其他实施例中,如果所运行的应用程序不同,则服务器所调用的图像分割函数也相应地有所区别,本实施例并非以此加以限定。
值得一提的是,牲畜在图片中的轮廓是需要能够完全体现牲畜体积的,即此轮廓也可以理解为是牲畜在图片中的最大轮廓,例如,俯视角度时的最大轮廓,如图7所示,侧视角度时的最大轮廓,如图8所示,以此充分地保障牲畜体重测量的准确性。
步骤334,根据牲畜在图片中的轮廓将图片划分为牲畜所在区域和背景所在区域。
步骤336,遍历图片中的像素,将位于牲畜所在区域中像素的灰度值转换为第一指定灰度值,并将位于背景所在区域中像素的灰度值转换为第二指定灰度值。
应当理解,图片中像素是矩阵排列方式,即先在第一行按列排满像素,再在第二行按列排满像素,以此类推,直至最后一行按列排满像素。
相应地,图片中像素的遍历,即是指按行按列依次扫描图片中的像素。
那么,对于扫描到的像素而言,如果此像素位于牲畜所在区域,则将此像素的灰度值转化为第一指定灰度值,例如,二值化处理时,第一指定灰度值为255;如果此像素位于背景所在区域,则将此像素的灰度值转化为第二指定灰度值,例如,二值化处理时,第二指定灰度值为0。
当然,在其他实施例中,第一指定灰度值和第二指定灰度值可以根据实际应用场景灵活地设定,只要牲畜所在区域中像素的灰度值区别于背景所在区域中像素的灰度值即可,本实施例并非以此加以限定。
步骤338,待完成图片中像素的遍历,形成不同拍摄角度对应的分割图片。
上述过程中,如图7、图8所示,分割图片中,牲畜所在区域为白色,而背景所在区域为黑色,由此使得分割图片呈现出黑白分明的效果,进而完成牲畜与背景的分离。
当然,在其他实施例中,拍摄角度还可以是仰视角度、后视角度、正视角度等,并非局限于俯视角度和侧视角度,本实施例并未对此构成限定。
请参阅图11,在一示例性实施例中,不同拍摄角度对应的分割图片包括俯视角度对应的分割图片和侧视角度对应的分割图片。
相应地,步骤350可以包括以下步骤:
步骤351,针对俯视角度对应的分割图片和侧视角度对应的分割图片,分别统计灰度值为第一指定灰度值的像素个数,得到俯视角度对应的像素总数和侧视角度对应的像素总数。
步骤353,以俯视角度对应的像素总数作为牲畜在俯视角度的投影面积,并以侧视角度对应的像素总数作为牲畜在侧视角度的投影面积。
仍以图7、图8所示进行说明,针对白色区域,即牲畜所在区域中灰度值为255的像素个数进行统计,即得到牲畜所在区域的像素总数,以此表示牲畜所在区域的区域面积。
针对黑色区域,即背景所在区域中灰度值为0的像素个数进行统计,即得到背景所在区域的像素总数,以此表示背景所在区域的区域面积。
如前所述,区域面积实质上即为牲畜针对不同拍摄角度的投影面积。
由此,无论是俯视角度还是侧视角度,均可得到牲畜在相应拍摄角度的投影面积,进而输入至体重测量函数即可得到牲畜的体重。
下述为本申请装置实施例,可以用于执行本申请所涉及的牲畜体重测量方法。对于本申请装置实施例中未披露的细节,请参照本申请所涉及的牲畜体重测量方法的方法实施例。
请参阅图12,在一示例性实施例中,一种牲畜体重测量装置900包括但不限于:数据接收模块910、图像分割模块930、面积计算模块950和体重测量模块970。
其中,数据接收模块910用于获取图像数据,图像数据是对牲畜进行不同角度拍摄生成的。
图像分割模块930用于对牲畜的图像数据进行图像分割,得到分割图片。
面积计算模块950用于根据分割图片中表示牲畜的像素计算牲畜在不同拍摄角度的投影面积。
体重测量模块970用于将牲畜在不同拍摄角度的投影面积输入体重测量函数进行牲畜的体重测量。
请参阅图13,在一示例性实施例中,一种牲畜体重测量装置1000,包括处理器1001及存储器1002,还包括至少一通信总线1003。
其中,存储器1002上存储有计算机可读指令,处理器1001通过至少一通信总线1003从存储器1002中读取计算机可读指令。
该计算机可读指令被处理器执行时实现上述各实施例中的牲畜体重测量方法。
在一示例性实施例中,一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述各实施例中的牲畜体重测量方法。
需要说明的是,上述实施例所提供的牲畜体重测量装置在进行牲畜体重测量处理时,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即牲畜体重测量装置的内部结构将划分为不同的功能模块,以完成以上描述的全部或者部分功能。
另外,上述实施例所提供的牲畜体重测量装置与牲畜体重测量方法的实施例属于同一构思,其中各个模块执行操作的具体方式已经在方法实施例中进行了详细描述,此处不再赘述。
上述内容,仅为本申请的较佳示例性实施例,并非用于限制本申请的实施方案,本领域普通技术人员根据本申请的主要构思和精神,可以十分方便地进行相应的变通或修改,故本申请的保护范围应以权利要求书所要求的保护范围为准。

Claims (28)

  1. 一种牲畜体重测量方法,其特征在于,包括:
    获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;
    对所述牲畜的图像数据进行图像分割,得到分割图片;
    根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;
    将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
  2. 如权利要求1所述的方法,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片之前,所述方法还包括:
    调用滤波器对所述图像数据进行去噪处理,以使所述图像分割是基于去噪处理的所述图像数据。
  3. 如权利要求1或2所述的方法,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片,包括:
    对不同拍摄角度所生成图像数据所表示图片中的所述牲畜进行轮廓定位,得到所述牲畜在所述图片中的轮廓;
    根据所述牲畜在所述图片中的轮廓将所述图片划分为牲畜所在区域和背景所在区域;
    遍历所述图片中的像素,将位于所述牲畜所在区域中像素的灰度值转换为第一指定灰度值,并将位于所述背景所在区域中像素的灰度值转换为第二指定灰度值;
    待完成所述图片中像素的遍历,形成不同拍摄角度对应的分割图片。
  4. 如权利要求3所述的方法,其特征在于,不同拍摄角度对应的分割图片包括俯视角度对应的分割图片和侧视角度对应的分割图片,所述根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积,包括:
    针对俯视角度对应的分割图片和侧视角度对应的分割图片,分别统计灰度值为第一指定灰度值的像素个数,得到俯视角度对应的像素总数和侧视角度对应的像素总数;
    以俯视角度对应的像素总数作为所述牲畜在俯视角度的投影面积,并以侧视角度对应的像素总数作为所述牲畜在侧视角度的投影面积。
  5. 如权利要求3或4所述的方法,其特征在于,所述第一指定灰度值为255,所述第二指定灰度值为0。
  6. 如权利要求1至5任一项所述的方法,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述方法还包括:
    获取携带体重标签的样本图像数据,所述样本图像数据是对牲畜样本进行不同角度拍摄生成的,所述体重标签指示了所述牲畜样本的实际体重;
    根据所述样本图像数据对线性回归方程式中的未知拟合参数进行拟合,得到最优拟合参数;
    将所述最优拟合参数替代所述未知拟合参数输入至所述线性回归方程式,得到所述体重测量函数。
  7. 如权利要求1至6任一项所述的方法,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述方法还包括:
    对所述牲畜在不同拍摄角度的投影面积进行筛选,舍弃未达到指定阈值的所述投影面积。
  8. 一种牲畜体重测量装置,其特征在于,包括:
    数据接收模块,用于获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;
    图像分割模块,用于对所述牲畜的图像数据进行图像分割,得到分割图片;
    面积计算模块,用于根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;
    体重测量模块,用于将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
  9. 如权利要求8所述的装置,其特征在于,所述装置还包括:
    去噪处理模块,用于调用滤波器对所述图像数据进行去噪处理,以使所述图像分割是基于去噪处理的所述图像数据。
  10. 如权利要求8或9所述的装置,其特征在于,所述图像分割模块包括:
    轮廓定位单元,用于对不同拍摄角度所生成图像数据所表示图片中的所述牲畜进行轮廓定位,得到所述牲畜在所述图片中的轮廓;
    区域划分单元,用于根据所述牲畜在所述图片中的轮廓将所述图片划分为牲畜所在区域和背景所在区域;
    灰度值转换单元,用于遍历所述图片中的像素,将位于所述牲畜所在区域中像素的灰度值转换为第一指定灰度值,并将位于所述背景所在区域中像素的灰度值转换为第二指定灰度值;
    图片形成单元,用于待完成所述图片中像素的遍历,形成不同拍摄角度对应的分割图片。
  11. 如权利要求10所述的装置,其特征在于,不同拍摄角度对应的分割图片包括俯视角度对应的分割图片和侧视角度对应的分割图片;
    所述面积计算模块包括:
    像素个数统计单元,用于针对俯视角度对应的分割图片和侧视角度对应的分割图片,分别统计灰度值为第一指定灰度值的像素个数,得到俯视角度对应的像素总数和侧视角度对应的像素总数;
    面积定义单元,用于以俯视角度对应的像素总数作为所述牲畜在俯视角度的投影面积,并以侧视角度对应的像素总数作为所述牲畜在侧视角度的投影面积。
  12. 如权利要求10或11所述的装置,其特征在于,所述第一指定灰度值为255,所述第二指定灰度值为0。  
  13. 如权利要求8至12任一项所述的装置,其特征在于,所述装置还包括:
    样本数据获取模块,用于获取携带体重标签的样本图像数据,所述样本图像数据是对牲畜样本进行不同角度拍摄生成的,所述体重标签指示了所述牲畜样本的实际体重;
    拟合模块,用于根据所述样本图像数据对线性回归方程式中的未知拟合参数进行拟合,得到最优拟合参数;
    函数生成模块,用于将所述最优拟合参数替代所述未知拟合参数输入至所述线性回归方程式,得到所述体重测量函数。
  14. 如权利要求8至13任一项所述的装置,其特征在于,所述装置还包括:
    筛选模块,用于对所述牲畜在不同拍摄角度的投影面积进行筛选,舍弃未达到指定阈值的所述投影面积。
  15. 一种牲畜体重测量装置,其特征在于,包括:
    处理器;及
    存储器,所述存储器上存储有计算机可读指令,所述计算机可读指令被所述处理器执行时,所述处理器用于实现以下步骤:
    获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;
    对所述牲畜的图像数据进行图像分割,得到分割图片;
    根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;
    将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
  16. 如权利要求15所述的装置,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片之前,所述处理器还用于实现以下步骤:
    调用滤波器对所述图像数据进行去噪处理,以使所述图像分割是基于去噪处理的所述图像数据。
  17. 如权利要求15或16所述的装置,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片,所述处理器用于实现以下步骤:
    对不同拍摄角度所生成图像数据所表示图片中的所述牲畜进行轮廓定位,得到所述牲畜在所述图片中的轮廓;
    根据所述牲畜在所述图片中的轮廓将所述图片划分为牲畜所在区域和背景所在区域;
    遍历所述图片中的像素,将位于所述牲畜所在区域中像素的灰度值转换为第一指定灰度值,并将位于所述背景所在区域中像素的灰度值转换为第二指定灰度值;
    待完成所述图片中像素的遍历,形成不同拍摄角度对应的分割图片。
  18. 如权利要求17所述的装置,其特征在于,不同拍摄角度对应的分割图片包括俯视角度对应的分割图片和侧视角度对应的分割图片,
    所述根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积,所述处理器用于实现以下步骤:
    针对俯视角度对应的分割图片和侧视角度对应的分割图片,分别统计灰度值为第一指定灰度值的像素个数,得到俯视角度对应的像素总数和侧视角度对应的像素总数;
    以俯视角度对应的像素总数作为所述牲畜在俯视角度的投影面积,并以侧视角度对应的像素总数作为所述牲畜在侧视角度的投影面积。
  19. 如权利要求17或18所述的装置,其特征在于,所述第一指定灰度值为255,所述第二指定灰度值为0。
  20. 如权利要求15至19任一项所述的装置,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述处理器还用于实现以下步骤:
    获取携带体重标签的样本图像数据,所述样本图像数据是对牲畜样本进行不同角度拍摄生成的,所述体重标签指示了所述牲畜样本的实际体重;
    根据所述样本图像数据对线性回归方程式中的未知拟合参数进行拟合,得到最优拟合参数;
    将所述最优拟合参数替代所述未知拟合参数输入至所述线性回归方程式,得到所述体重测量函数。
  21. 如权利要求15至20任一项所述的装置,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述处理器还用于实现以下步骤:
    对所述牲畜在不同拍摄角度的投影面积进行筛选,舍弃未达到指定阈值的所述投影面积。
  22. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时,所述处理器用于实现以下步骤:
    获取图像数据,所述图像数据是对所述牲畜进行不同角度拍摄生成的;
    对所述牲畜的图像数据进行图像分割,得到分割图片;
    根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积;
    将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量。
  23. 如权利要求22所述的计算机可读存储介质,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片之前,所述处理器还用于实现以下步骤:
    调用滤波器对所述图像数据进行去噪处理,以使所述图像分割是基于去噪处理的所述图像数据。
  24. 如权利要求22或23所述的计算机可读存储介质,其特征在于,所述对所述牲畜的图像数据进行图像分割,得到分割图片,所述处理器用于实现以下步骤:
    对不同拍摄角度所生成图像数据所表示图片中的所述牲畜进行轮廓定位,得到所述牲畜在所述图片中的轮廓;
    根据所述牲畜在所述图片中的轮廓将所述图片划分为牲畜所在区域和背景所在区域;
    遍历所述图片中的像素,将位于所述牲畜所在区域中像素的灰度值转换为第一指定灰度值,并将位于所述背景所在区域中像素的灰度值转换为第二指定灰度值;
    待完成所述图片中像素的遍历,形成不同拍摄角度对应的分割图片。
  25. 如权利要求24所述的计算机可读存储介质,其特征在于,不同拍摄角度对应的分割图片包括俯视角度对应的分割图片和侧视角度对应的分割图片,
    所述根据所述分割图片中表示所述牲畜的像素计算所述牲畜在不同拍摄角度的投影面积,所述处理器用于实现以下步骤:
    针对俯视角度对应的分割图片和侧视角度对应的分割图片,分别统计灰度值为第一指定灰度值的像素个数,得到俯视角度对应的像素总数和侧视角度对应的像素总数;
    以俯视角度对应的像素总数作为所述牲畜在俯视角度的投影面积,并以侧视角度对应的像素总数作为所述牲畜在侧视角度的投影面积。
  26. 如权利要求24或25所述的计算机可读存储介质,其特征在于,所述第一指定灰度值为255,所述第二指定灰度值为0。
  27. 如权利要求22至26任一项所述的计算机可读存储介质,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述处理器还用于实现以下步骤:
    获取携带体重标签的样本图像数据,所述样本图像数据是对牲畜样本进行不同角度拍摄生成的,所述体重标签指示了所述牲畜样本的实际体重;
    根据所述样本图像数据对线性回归方程式中的未知拟合参数进行拟合,得到最优拟合参数;
    将所述最优拟合参数替代所述未知拟合参数输入至所述线性回归方程式,得到所述体重测量函数。
  28. 如权利要求22至27任一项所述的计算机可读存储介质,其特征在于,所述将所述牲畜在不同拍摄角度的投影面积输入体重测量函数进行所述牲畜的体重测量之前,所述处理器还用于实现以下步骤:
    对所述牲畜在不同拍摄角度的投影面积进行筛选,舍弃未达到指定阈值的所述投影面积。
PCT/CN2018/108289 2018-07-06 2018-09-28 牲畜体重测量方法及装置 Ceased WO2020006899A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810735603.4 2018-07-06
CN201810735603.4A CN108871520A (zh) 2018-07-06 2018-07-06 牲畜体重测量方法及装置

Publications (1)

Publication Number Publication Date
WO2020006899A1 true WO2020006899A1 (zh) 2020-01-09

Family

ID=64299422

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/108289 Ceased WO2020006899A1 (zh) 2018-07-06 2018-09-28 牲畜体重测量方法及装置

Country Status (2)

Country Link
CN (1) CN108871520A (zh)
WO (1) WO2020006899A1 (zh)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109579956B (zh) * 2018-12-13 2021-05-14 北京小龙潜行科技有限公司 一种智能养猪限位测重方法、装置、电子设备及存储介质
CN109632058B (zh) * 2018-12-13 2020-06-02 北京小龙潜行科技有限公司 一种智能养猪群养测重方法、装置、电子设备及存储介质
CN109632059B (zh) * 2018-12-13 2021-05-14 北京小龙潜行科技有限公司 一种智能养猪方法、系统、电子设备及存储介质
CN111639777B (zh) * 2019-03-01 2023-09-29 京东科技信息技术有限公司 估计目标体重的方法和装置
CN110288580A (zh) * 2019-06-25 2019-09-27 深圳德里克设备有限公司 牲畜体重的测量方法、测量装置及可读存储介质
CN110480644B (zh) * 2019-07-08 2024-08-27 华南农业大学 一种基于uwb定位的猪场巡检机器人
CN111008560A (zh) * 2019-10-31 2020-04-14 重庆小雨点小额贷款有限公司 一种牲畜的重量确定方法、装置、终端及计算机存储介质
CN111121932A (zh) * 2019-12-24 2020-05-08 秒针信息技术有限公司 测量牲畜体重的方法和装置
CN111150402A (zh) * 2020-01-02 2020-05-15 秒针信息技术有限公司 确定家畜形体参数的方法、装置、存储介质及电子装置
CN111888775A (zh) * 2020-06-05 2020-11-06 祝爱莲 稳定气流风速调控系统
CN111985477B (zh) * 2020-08-27 2024-06-28 平安科技(深圳)有限公司 基于单目摄像头的动物体在线核赔方法、装置及存储介质
CN112461342B (zh) * 2020-11-04 2022-04-01 青岛丰禾星普科技有限公司 水产品称重方法、终端设备及存储介质
CN113077485A (zh) * 2021-04-28 2021-07-06 北京神州慧达信息技术有限公司 基于人工智能的无参考物的测量方法
CN116758291A (zh) * 2023-05-15 2023-09-15 北京邮电大学 出肉量估计方法及相关设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19918100A1 (de) * 1999-04-22 2000-10-26 Helmut Niklaus Vorrichtung und Verfahren zur berührungslosen Gewichtsermittlung von lebenden Tieren, insbesondere von Schweinen in ihrer Haltungsumwelt, vorzugsweise in ihren Buchten
CN101144705A (zh) * 2007-07-25 2008-03-19 中国农业大学 一种利用双目视觉技术监测猪生长的方法
CN102509085A (zh) * 2011-11-19 2012-06-20 江苏大学 基于轮廓不变矩特征的猪行走姿态识别系统和方法
CN103235550A (zh) * 2013-04-15 2013-08-07 南京农业大学 保温箱仔猪生长参数监控系统及其方法
CN203206909U (zh) * 2013-05-09 2013-09-25 中国农业大学 数据采集装置及应用该装置的猪的生长形态检测系统
CN106662437A (zh) * 2014-06-17 2017-05-10 玛精能手股份有限公司 用于物体的自动参数计算的方法和装置

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19918100A1 (de) * 1999-04-22 2000-10-26 Helmut Niklaus Vorrichtung und Verfahren zur berührungslosen Gewichtsermittlung von lebenden Tieren, insbesondere von Schweinen in ihrer Haltungsumwelt, vorzugsweise in ihren Buchten
CN101144705A (zh) * 2007-07-25 2008-03-19 中国农业大学 一种利用双目视觉技术监测猪生长的方法
CN102509085A (zh) * 2011-11-19 2012-06-20 江苏大学 基于轮廓不变矩特征的猪行走姿态识别系统和方法
CN103235550A (zh) * 2013-04-15 2013-08-07 南京农业大学 保温箱仔猪生长参数监控系统及其方法
CN203206909U (zh) * 2013-05-09 2013-09-25 中国农业大学 数据采集装置及应用该装置的猪的生长形态检测系统
CN106662437A (zh) * 2014-06-17 2017-05-10 玛精能手股份有限公司 用于物体的自动参数计算的方法和装置

Also Published As

Publication number Publication date
CN108871520A (zh) 2018-11-23

Similar Documents

Publication Publication Date Title
WO2020006899A1 (zh) 牲畜体重测量方法及装置
CN109636754B (zh) 基于生成对抗网络的极低照度图像增强方法
CN108921161B (zh) 模型训练方法、装置、电子设备和计算机可读存储介质
EP3579148A1 (en) Method and apparatus for training, classification model, mobile terminal, and readable storage medium
WO2021208875A1 (zh) 视觉检测方法和视觉检测装置
WO2019100608A1 (zh) 摄像装置、人脸识别的方法、系统及计算机可读存储介质
CN107465911B (zh) 一种深度信息提取方法及装置
WO2017076040A1 (zh) 应用于连拍过程中的图像处理方法和装置
CN108449555A (zh) 图像融合方法及系统
CN110349163A (zh) 图像处理方法和装置、电子设备、计算机可读存储介质
CN113298707B (zh) 图像帧拼接方法、视频巡检方法、装置、设备及存储介质
CN110335216A (zh) 图像处理方法、图像处理装置、终端设备及可读存储介质
WO2019223068A1 (zh) 虹膜图像局部增强方法、装置、设备及存储介质
WO2019029573A1 (zh) 图像虚化方法、计算机可读存储介质和计算机设备
WO2020001219A1 (zh) 图像处理方法和装置、存储介质、电子设备
WO2021189770A1 (zh) 基于人工智能的图像增强处理方法、装置、设备及介质
CN107564018A (zh) 一种利用改进迭代算法提取目标图像的方法
CN110688926B (zh) 主体检测方法和装置、电子设备、计算机可读存储介质
CN108010059A (zh) 电子防抖算法的性能分析方法及装置
CN111354058A (zh) 一种图像着色方法、装置、图像采集设备及可读存储介质
CN117197111A (zh) 一种显示器缺陷检测方法、装置、计算机设备及存储介质
CN113454684A (zh) 一种关键点标定方法和装置
CN108734712B (zh) 背景分割的方法、装置及计算机存储介质
CN114331857A (zh) 一种彩色图像紫边校正方法、装置及计算机存储介质
WO2022068551A1 (zh) 裁剪视频的方法、装置、设备以及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18925263

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC , EPO FORM 1205A DATED 19.04.21.

122 Ep: pct application non-entry in european phase

Ref document number: 18925263

Country of ref document: EP

Kind code of ref document: A1