Livestock body measurement method and device, computer equipment and storage medium
By performing object detection model processing on the animal body image, the four corner points of the paper are determined and their area is calculated, which solves the problem of insufficient robustness of paper calibration materials in animal body measurement, and achieves high-precision animal body measurement and volume , weight prediction.
Patent Information
- Application Number
- CN202411176944.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-24
- Publication Date
- 2024-12-31
AI Technical Summary
When paper is used as a calibrator to weigh and measure the length of the livestock body, the existing technology is not robust, which easily causes errors and is difficult to adapt to various scenarios.
By acquiring the animal body images, inputting a preset object detection model, performing denoising, binarization and Hough transformation, determining the four corners of the paper, calculating the estimated values of its side length and area, and using it as a measurement standard , predict the volume and weight of the animal body.
It improves the accuracy and robustness of animal body measurement, can accurately and intelligent measurements in multiple scenarios, reduces errors, and is suitable for business scenarios such as insurance claims.
Smart Images

Figure CN119228869A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of image processing and financial technology, and is applied to scenarios where paper is used as a calibration object to weigh and measure the length of livestock, and in particular, to a livestock measurement method, device, computer equipment and storage medium. Background Art
[0002] With the rapid development of financial technology, its application in various business scenarios of the insurance industry is becoming more and more extensive. For the insurance industry, insurance claims is a concrete manifestation of the insurance compensation function and is one of the most common business scenarios.
[0003] In the process of insurance claims, it is often necessary to weigh and measure the length of certain livestock in order to determine the loss (damage assessment) and formulate a compensation plan. At present, when applying AI for intelligent weighing and intelligent length measurement, specific items are selected as calibration objects to influence the final result through the detection of the calibration objects.
[0004] However, selecting specific items as calibration objects will increase costs and cannot be adapted to most scenarios. Therefore, paper (such as A4 paper) that is easy to obtain, easy to replace, and low in cost can be used as calibration objects. However, the current detection solutions for paper are mainly used in indoor office scenes, and the detection results are mostly used for text sharpening. The edge recognition is not clear enough. When used as a calibration object for weighing and measuring the length of livestock, its robustness is not strong and it is easy to cause errors. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a method, device, computer equipment and storage medium for measuring animal bodies, so as to solve the technical problem of weak robustness when using paper as a calibration object to weigh and measure the length of animal bodies.
[0006] In order to solve the above technical problems, the present application provides a method for measuring animal carcasses, which adopts the following technical solution:
[0007] A method for measuring a carcass comprises the following steps:
[0008] Acquire a carcass image containing the paper to be measured;
[0009] Inputting the carcass image into a preset target detection model to obtain a target area image corresponding to the paper to be measured;
[0010] De-noising, binarizing and Hough transforming the target area image in sequence to determine four corner points of the paper to be measured;
[0011] Determine the estimated values of the side length and area of the paper to be measured according to the four corner points;
[0012] The estimated values are used as a measurement standard to predict the volume and weight of the target carcass.
[0013] Furthermore, the step of sequentially performing denoising, binarization and Hough transformation on the target area image to determine the four corner points of the paper to be measured specifically includes:
[0014] Denoising the target area image by Gaussian blurring;
[0015] Binarizing the denoised target area image to obtain the binarized image;
[0016] Perform Hough transform on the binary image to determine the four corner points.
[0017] Furthermore, the step of performing Hough transform on the binary image to determine the four corner points specifically includes:
[0018] Performing straight line detection on the binary image by Hough transform to extract Hough lines;
[0019] The four corner points are determined according to the Hough lines.
[0020] Furthermore, the step of determining the four corner points according to the Hough lines specifically includes:
[0021] Perform cluster analysis based on each intersection of the Hough lines to determine four point sets;
[0022] The clustering points of the four point sets are determined as the four corner points.
[0023] Furthermore, the step of determining the estimated values of the side length and area of the paper to be measured based on the four corner points specifically includes:
[0024] Perform sub-pixel positioning on the four corner points to determine each sub-pixel positioning point;
[0025] Determining the coordinate values of the four corner points according to the sub-pixel positioning points and the aspect ratio of the paper to be measured;
[0026] The estimated value is calculated based on the coordinate value.
[0027] Furthermore, the step of using the estimated value as a measurement standard to predict the volume and weight of the target carcass specifically includes:
[0028] Using the estimated value as the measurement standard, estimating various length data corresponding to the target carcass in the carcass image;
[0029] Perform data statistics according to the length data to obtain data statistical results;
[0030] The volume and weight of the target carcass are predicted based on the statistical results of the data.
[0031] Furthermore, the step of inputting the carcass image into a preset target detection model to obtain the target area image corresponding to the paper to be measured specifically includes:
[0032] Inputting the carcass image into the target detection model, and detecting the target area corresponding to the paper to be measured according to the target detection model;
[0033] Determining a corresponding enlargement ratio according to the resolution of the carcass image;
[0034] The target area is enlarged according to the enlargement ratio, and the target area image is obtained by cutting.
[0035] In order to solve the above technical problems, the embodiment of the present application also provides a carcass measuring device, which adopts the following technical solution:
[0036] A carcass measuring device, comprising:
[0037] An acquisition module, used for acquiring an image of a carcass containing the paper to be measured;
[0038] An input module, used for inputting the carcass image into a preset target detection model to obtain a target area image corresponding to the paper to be measured;
[0039] A first determination module is used to sequentially perform denoising, binarization and Hough transformation on the target area image to determine four corner points of the paper to be measured;
[0040] A second determination module, used to determine the estimated values of the side length and area of the paper to be measured according to the four corner points;
[0041] The prediction module is used to use the estimated value as a measurement standard to predict the volume and weight of the target carcass.
[0042] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0043] A computer device comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the above-mentioned animal body measurement method when executing the computer-readable instructions.
[0044] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0045] A computer-readable storage medium stores computer-readable instructions, which implement the steps of the above-mentioned animal body measurement method when executed by a processor.
[0046] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0047] The animal body measurement method disclosed in the present application obtains an animal body image containing the paper to be measured; and inputs the animal body image into a preset target detection model to obtain a target area image corresponding to the paper to be measured; then, the target area image is denoised, binarized, and Hough transformed in sequence to determine the four corner points of the paper to be measured; and then, based on the four corner points, the estimated values of the side length and area of the paper to be measured are determined; thereby, the estimated values are used as the measurement standard to predict the volume and weight of the target animal body. The present application uses a deep learning target detection model to extract images of the area where the paper is located in the animal body image in multiple scenarios, and uses a series of image processing to accurately determine the size data of the paper, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0049] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0050] Figure 2 is a flow chart of an embodiment of a method for measuring a carcass according to the present application;
[0051] Figure 3 is a schematic structural diagram of an embodiment of a carcass measuring device according to the present application;
[0052] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0053] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0054] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0056] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0057] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0058] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, and the like.
[0059] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0060] It should be noted that the animal body measurement method provided in the embodiment of the present application is generally executed by a server, and accordingly, the animal body measurement device is generally disposed in the server.
[0061] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0062] Continue to refer Figure 2 , shows a flow chart of an embodiment of a method for measuring a carcass according to the present application. The method for measuring a carcass comprises the following steps:
[0063] Step S201, obtaining an image of a carcass including the paper to be measured.
[0064] In this embodiment, the electronic device (eg, Figure 1 The server shown in the figure) can send or receive data through a wired connection or a wireless connection. It should be noted that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, Wi MAX connection, Zigbee connection, UWB (ultra wi deband) connection, and other wireless connection methods currently known or to be developed in the future.
[0065] It should be noted that insurance is an important part of the financial industry, and financial technology has a significant impact on the insurance industry. With the development of financial technology, insurance companies' innovations in financial technology include channel innovation, product innovation, and service innovation based on the Internet. For insurance companies, whether it is products, marketing and underwriting, or claims, services and anti-fraud, they all need to combine innovations in financial technology on the basis of business scenarios in order to achieve better results.
[0066] In this embodiment, in order to more accurately determine the damage in the insurance claim process, paper can be used as a calibration object to perform intelligent measurement on the livestock. First, it is necessary to obtain a livestock image containing the paper to be measured. Specifically, since the embodiment of the present application is mainly used in the scenario where paper is used as a calibration object to weigh and measure the length of the livestock, the livestock that needs to be weighed and measured can be used as the target livestock. When the claim is settled, the paper is placed at the scene where the target livestock is located and photographed to obtain a number of photos containing the paper and the target livestock as the livestock image. It should be noted that in the livestock image, the paper and the target livestock can be placed close to each other, but cannot block each other to avoid the subsequent measurement process from being unable to proceed. Take A4 paper as the paper and a dead pig as the target livestock as an example. Take A4 paper as the paper to be measured. When it is necessary to make an insurance claim for the dead pig, in a certain scene where the dead pig is placed, a normal A4 paper can be placed around the dead pig, and then photographed, and finally a number of photos containing the dead pig and A4 paper are obtained as the livestock image.
[0067] It is understandable that the use of paper as a calibration object to weigh and measure the length of livestock can be applied in multiple natural scenes at different times and locations, whether in the early morning, noon, or evening, or on more land in rural areas, more concrete floors in towns, and more marble floors indoors. Only hundreds of livestock images are needed to meet subsequent measurements, thereby saving data. The reason is that the samples that need to be identified only include paper and livestock, which are relatively simple, and therefore the requirements for the environment are not high.
[0068] Step S202: input the animal body image into a preset target detection model to obtain a target area image corresponding to the paper to be measured.
[0069] In this embodiment, after obtaining the animal body image including the paper to be measured, the animal body image can be input into a preset target detection model to obtain a target area image corresponding to the paper to be measured. Specifically, after the animal body image containing the paper to be measured is input into the target detection model, the target area of the paper to be measured in the animal body image can be detected according to the target detection model, and then the corresponding enlargement ratio can be determined according to the resolution of the body image, the target area is enlarged according to the enlargement ratio, and the target area is cut after the enlargement is completed to obtain the target area image, wherein the target detection model belongs to a deep learning model, which is built by a target detection algorithm, for example, an R-CNN series algorithm and a YOLO series algorithm, the R-CNN series algorithm includes R-CNN, Fast R-CNN, Faster R-CNN, etc., the YOLO series algorithm includes YOLOv3, YOLOv4, YOLOv5, etc., this embodiment can use YOLOv5 as the target detection algorithm, which has the advantages of fast detection speed, high accuracy, easy deployment, etc., and is one of the widely used target detection algorithms. An initial model can be built based on the YOLOv5 algorithm, and then the initial model is trained according to the training set to obtain the target detection model.
[0070] Step S203, performing denoising, binarization and Hough transformation on the target area image in sequence to determine four corner points of the paper to be measured.
[0071] In this embodiment, after the carcass image is input into the preset target detection model and the target area image corresponding to the paper to be measured is obtained, the target area image can be denoised, binarized and Hough transformed in sequence to determine the four corner points of the paper to be measured. Specifically, after the target area image is obtained, the target area image can be denoised by Gaussian blur to effectively filter the noise data for subsequent processing, and then the denoised target area image can be binarized to obtain a binarized image showing a black and white effect, and then the binarized image is Hough transformed, and the Hough line is extracted by Hough line detection, and finally the four corner points of the paper to be measured are determined according to the Hough line.
[0072] It is understandable that adaptive binarization can be used when binarizing the denoised target area image, thereby effectively avoiding the impact of paper missing after binarization due to uneven shadows.
[0073] Step S204: determining estimated values of the side length and area of the paper to be measured according to the four corner points.
[0074] In this embodiment, after determining the four corner points of the paper to be measured, the estimated values of the side length and area of the paper to be measured can be determined based on the four corner points. Specifically, after determining the four corner points of the paper to be measured, a series of optimization strategies can be used to perform sub-pixel positioning on the four corner points, determine each sub-pixel positioning point, and then determine the coordinate values of the four corner points based on each sub-pixel positioning point and the aspect ratio of the paper, and finally calculate the estimated values of the side length and area of the paper to be measured based on the coordinate values of the four corner points. For example, A4 paper is used as the paper to be measured, and the aspect ratio of A4 paper is about 1.414. After determining each sub-pixel positioning point, the most suitable long side and short side can be selected based on each sub-pixel positioning point and the aspect ratio of A4 paper, and the coordinate values of the four corner points can be determined in sequence based on this, and the estimated values of the side length and area of the paper to be measured can be calculated.
[0075] Step S205: using the estimated value as a measurement standard to predict the volume and weight of the target carcass.
[0076] In this embodiment, after determining the estimated values of the side length and area of the paper to be measured according to the four corner points of the paper to be measured, the estimated values can be used as a measurement standard to predict the volume and weight of the target animal body. Specifically, after determining the estimated values of the side length and area of the paper to be measured, the estimated values can be used as a measurement standard to estimate the length data corresponding to the target animal body in the animal body image, and then data statistics are performed based on the length data to obtain data statistical results, thereby predicting the volume and weight of the target animal body according to the data statistical results, and realizing intelligent measurement of the target animal body.
[0077] Through the deep learning target detection model, this application can extract the image of the area where the paper is located in the animal image in multiple scenarios, and use a series of image processing to accurately determine the size data of the paper, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0078] In some optional implementations of this embodiment, the step of sequentially performing denoising, binarization and Hough transformation on the target area image to determine the four corner points of the paper to be measured includes:
[0079] Denoising the target area image by Gaussian blurring;
[0080] Binarizing the denoised target area image to obtain the binarized image;
[0081] Perform Hough transform on the binary image to determine the four corner points.
[0082] In this embodiment, after obtaining the target area image with the help of the target detection model, the target area image can be denoised by Gaussian blur, and then the denoised target area image is binarized to obtain a binarized image, and then the binarized image is subjected to Hough transform to determine the four corner points of the paper to be measured. Specifically, denoising the target area image by Gaussian blur can effectively filter noise data. As the first step of image processing, it can make subsequent processing more convenient. After completing the denoising of the target area image, the target area can be binarized to obtain a binarized image. As the second step of image processing, the binarized image generally presents a black and white effect, in which each pixel is a value of pure black or pure white. After obtaining the binarized image, the binarized image can be subjected to straight line detection by Hough transform to extract the Hough line, thereby determining the four corner points of the paper to be measured based on the Hough line.
[0083] It can be understood that, under normal circumstances, the target area image can be binarized by using the threshold method. By setting a threshold color level, pixels with a color level greater than the threshold color level can be taken as pure white, and pixels with a color level less than the threshold color level can be taken as full black, thereby obtaining a binary image, which helps to improve the accuracy of subsequently determining the four corner points of the paper to be measured.
[0084] The present application determines the four corner points of the paper to be measured through a series of image processing methods, so that the size data of the paper can be accurately determined using the four corner points subsequently, thereby realizing intelligent measurement of livestock using paper as a calibration object and improving the measurement accuracy of livestock measurements.
[0085] In some optional implementations of this embodiment, the step of performing Hough transform on the binary image to determine the four corner points includes:
[0086] Performing straight line detection on the binary image by Hough transform to extract Hough lines;
[0087] The four corner points are determined according to the Hough lines.
[0088] In this embodiment, after the denoised target area image is binarized and a binarized image is obtained, the binarized image can be subjected to straight line detection through Hough transform to extract Hough lines, and then the four corner points of the paper to be measured are determined based on the Hough lines. Specifically, Hough transform is one of the basic methods for detecting geometric shapes from images in the field of image processing. Hough lines can be extracted by performing straight line detection on the binarized image through Hough transform. For Hough transform straight line detection, the straight lines in the image space correspond to the points in the parameter space one-to-one, and the straight lines in the parameter space correspond to the points in the image space one-to-one. The binarized image is the image space. After converting several points in the binarized image into several corresponding straight lines in the parameter space, a straight line in the binarized image can be determined through the intersection of every two straight lines in the parameter space as a Hough line, and then cluster analysis is performed based on the intersections of the Hough lines to determine four point sets, and the clustering points of the four point sets are determined as the four corner points of the paper to be measured.
[0089] The present application determines the four corner points of the paper to be measured through a series of image processing means and utilizes Hough transform straight line detection, thereby improving the accuracy of the four corner points of the paper to be measured, so that the size data of the paper can be accurately determined using the four corner points, thereby improving the measurement accuracy of the subsequent intelligent measurement of the livestock body using the paper as a calibration object.
[0090] In some optional implementations of this embodiment, the step of determining the four corner points according to the Hough lines includes:
[0091] Perform cluster analysis based on each intersection of the Hough lines to determine four point sets;
[0092] The clustering points of the four point sets are determined as the four corner points.
[0093] It should be noted that clustering point is one of the basic concepts of topological space. It is defined as: Let A be a subset of topological space X, a∈X, if any neighborhood of a contains a point in A that is different from a, then a is called a clustering point of A.
[0094] In this embodiment, after the Hough transform is used to perform straight line detection on the binary image and the Hough lines are extracted, cluster analysis can be performed based on the intersection points of the Hough lines to determine four point sets, and then the clustering points of the four point sets are determined as the four corner points of the paper to be measured. Specifically, through the Hough transform straight line detection, a number of points in the binary image can be first converted into a number of corresponding straight lines in the parameter space, and then the intersection points of every two straight lines in the parameter space are converted into a number of Hough lines in the binary image, and then the intersection points of the several Hough lines are counted and cluster analysis is performed to determine four point sets corresponding to the four corner points of the paper to be measured. Finally, the clustering points of the four point sets are directly determined, which can be used as the four corner points of the value to be measured.
[0095] After extracting the Hough line through Hough transform straight line detection, the application uses cluster analysis and clustering points to determine the four corner points of the paper to be measured, thereby improving the accuracy of the four corner points of the paper to be measured, so that the size data of the paper can be accurately determined by the four corner points, and the measurement accuracy of the subsequent intelligent measurement of the animal body using the paper as a calibration object is improved.
[0096] In some optional implementations of this embodiment, the step of determining the estimated values of the side length and area of the paper to be measured according to the four corner points includes:
[0097] Perform sub-pixel positioning on the four corner points to determine each sub-pixel positioning point;
[0098] Determining the coordinate values of the four corner points according to the sub-pixel positioning points and the aspect ratio of the paper to be measured;
[0099] The estimated value is calculated based on the coordinate value.
[0100] It should be noted that digital images are usually discretized into pixels, and each pixel corresponds to an integer coordinate position. However, integer coordinate positions are not accurate for many applications, such as image registration, image stitching, and three-dimensional reconstruction. Therefore, in order to achieve accuracy in certain applications, it is necessary to accurately determine the floating-point coordinate position, which is sub-pixel positioning.
[0101] In this embodiment, after determining the four corner points of the paper to be measured through denoising, binarization and Hough transform, the four corner points can be sub-pixel positioned to determine each sub-pixel positioning point, and then the coordinate values of the four corner points are determined based on each sub-pixel positioning point and the aspect ratio of the paper to be measured, so as to calculate the estimated value of the side length and area of the paper to be measured based on the coordinate values. Specifically, since the actual positions of the four corner points may not be at the integer coordinate position of the pixel but inside the pixel, it is necessary to perform sub-pixel positioning on the four corner points, determine each sub-pixel positioning point, and then obtain the coordinate values of the four corner points according to each sub-pixel positioning point and the aspect ratio of the paper to be measured. For example, A4 paper is used as the paper to be measured. It is known that the aspect ratio of A4 paper is about 1.414. After determining each sub-pixel positioning point, appropriate long and short sides can be selected according to each sub-pixel positioning point and the aspect ratio of A4 paper, and the difference between the angle between the long and short sides and 90 degrees is used as the credibility evaluation. The smaller the difference, the higher the credibility. Thus, the corner point with the highest credibility is screened out as the initial point, and the corner point with higher credibility is determined as the adjacent point from the two corner points adjacent to the initial point. With the initial point as the coordinate origin, the estimated values of the coordinates of the adjacent points can be calculated, and then the estimated values of the coordinates of the remaining two corner points are calculated according to the aspect ratio, which are used as the coordinate values of the four corner points. Finally, the estimated values of the side length and area of the paper to be measured are calculated according to the coordinate values of the four corner points.
[0102] The present application uses sub-pixel positioning combined with the aspect ratio of the paper to accurately determine the size data of the paper based on the four corner points determined after a series of image processing processes, so that the paper can be used as a calibration object to achieve intelligent measurement of livestock, improve the measurement accuracy of livestock, and increase the robustness of livestock measurement.
[0103] In some optional implementations of this embodiment, the step of using the estimated value as a measurement standard to predict the volume and weight of the target carcass includes:
[0104] Using the estimated value as the measurement standard, estimating various length data corresponding to the target carcass in the carcass image;
[0105] Perform data statistics according to the length data to obtain data statistical results;
[0106] The volume and weight of the target carcass are predicted based on the statistical results of the data.
[0107] In this embodiment, after obtaining the estimated values of the side length and area of the paper to be measured, the estimated values can be used as the measurement standard to estimate the length data corresponding to the target animal body in the animal body image, and data statistics are performed based on the length data to obtain the data statistical results, and then the volume and weight of the target animal body are predicted based on the data statistical results. For example, taking A4 paper as the paper to be measured and a dead pig as the target animal body as an example, after obtaining the estimated values of the side length and area according to the coordinate values of the four corner points of the A4 paper, the estimated values can be used as the measurement standard to estimate the length data of various parts of the dead pig, and then data statistics are performed based on the obtained length data, and the volume and weight of the dead pig are predicted in combination with relevant information such as historical data, so that when insurance compensation is required based on the volume and weight of the dead pig, intelligent measurement of the dead pig can be achieved, and this measurement method can avoid physical contact and reduce the risk of pathogen transmission.
[0108] This application uses a series of image processing to accurately determine the size data of the paper, and then uses the paper as a calibration object to achieve intelligent measurement of the livestock, thereby improving the measurement accuracy of the livestock, avoiding physical contact, reducing the risk of pathogen transmission, and increasing the robustness of the livestock measurement.
[0109] In some optional implementations of this embodiment, the step of inputting the carcass image into a preset target detection model to obtain the target area image corresponding to the paper to be measured includes:
[0110] Inputting the carcass image into the target detection model, and detecting the target area corresponding to the paper to be measured according to the target detection model;
[0111] Determining a corresponding enlargement ratio according to the resolution of the carcass image;
[0112] The target area is enlarged according to the enlargement ratio, and the target area image is obtained by cutting.
[0113] In this embodiment, after obtaining the animal body image containing the paper to be measured, the animal body image can be input into a preset target detection model, and the target area corresponding to the paper to be measured is detected according to the target detection model, and then the corresponding enlargement ratio is determined according to the resolution of the animal body image, and then the target area is enlarged according to the enlargement ratio, and the target area image is cut to obtain the target area image. Specifically, conventional image resolutions include 540P, 720P, 1080P, etc. Under different shooting conditions, the resolution of the animal body image obtained is also different, so the pixels contained are different. Therefore, in order to achieve a clear recognition effect, it is necessary to enlarge the target area according to the resolution level of the animal body image. For example, the enlargement ratio corresponding to 540P is 1:1, the enlargement ratio corresponding to 720P is 4:3, and the enlargement ratio corresponding to 1080P is 2:1. After the target area is enlarged according to the enlargement ratio, the target area image can be cut to obtain the target area image for subsequent image processing.
[0114] Through the deep learning target detection model, this application can extract the image of the area where the paper is located in the animal image in multiple scenarios, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0115] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0116] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0117] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0118] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0119] Further references Figure 3 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a carcass measuring device, which is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0120] like Figure 3 As shown, the animal body measurement device 300 described in this embodiment includes: an acquisition module 301, an input module 302, a first determination module 303, a second determination module 304 and a prediction module 305. Among them:
[0121] An acquisition module 301 is used to acquire an image of a carcass including the paper to be measured;
[0122] An input module 302 is used to input the animal body image into a preset target detection model to obtain a target area image corresponding to the paper to be measured;
[0123] The first determination module 303 is used to sequentially perform denoising, binarization and Hough transformation on the target area image to determine four corner points of the paper to be measured;
[0124] A second determination module 304 is used to determine the estimated values of the side length and area of the paper to be measured according to the four corner points;
[0125] The prediction module 305 is used to predict the volume and weight of the target carcass using the estimated value as a measurement standard.
[0126] The animal body measurement device provided in the present application can extract the image of the area where the paper is located in the animal body image in multiple scenarios through a deep learning target detection model, and use a series of image processing to accurately determine the size data of the paper, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0127] In some optional implementations of this embodiment, the first determining module 303 is further configured to:
[0128] Denoising the target area image by Gaussian blurring;
[0129] Binarizing the denoised target area image to obtain the binarized image;
[0130] Perform Hough transform on the binary image to determine the four corner points.
[0131] The animal body measurement device provided in the present application determines the four corner points of the paper to be measured through a series of image processing means, so that the size data of the paper can be accurately determined using the four corner points subsequently, thereby realizing intelligent measurement of the animal body using paper as a calibration object and improving the measurement accuracy of the animal body.
[0132] In some optional implementations of this embodiment, the first determining module 303 is further configured to:
[0133] Performing straight line detection on the binary image by Hough transform to extract Hough lines;
[0134] The four corner points are determined according to the Hough lines.
[0135] The animal body measurement device provided in the present application determines the four corner points of the paper to be measured through a series of image processing means and utilizes Hough transform straight line detection, thereby improving the accuracy of the four corner points of the paper to be measured, so that the size data of the paper can be accurately determined using the four corner points subsequently, thereby improving the measurement accuracy of the subsequent intelligent measurement of the animal body using the paper as a calibration object.
[0136] In some optional implementations of this embodiment, the first determining module 303 is further configured to:
[0137] Perform cluster analysis based on each intersection of the Hough lines to determine four point sets;
[0138] The clustering points of the four point sets are determined as the four corner points.
[0139] The animal body measurement device provided by the present application, after extracting the Hough line through Hough transform straight line detection, uses cluster analysis and clustering points to determine the four corner points of the paper to be measured, thereby improving the accuracy of the four corner points of the paper to be measured, so that the size data of the paper can be accurately determined using the four corner points, thereby improving the measurement accuracy of the subsequent intelligent measurement of the animal body using the paper as a calibration object.
[0140] In some optional implementations of this embodiment, the second determining module 304 is further configured to:
[0141] Perform sub-pixel positioning on the four corner points to determine each sub-pixel positioning point;
[0142] Determining the coordinate values of the four corner points according to the sub-pixel positioning points and the aspect ratio of the paper to be measured;
[0143] The estimated value is calculated based on the coordinate value.
[0144] The animal body measurement device provided in the present application uses sub-pixel positioning combined with the aspect ratio of the paper to accurately determine the size data of the paper based on the four corner points determined after a series of image processing processes, so that the paper can be used as a calibration object to achieve intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0145] In some optional implementations of this embodiment, the prediction module 305 is further configured to:
[0146] Using the estimated value as the measurement standard, estimating various length data corresponding to the target carcass in the carcass image;
[0147] Perform data statistics according to the length data to obtain data statistical results;
[0148] The volume and weight of the target carcass are predicted based on the statistical results of the data.
[0149] The animal body measurement device provided in the present application uses a series of image processing to accurately determine the size data of the paper, and then uses the paper as a calibration object to realize intelligent measurement of the animal body, thereby improving the measurement accuracy of the animal body measurement, avoiding physical contact, reducing the risk of pathogen transmission, and increasing the robustness of the animal body measurement.
[0150] In some optional implementations of this embodiment, the input module 302 is further used to:
[0151] Inputting the carcass image into the target detection model, and detecting the target area corresponding to the paper to be measured according to the target detection model;
[0152] Determining a corresponding enlargement ratio according to the resolution of the carcass image;
[0153] The target area is enlarged according to the enlargement ratio, and the target area image is obtained by cutting.
[0154] The animal body measurement device provided in the present application can extract the image of the area where the paper is located in the animal body image in multiple scenarios through a deep learning target detection model, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0155] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0156] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0157] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0158] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the animal body measurement method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0159] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions or process data stored in the memory 41, such as computer-readable instructions for running the carcass measurement method.
[0160] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0161] The computer device provided in the present application can, through a deep learning target detection model, extract the image of the area where the paper is located in the animal image in multiple scenarios, and use a series of image processing to accurately determine the size data of the paper, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0162] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the animal body measurement method as described above.
[0163] The computer-readable storage medium provided in the present application can extract the image of the area where the paper is located in the animal image in multiple scenarios through a deep learning target detection model, and use a series of image processing to accurately determine the size data of the paper, so that the paper can be used as a calibration object to realize intelligent measurement of the animal body, improve the measurement accuracy of the animal body measurement, and increase the robustness of the animal body measurement.
[0164] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0165] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A method for measuring a carcass, characterized in that: The steps include: Acquire a carcass image containing the paper to be measured; Inputting the carcass image into a preset target detection model to obtain a target area image corresponding to the paper to be measured; De-noising, binarizing and Hough transforming the target area image in sequence to determine four corner points of the paper to be measured; Determine the estimated values of the side length and area of the paper to be measured according to the four corner points; The estimated values are used as a measurement standard to predict the volume and weight of the target carcass.
2. The method for measuring a carcass according to claim 1, characterized in that: The step of sequentially performing denoising, binarization and Hough transformation on the target area image to determine the four corner points of the paper to be measured specifically includes: Denoising the target area image by Gaussian blurring; Binarizing the denoised target area image to obtain the binarized image; Perform Hough transform on the binary image to determine the four corner points.
3. The method for measuring a carcass according to claim 2, characterized in that: The step of performing Hough transform on the binary image to determine the four corner points specifically includes: Performing straight line detection on the binary image by Hough transform to extract Hough lines; The four corner points are determined according to the Hough lines.
4. The method for measuring a carcass according to claim 3, characterized in that: The step of determining the four corner points according to the Hough lines specifically includes: Perform cluster analysis based on each intersection of the Hough lines to determine four point sets; The clustering points of the four point sets are determined as the four corner points.
5. The method for measuring a carcass according to claim 1, characterized in that: The step of determining the estimated values of the side length and area of the paper to be measured according to the four corner points specifically includes: Perform sub-pixel positioning on the four corner points to determine each sub-pixel positioning point; Determining the coordinate values of the four corner points according to the sub-pixel positioning points and the aspect ratio of the paper to be measured; The estimated value is calculated based on the coordinate value.
6. The method for measuring a carcass according to claim 1, characterized in that: The step of using the estimated value as a measurement standard to predict the volume and weight of the target carcass specifically includes: Using the estimated value as the measurement standard, estimating various length data corresponding to the target carcass in the carcass image; Perform data statistics according to the length data to obtain data statistical results; The volume and weight of the target carcass are predicted based on the statistical results of the data.
7. The method for measuring a carcass according to any one of claims 1 to 6, characterized in that: The step of inputting the carcass image into a preset target detection model to obtain the target area image corresponding to the paper to be measured specifically includes: Inputting the carcass image into the target detection model, and detecting the target area corresponding to the paper to be measured according to the target detection model; Determining a corresponding enlargement ratio according to the resolution of the carcass image; The target area is enlarged according to the enlargement ratio, and the target area image is obtained by cutting.
8. A carcass measuring device, characterized in that: include: An acquisition module, used for acquiring an image of a carcass containing the paper to be measured; An input module, used for inputting the carcass image into a preset target detection model to obtain a target area image corresponding to the paper to be measured; A first determination module is used to sequentially perform denoising, binarization and Hough transformation on the target area image to determine four corner points of the paper to be measured; A second determination module, used to determine the estimated values of the side length and area of the paper to be measured according to the four corner points; The prediction module is used to use the estimated value as a measurement standard to predict the volume and weight of the target carcass.
9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the animal body measurement method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the animal body measurement method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
System and method of estimating livestock weight
CN111542222A
Animal body length measuring method and device based on artificial intelligence, equipment and medium
CN113989361A
Crack width identification method and system based on Hough transform correction two-dimensional code image
CN115018735A
Body weight determination method and device, storage medium and electronic equipment
CN115222796A
Anti-counterfeiting code generation and verification method and label-based anti-counterfeiting system
CN117952138A
