Method and product for obtaining camera preset angles and monitoring breeding pens

By automatically adjusting the camera shooting angle and identifying the breeding pen guardrails to determine the preset angle, the problem of low manual operation efficiency in the existing technology is solved and efficient breeding pen monitoring is achieved.

CN114189627BActive Publication Date: 2024-09-06HENAN MUYUAN INTELLIGENT TECH CO LTD
View PDF 19 Cites 0 Cited by

Patent Information

Application Number
CN202111407136.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-24
Publication Date
2024-09-06
Estimated Expiration
2041-11-24

AI Technical Summary

Technical Problem

In the existing technology, the method of obtaining the preset angle of the breeding pen camera requires manual operation, resulting in low work efficiency and high labor costs.

Method used

By adjusting the camera shooting angle, multiple images are acquired along the width and length of the breeding pen, the guardrail is identified to determine the preset angle, and the first, second and third preset angles of the camera are automatically obtained.

Benefits of technology

The camera preset angle can be automatically obtained without manual participation, reducing labor costs, improving work efficiency, and ensuring comprehensive monitoring of the breeding pens.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114189627B
    Figure CN114189627B
Patent Text Reader

Abstract

The present invention relates to a method and product for obtaining a camera preset angle and a breeding pen image, wherein the method for obtaining a camera preset angle comprises: adjusting the shooting angle of the camera along the width direction of the target breeding pen to obtain a plurality of first images; in response to the width of the target breeding pen in the first image being consistent with the image direction, taking the shooting angle corresponding to the first image as the first preset angle corresponding to the target breeding pen; starting from the first preset angle, adjusting the shooting angle of the camera along the length direction of the target breeding pen to obtain a plurality of second images; in response to the guardrail in the length direction of the target breeding pen included in the second image, taking the shooting angle corresponding to the second image as the second preset angle or the third preset angle corresponding to the target breeding pen. The technical solution provided by the present invention can reduce the labor cost of obtaining the preset angle corresponding to the target breeding pen and improve work efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention generally relates to the technical field of image capture of breeding pens, and more specifically to a method for obtaining a camera preset angle, a method for monitoring breeding pens, a device, and a computer-readable storage medium. Background Art

[0002] In a breeding farm, in order to obtain the growth status of livestock in the breeding pens in real time, it is necessary to monitor the breeding pens in real time. At present, the commonly used monitoring method for breeding pens is to set an inspection track above the breeding pens, and then install a camera on the inspection track so that the camera can reciprocate on the inspection track. When the camera moves above one of the breeding pens, it can take an image of the breeding pen to obtain information about the livestock in the breeding pen, thereby realizing the monitoring of the breeding pen. And in order to obtain images of all livestock in each breeding pen, a pan-tilt is also provided at the camera, and the shooting angle of the camera can be adjusted by the pan-tilt. In order to improve the speed and quality of obtaining images of each breeding pen, the camera has a corresponding preset angle in each breeding pen. The camera obtains images of the corresponding breeding pen at each preset angle, and the status of all livestock in the breeding pen can be obtained.

[0003] In the prior art, the method of presetting the angle of the camera for the breeding pen is obtained by manual operation, that is, the staff controls the remote control to control the rotation of the cloud platform to adjust the shooting angle of the camera, and then obtains the preset angle of the camera for the breeding pen according to the shooting effect of the camera at each shooting angle. This method of obtaining the preset angle of the camera for the breeding pen not only requires the staff to manually adjust the shooting angle of the camera, but also requires a long adjustment time, so there are problems of low work efficiency and high labor costs. Summary of the invention

[0004] The present invention provides a method and product for obtaining camera preset angles and breeding pen images, so as to at least solve the problems of low working efficiency and high labor cost of the above-mentioned camera preset angle obtaining method.

[0005] To at least solve the above-mentioned problems, in a first aspect, the present invention provides a method for obtaining a camera preset angle, wherein the camera is located above a target breeding pen, and the corresponding image is obtained by adjusting the shooting angle of the camera, the method comprising: adjusting the shooting angle of the camera along the width direction of the target breeding pen to obtain a plurality of first images; in response to the width of the target breeding pen in the first image being consistent with the image direction, using the shooting angle corresponding to the first image as the first preset angle corresponding to the target breeding pen; starting from the first preset angle, adjusting the shooting angle of the camera along the length direction of the target breeding pen to obtain a plurality of second images; in response to the second image containing a guardrail in the length direction of the target breeding pen, using the shooting angle corresponding to the second image as the second preset angle or the third preset angle corresponding to the target breeding pen.

[0006] According to one embodiment of the present invention, adjusting the shooting angle of the camera along the length direction of the target breeding pen includes: starting from the first preset angle, adjusting the shooting angle of the camera along the first length direction of the target breeding pen to obtain multiple second images, and using the shooting angle corresponding to the second image containing the guardrail corresponding to the first length direction as the second preset angle; starting from the first preset angle, adjusting the shooting angle of the camera along the second length direction of the target breeding pen to obtain multiple second images, and using the shooting angle corresponding to the second image containing the guardrail corresponding to the second length direction as the third preset angle.

[0007] According to another embodiment of the present invention, the camera is also located above the midpoint of the length direction of the target breeding pen, the second preset angle and the third preset angle are symmetrical with the first preset angle as the center, and the adjusting the camera shooting angle along the length direction of the target breeding pen includes: starting from the first preset angle, adjusting the camera shooting angle along the first length direction of the target breeding pen to obtain multiple second images, and taking the shooting angle corresponding to the second image containing the guardrail corresponding to the first length direction as the second preset angle; obtaining the third preset angle according to the symmetrical relationship between the first preset angle, the second preset angle and the third preset angle and the second preset angle.

[0008] According to another embodiment of the present invention, in response to the fact that the width of the target breeding pen in the first image is consistent with the image direction, the method includes: identifying baffles on both sides of the width direction of the target breeding pen in the first image; and judging whether the width of the target breeding pen in the first image is consistent with the image direction based on the length-to-width ratio of the rectangular outer bounding boxes of the baffles on both sides of the width direction of the target breeding pen in the first image.

[0009] According to another embodiment of the present invention, the identifying of baffles on both sides of the width direction of the breeding pen in the first image includes: performing grayscale processing and binarization processing on the first image to obtain two largest connected domains located on both sides of the width direction of the first image, and use them as baffles on both sides of the width direction of the breeding pen.

[0010] According to yet another embodiment of the present invention, the step of identifying baffles on both sides of the breeding pen in the width direction of the first image further includes a step of denoising the first image.

[0011] According to another embodiment of the present invention, adjusting the shooting angle of the camera along the width direction of the target breeding pen includes: continuously adjusting the shooting angle of the camera multiple times in the width direction of the target breeding pen, and each adjustment angle is a set step angle.

[0012] In a second aspect, the present invention also provides a method for monitoring breeding pens, wherein a preset angle corresponding to each breeding pen is obtained according to the method described in any of the above embodiments, including: in response to identifying a breeding pen, obtaining a preset angle corresponding to the breeding pen; controlling the camera to capture an image of the breeding pen at the preset angle corresponding to the breeding pen.

[0013] In a third aspect, the present invention further provides a device, comprising a processor and a memory, wherein the memory is used to store computer program instructions, and the computer program instructions are executed by the processor to implement the method as described in any of the above embodiments.

[0014] In a fourth aspect, the present invention further provides a computer-readable storage medium having computer program instructions stored thereon, and when the computer program instructions are executed, the method described in any of the above embodiments is implemented.

[0015] The technical solution provided by the present invention first adjusts the shooting angle of the camera along the width direction of the target breeding pen to obtain multiple first images, and takes the shooting angle corresponding to the first image in which the width of the target breeding pen is consistent with the image direction as the first preset angle; then starting from the first preset angle, the shooting angle of the camera is adjusted along the length direction of the target breeding pen to obtain multiple second images, and then the shooting angle corresponding to the second image containing the guardrail in the length direction of the target breeding pen is taken as the second preset angle or the third preset angle. Since the shooting angle of the camera is adjusted along the length direction of the target breeding pen starting from the first preset angle when obtaining the second image, it can be ensured that the range captured by the obtained second image will not exceed the area of ​​the target breeding pen, and the second preset angle or the third preset angle can be obtained. The technical solution provided by the present invention can automatically obtain the first preset angle, the second preset angle and the third preset angle corresponding to the target breeding pen without manual participation. Compared with the prior art, it can not only reduce labor costs, but also improve work efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0017] Figure 1 is a flowchart of a method for obtaining a preset camera angle according to an embodiment of the present invention;

[0018] Figure 2 is an example diagram of a first image according to an embodiment of the present invention;

[0019] Figure 3 A flowchart of a method for determining whether the width of a target breeding pen in a first image is consistent with the image direction according to an embodiment of the present invention;

[0020] Figure 4 It is a flow chart of a method for identifying baffles on both sides of a breeding pen in a width direction on a first image according to an embodiment of the present invention;

[0021] Figure 5 is an example diagram of a third binarized image according to an embodiment of the present invention;

[0022] Figure 6 is a flow chart of a method for monitoring a breeding house according to an embodiment of the present invention;

[0023] Figure 7 Schematic diagram of a device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0024] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. It should be understood that the embodiments described in this specification are only partial embodiments provided by the present invention to facilitate a clear understanding of the solutions and to comply with legal requirements, and are not all embodiments that can implement the present invention. Based on the embodiments disclosed in this specification, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0025] See also Figure 1 , Figure 1 The flowchart of a method for obtaining a preset camera angle is shown. The method is applied to a monitoring system of a breeding house. The monitoring system of the breeding house includes a patrol track located above each breeding pen. The camera is installed on the patrol track through a pan-tilt head and can reciprocate on the track. When the camera moves to the top of one of the breeding pens, the camera can shoot the breeding pen at a preset angle corresponding to the breeding pen, and the camera's shooting angle can be adjusted through the pan-tilt head to achieve comprehensive monitoring of all livestock in the breeding pen. Figure 1 , the method for obtaining the preset angle of the camera of the present invention is described in detail.

[0026] like Figure 1 As shown, the method for obtaining a preset camera angle provided by the present invention includes:

[0027] In step S11, the shooting angle of the camera is adjusted along the width direction of the target breeding pen to obtain multiple first images. In this step S11, when adjusting the shooting angle of the camera along the width direction of the target breeding pen, the shooting angle of the camera is first set to the maximum shooting angle on one side of the width direction of the target breeding pen, that is, when adjusting the shooting angle of the camera in the width direction of the target breeding pen, the shooting angle of the camera can only be adjusted to the other side of the width direction of the target breeding pen; then the shooting angle of the camera in the length direction of the breeding pen is kept unchanged, and only the shooting angle of the camera in the width direction of the breeding pen is changed multiple times, and each time the shooting angle of the camera is changed, an image of the target breeding pen is obtained. In this embodiment, the images of the breeding pen obtained in this process are all referred to as first images, and the first images with guardrails on both sides of the width direction of the target breeding pen are screened out from the multiple first images.

[0028] In step S12, in response to the fact that the width of the target breeding pen in the first image is consistent with the direction of the image width, the shooting angle corresponding to the first image is used as the first preset angle corresponding to the target breeding pen. After obtaining multiple first images in step S11, an image recognition method can be used to identify the guardrails on both sides of the width direction of the target breeding pen in each first image, so that the width direction of the target breeding pen in each first image can be obtained. After obtaining the width direction of the target breeding pen in each first image, a first image in which the width direction of the target breeding pen is consistent with the width direction of the image is obtained, wherein the first image in which the width direction of the target breeding pen is consistent with the width direction of the image includes the guardrails on both sides of the width direction of the target breeding pen, and then the shooting angle corresponding to the obtained first image is used as the first preset angle corresponding to the target breeding pen. For example, the first image can be as follows Figure 2 The first image shown, and then the shooting angle corresponding to the first image is used as the first preset angle corresponding to the target breeding pen.

[0029] In step S13, the shooting angle of the camera is adjusted along the length direction of the target breeding pen with the first preset angle as the starting point to obtain multiple second images. In this step S13, since the width direction of the target breeding pen in the image captured by the camera at the first preset angle is the same as the width direction of the image, when the shooting angle of the camera is adjusted in the length direction of the target breeding pen, the shooting range will not exceed the area of ​​the target breeding pen, which can improve the reliability of obtaining the second preset angle and the third preset angle. In this step S13, the shooting angle of the camera in the width direction of the breeding pen is kept unchanged, and only the shooting angle of the camera in the length direction of the breeding pen is changed multiple times, and each time the shooting angle of the camera is changed, an image of the target breeding pen is obtained once, thereby obtaining multiple images of the target breeding pen. In this embodiment, the images of the target breeding pen obtained in this process are referred to as second images.

[0030] In step S14, in response to the second image containing the guardrail in the length direction of the target breeding pen, the shooting angle corresponding to the second image is used as the second preset angle or the third preset angle corresponding to the target breeding pen. In the above step S13, the shooting angle of the camera may be adjusted to the first length direction of the target breeding pen, or it may be adjusted to the second length direction of the target breeding pen. After obtaining the second image, the guardrail in the length direction of the target breeding pen can be identified by the image recognition method. When the shooting angle of the camera is adjusted to the first length direction of the length of the target breeding pen, if the guardrail of the target breeding pen in the first length direction is photographed, it can be determined that the shooting range of the camera has reached the guardrail in the first length direction of the target breeding pen, so the shooting angle corresponding to the second image at this time is used as the second preset angle corresponding to the target breeding pen; similarly, if the guardrail of the target breeding pen in the second length direction is photographed, it can be determined that the shooting range of the camera has reached the guardrail in the second length direction, so the shooting angle corresponding to the second image at this time is used as the third preset angle corresponding to the target breeding pen.

[0031] In summary, in the technical solution provided by the present invention, the shooting angle of the camera is first adjusted along the width direction of the target breeding pen to obtain multiple first images, and the shooting angle corresponding to the first image in which the width of the target breeding pen is consistent with the image direction is used as the first preset angle corresponding to the target breeding pen; then starting from the first preset angle, the shooting angle of the camera is adjusted along the length direction of the target breeding pen to obtain multiple second images, and then the shooting angle corresponding to the second image containing the guardrail in the length direction of the target breeding pen is used as the second preset angle or the third preset angle corresponding to the target breeding pen. When acquiring the second image, since the width direction of the breeding pen in the image acquired by the camera from the first preset angle is consistent with the width direction of the image, and the angle of the camera in the width direction of the target breeding pen remains unchanged and only the shooting angle of the camera in the length direction of the target breeding pen is adjusted, the shooting range will not be from the area of ​​the target breeding pen, thereby improving the reliability of acquiring the second preset angle and the third preset angle. Due to the technical solution provided by the present invention, the first preset angle, the second preset angle and the third preset angle corresponding to the target breeding pen can be automatically obtained, and no human participation is required in the acquisition process. Therefore, compared with the prior art, it can not only reduce labor costs but also improve work efficiency.

[0032] The above is an overall introduction to the method for obtaining the preset angle of the camera of the present invention. The following is a detailed description of the method for obtaining the second preset angle and the third preset angle in combination with specific application scenarios.

[0033] In an application scenario, adjusting the shooting angle of the camera along the length direction of the target breeding pen in the above steps S13 and S14 includes: starting from a first preset angle, adjusting the shooting angle of the camera along the first length direction of the target breeding pen, and using the shooting angle corresponding to the second image including the first side guardrail in the length direction of the target breeding pen as the second preset angle corresponding to the target breeding pen; starting from the first preset angle, adjusting the shooting angle of the camera along the second length direction of the target breeding pen, and using the shooting angle corresponding to the second image including the second side guardrail in the length direction of the target breeding pen as the third preset angle corresponding to the target breeding pen. The first side guardrail in the length direction of the target breeding fence mentioned above refers to the guardrail of the target breeding fence in the first length direction. When the camera moves on the first length of the breeding fence, if the first side guardrail can be photographed, it can be determined that the camera's shooting range has covered the entire area of ​​the target breeding fence in the first length direction; the second guardrail refers to the guardrail of the target breeding fence in the second length direction of the target breeding fence. Similarly, when the camera moves on the second length direction of the target breeding fence, if the second side guardrail can be photographed, it can be determined that the camera's shooting range has covered the entire area of ​​the target breeding fence in the second length direction. The second preset angle and the third preset angle are obtained by the method provided in this embodiment, so that when acquiring the image of the target breeding fence, the camera's shooting range can cover the entire target breeding fence area, thereby improving the comprehensiveness and reliability of monitoring the target breeding fence.

[0034] In another application scenario, the camera is located above the midpoint of the length direction of the target breeding pen, and when the camera is located at the initial position, its shooting position in the length direction of the breeding house is in the middle position of the length direction of the breeding house. When moving the shooting angle of the camera, it is only adjusted in the width direction of the breeding pen without changing the angle of the camera in the length direction of the breeding pen. Therefore, the second preset angle and the third preset angle corresponding to the target breeding pen are symmetrical with the first preset angle as the center. In the above steps S13 and S14, adjusting the shooting angle of the camera along the length direction of the target breeding pen includes: starting from the first preset angle, adjusting the shooting angle of the camera along the first length direction of the target breeding pen, and taking the shooting angle corresponding to the second image containing the first side guardrail in the length direction of the target breeding pen as the second preset angle; then according to the size of the first preset angle and the second preset angle and the symmetric relationship between the third preset angle and the second preset angle, the size of the third preset angle can be calculated. The setting method of this embodiment can save the process of adjusting the camera in the second length direction of the target breeding pen, and can improve the work efficiency of obtaining the preset angle corresponding to the target breeding pen.

[0035] Figure 3 The flowchart of a method for determining whether the width of a target breeding pen in a first image is consistent with the width direction of the image is shown. It can be understood that Figure 3The process shown is a method for determining whether the width of the target breeding pen in the first image is consistent with the width direction of the image in the above step S12, which is exemplary and not restrictive, and the description of the first image and the target breeding pen above is also applicable to the following description of the first image and the target breeding pen. Figure 3 Description.

[0036] like Figure 3 As shown, the method for determining whether the width of a target breeding pen in a first image is consistent with the width direction of the image includes:

[0037] In step S111, the baffles on both sides of the width direction of the target breeding pen in the first image are identified. Since the camera is located above the target breeding pen, when the camera shoots the target breeding pen, the objects in the obtained first image include the floor of the target breeding pen, livestock, and the guardrails on both sides of the target breeding pen. After obtaining the first image, an image recognition method can be used to identify the target breeding pen in the first image. For example, a neural network model for identifying images can be first established, and then the neural network model can be trained using a data set containing images of guardrails on both sides of the width direction of the breeding pen to obtain a neural network model that can identify the guardrails on both sides of the width direction of the breeding pen in the image; finally, the neural network model is used to perform recognition processing on the first image to obtain the guardrails on both sides of the width direction of the target breeding pen in the first image.

[0038] In step S112, according to the length-width ratio of the rectangular outer bounding box of the baffles on both sides of the width direction of the target breeding pen in the first image, it is determined whether the width of the target breeding pen in the first image is consistent with the image direction. Since the camera moves in the width direction of the target breeding pen when shooting the first image, but does not change in the length direction of the target breeding pen, the length-width ratio of the outer bounding box of the guardrails on both sides of the width of the target breeding pen will change in each first image, so according to the length-width ratio of the rectangular outer bounding box of the baffles on both sides of the width direction of the target breeding pen in the first image, it can be determined whether the shooting angle of the camera can be used as the first preset angle.

[0039] The following uses an application scenario as an example to illustrate the method for determining whether the width of the target breeding pen in the first image is consistent with the image direction in the above step S112. In the above step S11, when the camera's shooting angle is adjusted along the width direction of the target breeding pen, the direction of the camera angle shooting adjustment remains unchanged, and an image of the target breeding pen is acquired once each time the camera's shooting angle is adjusted to obtain multiple first images. Suppose that when the camera's shooting angle is adjusted for the tth time, the length of the outer rectangular bounding box of the first side guardrail in the width direction of the target breeding pen in the first image is h 1,t , width is w 1,t , the length of the rectangular bounding box outside the second side guardrail is h 2,t The width is w 2,t, then when the aspect ratio of the outer rectangular bounding box of the first side and the second side guardrail in the width direction of the target breeding pen in the first image taken for the tth time satisfies the following conditions 1 and 2, it can be determined that the width direction of the breeding pen in the first image obtained when the camera shooting angle is adjusted for the tth time is consistent with the width direction of the image:

[0040] Condition 1: (h 1,t-1 / w 1,t-1 )<(h 1,t / w 1,t )>(h 1,t+1 / w 1,t+1 );

[0041] Condition 2: (h 2,t-1 / w 2,t-1 )<(h 2,t / w 2,t )>(h 2,t+1 / w 2,t+1 ).

[0042] Figure 4 The flowchart of a method for identifying baffles on both sides of the width direction of a target breeding pen in a first image is shown. It can be understood that Figure 4 The process shown is a method of identifying the baffles on both sides of the width direction of the target breeding pen in the first image in the above step S11, which is exemplary and not restrictive, and the description of the first image and the target breeding pen above is also applicable to the description of the first image and the target breeding pen below. Figure 4 Description.

[0043] like Figure 4 As shown, in an application scenario, a method for identifying guardrails on both sides of a target breeding pen in a first image in a width direction includes:

[0044] In step S121, the first image is subjected to grayscale reduction processing, that is, the first image is first subjected to grayscale processing to obtain a corresponding grayscale image, and then the grayscale image is subjected to reduction processing, for example, the pixels of the grayscale image are reduced from 1280×720 to 355×198. The method of grayscale reduction processing on the first image belongs to the prior art. By performing grayscale reduction processing on the first image, the size of the first image can be reduced, so as to reduce the workload of processing the first image in subsequent steps, and improve the work efficiency of identifying the guardrails on both sides of the width direction of the target breeding pen in the first image.

[0045] In step S122, the first image after the grayscale reduction processing is binarized to obtain a first binarized image. When the first image after the grayscale reduction processing is binarized, an adaptive threshold T is first selected, and then the first image is binarized using the adaptive threshold T, that is, in the first image after the grayscale reduction processing, the grayscale value of the pixel whose grayscale value is greater than or equal to T is set to 255, and the grayscale value of the pixel whose grayscale value is less than T is set to 0.

[0046] In step S123, edge detection is performed on the first binarized image to obtain an edge effect map, and the edge effect map is binarized again to obtain a second binarized image.

[0047] In step S124, the first binary image and the second binary image are subjected to an XOR process to obtain a third binary image. For example, let the pixel point with coordinates (i, j) in the first binary image be F 1 (i, j), the coordinates of the pixel point with coordinates (i, j) in the second binary image F 2 (i, j), the pixel with coordinates (i, j) in the third binary image is F 3 (i, j), then after XOR processing the first binary image and the second binary image, if F 1 (i,j)=F 2 (i,j), then F 3 (i,j)=0, if F 1 (i,j)≠F 2 (i,j), then F 3 (i, j)=255, thus obtaining a third binary image.

[0048] In step S125, the connected domains in the third binary image are obtained, and the two largest connected domains on both sides of the width direction are used as two guardrails in the width direction of the target breeding pen. Figure 2 After the above processing is performed on the first image in, the third binary image obtained is as follows Figure 5 As shown, in the image, the area with a pixel value of 255 (i.e. Figure 5 The black area) is the floor of the breeding pen, and the two maximum connected domains with pixel values ​​of 0 on both sides of the width direction in the third binary image are the two guardrails in the width direction of the target breeding pen.

[0049] Furthermore, in another application scenario, the method for identifying the guardrails on both sides of the width direction of the target breeding pen in the above-mentioned first image also includes the step of denoising the first image. In the first image captured by the camera, there are not only guardrails in the width direction of the target breeding pen, but also livestock and slatted manure boards raised in the breeding pen, which may affect the recognition of the guardrails. Therefore, in this embodiment, the first image is also denoised to eliminate the impact of livestock and slatted manure boards on guardrail recognition. In this embodiment, the method for denoising the first image includes: after obtaining the third binary image, corroding it to remove the livestock and slatted manure boards therein, and then dilating the corroded image to restore the baffle information on both sides of the width direction of the target breeding pen in the image.

[0050] The following describes a method for adjusting the shooting angle of a camera in the width direction of a target breeding pen in conjunction with a specific application scenario.

[0051] In one application scenario, adjusting the shooting angle of the camera along the width direction of the target breeding pen in step S11 includes: continuously adjusting the shooting angle of the camera multiple times in the width direction of the target breeding pen, and each adjustment angle is a set step angle. For example, the shooting angle range that the camera can adjust in the width direction of the target breeding pen can be first obtained, and then an angle is obtained at each interval of a set step length within the shooting angle range to obtain multiple shooting angles; then the shooting angle of the camera is adjusted through the cloud platform to shoot the target breeding pen at each shooting angle to obtain multiple first images.

[0052] In a second aspect, the present invention also provides a method for monitoring livestock pens, wherein a patrol track is arranged above each livestock pens in a livestock farm, and a camera is mounted on the patrol track via a pan / tilt platform, and can move along the patrol track, and when moving to a livestock pen, the camera can take a picture of the livestock pen to obtain an image of the livestock pen, thereby monitoring the status of the livestock in each livestock pen. Figure 6 , the method for monitoring breeding pens of the present invention is described in detail.

[0053] like Figure 6 As shown, the method for monitoring breeding pens provided by the present invention includes:

[0054] In step S21, in response to identifying a breeding pen, a preset angle corresponding to the breeding pen is obtained. The camera moves on the inspection track, and when the camera reaches the top of a breeding pen, the identity information of the breeding pen can be identified. For example, the position of each breeding pen is fixed, and the length of the inspection track is also fixed, so a correspondence can be established between the camera movement distance and the identity information of the breeding pen, and then the identity information of the breeding pen is obtained according to the distance the camera moves on the inspection track. For example, when the camera moves a set distance on the inspection track, it can be determined that the camera reaches the top of the breeding pen corresponding to the set distance.

[0055] The above-mentioned obtaining of the preset angle corresponding to the breeding pen refers to obtaining the preset angle corresponding to the breeding pen after the breeding pen is identified. For example, the method for determining the preset angle of the camera provided in the first aspect can be used to obtain the preset angles corresponding to each breeding pen in the farm and store them in a database. After a breeding pen is identified, the preset angle corresponding to the breeding pen is obtained from the database, including the first preset angle, the second preset angle and the third preset angle corresponding to the breeding pen.

[0056] In step S22, the camera is controlled to capture an image of the breeding pen at a preset angle corresponding to the breeding pen to monitor the breeding pen. The preset angles corresponding to the breeding pen include a first preset angle, a second preset angle, and a third preset angle. After the breeding pen is identified, the camera's shooting angles can be set to the first preset angle, the second preset angle, and the third preset angle corresponding to the breeding pen, respectively, and at least one image is captured when the camera's shooting angle is the first preset angle, the second preset angle, and the third preset angle; or after the breeding pen is identified, the camera's shooting angle can be adjusted to the second preset angle, and then the camera's shooting angle is adjusted in the direction of the first preset angle with the second preset angle as the starting point, and when the camera's shooting angle is the first preset angle, the camera's shooting angle is adjusted in the direction of the third preset angle.

[0057] The technical solution provided by the present invention, when monitoring the breeding pens, obtains the preset angles corresponding to each breeding house by the method of the first aspect mentioned above, which can reduce the labor cost of obtaining the preset angles corresponding to each breeding house and improve work efficiency; in addition, the camera is controlled to shoot the target breeding pen from the first preset angle, the second preset angle and the third preset angle corresponding to the breeding pen, and the shooting range can cover the entire breeding pen area, thereby ensuring the comprehensiveness and reliability of the monitoring of the breeding pens.

[0058] In one embodiment, identifying a breeding pen in the above step S22 includes: detecting an identification of the breeding pen, and identifying the breeding pen according to the identification. In this embodiment, a corresponding identification code such as a QR code, a barcode, etc. is set above each breeding pen of the breeding farm. When the camera moves on the inspection track, if the identification code of a breeding pen is detected, it will be determined that the inspection robot has arrived at the breeding pen, and the breeding pen needs to be detected, and then the information of the breeding pen is obtained according to the identification code.

[0059] In a third aspect, the present invention also provides a device, such as Figure 7 As shown, the device includes a processor, a memory, a communication interface and a communication bus, and the processor, the memory and the communication interface communicate with each other through the communication bus. The processor is used to provide computing and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer program instructions. The internal memory provides an environment for the operation of the operating system and computer program instructions in the non-volatile storage medium. The communication interface of the above-mentioned device is used to communicate with an external terminal in a wired or wireless manner, and the wireless method can be implemented through WIFI, an operator network, NFC (near field communication) or other technologies. The device provided in this embodiment, its memory is used to store computer program instructions, and the computer program instructions are executed by the processor to implement the method of the first aspect or the method of the second aspect.

[0060] In a fourth aspect, the present invention also provides a computer-readable storage medium. It can be understood by a person of ordinary skill in the art that all or part of the processes in the method of the first or second aspect of the above-mentioned implementation can be completed by instructing the relevant hardware through computer program instructions, and the computer program instructions can be stored in a non-volatile computer-readable storage medium. When the computer program instructions are executed, they may include the process of the method of the first or second aspect as described above. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0061] According to the above description of this specification, those skilled in the art may also understand that the terms used below, such as "length direction", "width direction" and other terms indicating orientation or position relationship, are based on the orientation or position relationship shown in the drawings of this specification, and are only for the purpose of facilitating the explanation of the scheme of the present invention and simplifying the description, rather than explicitly or implicitly indicating that the device or element involved must have the specific orientation, be constructed and operated in a specific orientation. Therefore, the above-mentioned orientation or position relationship terms cannot be understood or interpreted as limitations on the scheme of the present invention.

[0062] In addition, the terms "first" or "second" used in this specification to refer to numbers or ordinals are only used for descriptive purposes and cannot be understood as explicitly or implicitly indicating relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this specification, the meaning of "plurality" is at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.

[0063] Although this specification has shown and described a plurality of embodiments of the present invention, it is obvious to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will think of many changes, modifications and alternatives without departing from the thought and spirit of the present invention. It should be understood that in the process of practicing the present invention, various alternatives to the embodiments of the present invention described herein may be adopted. The attached claims are intended to define the scope of protection of the present invention, and therefore cover the modular composition, equivalent or alternatives within the scope of protection of these claims.

Claims

1. A method for obtaining a preset angle of a camera, wherein the camera is located above a target breeding pen, and the corresponding image is obtained by adjusting the shooting angle of the camera, characterized in that: The method comprises: Adjusting the shooting angle of the camera along the width direction of the target breeding pen to obtain a plurality of first images; In response to the width direction of the target breeding pen in the first image being consistent with the width direction of the image, taking the shooting angle corresponding to the first image as the first preset angle corresponding to the target breeding pen, wherein the first image has guardrails on both sides of the width direction of the target breeding pen; Starting from the first preset angle, adjusting the shooting angle of the camera along the length direction of the target breeding pen to obtain a plurality of second images; In response to the second image containing a guardrail in the length direction of the target breeding pen, taking a shooting angle corresponding to the second image as a second preset angle or a third preset angle corresponding to the target breeding pen; The adjusting the camera shooting angle along the length direction of the target breeding pen comprises: Starting from the first preset angle, the shooting angle of the camera is adjusted along the first length direction of the target breeding pen. to obtain a plurality of second images, and use the shooting angle corresponding to the second image including the guardrail corresponding to the first length direction as the second preset angle; Starting from the first preset angle, the shooting angle of the camera is adjusted along the second length direction of the target breeding fence to obtain multiple second images, and the shooting angle corresponding to the second image of the fence corresponding to the second length direction is used as the third preset angle.

2. The method for obtaining a preset camera angle according to claim 1, characterized in that: The camera is also located above the midpoint of the target breeding pen in the length direction, the second preset angle and the third preset angle are symmetrical with the first preset angle as the center, and the adjusting the camera shooting angle along the length direction of the target breeding pen includes: Starting from the first preset angle, adjusting the shooting angle of the camera along the first length direction of the target breeding fence to obtain a plurality of second images, and taking the shooting angle corresponding to the second image containing the fence corresponding to the first length direction as the second preset angle; The third preset angle is obtained according to the first preset angle, the second preset angle, and a symmetric relationship between the third preset angle and the second preset angle.

3. The method for obtaining a preset camera angle according to claim 1, characterized in that: In response to the width direction of the target breeding pen in the first image being consistent with the width direction of the image, the method comprises: Identify baffles on both sides of the target breeding pen in the first image in the width direction; According to the length-to-width ratio of the rectangular outer bounding box of the baffles on both sides of the target breeding pen in the width direction in the first image, it is determined whether the width of the target breeding pen in the first image is consistent with the image direction.

4. The method for obtaining a preset camera angle according to claim 3, characterized in that: The identifying of the baffles on both sides of the width direction of the breeding pen on the first image includes: performing grayscale processing and binarization processing on the first image to obtain two largest connected domains located on both sides of the width direction of the first image, and use them as the baffles on both sides of the width direction of the breeding pen.

5. The method for obtaining a preset camera angle according to claim 4, characterized in that: The step of identifying the baffles on both sides of the breeding pen in the width direction of the first image also includes a step of denoising the first image.

6. The method for obtaining a preset camera angle according to claim 1, characterized in that: The step of adjusting the shooting angle of the camera along the width direction of the target breeding pen includes: continuously adjusting the shooting angle of the camera multiple times in the width direction of the target breeding pen, and each adjustment angle is a set step angle.

7. A method for monitoring breeding pens, wherein the preset angle corresponding to each breeding pen is obtained according to the method according to any one of claims 1 to 6, characterized in that: The method for monitoring aquaculture pens comprises: In response to identifying a breeding pen, obtaining a preset angle corresponding to the breeding pen; The camera is controlled to capture an image of the breeding pen at a preset angle corresponding to the breeding pen.

8. A device for monitoring a breeding pen, comprising a processor and a memory, wherein the memory is used to store computer program instructions, and the computer program instructions are executed by the processor to implement the method according to claim 7.

9. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed, the method of claim 7 is implemented.

Citation Information

Patent Citations

  • Panoramic monitoring system and monitoring method of the same based on improved SIFT feature matching

    CN102497539A

  • Motion detection and positioning photography method and device thereof

    CN103780837A

  • Device for detecting whether goods shelf transverse beam is qualified or not through fish-eye lens set

    CN105784714A

  • Shooting method and terminal equipment

    CN109788144A

  • Bridge side fence patrolling flight route planning method

    CN109885098A