Non-contact fish weight measurement method, device, electronic equipment and storage medium
Patent Information
- Application Number
- CN202310936966.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-27
- Publication Date
- 2026-10-30
- Estimated Expiration
- 2043-07-27
AI Technical Summary
环境DNA方法,需要采集养殖水环境中大量的DNA数据,进行比对分析,因此效率较低
[0039]本发明提供的非接触式鱼类体重测量方法、装置、电子设备及存储介质,通过深度相机采集鱼类的鱼体图像进行图像处理得到目标图像,从而可以根据目标图像的深度信息得到鱼类的体积,将鱼类体积乘以鱼类密度直接得到鱼类体重,方法简单易于实现,效率高,准确率较高。
Smart Images

Figure CN117053906B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of machine vision technology, and in particular to a non-contact method, device, electronic device, and storage medium for measuring fish weight. Background Technology
[0002] Fish body weight is one of the most important economic traits and a direct breeding target trait. Currently, manual weighing is the most common estimation method, but it is time-consuming, labor-intensive, invasive, and inconsistent. Furthermore, fish live in environments with uncontrolled visibility, light, and stability, making them highly sensitive and easily stressed. This manual, contact-based measurement can easily cause harm, even leading to disease and death, thus affecting their normal growth. Therefore, developing non-contact weight measurement methods is essential.
[0003] Existing non-invasive weight estimation methods mainly include acoustic echo sounding and environmental DNA methods. Acoustic echo sounding is suitable for estimating the weight of fish groups in large bodies of water, such as marine cages, but its accuracy is greatly limited for small-scale recirculating aquaculture systems. In other words, when using acoustic echo sounding to measure weight, the size of the water surface must be considered, and this method is only suitable for group weight assessment. Environmental DNA methods require collecting large amounts of DNA data from the aquaculture environment for comparative analysis, thus resulting in lower efficiency. Summary of the Invention
[0004] To address the problems existing in the prior art, embodiments of the present invention provide a non-contact fish weight measurement method, device, electronic device, and storage medium.
[0005] This invention provides a non-contact method for measuring fish weight, comprising:
[0006] The target number of fish images in the target area are acquired using a depth camera;
[0007] Image processing is performed on the target number of fish body images to determine the target image; the target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; and a second distance between the depth camera corresponding to the target image and the bottom of the target region;
[0008] The volume of the fish is determined based on the depth information of the target image;
[0009] The weight of the fish is determined based on its volume.
[0010] In some embodiments, the image processing of the target number of fish body images to determine the target image includes:
[0011] The background in the fish image is removed based on a preset RGB threshold to obtain a binarized image;
[0012] Perform morphological operations on the binarized image to determine the corrected image;
[0013] Based on the BFS algorithm, the branches of pixels in the corrected image are determined;
[0014] Based on the number of pixels in the branches, an image containing the fish's body is obtained;
[0015] The target image is determined by performing an erosion operation on the image containing the branches of the fish's body.
[0016] In some embodiments, performing morphological operations on the binarized image to determine the corrected image includes:
[0017] A closing operation is performed on the binarized image to connect the faults within the binarized image;
[0018] Open the image after tomographic connection to remove noise;
[0019] The image after noise removal is used as the corrected image.
[0020] In some embodiments, determining the volume of the fish based on the depth information of the target image includes:
[0021] The target image corresponding to the maximum value in the first distance is used as the reference image;
[0022] Based on the first distance and the second distance corresponding to the reference image, the volume of the fish corresponding to the reference image is determined;
[0023] Based on the volume of the fish corresponding to the reference image, determine the volume of the fish corresponding to the target image;
[0024] The average volume of the fish corresponding to the target image is taken as the volume of the fish.
[0025] In some embodiments, determining the volume of the fish corresponding to the reference image based on a first distance and a second distance corresponding to the reference image includes:
[0026] Based on the first distance and the second distance corresponding to the reference image, the thickness of each pixel of the fish body in the reference image is determined;
[0027] The volume of the fish corresponding to the reference image is obtained by integrating the thickness of each pixel of the fish body in the reference image.
[0028] In some embodiments, the volume of the fish corresponding to the target image is expressed as follows:
[0029]
[0030] Among them, V n Let V0 represent the volume of the fish in the target image of the nth frame, V0 represent the volume of the fish in the reference image, and y0 represent the first distance corresponding to the reference image. n This represents the first distance corresponding to the target image in the nth frame.
[0031] The present invention also provides a non-contact fish weight measuring device, comprising:
[0032] The acquisition module is used to acquire a target number of fish body images of the target area using a depth camera;
[0033] The processing module is used to perform image processing on the target number of fish body images to determine the target image; the target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; and a second distance between the depth camera corresponding to the target image and the bottom of the target region;
[0034] A determining module is used to determine the volume of the fish based on the depth information of the target image;
[0035] A measurement module for determining the weight of the fish based on its volume.
[0036] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the processor executes the program to implement the non-contact fish weight measurement method as described above.
[0037] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the non-contact fish weight measurement method as described above.
[0038] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the non-contact fish weight measurement methods described above.
[0039] The non-contact fish weight measurement method, device, electronic device and storage medium provided by the present invention acquires fish body images by depth camera and performs image processing to obtain target images. The fish volume can be obtained based on the depth information of the target image. The fish weight can be directly obtained by multiplying the fish volume by the fish density. The method is simple, easy to implement, efficient and accurate. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0041] Figure 1 This is a flowchart illustrating the non-contact fish weight measurement method provided in an embodiment of the present invention;
[0042] Figure 2 This is one of the schematic diagrams of a method for determining fish volume provided in an embodiment of the present invention;
[0043] Figure 3 This is a second schematic diagram of the method for determining fish volume provided in an embodiment of the present invention;
[0044] Figure 4 This is a schematic diagram of the experimental comparison provided in the embodiments of the present invention;
[0045] Figure 5 This is a schematic diagram of the non-contact fish weight measuring device provided in an embodiment of the present invention;
[0046] Figure 6 This is a schematic diagram of the structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0048] The terms "first," "second," etc., used in the specification and claims of this invention are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such terms can be used interchangeably where appropriate so that embodiments of the invention can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first" and "second" are generally of the same class, not limited in number; for example, the first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0049] Figure 1This is a schematic flowchart of the non-contact fish weight measurement method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the non-contact fish weight measurement method provided in this embodiment of the invention includes:
[0050] Step 101: Acquire target number frames of fish images in the target area using a depth camera;
[0051] Step 102: Perform image processing on the target number of fish body images to determine the target image; the target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; a second distance between the depth camera corresponding to the target image and the bottom of the target region;
[0052] Step 103: Determine the volume of the fish based on the depth information of the target image;
[0053] Step 104: Determine the weight of the fish based on its volume.
[0054] It should be noted that the execution subject of the non-contact fish weight measurement method provided by this invention can be an electronic device, a component in an electronic device, an integrated circuit, or a chip. The electronic device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network-attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This invention does not impose specific limitations.
[0055] In step 101, a depth camera is used to acquire a target number of fish body images of the target area.
[0056] The target area can be a fish tank, and the depth camera can be positioned directly above the fish tank. The captured images of the fish are top-down views, including intensity and depth images. A depth image, also known as a range image, is an image that uses the distance (depth) from the image acquisition device to various points in the scene as pixel values; it directly reflects the geometry of the visible surfaces of the scene.
[0057] Optionally, 1,000 frames of images of the fish in the aquarium can be captured using a depth camera.
[0058] In step 102, image processing is performed on the target number of fish body images to determine the target image; the target image contains depth information.
[0059] By performing image processing on the collected target number of fish body images, the target number of target images can be obtained. The target images are images containing fish body information and depth information.
[0060] In some embodiments, the image processing of the target number of fish body images to determine the target image includes:
[0061] The background in the fish image is removed based on a preset RGB threshold to obtain a binarized image;
[0062] Perform morphological operations on the binarized image to determine the corrected image;
[0063] Based on the BFS algorithm, the branches of pixels in the corrected image are determined;
[0064] Based on the number of pixels in the branches, an image containing the fish's body is obtained;
[0065] The target image is determined by performing an erosion operation on the image containing the branches of the fish's body.
[0066] In some embodiments, performing morphological operations on the binarized image to determine the corrected image includes:
[0067] A closing operation is performed on the binarized image to connect the faults within the binarized image;
[0068] Open the image after tomographic connection to remove noise;
[0069] The image after noise removal is used as the corrected image.
[0070] Optionally, in the target number of fish images, if the color of the fish is significantly different from the background, an RGB threshold can be preset to roughly remove the background, resulting in a preliminary binary region with the background removed, i.e., a binary image.
[0071] The area after initial background removal has the following problems: First, there is noise; second, the extracted fish body is broken.
[0072] Therefore, morphological operations in image processing can be used to correct binarized images.
[0073] Morphological methods include the following:
[0074] Dilation operation: Set an n*n kernel. For each pixel in the image, with that pixel as the center of the kernel, if there are pixels with a value of 1 in the area covered by the kernel, then that pixel is set to 1.
[0075] Erosion operation: Set an n*n kernel. For each pixel in the image, with that pixel as the center of the kernel, if there are any pixels with a value of 0 in the area covered by the kernel, then that pixel is set to 0.
[0076] Opening operation: This operation first erodes the image and then dilates it. It is often used to remove noise.
[0077] Closing operation: This operation first dilates the image and then erodes it. It is often used to connect faults.
[0078] In this embodiment of the invention, the following method is used to correct the binarized image:
[0079] S1. The core size for closing operations is set to 6*6, and the core size for opening operations is set to 3*3.
[0080] The closing operation selects a larger core to connect a larger hole; while the opening operation selects a smaller core to prevent accidentally deleting scales from the edge of the fish's body.
[0081] S2. First, use the closing operation to connect the faults, and then use the opening operation to remove noise from the edges.
[0082] S3, repeat S2 twice.
[0083] Using the above method, a corrected image can be obtained, which is a low-noise, highly connected image of the fish's body.
[0084] However, other interfering areas still exist in the corrected image, and the redundant branches need to be removed.
[0085] Alternatively, a connected component refers to a set of pixels that are connected to each other. In the corrected image, in addition to the connected component corresponding to the fish's body, there may also be connected components corresponding to the fish tank pipes, etc.
[0086] Count all pixels in each connected branch, calculate the total number of pixels in each connected branch, and finally keep only the connected branch with the largest total number of pixels.
[0087] The specific process is as follows:
[0088] S1. First, the breadth-first search (BFS) algorithm is used to determine whether each pixel in the corrected image exists in a branch and in which branch it exists.
[0089] S2. Count the total number of pixels in each branch and remove the branches with fewer pixels.
[0090] This allows us to obtain an image containing only the connected components of the fish's body.
[0091] Because there is a shadow around the fish and a blue edge (the mark of the aquarium) is left, the edge can be removed by erosion to get a cleaner fish edge.
[0092] In step 103, the volume of the fish is determined based on the depth information of the target image.
[0093] In some embodiments, determining the volume of the fish based on the depth information of the target image includes:
[0094] The target image corresponding to the maximum value in the first distance is used as the reference image;
[0095] Based on the first distance and the second distance corresponding to the reference image, the volume of the fish corresponding to the reference image is determined;
[0096] Based on the volume of the fish corresponding to the reference image, determine the volume of the fish corresponding to the target image;
[0097] The average volume of the fish corresponding to the target image is taken as the volume of the fish.
[0098] In some embodiments, determining the volume of the fish corresponding to the reference image based on a first distance and a second distance corresponding to the reference image includes:
[0099] Based on the first distance and the second distance corresponding to the reference image, the thickness of each pixel of the fish body in the reference image is determined;
[0100] The volume of the fish corresponding to the reference image is obtained by integrating the thickness of each pixel of the fish body in the reference image.
[0101] In some embodiments, the volume of the fish corresponding to the target image is expressed as follows:
[0102]
[0103] Among them, V n Let V0 represent the volume of the fish in the target image of the nth frame, V0 represent the volume of the fish in the reference image, and y0 represent the first distance corresponding to the reference image. n This represents the first distance corresponding to the target image in the nth frame.
[0104] The depth information includes: the first distance between the depth camera corresponding to the target image and the fish, and the second distance between the depth camera corresponding to the target image and the bottom of the target area.
[0105] The depth camera corresponding to the target image is the same depth camera used when acquiring the target image.
[0106] The first distance is the distance between the depth camera and the back of the fish when the target image is acquired.
[0107] The second distance is the distance between the depth camera and the bottom of the fish tank when acquiring the target image.
[0108] To determine the volume of a fish, the distance between the depth camera and the fish's belly must first be determined before the fish's thickness can be determined.
[0109] Therefore, based on the depth information of the target image in each frame, specifically the first distance corresponding to each target image frame, it can be determined whether the fish is close to the bottom of the aquarium. When the fish is close to the bottom of the aquarium, that is, the bottom of the aquarium is the fish's belly.
[0110] Optionally, the closer the first distance is to the depth of the aquarium, the closer the fish are to the bottom of the aquarium. Therefore, the target image corresponding to the maximum value of the first distance among the target number of target images can be used as the reference image, in which the fish are close to the bottom of the aquarium.
[0111] Figure 2 This is one of the schematic diagrams of a method for determining fish volume provided in an embodiment of the present invention, such as... Figure 2 As shown, the depth value of a fish's abdomen cannot be directly read from the depth image captured by the depth camera, while the depth information of the bottom of the aquarium can be directly read from the depth image. Since the aquarium is a hemispherical object, the depth value at the bottom of the aquarium is not constant throughout. Therefore, the depth value of the fish's abdomen can be estimated by measuring the depth of the aquarium along the area covered by the fish's outline. In this embodiment, the average depth value of the aquarium corresponding to a ring around the fish's outline is taken as the fish's abdomen depth value.
[0112] The depth value of the aquarium covered by the fish's outline refers to the depth value of the bottom of the aquarium where the fish's outline is located, as seen from the depth image obtained by the depth camera.
[0113] The depth value of the aquarium surrounding the fish's outline refers to the depth value of the corresponding pixel in the aquarium image where the fish's outline is located, as seen from the depth image acquired by the depth camera.
[0114] The thickness of each pixel in the fish's body is equal to the difference between the depth of that pixel and the depth of the fish's belly.
[0115] By summing and integrating the thickness of each pixel on the fish, we can obtain the volume of the fish corresponding to the baseline image.
[0116] In the original material library, the height of the depth camera lens is not constant, and the height of the fish in the water is also not constant. Therefore, it is necessary to correct the volume measurement based on the distance from the depth camera to the fish's back.
[0117] Figure 3 This is a second schematic diagram of the method for determining fish volume provided in the embodiments of the present invention, as shown below. Figure 3 As shown, y0 is the first distance corresponding to the reference image, x0 is the width of the view plane of the depth camera corresponding to the reference image, y2 is the first distance corresponding to the second frame target image, and x2 is the width of the view plane of the depth camera corresponding to the second frame target image.
[0118] like Figure 3 As shown, based on the properties of similar triangles, we know that:
[0119]
[0120] Let W be the imaging field of view area, then we have:
[0121]
[0122] Let S be the surface area of the fish. S should be inversely proportional to W. Then we have:
[0123]
[0124] Let V be the volume of the fish. Since the thickness is constant, V is directly proportional to S, therefore:
[0125]
[0126] That is, after determining the volume V0 of the fish corresponding to the reference image, and correcting all the images from the first frame to the nth frame to the scale of the reference image, it is only necessary to obtain the first distance y0 of the reference image and the first distance y0 of the target image in the current frame. n The expression for the volume of the fish corresponding to the target image in the nth frame is as follows:
[0127]
[0128] Among them, V n Let V0 represent the volume of the fish in the target image of the nth frame, V0 represent the volume of the fish in the reference image, and y0 represent the first distance corresponding to the reference image. n This represents the first distance corresponding to the target image in the nth frame.
[0129] After determining the volume of the fish corresponding to each of the n target images, the average of the volumes can be calculated to reduce the error, resulting in the final fish volume, as shown in the following expression:
[0130]
[0131] in, V represents the mean volume, n represents the number of frames of the fish images acquired, and V n This represents the volume of the fish corresponding to the target image in the nth frame.
[0132] In step 104, the weight of the fish is determined based on its volume.
[0133] After determining the volume of the fish, multiplying the volume by the density of the fish will give you the fish's weight.
[0134] According to Archimedes' principle, the average density of the small sturgeon tested using this method in the laboratory was measured to be 1.04, therefore the weight was calculated.
[0135] The non-contact fish weight measurement method provided in this invention uses a depth camera to acquire images of the fish body and performs image processing to obtain a target image. The volume of the fish can then be obtained based on the depth information of the target image. The fish weight is obtained by multiplying the fish volume by the fish density. The method is simple, easy to implement, efficient, and has a high accuracy rate.
[0136] Furthermore, to verify the prediction accuracy of the non-contact fish weight measurement method provided in this embodiment of the invention, the weight calculated using the non-contact fish weight measurement method provided in this embodiment of the invention was subjected to least-squares linear fitting with the weight actually measured by an electronic scale. Figure 4 This is a schematic diagram of the experimental comparison provided in the embodiments of the present invention, such as... Figure 4 As shown in the figure, the horizontal axis represents the actual weight measured by the electronic scale, and the vertical axis represents the weight calculated by the non-contact fish weight measurement method provided in this embodiment of the invention. A 45-degree ideal alignment line is plotted in the figure for comparison. It can be seen from the figure that all the points basically fall near the 45-degree line, and the correlation coefficient obtained by quantitative analysis using the correlation coefficient is 0.897.
[0137] Therefore, embodiments of the present invention provide a non-contact fish weight measurement method, which can accurately measure the weight of fish without contact with them.
[0138] The non-contact fish weight measuring device provided by the present invention will be described below. The non-contact fish weight measuring device described below can be referred to in correspondence with the non-contact fish weight measuring method described above.
[0139] Figure 5 This is a schematic diagram of the non-contact fish weight measuring device provided in an embodiment of the present invention, as shown below. Figure 5 As shown, the non-contact fish weight measuring device provided in this embodiment of the invention includes:
[0140] The acquisition module 510 is used to acquire a target number of fish body images of fish in the target area using a depth camera;
[0141] Processing module 520 is used to perform image processing on the target number of fish body images to determine a target image; the target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; and a second distance between the depth camera corresponding to the target image and the bottom of the target region;
[0142] The determining module 530 is used to determine the volume of the fish based on the depth information of the target image;
[0143] Measurement module 540 is used to determine the weight of the fish based on the volume of the fish.
[0144] It should be noted that the non-contact fish weight measuring device provided in this embodiment of the invention can realize all the method steps implemented in the above-mentioned non-contact fish weight measuring method embodiment, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiment and the beneficial effects will not be described in detail.
[0145] Optionally, the processing module 520 is specifically used for:
[0146] The background in the fish image is removed based on a preset RGB threshold to obtain a binarized image;
[0147] Perform morphological operations on the binarized image to determine the corrected image;
[0148] Based on the BFS algorithm, the branches of pixels in the corrected image are determined;
[0149] Based on the number of pixels in the branches, an image containing the fish's body is obtained;
[0150] The target image is determined by performing an erosion operation on the image containing the branches of the fish's body.
[0151] Optionally, the processing module 520 is specifically used for:
[0152] A closing operation is performed on the binarized image to connect the faults within the binarized image;
[0153] Open the image after tomographic connection to remove noise;
[0154] The image after noise removal is used as the corrected image.
[0155] Optionally, the determining module 530 is specifically used for:
[0156] The target image corresponding to the maximum value in the first distance is used as the reference image;
[0157] Based on the first distance and the second distance corresponding to the reference image, the volume of the fish corresponding to the reference image is determined;
[0158] Based on the volume of the fish corresponding to the reference image, determine the volume of the fish corresponding to the target image;
[0159] The average volume of the fish corresponding to the target image is taken as the volume of the fish.
[0160] Optionally, the determining module 530 is specifically used for:
[0161] Based on the first distance and the second distance corresponding to the reference image, the thickness of each pixel of the fish body in the reference image is determined;
[0162] The volume of the fish corresponding to the reference image is obtained by integrating the thickness of each pixel of the fish body in the reference image.
[0163] Optionally, the expression for the volume of the fish corresponding to the target image is as follows:
[0164]
[0165] Among them, V n Let V0 represent the volume of the fish in the target image of the nth frame, V0 represent the volume of the fish in the reference image, and y0 represent the first distance corresponding to the reference image. n This represents the first distance corresponding to the target image in the nth frame.
[0166] Figure 6 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 6As shown, the electronic device may include a processor 610, a communications interface 620, a memory 630, and a communication bus 640, wherein the processor 610, communications interface 620, and memory 630 communicate with each other via the communication bus 640. The processor 610 can call logical instructions in the memory 630 to execute a non-contact fish weight measurement method. This method includes: acquiring a target number of fish body images of a target area using a depth camera; performing image processing on the target number of fish body images to determine a target image; the target image containing depth information; the depth information including: a first distance between the depth camera corresponding to the target image and the fish; a second distance between the depth camera corresponding to the target image and the bottom of the target area; determining the volume of the fish based on the depth information of the target image; and determining the weight of the fish based on the volume of the fish.
[0167] Furthermore, the logical instructions in the aforementioned memory 630 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0168] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the non-contact fish weight measurement method provided by the above methods. The method includes: acquiring a target number of fish body images of a target area using a depth camera; performing image processing on the target number of fish body images to determine a target image; the target image containing depth information; the depth information including: a first distance between the depth camera corresponding to the target image and the fish; a second distance between the depth camera corresponding to the target image and the bottom of the target area; determining the volume of the fish based on the depth information of the target image; and determining the weight of the fish based on the volume of the fish.
[0169] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs the non-contact fish weight measurement method provided by the methods described above. The method includes: acquiring a target number of fish body images of a target area using a depth camera; performing image processing on the target number of fish body images to determine a target image; the target image containing depth information; the depth information including: a first distance between the depth camera corresponding to the target image and the fish; a second distance between the depth camera corresponding to the target image and the bottom of the target area; determining the volume of the fish based on the depth information of the target image; and determining the weight of the fish based on the volume of the fish.
[0170] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0171] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0172] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A non-contact method for measuring fish weight, characterized in that, include: The target number of fish images in the target area are acquired using a depth camera; Image processing is performed on the target number of fish body images to determine the target image; The target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; and a second distance between the depth camera corresponding to the target image and the bottom of the target area. The volume of the fish is determined based on the depth information of the target image; The weight of the fish is determined based on its volume; The step of determining the volume of the fish based on the depth information of the target image includes: The target image corresponding to the maximum value in the first distance is used as the reference image; Based on the first distance and the second distance corresponding to the reference image, the volume of the fish corresponding to the reference image is determined; Based on the volume of the fish corresponding to the reference image, determine the volume of the fish corresponding to the target image; The average volume of the fish corresponding to the target image is taken as the volume of the fish. Determining the volume of the fish corresponding to the reference image based on the first and second distances corresponding to the reference image includes: Based on the first distance and the second distance corresponding to the reference image, the thickness of each pixel of the fish body in the reference image is determined; Integrating the thickness of each pixel of the fish body in the reference image yields the volume of the fish corresponding to the reference image; The expression for the volume of the fish corresponding to the target image is as follows: ; in, Indicates the first n The volume of the fish corresponding to the target image in the frame. This represents the volume of the fish corresponding to the reference image. This represents the first distance corresponding to the reference image. This represents the first distance corresponding to the target image in the nth frame.
2. The non-contact fish weight measurement method according to claim 1, characterized in that, The step of performing image processing on the target number of fish body images to determine the target image includes: The background in the fish image is removed based on a preset RGB threshold to obtain a binarized image; Perform morphological operations on the binarized image to determine the corrected image; Based on the BFS algorithm, the branches of pixels in the corrected image are determined; Based on the number of pixels in the branches, an image containing the fish's body is obtained; The target image is determined by performing an erosion operation on the image containing the branches of the fish's body.
3. The non-contact fish weight measurement method according to claim 2, characterized in that, The step of performing morphological operations on the binarized image to determine the corrected image includes: A closing operation is performed on the binarized image to connect the faults within the binarized image; Open the image after tomographic connection to remove noise; The image after noise removal is used as the corrected image.
4. A non-contact fish weight measuring device based on the non-contact fish weight measuring method according to any one of claims 1-3, characterized in that, include: The acquisition module is used to acquire a target number of fish body images of the target area using a depth camera; The processing module is used to perform image processing on the target number of fish body images to determine the target image; The target image contains depth information; the depth information includes: a first distance between the depth camera corresponding to the target image and the fish; and a second distance between the depth camera corresponding to the target image and the bottom of the target area. A determining module is used to determine the volume of the fish based on the depth information of the target image; A measurement module for determining the weight of the fish based on its volume; The determining module is further configured to: The target image corresponding to the maximum value in the first distance is used as the reference image; Based on the first distance and the second distance corresponding to the reference image, the volume of the fish corresponding to the reference image is determined; Based on the volume of the fish corresponding to the reference image, determine the volume of the fish corresponding to the target image; The average volume of the fish corresponding to the target image is taken as the volume of the fish.
5. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the non-contact fish weight measurement method as described in any one of claims 1 to 3.
6. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the non-contact fish weight measurement method as described in any one of claims 1 to 3.
7. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the non-contact fish weight measurement method as described in any one of claims 1 to 3.
Citation Information
Patent Citations
Fish head fishtail image automatic recognition method for squid section-cutting machine
CN108564573A
Fish weight measuring and calculating method and device
CN111127396A