WO2022052189A1 - Method and device for acquiring external features of animal, and computer device - Google Patents

Method and device for acquiring external features of animal, and computer device Download PDF

Info

Publication number
WO2022052189A1
WO2022052189A1 PCT/CN2020/118607 CN2020118607W WO2022052189A1 WO 2022052189 A1 WO2022052189 A1 WO 2022052189A1 CN 2020118607 W CN2020118607 W CN 2020118607W WO 2022052189 A1 WO2022052189 A1 WO 2022052189A1
Authority
WO
WIPO (PCT)
Prior art keywords
animal
tested
key feature
shooting
image
Prior art date
Application number
PCT/CN2020/118607
Other languages
French (fr)
Chinese (zh)
Inventor
陶品
颜嘉辰
史元春
韩亮
刘志强
Original Assignee
清华大学
青海大学
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 清华大学, 青海大学 filed Critical 清华大学
Publication of WO2022052189A1 publication Critical patent/WO2022052189A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/62Control of parameters via user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/40Extraction of image or video features
    • G06V10/46Descriptors for shape, contour or point-related descriptors, e.g. scale invariant feature transform [SIFT] or bags of words [BoW]; Salient regional features
    • G06V10/462Salient features, e.g. scale invariant feature transforms [SIFT]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/63Control of cameras or camera modules by using electronic viewfinders
    • H04N23/631Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters
    • H04N23/632Graphical user interfaces [GUI] specially adapted for controlling image capture or setting capture parameters for displaying or modifying preview images prior to image capturing, e.g. variety of image resolutions or capturing parameters

Definitions

  • the present application relates to the technical field of image processing, and in particular, to a method, device and computer equipment for acquiring external features of animals.
  • an embodiment of the present application provides a method for acquiring external characteristics of an animal, the method comprising:
  • the shooting attitude information and the position information of the first key feature point the horizontal shooting distance between the center point of the image collector and the animal to be measured is obtained, and the first key feature point refers to the to-be-measured animal.
  • the key feature points whose distance from the ground is less than the first threshold the key feature points whose distance from the ground is less than the first threshold;
  • the external feature value to be tested corresponding to the animal to be tested is obtained.
  • the external features to be measured include at least one body size to be measured and/or at least one attribute to be measured of the animal to be measured, the horizontal shooting distance and the corresponding external features to be measured.
  • the corresponding attribute value to be measured of the animal to be measured is obtained.
  • the shooting attitude information includes a shooting pitch angle and a shooting roll angle
  • the center point of the image collector and the animal to be measured are obtained according to the shooting attitude information and the position information of the first key feature point.
  • the horizontal shooting distance between including:
  • the second included angle formed by the first key feature point and the first vertical point relative to the center point of the image collector is obtained, and the first vertical point Refers to the vertical projection point of the center point of the image collector relative to the ground plane on which the animal to be tested stands;
  • the horizontal shooting distance between the center point of the image collector and the animal to be tested is obtained through the operation of the tangent function.
  • the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured obtain the corresponding body size parameters of the animal to be measured, including:
  • the third angle formed by the corresponding two key feature points relative to the center point of the image collector is obtained;
  • the parameters of the body size to be measured corresponding to the animal to be measured are obtained.
  • the acquiring the shooting height of the image collector when shooting the target image includes:
  • the shooting height of the image collector relative to the ground plane where the animal to be tested stands is obtained.
  • performing feature extraction on the target image to obtain multiple key feature point information of the animal to be tested contained in the target image including:
  • the method further includes:
  • first prompt information is output, and the first prompt information is used to remind the operator to re-shoot the target image of the animal to be tested.
  • the present application also proposes a device for acquiring external features of animals, the device comprising:
  • an information acquisition module used for acquiring a target image of the animal to be tested, and the shooting attitude information when the image collector shoots the target image
  • a feature extraction module is used to perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, and the key feature point information includes the corresponding key feature points in the target image. location information in the image;
  • the horizontal shooting distance obtaining module is used to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting attitude information and the position information of the first key feature point.
  • the first key Feature points refer to the key feature points whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested;
  • the external feature value obtaining module to be tested is used for obtaining the external feature value to be tested corresponding to the animal to be tested according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be tested.
  • the present application also proposes a computer device, the computer device comprising:
  • a memory for storing a program that implements the above-mentioned method for obtaining an attribute value of an animal
  • the processor is configured to load and execute the program, and implement each step of the above-mentioned method for obtaining an attribute value of an animal.
  • the computer device is a mobile terminal or a server
  • the computer device When the computer device is the mobile terminal, the computer device further includes:
  • An image collector for taking images of the animal to be tested
  • a display screen for outputting the image of the animal to be tested captured by the image collector
  • attitude sensors for sensing the shooting attitude information when the image collector shoots the target image of the animal to be tested
  • the communication interface is used to receive the target image of the animal to be tested shot and sent by the image collector, and the shooting posture information when the image collector shoots the target image; The corresponding external characteristic value of the tested animal is fed back to the preset mobile terminal for output.
  • the present application provides a method, device and computer equipment for acquiring external features of animals.
  • external features such as weight and height of an animal to be measured need to be acquired, in order to avoid manual measurement of the animal to be tested or measurement of users
  • this embodiment proposes to use image analysis to obtain the external characteristic value of the animal to be tested.
  • the shooting attitude information of the target image is obtained by extracting the features of the target image to obtain a plurality of key feature point information of the animal to be tested, such as position information.
  • the horizontal shooting distance between the center point of the image collector and the animal to be tested so as to obtain the corresponding external feature value to be tested according to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested. Since the above-mentioned target image in this embodiment can be captured by an ordinary image collector, a professional depth camera must be used, which greatly reduces the equipment cost for acquiring the external features of the animal, and reduces the professional requirements for the user who captures the image, and The requirement of the site where the animal to be tested is located improves the universality of the method for acquiring the external features of the animal proposed in this application.
  • FIG. 1a is a schematic diagram of the hardware structure of an optional example of the computer device proposed by the application.
  • FIG. 1b is a schematic diagram of the hardware structure of another optional example of another computer device proposed by this application.
  • FIG. 2 is a schematic diagram of an optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
  • FIG. 3 is a schematic diagram of another optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
  • FIG. 4 is a schematic diagram of another optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
  • FIG. 5 is a schematic flowchart of an optional example of the method for acquiring external features of animals proposed by the application;
  • FIG. 6 is a schematic diagram of a shooting posture of an image collector for shooting an image of an animal to be tested in the method for acquiring external features of an animal proposed by the present application;
  • FIG. 7 is a schematic diagram of another optional animal shooting scene suitable for the method for obtaining external features of animals proposed by the present application.
  • FIG. 8 is a schematic flowchart of another optional example of the method for acquiring external features of animals proposed by the application.
  • Fig. 9a is an optional schematic diagram of the target image of the animal to be measured obtained in the animal external feature acquisition method proposed by the application;
  • 9b is an optional schematic diagram of the obtained target image of the animal to be tested in the method for acquiring external features of animals proposed by the application;
  • FIG. 10 is a schematic diagram of an optional scene in which the key feature points of the animal to be tested are adjusted in the method for acquiring external features of animals proposed by the application;
  • FIG. 11 is a schematic diagram of another optional animal shooting scene suitable for the method for obtaining external features of animals proposed by the present application;
  • FIG. 12 is a schematic structural diagram of an optional example of the device for obtaining external features of animals proposed by the present application.
  • FIG. 13 is a schematic structural diagram of another optional example of the device for acquiring external features of animals proposed by the application;
  • FIG. 14 is a schematic structural diagram of yet another optional example of the apparatus for acquiring external features of animals proposed in the present application.
  • a depth camera is used to take pictures of the animal to be tested, to obtain the key feature point information on the image of the animal to be tested, and then according to the depth
  • the distance measured by the camera is calculated to obtain the external feature value of at least one external feature of the animal to be tested.
  • the external feature may include but is not limited to the weight, length, height, etc. of the animal to be tested.
  • the cost of cameras is also high and difficult to popularize.
  • the present application hopes to take pictures of the animals to be measured by using the common camera of the electronic equipment that has been popularized at present, and then analyze and process the captured images to obtain the external characteristics to be measured, so as to reduce the equipment cost and avoid the external appearance of the animals.
  • the electronic device may be a terminal with an image acquisition function, such as a smart phone, a tablet computer, a wearable device, etc. This application does not limit the device type of the electronic device, which can be determined according to the actual needs of the application scenario.
  • system means for distinguishing different components, elements, parts, parts or assemblies at different levels.
  • device means for converting signals into signals.
  • unit means for converting signals into signals.
  • module means for converting signals into signals.
  • the computer device may include, but is not limited to, a communication interface 11, a memory 12, and a processor 13, where:
  • the number of the communication interface 11 , the memory 12 , and the processor 13 can be at least one, and the communication interface 11 , the memory 12 , and the processor 13 can communicate with each other through a communication bus.
  • the communication interface 11 may include an interface of a communication module, such as a GSM module, a WIFI module, an interface for realizing data communication in a mobile communication network (such as a 5G and 6G network), etc.
  • a communication module such as a GSM module, a WIFI module
  • an interface for realizing data communication in a mobile communication network such as a 5G and 6G network
  • the communication interface 11 may also include interfaces such as a USB interface, a serial/parallel port, etc., for realizing the internal components of the computer equipment
  • the data interaction between them such as various intermediate data, input parameters, etc., which are generated or required in the implementation process of the animal external feature acquisition method proposed in this application, can be determined according to the needs of the actual application scenario, and this application does not go into detail. described.
  • the memory 12 may store a program composed of multiple instructions for implementing the method for acquiring external features of an animal provided by the embodiment of the present application, and the processor 13 calls and loads the program stored in the memory 12, thereby realizing the external animal external feature provided by the embodiment of the present application.
  • the processor 13 calls and loads the program stored in the memory 12, thereby realizing the external animal external feature provided by the embodiment of the present application.
  • the memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage device.
  • the processor 13 may be a central processing unit (Central Processing Unit, CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate Array (FPGA) or other programmable logic devices, etc.
  • CPU Central Processing Unit
  • ASIC application-specific integrated circuit
  • DSP digital signal processor
  • ASIC application-specific integrated circuit
  • FPGA off-the-shelf programmable gate Array
  • the memory 12 may include a program storage area and a data storage area
  • the program storage area may store an operating system and an application program required for at least one function (such as an image display function) to realize the application proposed in the present application.
  • the data storage area can store the data generated during the use of the computer equipment, such as the captured images of each frame of the animal to be tested, the input shooting parameters of the image collector (such as a camera), The height of the operator who uses the image pickup to capture the image, etc., depends on the situation.
  • FIG. 1a does not constitute a limitation on the computer device in the embodiments of the present application.
  • the computer device may include more or less components than those shown in FIG. 1a , This application does not list them all here.
  • the above-mentioned computer equipment may be a mobile terminal with a certain image processing capability, such as a smart phone, a tablet computer, etc.
  • the computer equipment may further include:
  • the image collector 14 is used for capturing images of the animal to be tested.
  • the image collector may be a built-in camera of a mobile terminal, such as a common optical camera, and the structure and working principle of the image collector will not be described in detail in this application.
  • the display screen 15 is used for outputting the image of the animal to be tested captured by the image collector 14 .
  • the display screen 15 may be a touch display screen, which includes a touch sensing unit capable of sensing touch events on the touch display panel, and a user using the mobile terminal can perform operations such as zooming in, zooming out, Touch operations such as the shooting focus are selected to obtain a target image of the animal to be tested that meets the requirements.
  • a touch display screen which includes a touch sensing unit capable of sensing touch events on the touch display panel, and a user using the mobile terminal can perform operations such as zooming in, zooming out, Touch operations such as the shooting focus are selected to obtain a target image of the animal to be tested that meets the requirements.
  • the above-mentioned display screen 15 can also be a non-touch display screen, and the user can use the input device of the mobile terminal to realize the input operation of the content presented on the display screen 15, which includes but is not limited to the above-mentioned various methods of displaying images. operation, depending on the situation.
  • attitude sensors 16 are used for sensing the shooting attitude information when the image collector shoots the target image of the animal to be tested.
  • the attitude sensor 16 may specifically include, but is not limited to, a gyroscope sensor, various angle sensors, position sensors, distance sensors, acceleration sensors, touch sensors, temperature sensors, etc., and may be determined according to the use requirements of the mobile terminal itself. It can be seen that the present application can utilize the gesture sensor of the mobile terminal itself to meet the requirements for acquiring external features of animals, and the specific implementation process can refer to the descriptions in the corresponding parts of the embodiments below, which will not be described in detail here.
  • the above-mentioned communication interface 11 may include various memory interfaces, earphone interfaces, antenna communication interfaces, etc., which may be determined according to the actual external device communication requirements and internal component communication requirements, and this embodiment does not Detailed description.
  • the structure of the mobile terminal shown in FIG. 1b does not constitute a limitation on the mobile terminal in this embodiment of the present application.
  • the mobile terminal may include more or less components than those shown in FIG. 1b, or Combining certain components, such as power management module, battery, charge management module, vibration mechanism, indicator light, audio module, speaker (ie horn), microphone, receiver (ie earpiece), mobile communication module, antenna and other input devices, output Equipment, this application does not list them all here.
  • the above-mentioned computer device may also be a server.
  • the user only needs to upload the target image (which may be a picture or video, etc.) and related parameters of the animal to be tested to the server, and the server will follow the application in this application.
  • the proposed method for acquiring the external features of animals can obtain the external feature values of the corresponding animals to be tested.
  • the equipment that does not need to shoot images of the animals to be tested has high image processing capabilities, which reduces the requirements for the equipment. For example, ordinary cameras, camera etc.
  • the above-mentioned communication interface 11 is used to receive the data of the animal to be tested captured and sent by the image collector.
  • the target image and the shooting attitude information when the image collector shoots the target image, and at the same time, the obtained external characteristic values of the animal to be tested corresponding to the test are fed back to the preset mobile terminal for output.
  • the computer device After the image of the animal to be tested is obtained, it can be wirelessly transmitted to a computer device (which can be a server, or, if the image of the animal to be tested is collected by a camera deployed on a livestock farm, as shown in Figure 3, the computer device here It can also be an electronic device with data processing capability, but is not limited to this), the computer device obtains the corresponding external feature value of the animal to be tested according to the method for acquiring external features of animals described in the following method embodiments.
  • a computer device which can be a server, or, if the image of the animal to be tested is collected by a camera deployed on a livestock farm, as shown in Figure 3, the computer device here It can also be an electronic device with data processing capability, but is not limited to this
  • the computer device obtains the corresponding external feature value of the animal to be tested according to the method for acquiring external features of animals described in the following method embodiments.
  • the user can also hold a mobile terminal with a certain image processing capability and a built-in image collector, and shoot to be The image of the animal to be tested is obtained, and the mobile terminal executes the method for acquiring external features of the animal proposed in the present application to obtain and output relevant information about the external features of the animal to be tested.
  • the computer equipment suitable for the method and apparatus for acquiring external features of animals proposed in this application can be a server or a mobile terminal with an integrated image collector and a certain image processing capability.
  • the program corresponding to the method for acquiring external features of animals provided by the embodiments implements the methods for acquiring external features of animals provided by the embodiments of the present application.
  • the program can be stored in the memory of the computing device and invoked by the processor to realize program functions.
  • the specific implementation process is not Do limit.
  • FIG. 5 a schematic flowchart of an optional example of the method for acquiring external features of animals provided by the embodiment of the present application is shown.
  • the method can be applied to computer equipment. It can be seen from the above analysis that the device type of the computer equipment in the present application is different. For limitation, it can be determined according to a specific application scenario, and the application scenario can refer to, but is not limited to, several scenarios for obtaining external features of animals listed above, and this application only takes this as an example for illustrative description.
  • the method for acquiring external features of animals proposed in this embodiment may include but is not limited to the following steps:
  • Step S51 acquiring the target image of the animal to be tested, and the shooting posture information when the image collector shoots the target image;
  • the image capture of the animal to be tested can be realized by a mobile terminal with an image collector, that is, the operator (such as animal management personnel, measurement personnel, etc.) can hold the mobile terminal and start the mobile terminal.
  • the image acquisition device (such as a camera) of the terminal points the image acquisition direction to the current direction of the animal to be tested, so that the animal to be tested appears in the preview box, click the shooting button to obtain the target image of the animal to be tested.
  • the camera deployed in the livestock breeding ground can also capture the image of each animal to be tested, and then transmit the image to a computer device with data processing capability through wireless communication, as described above.
  • the specific acquisition method of the target image of the animal to be tested in this application is not limited, and can be determined according to the actual application scenario, and is not limited to the above listed in this application. Method to realize.
  • multiple frames of images of the animal to be tested may be continuously captured (such as continuous multiple frames of pictures or videos.
  • computer equipment can extract the corresponding images of the animal to be tested from it.
  • Continuous multi-frame pictures the realization process will not be described in detail), but because the application requires the feature points of the whole body of the animal to be tested, and the captured image needs to contain a complete image of the animal to be tested, the above-mentioned target image in this embodiment can be Refers to the target image that contains the complete animal to be tested.
  • the image acquisition preview frame that is, the preview image displayed on the display screen of the mobile terminal contains the complete image to be tested.
  • the image acquisition preview frame that is, the preview image displayed on the display screen of the mobile terminal contains the complete image to be tested.
  • the relative height between the image collector and the animal to be tested is uncertain, it is often affected by the height of the animal to be tested, the operator (ie the user who takes the image) and the height of the animal to be tested.
  • the shooting parameters of the image collector have a certain relationship with the relative positional relationship between the operator and the animal to be tested in the current shooting scene. In this way, when the application needs to predict the horizontal distance between the image collector and the animal to be tested It can be realized in combination with the relevant shooting parameters of the image collector at the time of shooting.
  • the shooting parameters such as the shooting posture information of the image collector may affect the image acquisition when the target image is captured.
  • the shooting pitch angle (Pitch) of the image collector can also be called the tilt angle, as shown in FIG.
  • the rotation angle of the horizontal centerline of the image collector can change the pitch angle of the image collector.
  • the shooting pitch angle is usually determined according to the horizontal distance between the animal to be measured and the image collector, as well as the height of the animal to be measured itself, so as to ensure that the image collected by the image collector can contain complete
  • the image collector can be zoomed to adjust the display size of the animal to be measured in the entire image preview frame to meet the shooting requirements.
  • the shooting pitch can be determined according to the needs of the actual shooting scene. angle, which is not described in detail in this application.
  • the shooting roll angle can refer to the rotation angle of the image collector around the Z axis (which usually refers to the acquisition direction of the image collector, that is, the direction of the lens), as shown in Figure 6, in the actual shooting process, for the image acquisition
  • the image collector can rotate around the axis perpendicular to the screen of the mobile terminal; in the same way, the heading angle Yaw of the image collector can refer to the rotation angle of the image collector around the Y axis, that is, the image collector rotates around the Y axis.
  • the shooting attitude information such as the shooting pitch angle and shooting roll angle described above can be determined by the parameters sensed by the mobile terminal with the image collector or the various sensors of the independent image collector.
  • the sensors may include gyroscopes, various angle sensors, position sensors, etc.
  • the type and number of sensors may be determined according to actual detection requirements, but are not limited to the detection methods described in this embodiment.
  • Step S52 perform feature extraction on the target image to obtain multiple key feature point information of the animal to be tested contained in the target image;
  • the key feature point information includes the position information of the corresponding key feature point in the target image. Since the key feature point may be a certain pixel point of the animal to be tested in the target image, the corresponding position information can be obtained from the The three-dimensional coordinates of the pixel in the image coordinate system (such as the color values of R, G, and B in the RGB coordinate system, but not limited to this) are determined, or the coordinates of the pixel in the image coordinate system are converted to The three-dimensional coordinates in the camera coordinate system, etc., may depend on the situation, and the present application does not limit the content included in the information of each key feature point.
  • the three-dimensional coordinates of the pixel in the image coordinate system such as the color values of R, G, and B in the RGB coordinate system, but not limited to this
  • the three-dimensional coordinates in the camera coordinate system, etc. may depend on the situation, and the present application does not limit the content included in the information of each key feature point.
  • the key feature points of the animal to be tested may refer to feature points that can represent different external features of the animal to be tested, usually located on the body surface of the animal to be tested, that is, the edge feature points belonging to the animal to be tested in the target image (It refers to the edge feature points of the three-dimensional image), which can be specifically determined according to the category of the animal to be measured and the category of external features to be measured (such as the type of body size parameters to be measured, the category of attributes to be measured) and other information.
  • To obtain each external feature value of the animal to be tested it is necessary to know the position of the animal to be tested, so that the feature point corresponding to the position is recorded as a key feature point.
  • the positions and numbers of the corresponding key feature points may be different.
  • This application can be pre-determined according to the above method and combined with the actual measurement requirements.
  • the target image of the animal to be tested when extracting the key feature points of the animal to be tested, it is possible to know which position of the animal to be tested needs to be extracted directly according to the preset correspondence between each animal to be tested and each of the key feature points.
  • the feature points are key feature points, and the specific implementation process is not limited.
  • the animal to be tested is a yak
  • it is necessary to measure the yak's height, body length and other external characteristic values here can refer to the body size parameter
  • the body size parameter of height needs to know the distance between the highest point in the vertical direction of the yak (that is, the highest point on the yak's back) and the lowest point (that is, the contact point between the yak's hoof and the ground).
  • the feature points with a higher position among the feature points on the back of the yak can be recorded as key feature points, and the feature points where the yak hooves are in contact with the ground can be recorded as key feature points. It should be understood that in order to improve the reliability of image analysis , in determining various key feature points, several feature points adjacent to each other can be selected as key feature points, and then further screened to avoid omission and reduce the detection accuracy.
  • one or more feature points with the most protruding yak's mouth in the obtained yak's target image can be determined as key feature points, and the yak's tail can be determined as the key feature point.
  • the most prominent one or more feature points are determined as key feature points, and the distance between the most distant key feature points among the two types of key feature points is calculated in turn to obtain the body length of the yak.
  • the process of acquiring other body size parameters of the yak to be measured and the process of acquiring each of the body size parameters to be measured of other animals to be tested are similar, and will not be described in detail in this application.
  • the present application can use a preset feature extraction algorithm to process the target image of the animal to be tested to obtain key feature points and location information of the animal to be tested in the target image.
  • the test animal trains a corresponding feature extraction model. In this way, after obtaining the target image of the animal to be tested, the target image is directly input into the feature extraction model for processing, and the key feature point information of the animal to be tested is output.
  • the specific implementation process is not limited and can be determined according to actual application requirements.
  • Step S53 obtaining the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting attitude information and the position information of the first key feature point;
  • the first key feature point in this embodiment refers to the key feature point whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested.
  • the location and the number of the first key feature points can be determined according to the category of the animal to be tested. It should be understood that the distance between the first key feature point and the ground may be zero or a small value, therefore, the first threshold is usually a relatively small value, but the specific value of the first threshold is not limited in this application.
  • the adjusted shooting attitude information of the image collector is often based on the horizontal shooting distance between the center point of the image collector and the animal to be tested, and the Factors such as the height of the measured animal are determined, and reverse reasoning.
  • the shooting attitude information and the position information of the first key feature point can be used to obtain the shooting target image through calculation.
  • the level between the animal to be tested and the center point of the image collector Shooting distance in the process of acquiring the horizontal shooting distance, can be realized according to actual needs in combination with corresponding auxiliary parameters, such as the height of the operator to shoot the image of the animal to be measured by holding an electronic device with an image collector, and the independence of shooting the image of the animal to be tested.
  • the specific acquisition process of the horizontal shooting distance is not limited in this application.
  • the horizontal shooting distance calculated according to the above method may refer to the first distance between the center point of the image collector and the animal to be tested.
  • the horizontal distance GP between the key feature points represents the ground distance between the image collector and the animal to be measured, not the distance in the X-axis direction of the image collector coordinate system.
  • Step S54 according to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested, obtain the external feature value to be tested corresponding to the animal to be tested;
  • the position information of the key feature points located at different positions of the animal to be tested may be different.
  • the key feature point is recorded as the second key feature point, and the second key feature point may include the above-mentioned first key feature point and other key feature points, which may be specifically determined according to the measurement requirements of each external feature to be measured.
  • a second external characteristic value corresponding to the external characteristic value to be measured is obtained.
  • the position information of the key feature points since the number of the second key feature points corresponding to one external feature value to be measured is often multiple, such as two, three or even more, this embodiment can The position information of the second key feature point is calculated to obtain the corresponding external feature value to be measured.
  • this application needs to obtain the real external feature value of the animal to be tested, not the external feature value in the image. Therefore, in the operation process, the coordinate system can be converted to obtain the corresponding position of the real animal to be tested.
  • the position information of the second key feature point, so that the obtained external feature value to be measured is the actual external feature value of the animal to be tested.
  • the actual external characteristic value of the animal to be tested can be obtained by processing such as coordinate conversion, and this application will not describe the conversion process in detail.
  • the external characteristics of the animal to be tested may include at least one of the body measurements of the animal to be measured (such as the above-mentioned height, length, body oblique length, chest circumference, etc.), and/or at least An attribute to be measured (such as weight).
  • the attribute value of the animal to be measured is usually calculated based on the corresponding body size parameters. Therefore, in the actual measurement, the body size parameters of the animal to be measured can be obtained first, and then further based on this. Get the property value to be tested.
  • the above-mentioned step S54 may specifically include: obtaining the body size parameters to be measured corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured, and according to the obtained at least one The body size parameter to be measured is obtained, and the corresponding attribute value to be measured of the animal to be measured is obtained.
  • the external feature value of the body size parameter to be measured is the corresponding relationship between the external feature value and the key feature points.
  • the above method is used to obtain After at least one body size parameter of the animal to be measured, the value of the corresponding attribute to be measured of the animal to be measured can be further estimated according to the predetermined calculation relationship, such as the weight of the animal to be measured, etc.
  • the method of obtaining the operation relationship between the body size parameters of the object to be measured and the attributes to be measured, and the expression method of the operation relationship are not limited, and can be determined according to actual needs.
  • the body size parameters to be measured required to obtain the value of the property to be measured may be different, which can be determined according to actual measurement experience or experiments.
  • the position and number of the second key feature points of the animal to be measured are often different. Therefore, in practical applications, it can be determined according to the properties to be measured of the animal to be measured this time.
  • This embodiment proposes to use image analysis to obtain the external features of the animal to be tested.
  • an image collector is used to obtain the target image of the animal to be tested, and the shooting attitude information when the image collector captures the target image.
  • Feature extraction is performed on the target image to obtain a plurality of key feature point information of the animal to be tested, such as position information.
  • the center point of the image collector and the to-be-to-be-measured center point can be determined according to the position information of the first key feature point and the above shooting attitude information.
  • the horizontal shooting distance between the animals is measured, so as to obtain the corresponding external feature to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured. Since the above-mentioned target image in this embodiment can be captured by an ordinary image collector, a professional depth camera must be used, which greatly reduces the equipment cost for acquiring the external features of the animal, and reduces the professional requirements for the user who captures the image, and The requirement of the site where the animal to be tested is located improves the universality of the method for acquiring the external features of the animal proposed in this application.
  • FIG. 8 a schematic flowchart of another optional example of the method for acquiring external features of animals provided by the embodiment of the present application is shown.
  • This embodiment may be an optional refinement implementation of the method for acquiring external features of animals proposed in the above embodiments. However, it is not limited to the detailed implementation manner described in this embodiment.
  • the method may include:
  • Step S81 acquiring the target image of the animal to be tested, and the shooting pitch angle and shooting roll angle when the image collector shoots the target image;
  • step S81 For the specific implementation process of step S81, reference may be made to the descriptions in the corresponding parts of the foregoing embodiments, and details are not repeated here.
  • the shooting pitch angle and shooting roll angle if the image collector shoots the target image, there is a certain shooting pitch angle, as shown in FIG. 7, which will lead to The horizontal center line (ie X axis) of the image collector is no longer in a parallel relationship with the horizon, but in an intersecting relationship; if there is a certain shooting roll angle, the image of the animal to be tested in the captured image is inclined, as shown in Figure 9a
  • the parameter calculation can be carried out in a corresponding way according to the actual state of the animal to be tested in the target image. Perform tilt calibration on the target image to obtain a calibrated image as shown in FIG. 9b , and then perform subsequent calculations, which are not limited in this application, and may be determined according to circumstances.
  • the image preview interface of the image collector or computer equipment can display the current shooting lens, The captured preview image of the image to be tested, the shooting user can adjust the shooting angle, distance, etc. of the image collector according to actual needs, so that the animal to be tested is in the frontmost central position in the preview image, that is, the animal to be tested is in focus The center position, and the complete animal to be tested is photographed, and then the shooting button is pressed to obtain the target image of the animal to be tested, but it is not limited to this implementation.
  • the computer device can use an edge detection algorithm to acquire contour information (ie, edge information) of the animal to be tested in the preview image, and determine whether the acquired contour information is Meet the shooting requirements, such as whether it contains the complete contour information of the animal to be tested, if so, determine the frame preview image as the target image, if not, instruct the image collector to adjust the shooting according to the matching degree between the acquired contour information and the shooting requirements
  • Attitude information such as adjusting the shooting angle, shooting distance, zoom magnification (that is, using the digital zoom or optical zoom function of the image collector and its computer equipment to adjust to change the size of the animal to be tested in the entire preview image, and the specific zoom adjustment process) This embodiment does not describe in detail), etc., so that the image collector with the adjusted post-shooting attitude information, the profile information of the animal to be tested contained in the re-obtained preview image meets the shooting requirements, and the specific implementation process is not detailed in this embodiment. described.
  • this application does not limit the specific content of the edge detection algorithm on which the contour information of the animal to be measured is obtained, such as target detection algorithm based on semantic segmentation, edge detection algorithm based on search, edge detection algorithm based on zero crossing, etc. , which can be flexibly selected according to the actual application requirements, which are not described in detail in this application.
  • Step S82 input the target image into the image feature extraction model to obtain multiple key feature points of the animal to be tested contained in the target image;
  • the image feature extraction model can be obtained by training the sample images of each sample animal based on a machine learning algorithm, and is used to extract the key feature points of any sample animal.
  • the machine learning algorithm can be flexible according to the needs of the actual application scenario. Selection, such as a deep neural network, etc., this application does not describe in detail the type of machine learning algorithm on which the image feature extraction model is trained, and the specific training process of the model.
  • the present embodiment may obtain the multiplicity of data extracted this time according to the confidence of each key feature point, the topological position relationship formed by the respective position information of the multiple key feature points, and the like.
  • the overall score of each key feature point if the overall score reaches the preset score, it can be considered that the key feature points on the animal to be tested are completely extracted this time; otherwise, the overall score does not reach the preset score, it can be considered that the mentioned
  • the multiple key feature points of the test are not complete enough to calculate the body size parameters of the animal to be tested.
  • the corresponding prompt information can be output to remind the shooting user to re-collect the image of the animal to be tested, and According to the above method, feature extraction and verification are performed on the collected target image again to ensure that the mentioned multiple key feature points of the animal to be tested are complete.
  • the implementation method of how to verify whether the mentioned multiple key feature points of the animal to be tested are complete is not limited to the implementation method described above in this embodiment, and can be flexibly adjusted according to actual application requirements. I won't go into detail here.
  • Step S83 outputting multiple key feature points of the animal to be tested contained in the target image
  • Step S84 in response to the position adjustment operation for the output at least one key feature point, obtain a plurality of key feature point information of the animal to be tested;
  • the identification may not be accurate enough.
  • the present application proposes to calibrate the identified key feature points, but is not limited to the manual calibration solution described in this embodiment.
  • the identified key feature points of the animal to be tested may be output first.
  • the extracted key feature points of the animal to be tested can be represented by black dots, and the user can intuitively see the extracted key feature points through the display interface of the mobile terminal Where is the position on the animal to be tested? According to experience, if it thinks that the position of one or more key feature points currently proposed is not accurate enough, it can select the key feature point and drag it to a more accurate position.
  • the user can click the key feature point with inaccurate position with his finger, move the position of the key feature point in the direction of the arrow until it reaches the position that the user thinks is more accurate, release the finger, and realize the key feature point. Position adjustment.
  • the electronic device In the process of adjusting the position of the above key feature points, for the electronic device, it can respond to the position adjustment operation for at least one output key feature point, and obtain the corresponding key feature point information according to the position information of the adjusted key feature point.
  • the content contained in the key feature point information is not limited in this application, which may be determined according to the situation.
  • the implementation of the position of the key feature points extracted by manual calibration proposed in this application is not limited to the adjustment methods described in the above embodiments, and input devices (such as a mouse and a keyboard) of an electronic device can also be used.
  • the corresponding function keys (such as the direction keys of the keyboard, the preset click operation of the mouse, etc.) are realized, which can be determined according to the actual application scenario, or can be determined by the user according to the personal operation habits, which is not limited in this application.
  • Step S85 using the position information of the first key feature point to determine the first distance between the first key feature point and the horizontal center line of the image collector;
  • the first key feature point refers to the key feature point whose distance from the ground is less than the first threshold value among the multiple key feature points of the animal to be tested, with reference to Figure 7 above, it is assumed that the first key feature point is A key feature point is G, the horizontal center line of the image collector is the X-axis in FIG.
  • the first distance can be the vertical distance from the pixel point g to the X axis, and the specific acquisition method of the first distance in the present application is not Do limit.
  • Step S86 using the first distance and the shooting roll angle to obtain the first included angle of the first key feature point relative to the horizontal center line of the image collector;
  • the present embodiment can be based on different coordinate systems (such as the coordinate conversion relationship between the image coordinate system, the world coordinate system, etc.), using the first distance and the shooting roll angle to obtain the first angle ⁇ of the first key feature point G relative to the horizontal center line OX of the image collector XOG.
  • the present application can realize the calculation of the above-mentioned first included angle in combination with the configuration parameters currently possessed by the image collector, such as image resolution, zoom magnification, etc. limited.
  • Step S87 using the first included angle and the shooting pitch angle to obtain the second included angle formed by the first key feature point and the first vertical point relative to the center point of the image collector;
  • the first vertical point refers to the vertical projection point of the center point of the image collector relative to the ground plane where the animal to be tested stands, such as the point P shown in Figure 7, the horizontal center line OX and the vertical center line OY of the image collector
  • the formed angle ⁇ XOY is a right angle. Therefore, as shown in FIG. 7 , the second angle ⁇ GOP formed by the first key feature point G and the first vertical point P relative to the center point O of the image collector is the same as that obtained above.
  • the first included angle, the shooting pitch angle, and the second included angle in step S87 are all determined by converting to the same coordinate system, so as to ensure that these angles can be reliably performed in step S87 according to the above-mentioned angular relationship.
  • Step S88 acquiring the shooting height of the image collector when shooting the target image
  • the animal to be tested and the user usually stand on a basically flat ground, and the distance between the two is 5 meters to 10 meters (but not limited to this, and can be adjusted according to actual needs). Specifically, it can be determined according to the habit, body shape and other parameters of the animal to be tested. At this time, it can be considered that the user who took the image and the animal to be tested are standing on the same ground plane, as shown in FIG. 7 .
  • the shooting height of the image collector is determined according to the height of ordinary people. For example, if the user's height is between 1.6 meters and 1.8 meters (the user's height can be adjusted according to the actual situation), the height of the image collector when shooting images is usually the same as that of the user's eyes. The heights are similar.
  • this application can consider that the shooting height of the image collector is the height of the user minus 0.1 meters (but not limited to this, it can be adjusted according to the actual situation, and this application only uses this as an example to illustrate), That is, between 1.5 meters and 1.7 meters, but it is not limited to this. According to the actual situation, the shooting height when the current user uses the image collector to shoot the image of the animal to be tested can also be input in advance.
  • the first height difference can be determined in advance.
  • the height difference is input as a configuration parameter of the image collector, so that when the captured target image is processed in the above manner, the height difference can be combined with the processing.
  • the shooting height of the image collector obtained in this embodiment may be a relative shooting height, that is, the height of the center point O of the image collector relative to the ground plane on which the animal to be tested stands, as shown in the figure
  • the shooting height OP in 11 includes the above-mentioned first height difference between different standing ground planes.
  • the above step S88 may include: calling the height and the first height difference of the operating body (that is, the above-mentioned user) of the shooting target image, and obtaining the image capture according to the height and the first height difference of the operating body
  • the shooting height of the monitor relative to the ground plane where the animal to be tested stands but is not limited to this implementation.
  • Step S89 using the shooting height to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured through the operation of the tangent function;
  • the horizontal shooting distance GP between O and the animal to be tested can represent the height of the user who shoots the image of the animal to be tested;
  • 0.1 can represent the height difference between the user and the image collector;
  • tan( ) represents a tangent function.
  • calculation formula for calculating the horizontal shooting distance is not limited to the calculation formula listed above, and can be flexibly adjusted according to the requirements of actual application scenarios, which will not be described in detail in this application.
  • Step S810 according to the respective position information of any two key feature points of the animal to be tested, obtain a third angle formed by the corresponding two key feature points relative to the center point of the image collector;
  • the horizontal shooting distance GP from the center point O of the image collector to the animal to be measured is obtained in the above-mentioned manner, it can be used as a basic parameter to realize the calculation of various external characteristics of the animal to be measured.
  • it can be used as a basic parameter to realize the calculation of various external characteristics of the animal to be measured.
  • determine the two key feature points required to obtain the external feature to be tested and then use the respective position information of the two key feature points to calculate the relative relationship between the two key feature points.
  • the corresponding third angle is expressed as ⁇ AOB.
  • the acute angle formed by connecting the center point O of the image collector can also be used as the third angle in this way.
  • the position information of the key feature points, and the realization process of calculating the corresponding third included angle will not be described in detail.
  • Step S811 using the third included angle and the horizontal shooting distance to obtain the feature point distance between the corresponding two key feature points;
  • the trigonometric function can be combined.
  • Step S812 using the obtained feature point distances between at least two second key feature points corresponding to each type of body size to be measured, to obtain body size parameters to be measured corresponding to the animal to be measured;
  • Step S813 according to the obtained at least one body size parameter to be measured, obtain the corresponding attribute value to be measured of the animal to be measured.
  • the present application can determine the corresponding second key feature points according to the body size parameters to be measured that actually need to be measured, and then , and using the determined feature point distances between the second key feature points, the body size parameter to be measured is obtained by calculation.
  • the bust size of the animal to be measured can be calculated according to the distance between the feature points; as shown in the key feature points C and D in Figure 10, the key feature points can be obtained in the above manner The distance between the feature points between C and D can be used to obtain the body length of the animal to be tested, etc. This application will not give examples one by one.
  • the corresponding attribute values to be tested can be further calculated according to the empirical formula between the body size parameters of the animal to be tested and the attributes to be tested.
  • this embodiment proposes to use The method of image analysis realizes the non-contact measurement of the external features of the animal to be tested, and also gets rid of the heavy manual labor caused by the manual measurement method.
  • an ordinary optical camera that is, the above-mentioned image collector
  • an ordinary optical camera can be used to capture the image of the animal to be tested, and then use the relevant shooting parameters of the captured target image, and the The position information of the key feature points of the animal to be tested in the target image is calculated to obtain the shooting horizontal distance between the animal to be tested and the center point of the image collector, so as to obtain the feature point distance between the two key feature points, and then
  • the body size parameters to be measured and the attribute values to be measured are obtained by calculation, which meets the measurement requirements of the external features of the animal to be measured in the application scenario, and improves the universality of the method for obtaining the external features of the animal proposed in the present application.
  • the scheme of the method for obtaining external features of animals proposed in the present application is described.
  • the following will take the computer equipment as an example of photographing the user's mobile phone and measuring the weight of a yak.
  • the computer equipment that implements the scheme of this application includes but is not limited to mobile phones, and the animals to be tested include but are not limited to yak, but also other large animals such as camels, horses, elephants, etc.
  • the properties of the animals to be tested are tested. (That is, the external characteristic value of the animal's body) includes but is not limited to the body weight, which can be determined according to the actual animal measurement requirements, which will not be described in detail in this application.
  • the user can use the camera of the mobile phone to aim at the yak to be tested, and check whether the currently collected yak image is through the preview frame of the display screen. Meet the measurement requirements, such as whether the yak to be tested is located in the center of the preview frame, and contains the complete outline of the yak to be tested, if the measurement requirements are met, press the shooting button, and the obtained image will be used as the target image.
  • the extraction model performs feature extraction on it, and displays multiple key feature points of the extracted yak in the image, such as the 16 key feature points shown in Figure 10 above, but is not limited to this.
  • the user can check whether the displayed yak's key feature points are accurate. If not, they can manually adjust the positions of the corresponding key feature points to obtain an ideal image of the yak to be tested.
  • the adjustment process can be referred to but It is not limited to the description of the corresponding parts of the above embodiments.
  • the mobile phone can also use the default parameters without performing the above adjustment steps, and directly perform subsequent processing on the obtained image, which can be determined according to the actual situation.
  • the mobile phone can use the shooting posture information when shooting the above-mentioned ideal target image (the content of which can refer to the description of the corresponding part of the above-mentioned embodiment), such as the user's height H, the distance between the user and the ground plane where the animal to be tested is standing.
  • the shooting posture information when shooting the above-mentioned ideal target image (the content of which can refer to the description of the corresponding part of the above-mentioned embodiment), such as the user's height H, the distance between the user and the ground plane where the animal to be tested is standing.
  • Parameters such as the first height difference (which can be controlled within 10 centimeters or determined according to the actual situation), the height difference between the height of the camera and the height of the user (such as the above 0.1 meters, but not limited to this), and the parameters to be Measure the position of the contact point between the yak and the ground plane, etc., according to the processing method described in the above embodiment, estimate the shooting horizontal distance between the yak to be measured and the user, and then combine the extracted position information of each key feature point, Calculate the body size parameters of the yak to be tested, and then further estimate the weight of the yak to be tested.
  • FIG. 12 it is a schematic structural diagram of an optional example of the device for obtaining external features of animals proposed in the present application.
  • the device can be applied to the above-mentioned computer equipment.
  • the device can include:
  • the information acquisition module 121 is used to acquire the target image of the animal to be tested, and the shooting posture information when the image collector shoots the target image;
  • the feature extraction module 122 is configured to perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, and the key feature point information includes the corresponding key feature points in the location information in the target image;
  • the feature extraction module 122 may include:
  • a model processing unit configured to input the target image into an image feature extraction model to obtain a plurality of key feature points of the animal to be tested contained in the target image;
  • a key feature point output unit for outputting a plurality of key feature points of the animal to be tested contained in the target image
  • the position adjustment unit is configured to obtain multiple key feature point information of the animal to be tested in response to the position adjustment operation for the output at least one key feature point.
  • the device for acquiring external features of animals proposed in this application may also include:
  • the verification module is used to verify the integrity of the obtained multiple key feature points of the animal to be tested; if the verification is passed, the follow-up process is performed;
  • the prompt information output module is configured to output first prompt information when the result of the verification module is that the verification fails, and the first prompt information is used to remind the operator to re-shoot the target image of the animal to be tested.
  • the horizontal shooting distance obtaining module 123 is used to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting posture information and the position information of the first key feature point, the first The key feature points refer to the key feature points whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested;
  • the external feature value obtaining module 124 to be measured is configured to obtain the external feature value to be measured corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured.
  • the external feature to be tested may include at least one body size to be measured and/or at least one attribute to be tested of the animal to be tested, therefore, as shown in FIG. 13 , the above-mentioned external feature value to be tested Obtaining module 124 may include:
  • a body measure parameter obtaining unit configured to obtain the body measure parameter corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body measure to be measured;
  • the attribute value obtaining unit is configured to obtain the corresponding attribute value to be measured of the animal to be measured according to the obtained at least one body size parameter to be measured.
  • the above-mentioned shooting attitude information may include shooting pitch angle, shooting roll angle, shooting zoom magnification and other information.
  • the above-mentioned horizontal shooting distance obtaining module 123 may include:
  • a first distance determination unit 1231 configured to use the position information of the first key feature point to determine the first distance between the first key feature point and the horizontal center line of the image collector;
  • the first included angle obtaining unit 1232 is used to obtain the first included angle of the first key feature point relative to the horizontal center line by using the first distance and the shooting roll angle;
  • the second included angle obtaining unit 1233 is configured to use the first included angle and the shooting pitch angle to obtain the second angle formed by the first key feature point and the first vertical point relative to the center point of the image collector.
  • the first vertical point refers to the vertical projection point of the center point of the image collector relative to the ground plane on which the animal to be tested stands;
  • a shooting height obtaining unit 1234 configured to obtain the shooting height of the image collector when shooting the target image
  • the shooting height obtaining unit 1234 may include:
  • a parameter calling unit used for calling the height and the first height difference of the operating body that shoots the target image
  • a shooting height obtaining unit configured to obtain the shooting height of the image collector relative to the ground plane on which the animal to be tested stands according to the height of the operating body and the first height difference.
  • the horizontal shooting distance obtaining unit 1235 is used for obtaining the horizontal shooting distance between the center point of the image collector and the animal to be measured by using the above shooting height and through tangent function operation.
  • the above-mentioned body size parameter obtaining unit may include:
  • the third included angle obtaining unit 1241 is configured to obtain a third angle formed by the corresponding two key feature points relative to the center point of the image collector according to the respective position information of any two key feature points of the animal to be tested. included angle;
  • the feature point distance obtaining unit 1242 is used to obtain the feature point distance between the corresponding two key feature points by using the third included angle and the horizontal shooting distance;
  • the body measure parameter obtaining unit 1243 is used to obtain the corresponding body to be measured of the animal to be measured by using the obtained feature point distances between at least two second key feature points corresponding to each type of body measure to be measured. Ruler parameter.
  • the present application also provides a storage medium on which a computer program can be stored, and the computer program can be called and loaded by a processor to implement each step of the method for acquiring external features of an animal described in the above embodiments.
  • the present application also provides an animal external feature acquisition system, which may include a mobile terminal and a server.
  • the mobile terminal may have an image collector and certain image processing capabilities, and it has the structure described in the above computer equipment, and can execute the various steps of the method for acquiring external features of animals proposed in this application.
  • the implementation process may refer to the description of the corresponding part of the above-mentioned embodiment, which is not repeated.
  • the mobile terminal can also associate the obtained external feature value of the animal to be tested with its corresponding acquisition time, and upload it to the server for storage.
  • the captured target image of the animal to be tested and other shooting parameters can also be uploaded to the server for storage for subsequent calling and viewing.
  • the mobile terminal is only used as an image acquisition device and does not perform image processing. Then, in combination with the descriptions in the corresponding parts of the above embodiments, the user can use the mobile terminal to collect the target image of the animal to be tested, and upload the relevant shooting parameters to the Server:
  • the server executes each step of the animal external feature acquisition method proposed in the present application, obtains the required external feature value, and then feeds it back to the mobile terminal for output, so as to reduce the processing burden of the mobile terminal and improve processing efficiency.
  • the user can use the mobile terminal to shoot images of multiple animals to be tested and upload them to the server, which can simultaneously acquire the external features of multiple animals to be tested.
  • the server can simultaneously acquire the external features of multiple animals to be tested.
  • a software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
  • RAM random access memory
  • ROM read only memory
  • electrically programmable ROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Human Computer Interaction (AREA)
  • Signal Processing (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Studio Devices (AREA)

Abstract

Provided in the present application are a method and device for acquiring the external features of an animal, and a computer device. A common image capturing device is utilized to acquire a target image of an animal to be measured and photographing posture information of the image capturing device when photographing the target image, feature extraction is performed with respect to the target image to produce information of multiple key feature points of said animal, and the horizontal photographing distance between the center point of the image capturing device and said animal is determined on the basis of location information of a first key feature point and of photographing posture information, thus acquiring, on the basis of the horizontal photographing distance and location information of a second key feature point corresponding to body measurements to be measured, corresponding external feature values to be measured, preventing possible injuries that may be inflicted on said animal or on a measuring user during manual measurement, reducing equipment costs and professional requirements on the photographing user and a photographing venue, and increasing the universality of the method set forth in the present application for acquiring the external features of an animal.

Description

动物外部特征获取方法、装置及计算机设备Method, Apparatus and Computer Equipment for Obtaining External Characteristics of Animals
本申请要求于2020年09月09日提交中国专利局、申请号为202010940011.3、发明名称为“动物外部特征获取方法、装置及计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202010940011.3 and the invention titled "Method, Apparatus and Computer Equipment for Obtaining External Characteristics of Animals", which was filed with the China Patent Office on September 9, 2020, the entire contents of which are incorporated by reference in in this application.
技术领域technical field
本申请涉及图像处理技术领域,具体涉及一种动物外部特征获取方法、装置及计算机设备。The present application relates to the technical field of image processing, and in particular, to a method, device and computer equipment for acquiring external features of animals.
背景技术Background technique
在畜牧养殖领域,为了实现动物的科学有效喂养与管理,通常需要测量动物的体重、体尺(如身高、长度、胸围、体斜长等)等外部特征,来确定相应动物的生长及营养情况。但由于动物往往不会安静听从人的指挥,这为动物外部特征的测量带来很大困难,尤其是对于体型较大的动物,在人工测量过程中,可能会因动物不配合固定而对动物或对测量人员造成伤害。In the field of animal husbandry, in order to realize the scientific and effective feeding and management of animals, it is usually necessary to measure the external characteristics of animals such as body weight and body size (such as height, length, chest circumference, body oblique length, etc.) to determine the growth and nutritional status of the corresponding animals. . However, because animals often do not obey human commands quietly, this brings great difficulties to the measurement of the external characteristics of animals, especially for larger animals. or cause injury to the measuring personnel.
为了避免上述伤害,目前提出利用激光探测仪等方式对动物进行扫描,根据扫描的三维重建结果,来获得动物需要测量的外部特征值,但这种测量方式需要建造专用的圈道让动物从中走过,才能够完成测量,且所需测量设备价格昂贵、对测量环境要求较高,这都限制了这种测量方式的应用普及。In order to avoid the above injuries, it is currently proposed to scan the animal by means of a laser detector, and obtain the external characteristic values that the animal needs to measure according to the 3D reconstruction results of the scan. However, the measurement can be completed only after the measurement is completed, and the required measurement equipment is expensive and has high requirements on the measurement environment, which limits the application and popularization of this measurement method.
发明内容SUMMARY OF THE INVENTION
有鉴于此,为了避免人工测量对待测动物或测量用户可能造成的伤害威胁,本申请实施例提供一种动物外部特征获取方法,所述方法包括:In view of this, in order to avoid the threat of injury that may be caused by manual measurement of the animal to be tested or the measurement user, an embodiment of the present application provides a method for acquiring external characteristics of an animal, the method comprising:
获取待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;Obtain the target image of the animal to be tested, and the shooting attitude information when the image collector shoots the target image;
对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,所述关键特征点信息包含相应关键特征点在所述目标图像中的位置信息;Perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, where the key feature point information includes position information of the corresponding key feature point in the target image;
依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,所述第一关键特征点是指所述待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点;According to the shooting attitude information and the position information of the first key feature point, the horizontal shooting distance between the center point of the image collector and the animal to be measured is obtained, and the first key feature point refers to the to-be-measured animal. Among the multiple key feature points of the animal, the key feature points whose distance from the ground is less than the first threshold;
依据所述水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值。According to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested, the external feature value to be tested corresponding to the animal to be tested is obtained.
可选的,所述待测外部特征包括所述待测动物的至少一种待测体尺和/或至少一种待测属性,所述依据所述水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值,包括Optionally, the external features to be measured include at least one body size to be measured and/or at least one attribute to be measured of the animal to be measured, the horizontal shooting distance and the corresponding external features to be measured. The position information of the second key feature point to obtain the corresponding external feature value to be tested of the animal to be tested, including
依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测体尺参数;According to the horizontal shooting distance and the position information of the second key feature point corresponding to the body measure to be measured, obtain the body measure parameter to be measured corresponding to the animal to be measured;
依据获得的至少一种待测体尺参数,得到所述待测动物相应的待测属性值。According to the obtained at least one body size parameter to be measured, the corresponding attribute value to be measured of the animal to be measured is obtained.
可选的,所述拍摄姿态信息包含拍摄俯仰角和拍摄翻滚角,所述依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,包括:Optionally, the shooting attitude information includes a shooting pitch angle and a shooting roll angle, and the center point of the image collector and the animal to be measured are obtained according to the shooting attitude information and the position information of the first key feature point. The horizontal shooting distance between, including:
利用所述第一关键特征点的位置信息,确定所述第一关键特征点与所述图像采集器的水平中心线的第一距离;Using the position information of the first key feature point, determine the first distance between the first key feature point and the horizontal center line of the image collector;
利用所述第一距离及所述拍摄翻滚角,得到所述第一关键特征点相对于所述水平中心线的第一夹角;Using the first distance and the shooting roll angle to obtain a first included angle of the first key feature point relative to the horizontal centerline;
利用所述第一夹角及所述拍摄俯仰角,得到所述第一关键特征点与第一垂直点相对于所述图像采集器中心点所形成的第二夹角,所述第一垂直点是指所述图像采集器中心点相对于所述待测动物所站立的地平面的垂直投影点;Using the first included angle and the shooting pitch angle, the second included angle formed by the first key feature point and the first vertical point relative to the center point of the image collector is obtained, and the first vertical point Refers to the vertical projection point of the center point of the image collector relative to the ground plane on which the animal to be tested stands;
获取拍摄所述目标图像时所述图像采集器的拍摄高度;obtaining the shooting height of the image collector when shooting the target image;
利用所述拍摄高度,通过正切函数运算,得到所述图像采集器中心点与所述待测动物之间的水平拍摄距离。Using the shooting height, the horizontal shooting distance between the center point of the image collector and the animal to be tested is obtained through the operation of the tangent function.
可选的,所述依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测体尺参数,包括:Optionally, according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured, obtain the corresponding body size parameters of the animal to be measured, including:
依据所述待测动物的任意两个关键特征点各自的位置信息,得到相应的两个关键特征点相对于所述图像采集器中心点所形成的第三夹角;According to the respective position information of any two key feature points of the animal to be tested, the third angle formed by the corresponding two key feature points relative to the center point of the image collector is obtained;
利用所述第三夹角及所述水平拍摄距离,得到相应的两个关键特征点之间的特征点距离;Use the third included angle and the horizontal shooting distance to obtain the feature point distance between the corresponding two key feature points;
利用得到的每一种待测体尺对应的至少两个第二关键特征点相互之间的特征点距离,获得所述待测动物相应的待测体尺参数。Using the obtained feature point distances between at least two second key feature points corresponding to each type of body size to be measured, the parameters of the body size to be measured corresponding to the animal to be measured are obtained.
可选的,若所述操作体与所述待测动物各自所在地面之间存在第一高度差,所述获取拍摄所述目标图像时所述图像采集器的拍摄高度,包括:Optionally, if there is a first height difference between the operating body and the respective surfaces of the animal to be tested, the acquiring the shooting height of the image collector when shooting the target image includes:
调用拍摄所述目标图像的操作体的身高及所述第一高度差;calling the height and the first height difference of the operating body that captures the target image;
依据所述操作体的身高及所述第一高度差,获得所述图像采集器相对于所述待测动物所站立的地平面的拍摄高度。According to the height of the operating body and the first height difference, the shooting height of the image collector relative to the ground plane where the animal to be tested stands is obtained.
可选的,所述对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,包括:Optionally, performing feature extraction on the target image to obtain multiple key feature point information of the animal to be tested contained in the target image, including:
将所述目标图像输入图像特征提取模型,得到所述目标图像包含的所述待测动物的多个关键特征点;Inputting the target image into an image feature extraction model to obtain a plurality of key feature points of the animal to be tested contained in the target image;
输出所述目标图像包含的所述待测动物多个关键特征点;outputting multiple key feature points of the animal to be tested contained in the target image;
响应针对输出的至少一个关键特征点的位置调整操作,得到所述待测动物的多个关键特征点信息。In response to the position adjustment operation for the output at least one key feature point, multiple key feature point information of the animal to be tested is obtained.
可选的,所述方法还包括:Optionally, the method further includes:
对得到的所述待测动物的多个关键特征点进行完整性验证;Perform integrity verification on the obtained multiple key feature points of the animal to be tested;
如果验证不通过,输出第一提示信息,所述第一提示信息用于提醒操作体重新拍摄所述待测动物的目标图像。If the verification fails, first prompt information is output, and the first prompt information is used to remind the operator to re-shoot the target image of the animal to be tested.
本申请还提出了一种动物外部特征获取装置,所述装置包括:The present application also proposes a device for acquiring external features of animals, the device comprising:
信息获取模块,用于获取待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;an information acquisition module, used for acquiring a target image of the animal to be tested, and the shooting attitude information when the image collector shoots the target image;
特征提取模块,用于对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,所述关键特征点信息包含相应关键特征点在所述目标图像中的位置信息;A feature extraction module is used to perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, and the key feature point information includes the corresponding key feature points in the target image. location information in the image;
水平拍摄距离获得模块,用于依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,所述第一关键特征点是指所述待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点;The horizontal shooting distance obtaining module is used to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting attitude information and the position information of the first key feature point. The first key Feature points refer to the key feature points whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested;
待测外部特征值获得模块,用于依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值。The external feature value obtaining module to be tested is used for obtaining the external feature value to be tested corresponding to the animal to be tested according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be tested.
本申请还提出了一种计算机设备,所述计算机设备包括:The present application also proposes a computer device, the computer device comprising:
通信接口;Communication Interface;
存储器,用于存储实现如上述的动物属性值获取方法的程序;A memory for storing a program that implements the above-mentioned method for obtaining an attribute value of an animal;
处理器,用于加载并执行所述程序,实现如上述的动物属性值获取方法的各个步骤。The processor is configured to load and execute the program, and implement each step of the above-mentioned method for obtaining an attribute value of an animal.
可选的,所述计算机设备为移动终端或服务器;Optionally, the computer device is a mobile terminal or a server;
当所述计算机设备为所述移动终端,所述计算机设备还包括:When the computer device is the mobile terminal, the computer device further includes:
图像采集器,用于拍摄待测动物的图像;An image collector for taking images of the animal to be tested;
显示屏,用于输出所述图像采集器拍摄到的所述待测动物的图像;a display screen for outputting the image of the animal to be tested captured by the image collector;
多种姿态传感器,用于感应图像采集器拍摄所述待测动物的目标图像时的拍摄姿态信息;A variety of attitude sensors for sensing the shooting attitude information when the image collector shoots the target image of the animal to be tested;
当所述计算机设备为服务器,所述通信接口用于接收图像采集器拍摄并发送的所述待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;将所述待测动物相应的待测外部特征值反馈至预设移动终端输出。When the computer device is a server, the communication interface is used to receive the target image of the animal to be tested shot and sent by the image collector, and the shooting posture information when the image collector shoots the target image; The corresponding external characteristic value of the tested animal is fed back to the preset mobile terminal for output.
基于上述技术方案,本申请提供了一种动物外部特征获取方法、装置及计算机设备,当需要获取待测动物的如体重、身高等外部特征的情况下,为了避免人工测量对待测动物或测量用户可能造成的伤害威胁,本实施例提出利用图像分析的方式获取待测动物的待测外部特征值,具体的,利用图像采集器获取待测动物的目标图像,以及图像采集器拍摄该目标图像时的拍摄姿态信息,通过对该目标图像进行特征提取,得到待测动物的多个关键特征点信息,如位置信息,之后,可以依据第一关键特征点的位置信息及上述拍摄 姿态信息,来确定图像采集器中心点与待测动物之间的水平拍摄距离,从而依据该水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得相应的待测外部特征值。由于本实施例上述目标图像可以由普通的图像采集器拍摄得到,必须要使用专业的深度摄像头,极大降低了动物外部特征获取的设备成本,且降低了对拍摄图像的用户的专业要求,以及待测动物所在场地的要求,提高了本申请提出的动物外部特征获取方法的普适性。Based on the above technical solutions, the present application provides a method, device and computer equipment for acquiring external features of animals. When external features such as weight and height of an animal to be measured need to be acquired, in order to avoid manual measurement of the animal to be tested or measurement of users The threat of injury that may be caused, this embodiment proposes to use image analysis to obtain the external characteristic value of the animal to be tested. The shooting attitude information of the target image is obtained by extracting the features of the target image to obtain a plurality of key feature point information of the animal to be tested, such as position information. After that, it can be determined according to the position information of the first key feature point and the above shooting attitude information The horizontal shooting distance between the center point of the image collector and the animal to be tested, so as to obtain the corresponding external feature value to be tested according to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested. Since the above-mentioned target image in this embodiment can be captured by an ordinary image collector, a professional depth camera must be used, which greatly reduces the equipment cost for acquiring the external features of the animal, and reduces the professional requirements for the user who captures the image, and The requirement of the site where the animal to be tested is located improves the universality of the method for acquiring the external features of the animal proposed in this application.
附图说明Description of drawings
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the accompanying drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only It is an embodiment of the present application. For those of ordinary skill in the art, other drawings can also be obtained according to the provided drawings without any creative effort.
图1a为本申请提出的计算机设备的一可选示例的硬件结构示意图;FIG. 1a is a schematic diagram of the hardware structure of an optional example of the computer device proposed by the application;
图1b为本申请提出的又一种计算机设备的又一可选示例的硬件结构示意图;FIG. 1b is a schematic diagram of the hardware structure of another optional example of another computer device proposed by this application;
图2为适用于本申请提出的动物外部特征获取方法的一可选应用场景示意图;2 is a schematic diagram of an optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
图3为适用于本申请提出的动物外部特征获取方法的又一可选应用场景示意图;3 is a schematic diagram of another optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
图4为适用于本申请提出的动物外部特征获取方法的又一可选应用场景示意图;FIG. 4 is a schematic diagram of another optional application scenario applicable to the method for obtaining external features of animals proposed by the present application;
图5为本申请提出的动物外部特征获取方法的一可选示例的流程示意图;5 is a schematic flowchart of an optional example of the method for acquiring external features of animals proposed by the application;
图6为本申请提出的动物外部特征获取方法中,图像采集器拍摄待测动物图像的拍摄姿态示意图;6 is a schematic diagram of a shooting posture of an image collector for shooting an image of an animal to be tested in the method for acquiring external features of an animal proposed by the present application;
图7为适用于本申请提出的动物外部特征获取方法的又一可选动物拍摄场景示意图;7 is a schematic diagram of another optional animal shooting scene suitable for the method for obtaining external features of animals proposed by the present application;
图8为本申请提出的动物外部特征获取方法的又一可选示例的流程示意图;8 is a schematic flowchart of another optional example of the method for acquiring external features of animals proposed by the application;
图9a为本申请提出的动物外部特征获取方法中,所得待测动物的目标图 像的一可选示意图;Fig. 9a is an optional schematic diagram of the target image of the animal to be measured obtained in the animal external feature acquisition method proposed by the application;
图9b为本申请提出的动物外部特征获取方法中,所得待测动物的目标图像的一可选示意图;9b is an optional schematic diagram of the obtained target image of the animal to be tested in the method for acquiring external features of animals proposed by the application;
图10为本申请提出的动物外部特征获取方法中,调整待测动物的关键特征点的一可选场景示意图;10 is a schematic diagram of an optional scene in which the key feature points of the animal to be tested are adjusted in the method for acquiring external features of animals proposed by the application;
图11为适用于本申请提出的动物外部特征获取方法的又一可选动物拍摄场景示意图;11 is a schematic diagram of another optional animal shooting scene suitable for the method for obtaining external features of animals proposed by the present application;
图12为本申请提出的动物外部特征获取装置的一可选示例的结构示意图;FIG. 12 is a schematic structural diagram of an optional example of the device for obtaining external features of animals proposed by the present application;
图13为本申请提出的动物外部特征获取装置的又一可选示例的结构示意图;13 is a schematic structural diagram of another optional example of the device for acquiring external features of animals proposed by the application;
图14为本申请提出的动物外部特征获取装置的又一可选示例的结构示意图。FIG. 14 is a schematic structural diagram of yet another optional example of the apparatus for acquiring external features of animals proposed in the present application.
具体实施方式detailed description
为了改善背景技术部分描述的现有技术问题,提出采用图像分析方式实现对动物外部特征的获取,具体利用深度相机对待测动物进行拍照,获取待测动物图像上的关键特征点信息,再根据深度相机测量的距离,计算得到待测动物的至少一个待测外部特征的外部特征值,该外部特征可以包括但并不局限于待测动物的体重、体长、身高等,但这种专业的深度相机成本也较高,难以普及。In order to improve the existing technical problems described in the background technology, it is proposed to use an image analysis method to obtain the external features of animals. Specifically, a depth camera is used to take pictures of the animal to be tested, to obtain the key feature point information on the image of the animal to be tested, and then according to the depth The distance measured by the camera is calculated to obtain the external feature value of at least one external feature of the animal to be tested. The external feature may include but is not limited to the weight, length, height, etc. of the animal to be tested. The cost of cameras is also high and difficult to popularize.
基于此,本申请希望能够利用目前已经普及的电子设备具有的普通摄像头对待测动物拍照,再通过对拍摄到的图像进行分析处理,得到所需测量外部特征,以降低设备成本,同时避免动物外部特征获取过程中,对待测动物和测量人员造成伤害,并能够适用于各种应用场景。其中,电子设备可以是具有图像采集功能的终端,如智能手机、平板电脑、可穿戴设备等,本申请对该电子设备的设备类型不做限定,可以根据应用场景的实际需求确定。Based on this, the present application hopes to take pictures of the animals to be measured by using the common camera of the electronic equipment that has been popularized at present, and then analyze and process the captured images to obtain the external characteristics to be measured, so as to reduce the equipment cost and avoid the external appearance of the animals. In the process of feature acquisition, the animal to be tested and the measurement personnel are harmed, and it can be applied to various application scenarios. The electronic device may be a terminal with an image acquisition function, such as a smart phone, a tablet computer, a wearable device, etc. This application does not limit the device type of the electronic device, which can be determined according to the actual needs of the application scenario.
需要说明,关于本申请如何利用拍摄到的普通二维图像,得到待测动物的待测外部特征的具体实现过程,下面将结合本申请实施例中的附图,对 本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。而且,为了便于描述,附图中仅示出了与有关发明相关的部分。在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。It should be noted that with regard to the specific implementation process of how to obtain the external characteristics of the animal to be tested by using the ordinary two-dimensional images captured in the present application, the following will combine the drawings in the embodiments of the present application to describe the technical solutions in the embodiments of the present application. For a clear and complete description, it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application. Also, for convenience of description, only parts related to the related invention are shown in the drawings. The embodiments in this application and the features in the embodiments may be combined with each other without conflict.
应当理解,本申请中使用的“系统”、“装置”、“单元”和/或“模块”是用于区分不同级别的不同组件、元件、部件、部分或装配的一种方法。然而,如果其他词语可实现相同的目的,则可通过其他表达来替换该词语。It should be understood that "system", "device", "unit" and/or "module" as used in this application is a method used to distinguish different components, elements, parts, parts or assemblies at different levels. However, other words may be replaced by other expressions if they serve the same purpose.
如本申请和权利要求书中所示,除非上下文明确提示例外情形,“一”、“一个”、“一种”和/或“该”等词并非特指单数,也可包括复数。一般说来,术语“包括”与“包含”仅提示包括已明确标识的步骤和元素,而这些步骤和元素不构成一个排它性的罗列,方法或者设备也可能包含其它的步骤或元素。由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。As shown in this application and in the claims, unless the context clearly dictates otherwise, the words "a", "an", "an" and/or "the" are not intended to be specific in the singular and may include the plural. Generally speaking, the terms "comprising" and "comprising" only imply that the clearly identified steps and elements are included, and these steps and elements do not constitute an exclusive list, and the method or apparatus may also include other steps or elements. The inclusion of an element by the phrase "comprising a..." does not preclude the presence of additional identical elements in the process, method, article of manufacture or apparatus that includes the element.
其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,在本申请实施例的描述中,“多个”是指两个或多于两个。以下术语“第一”、“第二”仅用于描述目的,而不能理解为指示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征。Wherein, in the description of the embodiments of the present application, unless otherwise stated, “/” means or means, for example, A/B can mean A or B; “and/or” in this document is only a description of the associated object The association relationship of , indicates that there can be three kinds of relationships, for example, A and/or B, can indicate that A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" refers to two or more than two. The following terms "first" and "second" are only used for descriptive purposes, and should not be construed as indicating or implying relative importance or implying the number of indicated technical features. Thus, a feature defined as "first" or "second" may expressly or implicitly include one or more of that feature.
另外,本申请中使用了流程图用来说明根据本申请的实施例的系统所执行的操作。应当理解的是,前面或后面操作不一定按照顺序来精确地执行。相反,可以按照倒序或同时处理各个步骤。同时,也可以将其他操作添加到这些过程中,或从这些过程移除某一步或数步操作。In addition, flowcharts are used in this application to illustrate operations performed by a system according to an embodiment of the application. It should be understood that the preceding or following operations are not necessarily performed in the exact order. Instead, the various steps can be processed in reverse order or simultaneously. At the same time, other actions can be added to these procedures, or a step or steps can be removed from these procedures.
参照图1a,示出了本申请实施例提供的一种计算机设备的硬件结构示意图图,该计算机设备可以包括但并不局限于:通信接口11、存储器12和处理器13,其中:1a, a schematic diagram of the hardware structure of a computer device provided by an embodiment of the present application is shown. The computer device may include, but is not limited to, a communication interface 11, a memory 12, and a processor 13, where:
在本申请实施例中,通信接口11,存储器12,处理器13的数量均可以为至少一个,且通信接口11,存储器12,处理器13可以通过通信总线完成相互间的通信。In this embodiment of the present application, the number of the communication interface 11 , the memory 12 , and the processor 13 can be at least one, and the communication interface 11 , the memory 12 , and the processor 13 can communicate with each other through a communication bus.
可选的,通信接口11可以包括通信模块的接口,如GSM模块、WIFI模块、实现移动通信网络(如5G、6G网络)数据通信的接口等,在实际应用中,其可以用于实现与其他设备的数据交互,如传输待测动物的图像、得到的待测动物的待测外部特征等;该通信接口11还可以包括如USB接口、串/并口等接口,用于实现计算机设备内部组成部件之间的数据交互,如传说本申请提出的动物外部特征获取方法实现过程中产生或所需的各种中间数据、输入参数等,可以根据实际应用场景的需求确定,本申请不做一一详述。Optionally, the communication interface 11 may include an interface of a communication module, such as a GSM module, a WIFI module, an interface for realizing data communication in a mobile communication network (such as a 5G and 6G network), etc. In practical applications, it can be used to realize communication with other The data interaction of the device, such as the transmission of the image of the animal to be tested, the obtained external characteristics of the animal to be tested, etc.; the communication interface 11 may also include interfaces such as a USB interface, a serial/parallel port, etc., for realizing the internal components of the computer equipment The data interaction between them, such as various intermediate data, input parameters, etc., which are generated or required in the implementation process of the animal external feature acquisition method proposed in this application, can be determined according to the needs of the actual application scenario, and this application does not go into detail. described.
存储器12可以存储用于实现本申请实施例提供的动物外部特征获取方法的多个指令构成的程序,由处理器13调用并加载存储器12所存储的程序,从而实现本申请实施例提供的动物外部特征获取方法,具体实现过程可以参照但并不局限于下文相应实施例的描述。The memory 12 may store a program composed of multiple instructions for implementing the method for acquiring external features of an animal provided by the embodiment of the present application, and the processor 13 calls and loads the program stored in the memory 12, thereby realizing the external animal external feature provided by the embodiment of the present application. For the feature acquisition method and the specific implementation process, reference may be made to, but not limited to, the descriptions of the corresponding embodiments below.
在本申请实施例中,存储器12可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件或其他易失性固态存储器件。处理器13,可以为中央处理器(Central Processing Unit,CPU)、特定应用集成电路(application-specific integrated circuit,ASIC)、数字信号处理器(DSP)、专用集成电路(ASIC)、现成可编程门阵列(FPGA)或者其他可编程逻辑器件等。In the embodiment of the present application, the memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device or other volatile solid-state storage device. The processor 13 may be a central processing unit (Central Processing Unit, CPU), an application-specific integrated circuit (ASIC), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate Array (FPGA) or other programmable logic devices, etc.
在一种可能的实现方式中,存储器12可以包括程序存储区和数据存储区,该程序存储区可以存储操作系统、以及至少一个功能(如图像显示功能)所需的应用程序、实现本申请提出的动物外部特征获取方法的程序等;数据存储区可以存储计算机设备使用过程中所产生的数据,如拍摄到的待测动物的各帧图像、输入的图像采集器(如摄像头)的拍摄参数、使用图像采集器拍摄图像的操作体的身高等,可视情况而定。In a possible implementation manner, the memory 12 may include a program storage area and a data storage area, and the program storage area may store an operating system and an application program required for at least one function (such as an image display function) to realize the application proposed in the present application. The data storage area can store the data generated during the use of the computer equipment, such as the captured images of each frame of the animal to be tested, the input shooting parameters of the image collector (such as a camera), The height of the operator who uses the image pickup to capture the image, etc., depends on the situation.
应该理解的是,图1a所示的计算机设备的结构并不构成对本申请实施例中计算机设备的限定,在实际应用中,计算机设备可以包括比图1a所示的更多或更少的部件,本申请在此不做一一列举。It should be understood that the structure of the computer device shown in FIG. 1a does not constitute a limitation on the computer device in the embodiments of the present application. In practical applications, the computer device may include more or less components than those shown in FIG. 1a , This application does not list them all here.
在一些实施例中,上述计算机设备可以是具有一定图像处理能力的移动终端,如智能手机、平板电脑等,在这种情况下,如图1b所示,该计算机设备还可以包括:In some embodiments, the above-mentioned computer equipment may be a mobile terminal with a certain image processing capability, such as a smart phone, a tablet computer, etc. In this case, as shown in FIG. 1b, the computer equipment may further include:
图像采集器14,用于拍摄待测动物的图像。该图像采集器可以是移动终端内置摄像头,如普通的光学摄像头,本申请对图像采集器的结构及其工作原理不做详述。The image collector 14 is used for capturing images of the animal to be tested. The image collector may be a built-in camera of a mobile terminal, such as a common optical camera, and the structure and working principle of the image collector will not be described in detail in this application.
显示屏15,用于输出图像采集器14拍摄到的待测动物的图像。The display screen 15 is used for outputting the image of the animal to be tested captured by the image collector 14 .
实际应用中,该显示屏15可以是触摸显示屏,其包括能够感应触摸显示面板上的触摸事件的触摸感应单元,使用该移动终端的用户可以基于显示屏呈现的图像,进行如放大、缩小、选择拍摄焦点等触控操作,以得到满足要求的待测动物的目标图像,具体实现过程本实施例不做详述。In practical applications, the display screen 15 may be a touch display screen, which includes a touch sensing unit capable of sensing touch events on the touch display panel, and a user using the mobile terminal can perform operations such as zooming in, zooming out, Touch operations such as the shooting focus are selected to obtain a target image of the animal to be tested that meets the requirements. The specific implementation process is not described in detail in this embodiment.
当然,上述显示屏15也可以是非触摸显示屏,用户可以利用移动终端的输入设备,实现对显示屏15所呈现内容的输入操作,其包括但并不局限于上文列举的对显示图像的各种操作,可视情况而定。Of course, the above-mentioned display screen 15 can also be a non-touch display screen, and the user can use the input device of the mobile terminal to realize the input operation of the content presented on the display screen 15, which includes but is not limited to the above-mentioned various methods of displaying images. operation, depending on the situation.
多种姿态传感器16,用于感应图像采集器拍摄待测动物的目标图像时的拍摄姿态信息。该姿态传感器16具体可以包括但并不局限于陀螺仪传感器、各种角度传感器、位置传感器、距离传感器、加速度传感器、触摸传感器、温度传感器等,可以根据移动终端自身使用需求等确定。可见,本申请可以利用移动终端自身具有的姿态传感器,满足动物外部特征获取需求,具体实现过程可以参照下文实施例相应部分的描述,在此不做详述。其中,在计算机设备为移动终端的情况下,上述通信接口11可以包括各种存储器接口、耳机接口、天线通信接口等,可以根据实际外部设备通信需求以及内部部件通信需求确定,本实施例不做一一详述。Various attitude sensors 16 are used for sensing the shooting attitude information when the image collector shoots the target image of the animal to be tested. The attitude sensor 16 may specifically include, but is not limited to, a gyroscope sensor, various angle sensors, position sensors, distance sensors, acceleration sensors, touch sensors, temperature sensors, etc., and may be determined according to the use requirements of the mobile terminal itself. It can be seen that the present application can utilize the gesture sensor of the mobile terminal itself to meet the requirements for acquiring external features of animals, and the specific implementation process can refer to the descriptions in the corresponding parts of the embodiments below, which will not be described in detail here. Wherein, in the case where the computer device is a mobile terminal, the above-mentioned communication interface 11 may include various memory interfaces, earphone interfaces, antenna communication interfaces, etc., which may be determined according to the actual external device communication requirements and internal component communication requirements, and this embodiment does not Detailed description.
应该理解的是,图1b所示的移动终端的结构并不构成对本申请实施例中移动终端的限定,在实际应用中,移动终端可以包括比图1b所示的更多或更少的部件,或者组合某些部件,如电源管理模块、电池、充电管理模块、振 动机构、指示灯、音频模块、扬声器(即喇叭)、麦克风、受话器(即听筒)、移动通信模块、天线等其他输入设备、输出设备,本申请在此不做一一列举。It should be understood that the structure of the mobile terminal shown in FIG. 1b does not constitute a limitation on the mobile terminal in this embodiment of the present application. In practical applications, the mobile terminal may include more or less components than those shown in FIG. 1b, or Combining certain components, such as power management module, battery, charge management module, vibration mechanism, indicator light, audio module, speaker (ie horn), microphone, receiver (ie earpiece), mobile communication module, antenna and other input devices, output Equipment, this application does not list them all here.
在又一些实施例中,上述计算机设备也可以是服务器,这种情况下,用户只需要将待测动物的目标图像(可以是图片或视频等)以及相关参数上传至服务器,由服务器按照本申请提出的动物外部特征获取方法,得到相应待测动物的外部特征值,不需要拍摄待测动物图像的设备具有较高的图像处理能力,降低了对该设备的要求,如可以使用普通的相机、摄像机等。In still other embodiments, the above-mentioned computer device may also be a server. In this case, the user only needs to upload the target image (which may be a picture or video, etc.) and related parameters of the animal to be tested to the server, and the server will follow the application in this application. The proposed method for acquiring the external features of animals can obtain the external feature values of the corresponding animals to be tested. The equipment that does not need to shoot images of the animals to be tested has high image processing capabilities, which reduces the requirements for the equipment. For example, ordinary cameras, camera etc.
因此,在这种通过图像采集器与服务器之间的数据交互,实现本申请提出的动物外部特征获取方法的应用场景下,上述通信接口11用于接收图像采集器拍摄并发送的待测动物的目标图像,以及图像采集器拍摄目标图像时的拍摄姿态信息,同时,会将得到的待测动物相应的待测外部特征值反馈至预设移动终端输出。基于上述分析,在各种落地场景的实际应用中,结合上述分析,在一些实施例中,如图2所示的各种摄像头、具有图像采集器的移动设备等各种图像采集设备,抓取到待测动物的图像后,可以通过无线方式传输至计算机设备(其可以是服务器,或者,若待测动物的图像由部署在畜牧场地的摄像头采集,如图3所示,此处的计算机设备还可以是具有数据处理能力的电子设备,但并不局限于此),由计算机设备按照下文方法实施例描述的动物外部特征获取方法,得到待测动物相应的待测外部特征值。Therefore, in the application scenario where the method for obtaining external features of animals proposed in the present application is realized through data interaction between the image collector and the server, the above-mentioned communication interface 11 is used to receive the data of the animal to be tested captured and sent by the image collector. The target image and the shooting attitude information when the image collector shoots the target image, and at the same time, the obtained external characteristic values of the animal to be tested corresponding to the test are fed back to the preset mobile terminal for output. Based on the above analysis, in the practical application of various landing scenarios, combined with the above analysis, in some embodiments, various image acquisition devices such as various cameras as shown in FIG. After the image of the animal to be tested is obtained, it can be wirelessly transmitted to a computer device (which can be a server, or, if the image of the animal to be tested is collected by a camera deployed on a livestock farm, as shown in Figure 3, the computer device here It can also be an electronic device with data processing capability, but is not limited to this), the computer device obtains the corresponding external feature value of the animal to be tested according to the method for acquiring external features of animals described in the following method embodiments.
在又一些实施例中,如图4所示应用场景,对于本申请提出的动物外部特征获取方法的应用场景,也可以由用户手持具有一定图像处理能力且内置图像采集器的移动终端,拍摄待测动物的图像,由该移动终端执行本申请提出的动物外部特征获取方法,得到待测动物的待测外部特征相关信息并输出。In still other embodiments, as shown in the application scenario shown in FIG. 4 , for the application scenario of the method for acquiring external features of animals proposed in the present application, the user can also hold a mobile terminal with a certain image processing capability and a built-in image collector, and shoot to be The image of the animal to be tested is obtained, and the mobile terminal executes the method for acquiring external features of the animal proposed in the present application to obtain and output relevant information about the external features of the animal to be tested.
由此可见,适用于本申请提出的动物外部特征获取方法和装置的计算机设备,可以是服务器,也可以是集成图像采集器且具有一定图像处理能力的移动终端,该计算机设备可以配置与本申请实施例提供的动物外部特征获取方法相应的程序,实施本申请实施例提供的动物外部特征获取方法,该程序可以存储于计算设备的存储器中,并由处理器调用实现程序功能,具体实现过程不做限定。It can be seen that the computer equipment suitable for the method and apparatus for acquiring external features of animals proposed in this application can be a server or a mobile terminal with an integrated image collector and a certain image processing capability. The program corresponding to the method for acquiring external features of animals provided by the embodiments implements the methods for acquiring external features of animals provided by the embodiments of the present application. The program can be stored in the memory of the computing device and invoked by the processor to realize program functions. The specific implementation process is not Do limit.
下面站在计算机设备的角度,对本申请实施例提供的动物外部特征获取方法进行介绍,下文描述的方法步骤可以由计算机设备执行相应的程序实施。From the perspective of a computer device, the method for acquiring external features of an animal provided by the embodiments of the present application will be introduced. The method steps described below can be implemented by executing a corresponding program on the computer device.
参照图5,示出了本申请实施例提供的动物外部特征获取方法的一可选示例的流程示意图,该方法可适用于计算机设备,结合上述分析可知,本申请对该计算机设备的设备类型不做限定,可以依据具体应用场景确定,且该应用场景可以参照但并不局限于上文列举的几种动物外部特征获取场景,本申请仅以此为例进行示例性说明。如图5所示,本实施例提出的动物外部特征获取方法可以包括但并不局限于以下步骤:Referring to FIG. 5 , a schematic flowchart of an optional example of the method for acquiring external features of animals provided by the embodiment of the present application is shown. The method can be applied to computer equipment. It can be seen from the above analysis that the device type of the computer equipment in the present application is different. For limitation, it can be determined according to a specific application scenario, and the application scenario can refer to, but is not limited to, several scenarios for obtaining external features of animals listed above, and this application only takes this as an example for illustrative description. As shown in FIG. 5 , the method for acquiring external features of animals proposed in this embodiment may include but is not limited to the following steps:
步骤S51,获取待测动物的目标图像,以及图像采集器拍摄该目标图像时的拍摄姿态信息;Step S51, acquiring the target image of the animal to be tested, and the shooting posture information when the image collector shoots the target image;
结合上述实施例对本申请技术构思的描述,对于待测动物的图像拍摄,可以由具有图像采集器的移动终端实现,即操作体(如动物管理人员、测量人员等)可以手持移动终端,启动移动终端的图像采集器(如摄像头),将图像采集方向朝向待测动物当前所在方向,使得待测动物出现在预览框中,点击拍摄按钮,得到待测动物的目标图像。In combination with the description of the technical concept of the present application in the above embodiments, the image capture of the animal to be tested can be realized by a mobile terminal with an image collector, that is, the operator (such as animal management personnel, measurement personnel, etc.) can hold the mobile terminal and start the mobile terminal. The image acquisition device (such as a camera) of the terminal points the image acquisition direction to the current direction of the animal to be tested, so that the animal to be tested appears in the preview box, click the shooting button to obtain the target image of the animal to be tested.
当然,在一些实施例中,也可以由部署在牲畜饲养地的摄像头,来抓拍各待测动物的图像,再通过无线通信方式,将该图像传输至具有数据处理能力的计算机设备,如上述移动终端或服务器,由计算机设备从中获得待测动物的目标图像等,本申请对待测动物的目标图像的具体获得方式不做限定,可以根据实际应用场景确定,并不局限于本申请上文列举的实现方式。Of course, in some embodiments, the camera deployed in the livestock breeding ground can also capture the image of each animal to be tested, and then transmit the image to a computer device with data processing capability through wireless communication, as described above. The terminal or server, from which the computer equipment obtains the target image of the animal to be tested, etc. The specific acquisition method of the target image of the animal to be tested in this application is not limited, and can be determined according to the actual application scenario, and is not limited to the above listed in this application. Method to realize.
需要说明的是,在对待测动物进行图像拍摄过程中,可能会连续拍摄该待测动物的多帧图像(如连续多帧图片或视频,对于视频拍摄,可由计算机设备从中提取待测动物对应的连续多帧图片,实现过程不做详述),但由于本申请需要待测动物全身的特征点,需要所拍摄到的图像包含完整的待测动物图像,所以,本实施例上述目标图像可以是指包含完整待测动物的目标图像,如上述操作体手持移动终端拍摄图像的场景下,可以确定待测动物全身出现在图像采集预览框,即移动终端显示屏展示的预览图像包含完整的待测动物时,再确认拍摄,将此时拍摄得到的图像确定为待测动物的目标图像; 对于其他场景,也可以直接从待测动物的多帧图像中,筛选包含完整待测动物的一帧图像为目标图像,本申请在此不做一一详述。It should be noted that in the process of image capturing of the animal to be tested, multiple frames of images of the animal to be tested may be continuously captured (such as continuous multiple frames of pictures or videos. For video shooting, computer equipment can extract the corresponding images of the animal to be tested from it. Continuous multi-frame pictures, the realization process will not be described in detail), but because the application requires the feature points of the whole body of the animal to be tested, and the captured image needs to contain a complete image of the animal to be tested, the above-mentioned target image in this embodiment can be Refers to the target image that contains the complete animal to be tested. For example, in the above scenario where the operator holds the mobile terminal to capture the image, it can be determined that the entire body of the animal to be tested appears in the image acquisition preview frame, that is, the preview image displayed on the display screen of the mobile terminal contains the complete image to be tested. When there is an animal, confirm the shooting again, and determine the image captured at this time as the target image of the animal to be tested; for other scenarios, you can also directly select a frame of images containing the complete animal to be tested from the multiple frames of images of the animal to be tested For the target image, this application will not describe them in detail here.
其中,在拍摄待测动物的图像过程中,由于图像采集器与待测动物之间的相对高度是不确定的,往往受到不同待测动物的身高、操作体(即拍摄图像的用户)与待测动物所处地面高度差,操作体与待测动物之间的距离、操作体身高、图像采集器安装高度(主要是指在牲畜饲养地按照摄像头的场景)等多方面因素的影响,为了拍摄到完整的待测动物的目标图像,可能需要调整图像采集器的拍摄角度、拍摄高度、焦距等参数。所以说,图像采集器的拍摄参数与当前拍摄场景下,操作体与待测动物之间的相对位置关系有一定关系,这样,当本申请需要预测图像采集器与待测动物之间的水平距离时,可以结合拍摄时图像采集器的相关拍摄参数实现。Among them, in the process of taking the image of the animal to be tested, since the relative height between the image collector and the animal to be tested is uncertain, it is often affected by the height of the animal to be tested, the operator (ie the user who takes the image) and the height of the animal to be tested. The height difference on the ground where the animal is located, the distance between the operator and the animal to be measured, the height of the operator, the installation height of the image collector (mainly refers to the scene of the camera in the livestock breeding place) and other factors, in order to shoot To complete the target image of the animal to be tested, it may be necessary to adjust the shooting angle, shooting height, focal length and other parameters of the image collector. Therefore, the shooting parameters of the image collector have a certain relationship with the relative positional relationship between the operator and the animal to be tested in the current shooting scene. In this way, when the application needs to predict the horizontal distance between the image collector and the animal to be tested It can be realized in combination with the relevant shooting parameters of the image collector at the time of shooting.
经过试验或分析得知,在本申请实施例中,图像采集器拍摄待测动物的目标图像时,图像采集器的拍摄姿态信息这类拍摄参数,可能会影响拍摄到该目标图像时,图像采集器与待测动物之间的拍摄水平距离。所以,本实施例需要获取图像采集器拍摄目标图像时的拍摄姿态信息,其具体可以包括图像采集器的拍摄俯仰角、拍摄翻滚角及拍摄变焦倍率等,本申请对其包含的内容不做限定,可视情况而定。Through experiments or analysis, it is known that in the embodiment of the present application, when the image collector captures the target image of the animal to be tested, the shooting parameters such as the shooting posture information of the image collector may affect the image acquisition when the target image is captured. The horizontal distance between the camera and the animal to be tested. Therefore, in this embodiment, it is necessary to obtain the shooting attitude information when the image collector shoots the target image, which may specifically include the shooting pitch angle, shooting roll angle, shooting zoom ratio, etc. of the image collector, and the content contained in this application is not limited. , as the case may be.
其中,图像采集器的拍摄俯仰角(Pitch)也可以称为倾斜角,如图6所示,其可以指图像采集器绕X轴(其可以指相机坐标系中的X轴,也可以表示为图像采集器的水平中心线)旋转的角度,可以改变图像采集器的俯仰角度。在实际应用中,该拍摄俯仰角通常根据待测动物与图像采集器之间的水平距离,以及待测动物自身的身高等因素确定,以保证图像采集器所采集到的图像能够包含完整的待测动物,当然,在该过程中,还可以结合对图像采集器进行变焦,来调整待测动物在整个图像预览框中的显示大小,满足拍摄要求,具体可以根据实际拍摄场景的需求确定拍摄俯仰角,本申请在此不做详述。Among them, the shooting pitch angle (Pitch) of the image collector can also be called the tilt angle, as shown in FIG. The rotation angle of the horizontal centerline of the image collector) can change the pitch angle of the image collector. In practical applications, the shooting pitch angle is usually determined according to the horizontal distance between the animal to be measured and the image collector, as well as the height of the animal to be measured itself, so as to ensure that the image collected by the image collector can contain complete Of course, in this process, the image collector can be zoomed to adjust the display size of the animal to be measured in the entire image preview frame to meet the shooting requirements. Specifically, the shooting pitch can be determined according to the needs of the actual shooting scene. angle, which is not described in detail in this application.
拍摄翻滚角(roll)可以指图像采集器绕Z轴(其通常是指图像采集器采集方向,即镜头朝向方向)旋转的角度,如图6所示,在实际拍摄过程中,对于具有图像采集器的移动终端来说,图像采集器可以绕着垂直于移动终端 屏幕的轴旋转;同理,对于图像采集器的航向角Yaw可以指图像采集器绕Y轴旋转的角度,即图像采集器绕着电子设备向上方向旋转的角度。The shooting roll angle (roll) can refer to the rotation angle of the image collector around the Z axis (which usually refers to the acquisition direction of the image collector, that is, the direction of the lens), as shown in Figure 6, in the actual shooting process, for the image acquisition For the mobile terminal of the image collector, the image collector can rotate around the axis perpendicular to the screen of the mobile terminal; in the same way, the heading angle Yaw of the image collector can refer to the rotation angle of the image collector around the Y axis, that is, the image collector rotates around the Y axis. The angle by which the electronic device is rotated in the upward direction.
在实际应用中,对于上文描述的拍摄俯仰角、拍摄翻滚角等拍摄姿态信息,可以由具有图像采集器的移动终端或独立的图像采集器自身具有的各种传感器感应到的参数确定,该传感器可以包括陀螺仪、各种角度传感器、位置传感器等,可以根据实际检测需求来确定传感器类型及数量,但并不局限于本实施例描述检测方式。In practical applications, the shooting attitude information such as the shooting pitch angle and shooting roll angle described above can be determined by the parameters sensed by the mobile terminal with the image collector or the various sensors of the independent image collector. The sensors may include gyroscopes, various angle sensors, position sensors, etc. The type and number of sensors may be determined according to actual detection requirements, but are not limited to the detection methods described in this embodiment.
步骤S52,对目标图像进行特征提取,得到目标图像包含的待测动物的多个关键特征点信息;Step S52, perform feature extraction on the target image to obtain multiple key feature point information of the animal to be tested contained in the target image;
本申请实施例中,该关键特征点信息包含相应关键特征点在目标图像中的位置信息,由于关键特征点可以是目标图像中待测动物的某一像素点,其相应的位置信息可以由该像素点在图像坐标系中的三维坐标(如RGB坐标系下的R、G、B的颜色值,但并不局限于此)确定,或者是将该像素点在图像坐标系中的坐标转换到相机坐标系下的三维坐标等,可视情况而定,本申请对各关键特征点信息包含的内容不做限定。In the embodiment of the present application, the key feature point information includes the position information of the corresponding key feature point in the target image. Since the key feature point may be a certain pixel point of the animal to be tested in the target image, the corresponding position information can be obtained from the The three-dimensional coordinates of the pixel in the image coordinate system (such as the color values of R, G, and B in the RGB coordinate system, but not limited to this) are determined, or the coordinates of the pixel in the image coordinate system are converted to The three-dimensional coordinates in the camera coordinate system, etc., may depend on the situation, and the present application does not limit the content included in the information of each key feature point.
其中,待测动物的关键特征点可以是指能够表征该待测动物的不同待测外部特征的特征点,通常是位于待测动物的体表,即属于目标图像中待测动物的边缘特征点(其指三维图像的边缘特征点),具体可以依据该待测动物的类别,及其需要测量的外部特征类别(如待测体尺参数类型、待测属性类别)等信息,来确定该类待测动物要得到各待外部特征值,需要得知待测动物的什么位置的信息,从而将位置对应的特征点记为一个关键特征点。The key feature points of the animal to be tested may refer to feature points that can represent different external features of the animal to be tested, usually located on the body surface of the animal to be tested, that is, the edge feature points belonging to the animal to be tested in the target image (It refers to the edge feature points of the three-dimensional image), which can be specifically determined according to the category of the animal to be measured and the category of external features to be measured (such as the type of body size parameters to be measured, the category of attributes to be measured) and other information. To obtain each external feature value of the animal to be tested, it is necessary to know the position of the animal to be tested, so that the feature point corresponding to the position is recorded as a key feature point.
可见,对于不同类别、大小的待测动物,其对应的关键特征点的位置及其数量可能不同,本申请可以按照上述方式,结合实际测量要求来预先确定,这样,在需要从拍摄到的待测动物的目标图像中,提取该待测动物的关键特征点时,可以直接按照预设的各待测动物与各关键特征点之间的对应关系,得知该待测动物需要提取什么位置的特征点为关键特征点,具体实现过程不做限定。It can be seen that for animals to be tested of different categories and sizes, the positions and numbers of the corresponding key feature points may be different. This application can be pre-determined according to the above method and combined with the actual measurement requirements. In the target image of the animal to be tested, when extracting the key feature points of the animal to be tested, it is possible to know which position of the animal to be tested needs to be extracted directly according to the preset correspondence between each animal to be tested and each of the key feature points. The feature points are key feature points, and the specific implementation process is not limited.
示例性的,结合上图2~图4所示的各应用场景,若待测动物的牦牛,需要测量牦牛的身高、体长等外部特征值(此处可以指体尺参数),为了获得牦牛身高这一体尺参数,需要得知牦牛垂直方向上最高点(即牦牛背上最高点)与最低点(即牦牛蹄子与地面接触点)之间的距离,因此,在得到牦牛的目标图像后,可以将该目标图像中,牦牛背部边缘特征点中位置较高的特征点记为关键特征点,同时将牦牛蹄子与地面接触的特征点记为关键特征点,应该理解,为了提高图像分析可靠性,在确定各类关键特征点,可以选择位置相邻的若干特征点为关键特征点,后续再进一步筛选,以避免遗漏,降低检测准确性。Exemplarily, in combination with the application scenarios shown in Figures 2 to 4 above, if the animal to be tested is a yak, it is necessary to measure the yak's height, body length and other external characteristic values (here can refer to the body size parameter), in order to obtain the yak. The body size parameter of height needs to know the distance between the highest point in the vertical direction of the yak (that is, the highest point on the yak's back) and the lowest point (that is, the contact point between the yak's hoof and the ground). Therefore, after obtaining the target image of the yak, In the target image, the feature points with a higher position among the feature points on the back of the yak can be recorded as key feature points, and the feature points where the yak hooves are in contact with the ground can be recorded as key feature points. It should be understood that in order to improve the reliability of image analysis , in determining various key feature points, several feature points adjacent to each other can be selected as key feature points, and then further screened to avoid omission and reduce the detection accuracy.
同理,为了获得牦牛体长这一体尺参数,按照上述分析方式,可以将所得牦牛的目标图像中,牦牛嘴部最凸出的一个或多个特征点确定为关键特征点,并将牦牛尾部最凸出的一个或多个特征点确定为关键特征点,依次计算这两类关键特征点中,距离最远的关键特征点之间的距离,以获得耗牛的体长。对于牦牛的其他待测体尺参数的获取过程,以及其他待测动物的各待测体尺参数的获取过程类似,本申请不做一一详述。Similarly, in order to obtain the body size parameter of the yak's body length, according to the above analysis method, one or more feature points with the most protruding yak's mouth in the obtained yak's target image can be determined as key feature points, and the yak's tail can be determined as the key feature point. The most prominent one or more feature points are determined as key feature points, and the distance between the most distant key feature points among the two types of key feature points is calculated in turn to obtain the body length of the yak. The process of acquiring other body size parameters of the yak to be measured and the process of acquiring each of the body size parameters to be measured of other animals to be tested are similar, and will not be described in detail in this application.
在一些实施例中,本申请可以采用预设的特征提取算法,对待测动物的目标图像进行处理,来得到该目标图像中待测动物的关键特征点及其位置信息等,也可以预先针对待测动物训练出相应的特征提取模型,这样,在获得待测动物的目标图像后,直接将该目标图像输入特征提取模型进行处理,输出待测动物的关键特征点信息等,本申请对步骤S52的具体实现过程不做限定,可以根据实际应用需求确定。In some embodiments, the present application can use a preset feature extraction algorithm to process the target image of the animal to be tested to obtain key feature points and location information of the animal to be tested in the target image. The test animal trains a corresponding feature extraction model. In this way, after obtaining the target image of the animal to be tested, the target image is directly input into the feature extraction model for processing, and the key feature point information of the animal to be tested is output. The specific implementation process is not limited and can be determined according to actual application requirements.
步骤S53,依据拍摄姿态信息与第一关键特征点的位置信息,获得图像采集器中心点与待测动物之间的水平拍摄距离;Step S53, obtaining the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting attitude information and the position information of the first key feature point;
需要说明,本实施例的第一关键特征点是指待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点,如上述牦牛示例中,第一关键特征点可以指牦牛蹄子上接触地面的特征点和/或其相邻特征点,可以根据待测动物的类别来确定第一关键特征点位置及其数量。应该理解的是,第一关 键特征点与地面距离可以是零或较小数值,因此,该第一阈值通常是比较小的数值,但本申请对第一阈值的具体数值不做限定。It should be noted that the first key feature point in this embodiment refers to the key feature point whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested. For the feature points on the yak's hooves that touch the ground and/or their adjacent feature points, the location and the number of the first key feature points can be determined according to the category of the animal to be tested. It should be understood that the distance between the first key feature point and the ground may be zero or a small value, therefore, the first threshold is usually a relatively small value, but the specific value of the first threshold is not limited in this application.
结合上文对拍摄姿态信息的相关描述,在待测动物拍摄过程中,所调整的图像采集器的拍摄姿态信息,往往是依据图像采集器中心点与待测动物之间的水平拍摄距离、待测动物身高等因素确定,逆向推理,本申请实施例可以利用拍摄姿态信息及第一关键特征点的位置信息,经过运算得到拍摄目标图像时,待测动物与图像采集器中心点之间的水平拍摄距离,在该水平拍摄距离的获取过程中,根据实际需求可以结合相应的辅助参数实现,如手持具有图像采集器的电子设备拍摄待测动物图像的操作体身高、拍摄待测动物图像的独立的固定图像采集器的拍摄高度等,本申请对水平拍摄距离的具体获取过程不做限定。Combined with the above description of the shooting attitude information, during the shooting process of the animal to be tested, the adjusted shooting attitude information of the image collector is often based on the horizontal shooting distance between the center point of the image collector and the animal to be tested, and the Factors such as the height of the measured animal are determined, and reverse reasoning. In the embodiment of the present application, the shooting attitude information and the position information of the first key feature point can be used to obtain the shooting target image through calculation. The level between the animal to be tested and the center point of the image collector Shooting distance, in the process of acquiring the horizontal shooting distance, can be realized according to actual needs in combination with corresponding auxiliary parameters, such as the height of the operator to shoot the image of the animal to be measured by holding an electronic device with an image collector, and the independence of shooting the image of the animal to be tested. The specific acquisition process of the horizontal shooting distance is not limited in this application.
其中,参照图7所示的动物拍摄场景示意图,假设由操作体手持移动终端拍摄待测动物图像,按照上述方式计算得到的水平拍摄距离,可以指图像采集器中心点与待测动物的第一关键特征点之间的水平距离GP,即表示图像采集器与待测动物之间的地面距离,而非图像采集器坐标系的X轴方向上的距离。Wherein, referring to the schematic diagram of the animal shooting scene shown in FIG. 7 , assuming that the image of the animal to be tested is shot by the operator holding the mobile terminal, the horizontal shooting distance calculated according to the above method may refer to the first distance between the center point of the image collector and the animal to be tested. The horizontal distance GP between the key feature points represents the ground distance between the image collector and the animal to be measured, not the distance in the X-axis direction of the image collector coordinate system.
步骤S54,依据水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得待测动物相应的待测外部特征值;Step S54, according to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested, obtain the external feature value to be tested corresponding to the animal to be tested;
继上文相应部分的描述,对于待测动物的不同待测外部特征,可能不同位于待测动物不同位置的关键特征点的位置信息确定,本申请实施例将与任一待测外部特征对应的关键特征点记为第二关键特征点,且该第二关键特征点可以包括上述第一关键特征点,以及其他关键特征点,具体可以依据各待测外部特征的测量需求确定,本申请实施例在此不做一一详述。Following the description of the corresponding part above, for different external features of the animal to be tested, the position information of the key feature points located at different positions of the animal to be tested may be different. The key feature point is recorded as the second key feature point, and the second key feature point may include the above-mentioned first key feature point and other key feature points, which may be specifically determined according to the measurement requirements of each external feature to be measured. This embodiment of the present application I won't go into detail here.
基于此,对于待测动物的任一待测外部特征值,如待测体尺参数、待测属性值(如体重),按照预设对应关系,得到与该待测外部特征值对应的第二关键特征点的位置信息后,由于一个待测外部特征值对应的第二关键特征点的数量往往是多个,如两个、三个甚至更多个,因此,本实施例可以通过对多个第二关键特征点的位置信息进行运算,来获得相应待测外部特征值。Based on this, for any external characteristic value to be measured of the animal to be measured, such as the body size parameter to be measured, the attribute value to be measured (such as weight), according to the preset correspondence, a second external characteristic value corresponding to the external characteristic value to be measured is obtained. After the position information of the key feature points, since the number of the second key feature points corresponding to one external feature value to be measured is often multiple, such as two, three or even more, this embodiment can The position information of the second key feature point is calculated to obtain the corresponding external feature value to be measured.
应该理解的是,本申请需要获取待测动物的真正外部特征值,而非图像中的外部特征值,因此,在该运算过程中,可以进行坐标系的转换,以得到真实待测动物相应位置的第二关键特征点的位置信息,以使得所得待测外部特征值是待测动物的实际外部特征值,当然,也可以在计算得到图像中待测动物的待测外部特征值后,再进行坐标转换等处理,来获得待测动物的实际外部特征值,本申请对该转换过程不做详述。It should be understood that this application needs to obtain the real external feature value of the animal to be tested, not the external feature value in the image. Therefore, in the operation process, the coordinate system can be converted to obtain the corresponding position of the real animal to be tested. The position information of the second key feature point, so that the obtained external feature value to be measured is the actual external feature value of the animal to be tested. The actual external characteristic value of the animal to be tested can be obtained by processing such as coordinate conversion, and this application will not describe the conversion process in detail.
在一些实施例中,结合上述分析,待测动物的待测外部特征可以包括待测动物的至少一种待测体尺(如上述身高、长度、体斜长、胸围等),和/或至少一种待测属性(如体重)。而在实际应用中,对于待测动物的属性值,通常是依据相应的体尺参数计算得到,所以,在实际测量中,可以先获取待测动物的各待测体尺参数,再据此进一步得到待测属性值。In some embodiments, combined with the above analysis, the external characteristics of the animal to be tested may include at least one of the body measurements of the animal to be measured (such as the above-mentioned height, length, body oblique length, chest circumference, etc.), and/or at least An attribute to be measured (such as weight). In practical applications, the attribute value of the animal to be measured is usually calculated based on the corresponding body size parameters. Therefore, in the actual measurement, the body size parameters of the animal to be measured can be obtained first, and then further based on this. Get the property value to be tested.
基于此,上述步骤S54具体可以包括:依据水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得待测动物相应的待测体尺参数,在依据获得的至少一种待测体尺参数,得到待测动物相应的待测属性值。Based on this, the above-mentioned step S54 may specifically include: obtaining the body size parameters to be measured corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured, and according to the obtained at least one The body size parameter to be measured is obtained, and the corresponding attribute value to be measured of the animal to be measured is obtained.
在该可选实施例中,结合上文对待测动物的外部特征值与关键特征点的对应关系的描述,对于待测体尺参数这一外部特征值,其与关键特征点之间的对应关系类似,即可以预先确定获取各类待测体尺参数所需要什么位置的关键特征点,即建立各类待测体尺与不同待测动物各位置的关键特征点之间的对应关系,这样,在待测动物的体尺参数实际测量应用中,可以按照上述方式,先获得待测动物的各待测体尺参数。In this optional embodiment, in combination with the description of the correspondence between the external feature value of the animal to be measured and the key feature points, the external feature value of the body size parameter to be measured is the corresponding relationship between the external feature value and the key feature points. Similarly, it is possible to pre-determine the key feature points of the positions required to obtain various parameters of the body measure to be measured, that is, to establish the correspondence between the various body measures to be measured and the key feature points of different positions of the animals to be measured, so that, In the actual measurement application of the body size parameters of the animal to be tested, each of the body size parameters of the animal to be tested can be obtained first according to the above method.
之后,由于待测动物体尺参数与其待测属性之间往往有一定的运算关系(如采用公式方式表达该运算关系等),这可以依据实际测量经验确定,这样,本实施例按照上述方式得到待测动物的至少一种待测体尺参数之后,可以依据预先确定的该运算关系,来进一步估算出待测动物的相应待测属性的待测属性值,如待测动物的体重等,本申请对待测动物体尺参数与其待测属性之间的运算关系获取方式,以及该运算关系的表达方式不做限定,可以根据实际需求确定。Afterwards, since there is often a certain operational relationship between the body size parameters of the object to be measured and the properties to be measured (such as expressing the operational relationship in a formula, etc.), this can be determined based on actual measurement experience. In this way, in this embodiment, the above method is used to obtain After at least one body size parameter of the animal to be measured, the value of the corresponding attribute to be measured of the animal to be measured can be further estimated according to the predetermined calculation relationship, such as the weight of the animal to be measured, etc. The method of obtaining the operation relationship between the body size parameters of the object to be measured and the attributes to be measured, and the expression method of the operation relationship are not limited, and can be determined according to actual needs.
应该理解的是,对于待测动物不同待测属性来说,获取其待测属性值所需要的待测体尺参数可能不同,这样可以根据实际测量经验或试验确定,而 结合上述分析,对于不同的待测体尺参数,需要获得的待测动物的第二关键特征点的位置及数量往往不同,因此,在实际应用中,可以针对本次需要测量的待测动物的待测属性,来确定获取待测属性值所需的待测体尺参数,进而确定计算该待测体尺参数所需的第二关键特征点及其他参数,之后,可以按照上述分析方式,来获取该第二关键特征点的位置信息及其他参数。It should be understood that, for different properties of the animal to be tested, the body size parameters to be measured required to obtain the value of the property to be measured may be different, which can be determined according to actual measurement experience or experiments. The position and number of the second key feature points of the animal to be measured are often different. Therefore, in practical applications, it can be determined according to the properties to be measured of the animal to be measured this time. Obtain the body size parameter to be measured required for the attribute value to be measured, and then determine the second key feature point and other parameters required for calculating the body size parameter to be measured. After that, the second key feature can be obtained according to the above analysis method position information and other parameters of the point.
综上所述,在本申请实施例中,当需要获取待测动物的,如体重、身高、体长等外部特征的情况下,为了避免人工测量对待测动物或测量用户可能造成的伤害威胁,本实施例提出利用图像分析的方式获取待测动物的待测外部特征,具体的,利用图像采集器获取待测动物的目标图像,以及图像采集器拍摄该目标图像时的拍摄姿态信息,通过对该目标图像进行特征提取,得到待测动物的多个关键特征点信息,如位置信息,之后,可以依据第一关键特征点的位置信息及上述拍摄姿态信息,来确定图像采集器中心点与待测动物之间的水平拍摄距离,从而依据该水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得相应待测外部特征。由于本实施例上述目标图像可以由普通的图像采集器拍摄得到,必须要使用专业的深度摄像头,极大降低了动物外部特征获取的设备成本,且降低了对拍摄图像的用户的专业要求,以及待测动物所在场地的要求,提高了本申请提出的动物外部特征获取方法的普适性。To sum up, in the embodiment of the present application, when it is necessary to obtain the external characteristics of the animal to be tested, such as weight, height, body length, etc., in order to avoid the threat of injury that may be caused by manual measurement of the animal to be tested or measurement of the user, This embodiment proposes to use image analysis to obtain the external features of the animal to be tested. Specifically, an image collector is used to obtain the target image of the animal to be tested, and the shooting attitude information when the image collector captures the target image. Feature extraction is performed on the target image to obtain a plurality of key feature point information of the animal to be tested, such as position information. After that, the center point of the image collector and the to-be-to-be-measured center point can be determined according to the position information of the first key feature point and the above shooting attitude information. The horizontal shooting distance between the animals is measured, so as to obtain the corresponding external feature to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured. Since the above-mentioned target image in this embodiment can be captured by an ordinary image collector, a professional depth camera must be used, which greatly reduces the equipment cost for acquiring the external features of the animal, and reduces the professional requirements for the user who captures the image, and The requirement of the site where the animal to be tested is located improves the universality of the method for acquiring the external features of the animal proposed in this application.
参照图8,示出了本申请实施例提供的动物外部特征获取方法的又一可选示例流程示意图,本实施例可以是对上述实施例提出的动物外部特征获取方法的一可选细化实现方式,但并不局限于本实施例描述的细化实现方式,如图8所示,该方法可以包括:Referring to FIG. 8 , a schematic flowchart of another optional example of the method for acquiring external features of animals provided by the embodiment of the present application is shown. This embodiment may be an optional refinement implementation of the method for acquiring external features of animals proposed in the above embodiments. However, it is not limited to the detailed implementation manner described in this embodiment. As shown in FIG. 8 , the method may include:
步骤S81,获取待测动物的目标图像,以及图像采集器拍摄该目标图像时的拍摄俯仰角和拍摄翻滚角;Step S81, acquiring the target image of the animal to be tested, and the shooting pitch angle and shooting roll angle when the image collector shoots the target image;
关于步骤S81的具体实现过程,可以参照上述实施例相应部分的描述,不再赘述。For the specific implementation process of step S81, reference may be made to the descriptions in the corresponding parts of the foregoing embodiments, and details are not repeated here.
其中,关于拍摄俯仰角和拍摄翻滚角,结合上文实施例对其含义及其获取方式的描述,若图像采集器拍摄目标图像时,存在一定的拍摄俯仰角,如 图7所示,会导致图像采集器的水平中心线(即X轴)与地平线不再呈平行关系而是相交关系;若存在一定的拍摄翻滚角,对导致所拍摄到的图像中待测动物图像倾斜,如图9a所示,而非如图9b所示的水平拍摄所得到待测动物图像所呈现的水平状态,后续可以根据实际获得目标图像中待测动物的呈现状态,来采用相应方式进行参数计算,也可以先对该目标图像进行倾斜校准,得到如图9b所示的校准后的图像后,再进行后续计算,本申请对此不做限定,可视情况而定。Among them, regarding the shooting pitch angle and shooting roll angle, combined with the description of their meaning and the acquisition method in the above embodiment, if the image collector shoots the target image, there is a certain shooting pitch angle, as shown in FIG. 7, which will lead to The horizontal center line (ie X axis) of the image collector is no longer in a parallel relationship with the horizon, but in an intersecting relationship; if there is a certain shooting roll angle, the image of the animal to be tested in the captured image is inclined, as shown in Figure 9a Instead of the horizontal state shown by the image of the animal to be tested obtained by horizontal shooting as shown in FIG. 9b, the parameter calculation can be carried out in a corresponding way according to the actual state of the animal to be tested in the target image. Perform tilt calibration on the target image to obtain a calibrated image as shown in FIG. 9b , and then perform subsequent calculations, which are not limited in this application, and may be determined according to circumstances.
在图像采集器对待测动物的拍摄过程中,由于需要待测动物不同位置的特征点信息,需要拍摄完整的待测动物图像,图像采集器或计算机设备的图像预览界面可以展示当前拍摄镜头下,所拍摄到的待测图像的预览图像,拍摄用户可以根据实际需求,调整图像采集器的拍摄角度、距离等,以使得待测动物处于预览图像中的最前面中央位置,即待测动物处于聚焦中心位置,且拍摄到完整的待测动物,再按下拍摄按钮,得到待测动物的目标图像,但并不局限于这种实现方式。During the shooting process of the animal to be tested by the image collector, the complete image of the animal to be tested needs to be captured due to the need for feature point information of different positions of the animal to be tested. The image preview interface of the image collector or computer equipment can display the current shooting lens, The captured preview image of the image to be tested, the shooting user can adjust the shooting angle, distance, etc. of the image collector according to actual needs, so that the animal to be tested is in the frontmost central position in the preview image, that is, the animal to be tested is in focus The center position, and the complete animal to be tested is photographed, and then the shooting button is pressed to obtain the target image of the animal to be tested, but it is not limited to this implementation.
在又一些实施例中,可以对获取的每一帧预览图像,计算机设备可以利用边缘检测算法,来获取该预览图像中待测动物的轮廓信息(即边缘信息),并判断获取的轮廓信息是否满足拍摄要求,如是否包含待测动物的完整轮廓信息,如果是,将该帧预览图像确定为目标图像,若否,可以依据获取的轮廓信息与拍摄要求的匹配度,指示图像采集器调整拍摄姿态信息,如调整拍摄角度、拍摄距离、变焦倍率(即利用图像采集器及其所属计算机设备的数字变焦或光学变焦功能调节,以改变待测动物在整个预览图像中的大小,具体变焦调节过程本实施例不做详述)等,以使得具有调整的后拍摄姿态信息的图像采集器,重新获得的预览图像包含的待测动物的轮廓信息满足拍摄要求,具体实现过程本实施例不做详述。In still other embodiments, for each frame of the acquired preview image, the computer device can use an edge detection algorithm to acquire contour information (ie, edge information) of the animal to be tested in the preview image, and determine whether the acquired contour information is Meet the shooting requirements, such as whether it contains the complete contour information of the animal to be tested, if so, determine the frame preview image as the target image, if not, instruct the image collector to adjust the shooting according to the matching degree between the acquired contour information and the shooting requirements Attitude information, such as adjusting the shooting angle, shooting distance, zoom magnification (that is, using the digital zoom or optical zoom function of the image collector and its computer equipment to adjust to change the size of the animal to be tested in the entire preview image, and the specific zoom adjustment process) This embodiment does not describe in detail), etc., so that the image collector with the adjusted post-shooting attitude information, the profile information of the animal to be tested contained in the re-obtained preview image meets the shooting requirements, and the specific implementation process is not detailed in this embodiment. described.
需要说明,本申请对获取待测动物的轮廓信息所依据的边缘检测算法的具体内容不做限定,如基于语义分割的目标检测算法、基于搜索的边缘检测算法、基于零交叉的边缘检测算法等,可以根据实际应用需求灵活选择,本申请不做一一详述。It should be noted that this application does not limit the specific content of the edge detection algorithm on which the contour information of the animal to be measured is obtained, such as target detection algorithm based on semantic segmentation, edge detection algorithm based on search, edge detection algorithm based on zero crossing, etc. , which can be flexibly selected according to the actual application requirements, which are not described in detail in this application.
步骤S82,将目标图像输入图像特征提取模型,得到目标图像包含的待测动物的多个关键特征点;Step S82, input the target image into the image feature extraction model to obtain multiple key feature points of the animal to be tested contained in the target image;
本实施例中,图像特征提取模型可以基于机器学习算法,对各样本动物的样本图像进行训练得到,用于提取任一样本动物的关键特征点,该机器学习算法可以根据实际应用场景的需求灵活选择,如深度神经网络等,本申请对训练图像特征提取模型所依据的机器学习算法类别,以及该模型的具体训练过程不做详述。In this embodiment, the image feature extraction model can be obtained by training the sample images of each sample animal based on a machine learning algorithm, and is used to extract the key feature points of any sample animal. The machine learning algorithm can be flexible according to the needs of the actual application scenario. Selection, such as a deep neural network, etc., this application does not describe in detail the type of machine learning algorithm on which the image feature extraction model is trained, and the specific training process of the model.
在本申请提出的一些实施例中,为了提高动物外部特征获取方法的可靠性,需要获取待测动物的完整的关键特征点,因此,在提取目标图像包含的待测动物的多个关键特征点之后,可以对得到的多个关键特征点进行完整性验证,若验证通过,可以继续执行后续步骤;若验证不通过,可以输出第一提示信息,用以提醒操作体(即拍摄用户)重新拍摄待测动物的目标图像。In some embodiments proposed in this application, in order to improve the reliability of the method for acquiring external features of animals, it is necessary to acquire complete key feature points of the animal to be tested. Therefore, when extracting multiple key feature points of the animal to be tested contained in the target image After that, integrity verification can be performed on the obtained multiple key feature points. If the verification passes, the subsequent steps can be continued; if the verification fails, the first prompt message can be output to remind the operator (ie, the shooting user) to shoot again. The target image of the animal to be tested.
具体的,在一种可能的实现方式中,本实施例可以依据各关键特征点的置信度、这多个关键特征点各自的位置信息所构成的拓扑位置关系等,获得本次提取到的多个关键特征点的整体评分,若该整体评分达到预设分数,可以认为本次完整地提取到待测动物身上的关键特征点;反之,该整体评分未达到预设分数,可以认为所提到的多个关键特征点不够完整,不足以据此计算出待测动物的待测体尺参数,这种情况下,可以输出相应的提示信息,来提醒拍摄用户重新对待测动物进行图像采集,并按照上述方式,重新对采集到的目标图像进行特征提取及验证,保证所提到的待测动物的多个关键特征点完整。Specifically, in a possible implementation manner, the present embodiment may obtain the multiplicity of data extracted this time according to the confidence of each key feature point, the topological position relationship formed by the respective position information of the multiple key feature points, and the like. The overall score of each key feature point, if the overall score reaches the preset score, it can be considered that the key feature points on the animal to be tested are completely extracted this time; otherwise, the overall score does not reach the preset score, it can be considered that the mentioned The multiple key feature points of the test are not complete enough to calculate the body size parameters of the animal to be tested. In this case, the corresponding prompt information can be output to remind the shooting user to re-collect the image of the animal to be tested, and According to the above method, feature extraction and verification are performed on the collected target image again to ensure that the mentioned multiple key feature points of the animal to be tested are complete.
需要说明,关于如何验证所提到的待测动物的多个关键特征点是否完整的实现方式,并不局限于本实施例上文描述的实现方法,可以根据实际应用需求进行灵活调整,本申请在此不做一一详述。It should be noted that the implementation method of how to verify whether the mentioned multiple key feature points of the animal to be tested are complete is not limited to the implementation method described above in this embodiment, and can be flexibly adjusted according to actual application requirements. I won't go into detail here.
步骤S83,输出目标图像包含的待测动物多个关键特征点;Step S83, outputting multiple key feature points of the animal to be tested contained in the target image;
步骤S84,响应针对输出的至少一个关键特征点的位置调整操作,得到待测动物的多个关键特征点信息;Step S84, in response to the position adjustment operation for the output at least one key feature point, obtain a plurality of key feature point information of the animal to be tested;
在本实施例实际应用中,对于上文从目标图像中提取的待测动物的关键特征点,可能会存在识别不够准确的情况,为了保证后续利用关键特征点的 位置信息进行参数计算的可靠性,本申请提出对识别出的关键特征点进行校准,但并不局限于本实施例描述的这种手动校准方案。In the practical application of this embodiment, for the key feature points of the animal to be tested extracted from the target image above, the identification may not be accurate enough. In order to ensure the reliability of subsequent parameter calculation using the position information of the key feature points , the present application proposes to calibrate the identified key feature points, but is not limited to the manual calibration solution described in this embodiment.
如上述分析,在本实施例提出的关键特征点的校准实现过程中,可以先将识别出的待测动物的关键特征点输出,参照图10所示的待测动物关键特征点的输出示意图,在输出的包含待测动物的目标图像中,可以由黑色圆点来表示提取到的待测动物的各关键特征点,用户可以通过移动终端的显示界面,直观看到提取到的各关键特征点在待测动物身上的什么位置,根据经验,若其认为当前提出到的某一个或多个关键特征点的位置不够准确,可以选择该关键特征点,并将其拖动至更准确的位置,如图10所示,用户可以用手指点击位置不准确的关键特征点,按照箭头方向移动该关键特征点的位置,直至达到用户认为更加准确的位置,松开手指,实现对该关键特征点的位置调整。According to the above analysis, in the calibration implementation process of the key feature points proposed in this embodiment, the identified key feature points of the animal to be tested may be output first. Referring to the output schematic diagram of the key feature points of the animal to be tested shown in FIG. 10 , In the output target image containing the animal to be tested, the extracted key feature points of the animal to be tested can be represented by black dots, and the user can intuitively see the extracted key feature points through the display interface of the mobile terminal Where is the position on the animal to be tested? According to experience, if it thinks that the position of one or more key feature points currently proposed is not accurate enough, it can select the key feature point and drag it to a more accurate position. As shown in Figure 10, the user can click the key feature point with inaccurate position with his finger, move the position of the key feature point in the direction of the arrow until it reaches the position that the user thinks is more accurate, release the finger, and realize the key feature point. Position adjustment.
在上述关键特征点的位置调整过程中,对于电子设备来说,其可以响应针对输出的至少一个关键特征点的位置调整操作,依据调整后的关键特征点的位置信息,得到相应关键特征点信息,本申请对该关键特征点信息包含的内容不做限定,可视情况而定。In the process of adjusting the position of the above key feature points, for the electronic device, it can respond to the position adjustment operation for at least one output key feature point, and obtain the corresponding key feature point information according to the position information of the adjusted key feature point. , the content contained in the key feature point information is not limited in this application, which may be determined according to the situation.
需要说明的是,对于本申请提出的手动校准所提取的关键特征点位置的实现方式,并不局限于上文实施例描述的调整方式,还可以利用电子设备的输入设备(如鼠标、键盘)上相应的功能按键(如键盘的方向键、鼠标的预设点击操作等)实现,可以根据实际应用场景确定,也可以由用户根据个人操作习惯确定,本申请对此不做限定。It should be noted that the implementation of the position of the key feature points extracted by manual calibration proposed in this application is not limited to the adjustment methods described in the above embodiments, and input devices (such as a mouse and a keyboard) of an electronic device can also be used. The corresponding function keys (such as the direction keys of the keyboard, the preset click operation of the mouse, etc.) are realized, which can be determined according to the actual application scenario, or can be determined by the user according to the personal operation habits, which is not limited in this application.
另外,在实际应用中,在本申请预先训练的图像特征提取模型的输出结果精准度足够的情况下,本申请得到目标图像包含的待测动物的多个关键特征点之后,也可以直接获取相应的关键特征点信息,不用再对提取到的关键特征点进行位置校准。In addition, in practical applications, when the accuracy of the output results of the image feature extraction model pre-trained by the present application is sufficient, after the present application obtains a plurality of key feature points of the animal to be tested contained in the target image, it is also possible to directly obtain the corresponding The key feature point information is no longer required to perform position calibration on the extracted key feature points.
步骤S85,利用第一关键特征点的位置信息,确定第一关键特征点与图像采集器的水平中心线的第一距离;Step S85, using the position information of the first key feature point to determine the first distance between the first key feature point and the horizontal center line of the image collector;
结合上文实施例相应部分的描述,由于第一关键特征点是指待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点,参照上图7所示,假设第一关键特征点为G,图像采集器的水平中心线为图7中的X轴, 从第一关键特征点G出发,生成垂直于X轴的射线,将该第一关键特征点G与该射线和X轴的交点之间的距离确定为第一距离;参照图9a和图9b所示,第一距离可以是像素点g到X轴的垂直距离,本申请对第一距离的具体获取方式不做限定。Combining with the description of the corresponding part of the above embodiment, since the first key feature point refers to the key feature point whose distance from the ground is less than the first threshold value among the multiple key feature points of the animal to be tested, with reference to Figure 7 above, it is assumed that the first key feature point is A key feature point is G, the horizontal center line of the image collector is the X-axis in FIG. 7 , starting from the first key feature point G, a ray perpendicular to the X-axis is generated, and the first key feature point G is associated with the ray The distance between the intersection point with the X axis is determined as the first distance; with reference to Figure 9a and Figure 9b, the first distance can be the vertical distance from the pixel point g to the X axis, and the specific acquisition method of the first distance in the present application is not Do limit.
步骤S86,利用第一距离及拍摄翻滚角,得到第一关键特征点相对于图像采集器的水平中心线的第一夹角;Step S86, using the first distance and the shooting roll angle to obtain the first included angle of the first key feature point relative to the horizontal center line of the image collector;
结合上文对拍摄翻滚角的相关描述,参照图7所示的场景示意图,在得到第一关键特征点到图像采集器的水平中心线的第一距离之后,本实施例可以依据不同坐标系(如图像坐标系、世界坐标系等)之间的坐标转换关系,利用该第一距离和拍摄翻滚角,得到第一关键特征点G相对于图像采集器的水平中心线OX的第一夹角∠XOG。根据实际需求,本申请可以结合图像采集器当前具有的配置参数,如图像分辨率、变焦倍率等,实现对上述第一夹角的计算,本申请对上述第一夹角的具体获取方式不做限定。In conjunction with the above description of the shooting roll angle, with reference to the schematic diagram of the scene shown in FIG. 7 , after obtaining the first distance from the first key feature point to the horizontal centerline of the image collector, the present embodiment can be based on different coordinate systems ( Such as the coordinate conversion relationship between the image coordinate system, the world coordinate system, etc.), using the first distance and the shooting roll angle to obtain the first angle ∠ of the first key feature point G relative to the horizontal center line OX of the image collector XOG. According to actual needs, the present application can realize the calculation of the above-mentioned first included angle in combination with the configuration parameters currently possessed by the image collector, such as image resolution, zoom magnification, etc. limited.
步骤S87,利用第一夹角及拍摄俯仰角,得到第一关键特征点与第一垂直点相对于图像采集器中心点所形成的第二夹角;Step S87, using the first included angle and the shooting pitch angle to obtain the second included angle formed by the first key feature point and the first vertical point relative to the center point of the image collector;
其中,第一垂直点是指图像采集器中心点相对于待测动物所站立的地平面的垂直投影点,如图7所示的点P,图像采集器的水平中心线OX与垂直中心线OY构成的角度∠XOY为直角,因此,如图7所示,第一关键特征点G与第一垂直点P相对于图像采集器中心点O所形成的第二夹角∠GOP,与上述得到的第一夹角∠XOG及拍摄俯仰角∠YOP构成了∠XOY,该第二夹角∠GOP=90°-∠YOP-∠XOG。应该理解的是,步骤S87中的第一夹角、拍摄俯仰角和第二夹角,均是转换到同一坐标系下确定的,以保证这些角度能够按照上述角度关系可靠执行步骤S87。Among them, the first vertical point refers to the vertical projection point of the center point of the image collector relative to the ground plane where the animal to be tested stands, such as the point P shown in Figure 7, the horizontal center line OX and the vertical center line OY of the image collector The formed angle ∠XOY is a right angle. Therefore, as shown in FIG. 7 , the second angle ∠GOP formed by the first key feature point G and the first vertical point P relative to the center point O of the image collector is the same as that obtained above. The first included angle ∠XOG and the shooting pitch angle ∠YOP constitute ∠XOY, and the second included angle ∠GOP=90°-∠YOP-∠XOG. It should be understood that the first included angle, the shooting pitch angle, and the second included angle in step S87 are all determined by converting to the same coordinate system, so as to ensure that these angles can be reliably performed in step S87 according to the above-mentioned angular relationship.
步骤S88,获取拍摄目标图像时该图像采集器的拍摄高度;Step S88, acquiring the shooting height of the image collector when shooting the target image;
在图像拍摄过程中,待测动物与用户通常会站在基本平整的地面,两者距离5米~10米(但并不局限于此,可以根据实际需求进行适应性调整)的距离进行拍摄,具体可以依据待测动物的习性、体型等参数确定,此时,可以认为拍摄图像的用户与待测动物站立在同一地平面上,如图7所示。按照普通人的身高来确定图像采集器的拍摄高度,如用户身高在1.6米~1.8米(用户 身高可以根据实际情况进行适应性调整)之间,拍摄图像时图像采集器的高度通常与用户眼睛高度相近,因此,本申请可以认为图像采集器的拍摄高度为用户身高减去0.1米(但并不局限于此,可以根据实际情况进行适应性调整,本申请仅以此为例进行说明),即1.5米~1.7米之间,但并不局限于此,也可以根据实际情况,预先输入当前用户使用图像采集器拍摄待测动物图像时的拍摄高度。In the process of image shooting, the animal to be tested and the user usually stand on a basically flat ground, and the distance between the two is 5 meters to 10 meters (but not limited to this, and can be adjusted according to actual needs). Specifically, it can be determined according to the habit, body shape and other parameters of the animal to be tested. At this time, it can be considered that the user who took the image and the animal to be tested are standing on the same ground plane, as shown in FIG. 7 . The shooting height of the image collector is determined according to the height of ordinary people. For example, if the user's height is between 1.6 meters and 1.8 meters (the user's height can be adjusted according to the actual situation), the height of the image collector when shooting images is usually the same as that of the user's eyes. The heights are similar. Therefore, this application can consider that the shooting height of the image collector is the height of the user minus 0.1 meters (but not limited to this, it can be adjusted according to the actual situation, and this application only uses this as an example to illustrate), That is, between 1.5 meters and 1.7 meters, but it is not limited to this. According to the actual situation, the shooting height when the current user uses the image collector to shoot the image of the animal to be tested can also be input in advance.
然而,在一些拍摄场景下,拍摄图像的用户所站立的地面与待测动物站立的地面之间可能会存在高度差,记为第一高度差,如图11所示,可以预先确定该第一高度差,并将其作为图像采集器的配置参数输入,以便按照上述方式对拍摄到的目标图像进行处理时,能够结合该高度差进行处理。需要说明的是,在该拍摄场景下,本实施例获取的图像采集器的拍摄高度可以是相对拍摄高度,即图像采集器中心点O相对于待测动物所站立的地平面的高度,如图11中的拍摄高度OP,其包含了上述不同站立地平面之间的第一高度差。However, in some shooting scenarios, there may be a height difference between the ground on which the user taking the image stands and the ground on which the animal to be tested stands, which is recorded as the first height difference. As shown in FIG. 11 , the first height difference can be determined in advance. The height difference is input as a configuration parameter of the image collector, so that when the captured target image is processed in the above manner, the height difference can be combined with the processing. It should be noted that, in this shooting scene, the shooting height of the image collector obtained in this embodiment may be a relative shooting height, that is, the height of the center point O of the image collector relative to the ground plane on which the animal to be tested stands, as shown in the figure The shooting height OP in 11 includes the above-mentioned first height difference between different standing ground planes.
在一种可能的实现方式中,上述步骤S88可以包括:调用拍摄目标图像的操作体(即上述用户)的身高及第一高度差,依据该操作体的身高及第一高度差,获得图像采集器相对于待测动物所站立的地平面的拍摄高度,但并不局限于这种实现方式。In a possible implementation manner, the above step S88 may include: calling the height and the first height difference of the operating body (that is, the above-mentioned user) of the shooting target image, and obtaining the image capture according to the height and the first height difference of the operating body The shooting height of the monitor relative to the ground plane where the animal to be tested stands, but is not limited to this implementation.
步骤S89,利用拍摄高度,通过正切函数运算,得到图像采集器中心点与待测动物之间的水平拍摄距离;Step S89, using the shooting height to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured through the operation of the tangent function;
参照图7和图11所示的拍摄场景,结合三角函数的运算原理,可以按照水平拍摄距离GP=(H-0.1+m)*tan(∠GOP)这一计算公式,得到图像采集器中心点O与待测动物之间的水平拍摄距离GP,该计算公式中,H可以表示拍摄待测动物图像的用户身高;0.1可以表示用户与图像采集器之间的高度差;m可以表示上述第一高度差,应该理解,在拍摄图像的用户所站立的地面与待测动物站立的地面之间不存在第一高度差的情况下,m=0;tan()表示正切函数。Referring to the shooting scenes shown in Figure 7 and Figure 11, combined with the operation principle of the trigonometric function, the center point of the image collector can be obtained according to the calculation formula of the horizontal shooting distance GP=(H-0.1+m)*tan(∠GOP) The horizontal shooting distance GP between O and the animal to be tested. In this calculation formula, H can represent the height of the user who shoots the image of the animal to be tested; 0.1 can represent the height difference between the user and the image collector; m can represent the first Height difference, it should be understood that in the case where there is no first height difference between the ground on which the user taking the image stands and the ground on which the animal to be tested stands, m=0; tan( ) represents a tangent function.
需要说明,计算水平拍摄距离的计算公式并局限于上文列举的计算公式,可以根据实际应用场景的需求进行灵活调整,本申请在此不作详述。It should be noted that the calculation formula for calculating the horizontal shooting distance is not limited to the calculation formula listed above, and can be flexibly adjusted according to the requirements of actual application scenarios, which will not be described in detail in this application.
步骤S810,依据待测动物的任意两个关键特征点各自的位置信息,得到相应的两个关键特征点相对于图像采集器中心点所形成的第三夹角;Step S810, according to the respective position information of any two key feature points of the animal to be tested, obtain a third angle formed by the corresponding two key feature points relative to the center point of the image collector;
本实施例按照上述方式得到图像采集器中心点O到待测动物的水平拍摄距离GP之后,可以将其作为基础参数,实现对待测动物的各种待测外部特征的计算,具体的,结合上述分析,针对某一待测外部特征,确定获得该待测外部特征所需的两个关键特征点,之后,可以利用这两个关键特征点各自的位置信息,计算得到这两个关键特征点相对于图像采集器中心点O所形成的第三夹角。In this embodiment, after the horizontal shooting distance GP from the center point O of the image collector to the animal to be measured is obtained in the above-mentioned manner, it can be used as a basic parameter to realize the calculation of various external characteristics of the animal to be measured. Specifically, in combination with the above Analysis, for a certain external feature to be tested, determine the two key feature points required to obtain the external feature to be tested, and then use the respective position information of the two key feature points to calculate the relative relationship between the two key feature points. The third included angle formed by the center point O of the image collector.
示例性的,参照图7所示的拍摄场景示意图,对于关键特征点A和B(其可以对应图9a和图9b所示的关键特征点a和b),其对应的第三夹角表示为∠AOB。同理,对于待测动物上的其他任意两个关键特征点,也可以按照这种方式,将其连接图像采集器中心点O所形成的锐角作为第三夹角,本申请对如何利用两个关键特征点的位置信息,计算得到相应的第三夹角的实现过程不做详述。Exemplarily, referring to the schematic diagram of the shooting scene shown in FIG. 7 , for the key feature points A and B (which may correspond to the key feature points a and b shown in FIG. 9 a and FIG. 9 b ), the corresponding third angle is expressed as ∠AOB. In the same way, for any other two key feature points on the animal to be tested, the acute angle formed by connecting the center point O of the image collector can also be used as the third angle in this way. The position information of the key feature points, and the realization process of calculating the corresponding third included angle will not be described in detail.
步骤S811,利用该第三夹角及水平拍摄距离,得到相应的两个关键特征点之间的特征点距离;Step S811, using the third included angle and the horizontal shooting distance to obtain the feature point distance between the corresponding two key feature points;
继上述分析,仍以图7所示的第三夹角∠AOB为例进行说明,在得知待测动物与图像采集器中心点O之间的拍摄水平距离GP的基础上,可以结合三角函数的运算原理,计算得到这两个关键特征点之间的特征点距离AB=GP*sin(∠AOB),本实施例对两个关键特征点之间的特征点距离的具体计算过程不做详述。Following the above analysis, still take the third angle ∠AOB shown in Figure 7 as an example to illustrate, on the basis of knowing the shooting horizontal distance GP between the animal to be tested and the center point O of the image collector, the trigonometric function can be combined. According to the operation principle, the feature point distance AB=GP*sin(∠AOB) between the two key feature points is calculated, and the specific calculation process of the feature point distance between the two key feature points is not detailed in this embodiment. described.
步骤S812,利用得到的每一种待测体尺对应的至少两个第二关键特征点相互之间的特征点距离,获得待测动物相应的待测体尺参数;Step S812, using the obtained feature point distances between at least two second key feature points corresponding to each type of body size to be measured, to obtain body size parameters to be measured corresponding to the animal to be measured;
步骤S813,依据获得的至少一种待测体尺参数,得到所述待测动物相应的待测属性值。Step S813, according to the obtained at least one body size parameter to be measured, obtain the corresponding attribute value to be measured of the animal to be measured.
结合上文实施例对待测动物的待测体尺参数与关键特征点之间的关系的相关描述,本申请可以根据实际需要测量的待测体尺参数,确定对应的第二关键特征点,之后,利用所确定的第二关键特征点之间的特征点距离,计算得到该待测体尺参数。如上述举例的关键特征点A和B,可以依据两者之间的 特征点距离,计算得到待测动物的胸围尺寸;如图10中的关键特征点C和D,按照上述方式得到关键特征点C和D之间的特征点距离,可以得到待测动物的体长等,本申请不再一一举例。In combination with the relevant description of the relationship between the body size parameters to be measured and the key feature points of the animal to be measured in the above embodiment, the present application can determine the corresponding second key feature points according to the body size parameters to be measured that actually need to be measured, and then , and using the determined feature point distances between the second key feature points, the body size parameter to be measured is obtained by calculation. For the key feature points A and B exemplified above, the bust size of the animal to be measured can be calculated according to the distance between the feature points; as shown in the key feature points C and D in Figure 10, the key feature points can be obtained in the above manner The distance between the feature points between C and D can be used to obtain the body length of the animal to be tested, etc. This application will not give examples one by one.
应该理解的是,对于待测动物的某些体尺参数,可能需要多个第二关键特征点之间的特征点距离得到,并不局限于上文列举的由两个第二关键特征点之间的特征点距离,直接计算得到待测体尺参数,可以根据实际需求确定,本申请不做一一详述。It should be understood that, for some body size parameters of the animal to be tested, it may be necessary to obtain the feature point distance between multiple second key feature points, and it is not limited to the above-mentioned two second key feature points. The distance between the feature points between the two can be directly calculated to obtain the parameters of the body size to be measured, which can be determined according to actual needs, and this application does not describe them in detail.
在得到待测动物的待测体尺参数后,可以根据待测动物的体尺参数与待测属性之间的经验公式,进一步计算得到相应的待测属性值,如采用回归分析方式,确定待测动物的体尺参数与体重之间的计算关系,进而在按照上述方式得到相应的待测体尺参数后,按照该计算关系,得到待测动物的体重,对于其他类别属性的属性值获取方式类似,本申请不做一一详述。After the body size parameters of the animal to be tested are obtained, the corresponding attribute values to be tested can be further calculated according to the empirical formula between the body size parameters of the animal to be tested and the attributes to be tested. The calculation relationship between the body size parameter and the body weight of the animal to be measured, and then after obtaining the corresponding body size parameter to be measured according to the above method, the body weight of the animal to be measured is obtained according to the calculation relationship, and the attribute value acquisition method for other categories of attributes Similarly, this application does not describe them in detail.
综上所述,在本实施例中,当需要获取待测动物的如体重、身高等外部特征的情况下,为了避免人工测量对待测动物或测量用户可能造成的伤害威胁,本实施例提出利用图像分析的方式,实现待测动物的外部特征无接触测量,同时也摆脱了人工测量方式带来的繁重的体力劳动。To sum up, in this embodiment, when it is necessary to obtain external characteristics such as weight and height of the animal to be measured, in order to avoid the threat of injury that may be caused by manual measurement of the animal to be measured or the user, this embodiment proposes to use The method of image analysis realizes the non-contact measurement of the external features of the animal to be tested, and also gets rid of the heavy manual labor caused by the manual measurement method.
具体的,为了降低设备成本以及对拍摄人员的专业要求,可以采用的普通光学摄像头(即上述图像采集器)来拍摄待测动物的图像,之后,利用拍摄到目标图像的相关拍摄参数,以及该目标图像中待测动物的关键特征点的位置信息进行运算,得到待测动物与图像采集器中心点之间的拍摄水平距离,从而据此得到两个关键特征点之间的特征点距离,进而计算得到待测体尺参数、待测属性值,满足应用场景对待测动物的各外部特征的测量要求,提高了本申请提出的动物外部特征获取方法的普适性。Specifically, in order to reduce equipment costs and professional requirements for photographers, an ordinary optical camera (that is, the above-mentioned image collector) can be used to capture the image of the animal to be tested, and then use the relevant shooting parameters of the captured target image, and the The position information of the key feature points of the animal to be tested in the target image is calculated to obtain the shooting horizontal distance between the animal to be tested and the center point of the image collector, so as to obtain the feature point distance between the two key feature points, and then The body size parameters to be measured and the attribute values to be measured are obtained by calculation, which meets the measurement requirements of the external features of the animal to be measured in the application scenario, and improves the universality of the method for obtaining the external features of the animal proposed in the present application.
结合上文实施例对本申请提出的动物外部特征获取方法的方案描述,为了更加清楚理解该方案,下面将以计算机设备为拍摄用户的手机、测量耗牛的体重为例进行说明,应该理解,对于执行本申请该方案的计算机设备包括但并不局限于手机,且待测动物包括但也不局限于耗牛,还可以是骆驼、马、大象等其他大型动物,待测动物的待测属性(即动物的身体外部特征值)包 括但也不局限于体重,可以根据实际动物测量需求确定,本申请不做一一详述。In combination with the above embodiments, the scheme of the method for obtaining external features of animals proposed in the present application is described. In order to understand the scheme more clearly, the following will take the computer equipment as an example of photographing the user's mobile phone and measuring the weight of a yak. It should be understood that for The computer equipment that implements the scheme of this application includes but is not limited to mobile phones, and the animals to be tested include but are not limited to yak, but also other large animals such as camels, horses, elephants, etc. The properties of the animals to be tested are tested. (That is, the external characteristic value of the animal's body) includes but is not limited to the body weight, which can be determined according to the actual animal measurement requirements, which will not be described in detail in this application.
结合上图4所示的应用场景示意图,在需要测量耗牛的体重的情况下,用户可以使用手机的摄像头对准待测耗牛,通过显示屏的预览框查看当前采集到的耗牛图像是否满足测量要求,如待测耗牛是否位于预览框中央位置,且包含待测耗牛完整轮廓,若满足测量要求,按下拍摄按钮,将所得到的图像作为目标图像,由手机内置的图像特征提取模型对其进行特征提取,并在该图像中展示提取到的耗牛的多个关键特征点,如上图10所示的16个关键特征点,但并不局限于此。在此期间,用户可以查看所展示的耗牛的各关键特征点是否准确,若不准确,可以手动调整相应关键特征点的位置,以得到理想的待测耗牛的图像,调整过程可以参照但并不局限于上文实施例相应部分的描述。当然,手机也可以使用默认参数,不执行上述调整步骤,直接对所得图像进行后续处理,这可以根据实际情况确定。Combined with the schematic diagram of the application scenario shown in Figure 4 above, when the weight of the yak needs to be measured, the user can use the camera of the mobile phone to aim at the yak to be tested, and check whether the currently collected yak image is through the preview frame of the display screen. Meet the measurement requirements, such as whether the yak to be tested is located in the center of the preview frame, and contains the complete outline of the yak to be tested, if the measurement requirements are met, press the shooting button, and the obtained image will be used as the target image. The extraction model performs feature extraction on it, and displays multiple key feature points of the extracted yak in the image, such as the 16 key feature points shown in Figure 10 above, but is not limited to this. During this period, the user can check whether the displayed yak's key feature points are accurate. If not, they can manually adjust the positions of the corresponding key feature points to obtain an ideal image of the yak to be tested. The adjustment process can be referred to but It is not limited to the description of the corresponding parts of the above embodiments. Of course, the mobile phone can also use the default parameters without performing the above adjustment steps, and directly perform subsequent processing on the obtained image, which can be determined according to the actual situation.
之后,手机可以利用拍摄上述理想目标图像时的拍摄姿态信息(其内容可以参照上述实施例相应部分的描述),用户输入的如用户身高H、用户与待测动物所站立的地平面之间的第一高度差(其可以控制在10厘米内,也可以根据实际情况确定)、相机拍摄高度与用户身高之间的高度差(如上述0.1米,但并不局限于此)等参数,以及待测耗牛与地平面接触点的位置等,按照上述实施例描述的处理方式,估算得到待测耗牛与用户之间的拍摄水平距离,进而结合所提取到的各关键特征点的位置信息,计算得到待测耗牛的体尺参数,再据此进一步估算出待测耗牛的体重。After that, the mobile phone can use the shooting posture information when shooting the above-mentioned ideal target image (the content of which can refer to the description of the corresponding part of the above-mentioned embodiment), such as the user's height H, the distance between the user and the ground plane where the animal to be tested is standing. Parameters such as the first height difference (which can be controlled within 10 centimeters or determined according to the actual situation), the height difference between the height of the camera and the height of the user (such as the above 0.1 meters, but not limited to this), and the parameters to be Measure the position of the contact point between the yak and the ground plane, etc., according to the processing method described in the above embodiment, estimate the shooting horizontal distance between the yak to be measured and the user, and then combine the extracted position information of each key feature point, Calculate the body size parameters of the yak to be tested, and then further estimate the weight of the yak to be tested.
应该理解,对于待测耗牛的其他属性值的获取过程,以及其他待测动物的各外部特征值得获取过程类似,本申请不做一一详述。而且,结合上文对本申请提出的动物外部特征获取方法的各应用场景的描述,并不局限于这种使用手机拍摄待测耗牛的应用场景,可以根据实际需求进行适应性调整,但获取动物外部特征的本质方法类似,本申请不做一一列举。It should be understood that the process of acquiring other attribute values of the yak to be tested and the process of acquiring the values of various external characteristics of other animals to be tested are similar, and will not be described in detail in this application. Moreover, in combination with the descriptions of the application scenarios of the method for obtaining external features of animals proposed in the present application, it is not limited to this application scenario of using a mobile phone to shoot the cattle to be tested. It can be adaptively adjusted according to actual needs. The essential methods of external features are similar, and this application does not list them all.
参照图12,为本申请提出的动物外部特征获取装置的一可选示例的结构示意图,该装置可以适用于上述计算机设备,如图12所示,该装置可以包括:Referring to FIG. 12 , it is a schematic structural diagram of an optional example of the device for obtaining external features of animals proposed in the present application. The device can be applied to the above-mentioned computer equipment. As shown in FIG. 12 , the device can include:
信息获取模块121,用于获取待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;The information acquisition module 121 is used to acquire the target image of the animal to be tested, and the shooting posture information when the image collector shoots the target image;
特征提取模块122,用于对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,所述关键特征点信息包含相应关键特征点在所述目标图像中的位置信息;The feature extraction module 122 is configured to perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, and the key feature point information includes the corresponding key feature points in the location information in the target image;
在一种可能的实现方式中,特征提取模块122可以包括:In a possible implementation, the feature extraction module 122 may include:
模型处理单元,用于将所述目标图像输入图像特征提取模型,得到所述目标图像包含的所述待测动物的多个关键特征点;A model processing unit, configured to input the target image into an image feature extraction model to obtain a plurality of key feature points of the animal to be tested contained in the target image;
关键特征点输出单元,用于输出所述目标图像包含的所述待测动物多个关键特征点;a key feature point output unit for outputting a plurality of key feature points of the animal to be tested contained in the target image;
位置调整单元,用于响应针对输出的至少一个关键特征点的位置调整操作,得到所述待测动物的多个关键特征点信息。The position adjustment unit is configured to obtain multiple key feature point information of the animal to be tested in response to the position adjustment operation for the output at least one key feature point.
进一步地,为了提高处理可靠性及准确性,本申请提出的动物外部特征获取装置还可以包括:Further, in order to improve processing reliability and accuracy, the device for acquiring external features of animals proposed in this application may also include:
验证模块,用于对得到的所述待测动物的多个关键特征点进行完整性验证;若验证通过,执行后续流程;The verification module is used to verify the integrity of the obtained multiple key feature points of the animal to be tested; if the verification is passed, the follow-up process is performed;
提示信息输出模块,用于在验证模块的结果为验证不通过的情况下,输出第一提示信息,所述第一提示信息用于提醒操作体重新拍摄所述待测动物的目标图像。The prompt information output module is configured to output first prompt information when the result of the verification module is that the verification fails, and the first prompt information is used to remind the operator to re-shoot the target image of the animal to be tested.
水平拍摄距离获得模块123,用于依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,所述第一关键特征点是指所述待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点;The horizontal shooting distance obtaining module 123 is used to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting posture information and the position information of the first key feature point, the first The key feature points refer to the key feature points whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested;
待测外部特征值获得模块124,用于依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值。The external feature value obtaining module 124 to be measured is configured to obtain the external feature value to be measured corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured.
在一些实施例中,由于待测外部特征可以包括所述待测动物的至少一种待测体尺和/或至少一种待测属性,因此,如图13所示,上述待测外部特征值获得模块124可以包括:In some embodiments, since the external feature to be tested may include at least one body size to be measured and/or at least one attribute to be tested of the animal to be tested, therefore, as shown in FIG. 13 , the above-mentioned external feature value to be tested Obtaining module 124 may include:
体尺参数获得单元,用于依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测体尺参数;a body measure parameter obtaining unit, configured to obtain the body measure parameter corresponding to the animal to be measured according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body measure to be measured;
属性值得到单元,用于依据获得的至少一种待测体尺参数,得到所述待测动物相应的待测属性值。The attribute value obtaining unit is configured to obtain the corresponding attribute value to be measured of the animal to be measured according to the obtained at least one body size parameter to be measured.
在本申请提出的一些实施例中,上述拍摄姿态信息可以包含拍摄俯仰角、拍摄翻滚角及拍摄变焦倍率等信息,关于各拍摄姿态信息所表达的含义以及获取方式,可以参照上述实施例相应部分的描述,不做赘述。基于此,如图13所示,上述水平拍摄距离获得模块123可以包括:In some embodiments proposed in this application, the above-mentioned shooting attitude information may include shooting pitch angle, shooting roll angle, shooting zoom magnification and other information. For the meaning and acquisition method of each shooting attitude information, please refer to the corresponding parts of the above-mentioned embodiments. description will not be repeated. Based on this, as shown in FIG. 13 , the above-mentioned horizontal shooting distance obtaining module 123 may include:
第一距离确定单元1231,用于利用所述第一关键特征点的位置信息,确定所述第一关键特征点与所述图像采集器的水平中心线的第一距离;a first distance determination unit 1231, configured to use the position information of the first key feature point to determine the first distance between the first key feature point and the horizontal center line of the image collector;
第一夹角得到单元1232,用于利用所述第一距离及所述拍摄翻滚角,得到所述第一关键特征点相对于所述水平中心线的第一夹角;The first included angle obtaining unit 1232 is used to obtain the first included angle of the first key feature point relative to the horizontal center line by using the first distance and the shooting roll angle;
第二夹角得到单元1233,用于利用所述第一夹角及所述拍摄俯仰角,得到所述第一关键特征点与第一垂直点相对于所述图像采集器中心点所形成的第二夹角,所述第一垂直点是指所述图像采集器中心点相对于所述待测动物所站立的地平面的垂直投影点;The second included angle obtaining unit 1233 is configured to use the first included angle and the shooting pitch angle to obtain the second angle formed by the first key feature point and the first vertical point relative to the center point of the image collector. Two included angles, the first vertical point refers to the vertical projection point of the center point of the image collector relative to the ground plane on which the animal to be tested stands;
拍摄高度获取单元1234,用于获取拍摄所述目标图像时所述图像采集器的拍摄高度;a shooting height obtaining unit 1234, configured to obtain the shooting height of the image collector when shooting the target image;
在一种可能的实现方式中,若操作体与所述待测动物各自所在地面之间存在第一高度差,如上图11所示,该拍摄高度获取单元1234可以包括:In a possible implementation manner, if there is a first height difference between the operating body and the respective surfaces of the animal to be tested, as shown in FIG. 11 above, the shooting height obtaining unit 1234 may include:
参数调用单元,用于调用拍摄所述目标图像的操作体的身高及所述第一高度差;a parameter calling unit, used for calling the height and the first height difference of the operating body that shoots the target image;
拍摄高度获得单元,用于依据所述操作体的身高及所述第一高度差,获得所述图像采集器相对于所述待测动物所站立的地平面的拍摄高度。A shooting height obtaining unit, configured to obtain the shooting height of the image collector relative to the ground plane on which the animal to be tested stands according to the height of the operating body and the first height difference.
水平拍摄距离得到单元1235,用于利用上述拍摄高度,通过正切函数运算,得到所述图像采集器中心点与所述待测动物之间的水平拍摄距离。The horizontal shooting distance obtaining unit 1235 is used for obtaining the horizontal shooting distance between the center point of the image collector and the animal to be measured by using the above shooting height and through tangent function operation.
结合上述实施例的描述,如图14所示,上述体尺参数获得单元可以包括:In combination with the description of the above embodiment, as shown in FIG. 14 , the above-mentioned body size parameter obtaining unit may include:
第三夹角得到单元1241,用于依据所述待测动物的任意两个关键特征点各自的位置信息,得到相应的两个关键特征点相对于所述图像采集器中心点所形成的第三夹角;The third included angle obtaining unit 1241 is configured to obtain a third angle formed by the corresponding two key feature points relative to the center point of the image collector according to the respective position information of any two key feature points of the animal to be tested. included angle;
特征点距离得到单元1242,用于利用所述第三夹角及所述水平拍摄距离,得到相应的两个关键特征点之间的特征点距离;The feature point distance obtaining unit 1242 is used to obtain the feature point distance between the corresponding two key feature points by using the third included angle and the horizontal shooting distance;
待测体尺参数获得单元1243,用于利用得到的每一种待测体尺对应的至少两个第二关键特征点相互之间的特征点距离,获得所述待测动物相应的待测体尺参数。The body measure parameter obtaining unit 1243 is used to obtain the corresponding body to be measured of the animal to be measured by using the obtained feature point distances between at least two second key feature points corresponding to each type of body measure to be measured. Ruler parameter.
需要说明的是,关于上述各装置实施例中的各种模块、单元等,均可以作为程序模块存储在存储器中,由处理器执行存储在存储器中的上述程序模块,以实现相应的功能,关于各程序模块及其组合所实现的功能,以及达到的技术效果,可以参照上述方法实施例相应部分的描述,本实施例不再赘述。It should be noted that various modules, units, etc. in the above-mentioned device embodiments can be stored in the memory as program modules, and the processor executes the above-mentioned program modules stored in the memory to realize corresponding functions. For the functions implemented by the program modules and their combinations, and the technical effects achieved, reference may be made to the descriptions in the corresponding parts of the foregoing method embodiments, and details are not repeated in this embodiment.
本申请还提供了一种存储介质,其上可以存储计算机程序,该计算机程序可以被处理器调用并加载,以实现上述实施例描述的动物外部特征获取方法的各个步骤。The present application also provides a storage medium on which a computer program can be stored, and the computer program can be called and loaded by a processor to implement each step of the method for acquiring external features of an animal described in the above embodiments.
本申请还提供了一种动物外部特征获取系统,该系统可以包括移动终端和服务器。The present application also provides an animal external feature acquisition system, which may include a mobile terminal and a server.
在一些实施例中,结合上述分析,该移动终端可以具有图像采集器,并具有一定的图像处理能力,其具有上述计算机设备描述的结构,能够执行本申请提出的动物外部特征获取方法的各个步骤,实现过程可以参照上述实施例相应部分的描述,不做赘述。In some embodiments, combined with the above analysis, the mobile terminal may have an image collector and certain image processing capabilities, and it has the structure described in the above computer equipment, and can execute the various steps of the method for acquiring external features of animals proposed in this application. , the implementation process may refer to the description of the corresponding part of the above-mentioned embodiment, which is not repeated.
在实际应用中,为了方便后续查询各待测动物的状态及不同阶段的外部特征信息,移动终端还可以将得到的待测动物的外部特征值,与其对应的获取时间关联,上传至服务器存储。根据需要,还可以将拍摄到的待测动物的目标图像以及其他拍摄参数,同时上传至服务器进行存储,以供后续调用查看。In practical applications, in order to facilitate the subsequent query of the state of each animal to be tested and the external feature information at different stages, the mobile terminal can also associate the obtained external feature value of the animal to be tested with its corresponding acquisition time, and upload it to the server for storage. According to needs, the captured target image of the animal to be tested and other shooting parameters can also be uploaded to the server for storage for subsequent calling and viewing.
在又一些实施例中,移动终端仅作为图像采集设备,不进行图像处理,那么,结合上述实施例相应部分的描述,用户可以使用移动终端采集待测动 物的目标图像,以及相关拍摄参数上传至服务器,由服务器执行本申请提出的动物外部特征获取方法的各个步骤,得到所需的外部特征值后反馈至移动终端输出,以减小移动终端的处理负担,提高处理效率。In still other embodiments, the mobile terminal is only used as an image acquisition device and does not perform image processing. Then, in combination with the descriptions in the corresponding parts of the above embodiments, the user can use the mobile terminal to collect the target image of the animal to be tested, and upload the relevant shooting parameters to the Server: The server executes each step of the animal external feature acquisition method proposed in the present application, obtains the required external feature value, and then feeds it back to the mobile terminal for output, so as to reduce the processing burden of the mobile terminal and improve processing efficiency.
而且,在该应用场景下,用户可以使用该移动终端拍摄多个待测动物的图像上传至服务器,能够同时实现对多个待测动物的外部特征的获取,具体实现过程可以参照上述实施例相应部分的描述,本实施例不做赘述。Moreover, in this application scenario, the user can use the mobile terminal to shoot images of multiple animals to be tested and upload them to the server, which can simultaneously acquire the external features of multiple animals to be tested. For the specific implementation process, refer to the corresponding embodiments in the above-mentioned embodiments. Part of the description is not repeated in this embodiment.
最后,需要说明,本说明书中各个实施例采用递进或并列的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置、计算机设备、系统而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Finally, it should be noted that the various embodiments in this specification are described in a progressive or juxtaposed manner, and each embodiment focuses on the differences from other embodiments, and the same and similar parts between the various embodiments can be referred to each other. . For the apparatuses, computer equipment, and systems disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the descriptions are relatively simple, and for related parts, please refer to the descriptions of the methods.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals may further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two, in order to clearly illustrate the possibilities of hardware and software. Interchangeability, the above description has generally described the components and steps of each example in terms of functionality. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的存储介质中。The steps of a method or algorithm described in conjunction with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two. A software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other known form of storage medium.
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的核心思想或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。The above description of the disclosed embodiments enables any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the core idea or scope of the present application. Therefore, this application is not intended to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

  1. 一种动物外部特征获取方法,其特征在于,所述方法包括:A method for acquiring external features of animals, characterized in that the method comprises:
    获取待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;Obtain the target image of the animal to be tested, and the shooting attitude information when the image collector shoots the target image;
    对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,所述关键特征点信息包含相应关键特征点在所述目标图像中的位置信息;Perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, where the key feature point information includes position information of the corresponding key feature point in the target image;
    依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,所述第一关键特征点是指所述待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点;According to the shooting attitude information and the position information of the first key feature point, the horizontal shooting distance between the center point of the image collector and the animal to be measured is obtained, and the first key feature point refers to the to-be-measured animal. Among the multiple key feature points of the animal, the key feature points whose distance from the ground is less than the first threshold;
    依据所述水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值。According to the horizontal shooting distance and the position information of the second key feature point corresponding to the external feature to be tested, the external feature value to be tested corresponding to the animal to be tested is obtained.
  2. 根据权利要求1所述的方法,其特征在于,所述待测外部特征包括所述待测动物的至少一种待测体尺和/或至少一种待测属性,所述依据所述水平拍摄距离,以及待测外部特征对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值,包括The method according to claim 1, wherein the external feature to be measured comprises at least one body size to be measured and/or at least one attribute to be measured of the animal to be measured, and the shooting according to the horizontal distance, and the position information of the second key feature point corresponding to the external feature to be tested, to obtain the external feature value to be tested corresponding to the animal to be tested, including
    依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测体尺参数;According to the horizontal shooting distance and the position information of the second key feature point corresponding to the body measure to be measured, obtain the body measure parameter to be measured corresponding to the animal to be measured;
    依据获得的至少一种待测体尺参数,得到所述待测动物相应的待测属性值。According to the obtained at least one body size parameter to be measured, the corresponding attribute value to be measured of the animal to be measured is obtained.
  3. 根据权利要求2所述的方法,其特征在于,所述拍摄姿态信息包含拍摄俯仰角和拍摄翻滚角,所述依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,包括:The method according to claim 2, wherein the shooting attitude information includes shooting pitch angle and shooting roll angle, and the image capture is obtained according to the shooting attitude information and the position information of the first key feature point. The horizontal shooting distance between the center point of the detector and the animal to be tested, including:
    利用所述第一关键特征点的位置信息,确定所述第一关键特征点与所述图像采集器的水平中心线的第一距离;Using the position information of the first key feature point, determine the first distance between the first key feature point and the horizontal center line of the image collector;
    利用所述第一距离及所述拍摄翻滚角,得到所述第一关键特征点相对于所述水平中心线的第一夹角;Using the first distance and the shooting roll angle to obtain a first included angle of the first key feature point relative to the horizontal centerline;
    利用所述第一夹角及所述拍摄俯仰角,得到所述第一关键特征点与第一垂直点相对于所述图像采集器中心点所形成的第二夹角,所述第一垂直点是指所述图像采集器中心点相对于所述待测动物所站立的地平面的垂直投影点;Using the first included angle and the shooting pitch angle, the second included angle formed by the first key feature point and the first vertical point relative to the center point of the image collector is obtained, and the first vertical point Refers to the vertical projection point of the center point of the image collector relative to the ground plane on which the animal to be tested stands;
    获取拍摄所述目标图像时所述图像采集器的拍摄高度;obtaining the shooting height of the image collector when shooting the target image;
    利用所述拍摄高度,通过正切函数运算,得到所述图像采集器中心点与所述待测动物之间的水平拍摄距离。Using the shooting height, the horizontal shooting distance between the center point of the image collector and the animal to be tested is obtained through the operation of the tangent function.
  4. 根据权利要求2或3所述的方法,其特征在于,所述依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测体尺参数,包括:The method according to claim 2 or 3, characterized in that, according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be measured, the corresponding to-be-measured animal of the to-be-measured animal is obtained Body size parameters, including:
    依据所述待测动物的任意两个关键特征点各自的位置信息,得到相应的两个关键特征点相对于所述图像采集器中心点所形成的第三夹角;According to the respective position information of any two key feature points of the animal to be tested, the third angle formed by the corresponding two key feature points relative to the center point of the image collector is obtained;
    利用所述第三夹角及所述水平拍摄距离,得到相应的两个关键特征点之间的特征点距离;Use the third included angle and the horizontal shooting distance to obtain the feature point distance between the corresponding two key feature points;
    利用得到的每一种待测体尺对应的至少两个第二关键特征点相互之间的特征点距离,获得所述待测动物相应的待测体尺参数。Using the obtained feature point distances between at least two second key feature points corresponding to each type of body size to be measured, the parameters of the body size to be measured corresponding to the animal to be measured are obtained.
  5. 根据权利要求3所述的方法,其特征在于,若所述操作体与所述待测动物各自所在地面之间存在第一高度差,所述获取拍摄所述目标图像时所述图像采集器的拍摄高度,包括:The method according to claim 3, wherein, if there is a first height difference between the operating body and the ground where the animal to be tested is located, the acquisition of the target image when the target image is captured Shooting heights, including:
    调用拍摄所述目标图像的操作体的身高及所述第一高度差;calling the height and the first height difference of the operating body that captures the target image;
    依据所述操作体的身高及所述第一高度差,获得所述图像采集器相对于所述待测动物所站立的地平面的拍摄高度。According to the height of the operating body and the first height difference, the shooting height of the image collector relative to the ground plane where the animal to be tested stands is obtained.
  6. 根据权利要求1所述的方法,其特征在于,所述对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,包括:The method according to claim 1, wherein the feature extraction is performed on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, including:
    将所述目标图像输入图像特征提取模型,得到所述目标图像包含的所述待测动物的多个关键特征点;Inputting the target image into an image feature extraction model to obtain a plurality of key feature points of the animal to be tested contained in the target image;
    输出所述目标图像包含的所述待测动物多个关键特征点;outputting multiple key feature points of the animal to be tested contained in the target image;
    响应针对输出的至少一个关键特征点的位置调整操作,得到所述待测动物的多个关键特征点信息。In response to the position adjustment operation for the output at least one key feature point, multiple key feature point information of the animal to be tested is obtained.
  7. 根据权利要求6所述的方法,其特征在于,所述方法还包括:The method according to claim 6, wherein the method further comprises:
    对得到的所述待测动物的多个关键特征点进行完整性验证;Perform integrity verification on the obtained multiple key feature points of the animal to be tested;
    如果验证不通过,输出第一提示信息,所述第一提示信息用于提醒操作体重新拍摄所述待测动物的目标图像。If the verification fails, first prompt information is output, and the first prompt information is used to remind the operator to re-shoot the target image of the animal to be tested.
  8. 一种动物外部特征获取装置,其特征在于,所述装置包括:A device for acquiring external features of animals, characterized in that the device comprises:
    信息获取模块,用于获取待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;an information acquisition module, used for acquiring a target image of the animal to be tested, and the shooting attitude information when the image collector shoots the target image;
    特征提取模块,用于对所述目标图像进行特征提取,得到所述目标图像包含的所述待测动物的多个关键特征点信息,所述关键特征点信息包含相应关键特征点在所述目标图像中的位置信息;A feature extraction module is used to perform feature extraction on the target image to obtain a plurality of key feature point information of the animal to be tested contained in the target image, and the key feature point information includes the corresponding key feature points in the target image. location information in the image;
    水平拍摄距离获得模块,用于依据所述拍摄姿态信息与第一关键特征点的位置信息,获得所述图像采集器中心点与所述待测动物之间的水平拍摄距离,所述第一关键特征点是指所述待测动物的多个关键特征点中,与地面距离小于第一阈值的关键特征点;The horizontal shooting distance obtaining module is used to obtain the horizontal shooting distance between the center point of the image collector and the animal to be measured according to the shooting posture information and the position information of the first key feature point. The first key Feature points refer to the key feature points whose distance from the ground is less than the first threshold among the multiple key feature points of the animal to be tested;
    待测外部特征值获得模块,用于依据所述水平拍摄距离,以及待测体尺对应的第二关键特征点的位置信息,获得所述待测动物相应的待测外部特征值。The external feature value obtaining module to be tested is used for obtaining the external feature value to be tested corresponding to the animal to be tested according to the horizontal shooting distance and the position information of the second key feature point corresponding to the body size to be tested.
  9. 一种计算机设备,其特征在于,所述计算机设备包括:A computer device, characterized in that the computer device comprises:
    通信接口;Communication Interface;
    存储器,用于存储实现如权利要求1-7任意一项所述的动物属性值获取方法的程序;a memory for storing a program for realizing the method for obtaining an attribute value of an animal according to any one of claims 1-7;
    处理器,用于加载并执行所述程序,实现如权利要求1-7任意一项所述的动物属性值获取方法的各个步骤。The processor is configured to load and execute the program to implement each step of the method for obtaining an attribute value of an animal according to any one of claims 1-7.
  10. 根据权利要求9所述的计算机设备,其特征在于,所述计算机设备为移动终端或服务器;The computer device according to claim 9, wherein the computer device is a mobile terminal or a server;
    当所述计算机设备为所述移动终端,所述计算机设备还包括:When the computer device is the mobile terminal, the computer device further includes:
    图像采集器,用于拍摄待测动物的图像;An image collector for taking images of the animal to be tested;
    显示屏,用于输出所述图像采集器拍摄到的所述待测动物的图像;a display screen for outputting the image of the animal to be tested captured by the image collector;
    多种姿态传感器,用于感应图像采集器拍摄所述待测动物的目标图像时的拍摄姿态信息;A variety of attitude sensors for sensing the shooting attitude information when the image collector shoots the target image of the animal to be tested;
    当所述计算机设备为服务器,所述通信接口用于接收图像采集器拍摄并发送的所述待测动物的目标图像,以及图像采集器拍摄所述目标图像时的拍摄姿态信息;将所述待测动物相应的待测外部特征值反馈至预设移动终端输出。When the computer device is a server, the communication interface is used to receive the target image of the animal to be tested shot and sent by the image collector, and the shooting posture information when the image collector shoots the target image; The corresponding external characteristic value of the tested animal is fed back to the preset mobile terminal for output.
PCT/CN2020/118607 2020-09-09 2020-09-29 Method and device for acquiring external features of animal, and computer device WO2022052189A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010940011.3 2020-09-09
CN202010940011.3A CN112040132A (en) 2020-09-09 2020-09-09 Animal external feature obtaining method and device and computer equipment

Publications (1)

Publication Number Publication Date
WO2022052189A1 true WO2022052189A1 (en) 2022-03-17

Family

ID=73584451

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/118607 WO2022052189A1 (en) 2020-09-09 2020-09-29 Method and device for acquiring external features of animal, and computer device

Country Status (2)

Country Link
CN (1) CN112040132A (en)
WO (1) WO2022052189A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114931112A (en) * 2022-04-08 2022-08-23 南京农业大学 Sow body ruler detection system based on intelligent inspection robot

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113518180B (en) * 2021-05-25 2022-08-05 宁夏宁电电力设计有限公司 Vehicle-mounted camera mounting method for electric power working vehicle

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013253868A (en) * 2012-06-07 2013-12-19 Central Research Institute Of Electric Power Industry Method for measuring size of arbitrary portion of animal photographed by camera trap
CN103759701A (en) * 2014-01-13 2014-04-30 南通大学 Intelligent cell phone ranging method based on android platform
CN107180438A (en) * 2017-04-26 2017-09-19 清华大学 Estimate yak body chi, the method for body weight and corresponding portable computer device
CN107764233A (en) * 2016-08-15 2018-03-06 杭州海康威视数字技术股份有限公司 A kind of measuring method and device
JP2019194573A (en) * 2018-04-25 2019-11-07 株式会社ノア Body weight estimation device
CN110693499A (en) * 2019-11-14 2020-01-17 河北农业大学 System and method for detecting animal body size and weight
CN110782467A (en) * 2019-10-24 2020-02-11 新疆农业大学 Horse body ruler measuring method based on deep learning and image processing

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5830876B2 (en) * 2011-02-18 2015-12-09 富士通株式会社 Distance calculation program, distance calculation method, and distance calculation device
CN103206919A (en) * 2012-07-31 2013-07-17 广州三星通信技术研究有限公司 Device and method used for measuring object size in portable terminal
US10782119B2 (en) * 2015-02-11 2020-09-22 Huawei Technologies Co., Ltd. Object dimension measurement method and apparatus
CN108240793A (en) * 2018-01-26 2018-07-03 广东美的智能机器人有限公司 Dimension of object measuring method, device and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013253868A (en) * 2012-06-07 2013-12-19 Central Research Institute Of Electric Power Industry Method for measuring size of arbitrary portion of animal photographed by camera trap
CN103759701A (en) * 2014-01-13 2014-04-30 南通大学 Intelligent cell phone ranging method based on android platform
CN107764233A (en) * 2016-08-15 2018-03-06 杭州海康威视数字技术股份有限公司 A kind of measuring method and device
CN107180438A (en) * 2017-04-26 2017-09-19 清华大学 Estimate yak body chi, the method for body weight and corresponding portable computer device
JP2019194573A (en) * 2018-04-25 2019-11-07 株式会社ノア Body weight estimation device
CN110782467A (en) * 2019-10-24 2020-02-11 新疆农业大学 Horse body ruler measuring method based on deep learning and image processing
CN110693499A (en) * 2019-11-14 2020-01-17 河北农业大学 System and method for detecting animal body size and weight

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114931112A (en) * 2022-04-08 2022-08-23 南京农业大学 Sow body ruler detection system based on intelligent inspection robot
CN114931112B (en) * 2022-04-08 2024-01-26 南京农业大学 Sow body ruler detection system based on intelligent inspection robot

Also Published As

Publication number Publication date
CN112040132A (en) 2020-12-04

Similar Documents

Publication Publication Date Title
CN107113415B (en) The method and apparatus for obtaining and merging for more technology depth maps
KR101657039B1 (en) Image processing apparatus, image processing method, and imaging system
JP6627935B2 (en) Information processing apparatus, information processing method, and information processing program
EP3739502A1 (en) Image processing method, apparatus, storage medium, and electronic device
US20110249117A1 (en) Imaging device, distance measuring method, and non-transitory computer-readable recording medium storing a program
US20140307086A1 (en) Method for determining dimension of subject by using camera-equipped electronic apparatus
CN106871878A (en) The method that spatial model is created using hand-held range unit
US11210796B2 (en) Imaging method and imaging control apparatus
US20120194636A1 (en) Information processing apparatus, information processing method, program, and imaging apparatus
WO2022052189A1 (en) Method and device for acquiring external features of animal, and computer device
JP2013122434A (en) Three-dimensional shape position measuring device by monocular camera using laser, method for measuring three-dimensional shape position, and three-dimensional shape position measuring program
US20120127276A1 (en) Image retrieval system and method and computer product thereof
WO2021244140A1 (en) Object measurement method and apparatus, virtual object processing method and apparatus, medium and electronic device
WO2021136386A1 (en) Data processing method, terminal, and server
CN104243800A (en) Control device and storage medium
WO2021168838A1 (en) Position information determining method, device, and storage medium
CN108781267A (en) Image processing equipment and method
WO2022241964A1 (en) Temperature measuring method, computer device, and computer-readable storage medium
CN107255813A (en) Distance-finding method, mobile terminal and storage medium based on 3D technology
US20130300899A1 (en) Information processing device, information processing method, and program
CN112434546A (en) Face living body detection method and device, equipment and storage medium
CN104864810A (en) Digital measuring method and device thereof
CN106681326B (en) Seat, method of controlling seat movement and movement control system for seat
CN106197366A (en) The treating method and apparatus of range information
WO2019000810A1 (en) Image collection device and electronic equipment

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: 20952976

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20952976

Country of ref document: EP

Kind code of ref document: A1