Method and device for acquiring phenotypic characteristics of target object
The method and device utilize image processing techniques to address the inefficiencies of traditional phenotypic measurements by employing grayscale transformation, binary processing, and principal component analysis to accurately determine the length and width of target objects, enhancing efficiency and precision in phenotypic data acquisition.
Patent Information
- Application Number
- CN202111095556.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-17
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2041-09-17
AI Technical Summary
Traditional phenotypic measurements of plant genetic breeding are time-consuming, labor-intensive, and inaccurate due to manual data measurement of plant seeds, leaves, fruits, and roots, and there is a lack of effective methods for quickly and accurately obtaining information such as the length and width of multiple target objects.
A method involving image processing techniques, including grayscale transformation, binary processing, principal component analysis, and removal of non-target objects, to accurately determine the phenotypic characteristics of target objects, such as length and width, using a device comprising an acquisition unit, processing units, and a removal unit to enhance accuracy.
The method and device enable rapid and precise acquisition of phenotypic characteristics of target objects, improving efficiency and reducing manual labor, while ensuring high accuracy in measurements.
Smart Images

Figure CN113920312B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and device for acquiring phenotypic features of a target object. Background Art
[0002] In traditional phenotypic measurements of plant genetic breeding, breeders mainly rely on manual data measurement of a large number of plant seeds, leaves, fruits, stems, and roots, which is time-consuming, labor-intensive, and not accurate enough.
[0003] Expanding to general fields, in the phenotypic detection of target objects, it is impossible to quickly and accurately obtain information such as the length and width of multiple target objects.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for acquiring phenotypic characteristics of a target object, so as to at least solve the technical problem that, in the phenotypic detection of the target object, information such as the length and width of the target object cannot be accurately acquired.
[0006] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for acquiring phenotypic characteristics of a target object is provided, comprising: acquiring an original image, wherein the original image includes multiple target object images and non-target object images; performing grayscale transformation and binary processing on the original image to obtain a binary image; using principal component analysis to process the multiple target object images and non-target object images in the binary image to obtain phenotypic characteristics of each of the target object images and non-target object images, wherein the phenotypic characteristics include length and width; and removing the non-target object images in the binary image.
[0007] Optionally, a principal component analysis method is used to process multiple target object images and non-target object images in the binary image to obtain phenotypic characteristics of each target object image and non-target object image, including: using the principal component analysis method to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and non-target object image; determining a directed bounding box of the target object image and the non-target object based on the major axis and minor axis, wherein the directed bounding box is a rectangle; and determining the length and width of the target object and the non-target object based on the length of the line connecting the center points of opposite sides of the directed bounding box.
[0008] Optionally, the principal component analysis method is used to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and non-target object image, including: using the principal component analysis method to process multiple target object images and non-target object images to obtain pixel eigenvalues and eigenvectors of each target object image; determining the major axis and minor axis of each target object image and non-target object image based on the pixel eigenvalues and eigenvectors.
[0009] Optionally, removing the non-target object image in the binary image includes: determining an area threshold; and removing the non-target object image in the binary image according to the area threshold.
[0010] Optionally, the method further includes: segmenting and labeling the plurality of target object images and the non-target object images.
[0011] Optionally, segmenting and labeling the plurality of target object images and the non-target object images includes: segmenting and labeling the plurality of target object images and the non-target object images using a cyclic watershed segmentation algorithm.
[0012] According to another aspect of the present application, a device for acquiring phenotypic characteristics of a target object is provided, comprising: an acquisition unit, used to acquire an original image, wherein the original image includes multiple target object images and non-target object images; a first processing unit, used to perform grayscale transformation and binary processing on the original image to obtain a binary image; a second processing unit, used to process the multiple target object images and non-target object images in the binary image using a principal component analysis method to obtain phenotypic characteristics of each of the target object images and non-target object images, wherein the phenotypic characteristics include length and width; and a removal unit, used to remove the non-target object images in the binary image.
[0013] According to another aspect of the present application, an image processing device is provided, wherein the image processing device is used to execute any one of the methods described.
[0014] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described.
[0015] According to another aspect of the present application, a processor is provided, wherein the processor is used to run a program, wherein any one of the methods is executed when the program is run.
[0016] By applying the technical solution of the present application, first, an original image is acquired, then grayscale transformation and binary processing are performed on the original image to obtain a binary image, and then the principal component analysis method is used to process multiple target object images and non-target object images in the binary image to obtain the phenotypic characteristics of each target object image and non-target object image. Then, the non-target object images in the binary image are removed. Combining grayscale transformation, binary processing, principal component analysis and removal of non-target object images realizes accurate acquisition of the phenotypic characteristics of the target object. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0018] Figure 1 is a flow chart of a method for acquiring phenotypic characteristics of a target object according to an embodiment of the present invention;
[0019] Figure 2 is a schematic diagram of a device for acquiring phenotypic characteristics of a target object according to an embodiment of the present invention;
[0020] Figure 3 is a diagram of an image processing device according to an embodiment of the present invention;
[0021] Figure 4 and Figure 5 is a schematic diagram of a binary image according to an embodiment of the present invention;
[0022] Figure 6 and Figure 7 Schematic diagram of principal component analysis results and labeling results according to an embodiment of the present invention.
[0023] The above drawings include the following reference numerals:
[0024] 100. A microcomputer equipped with a lens. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] For the convenience of description, some nouns or terms involved in the embodiments of the present application are explained below:
[0028] Principal component analysis: It is a statistical method. Through orthogonal transformation, a group of variables that may be correlated are converted into a group of linearly uncorrelated variables. The group of variables after conversion is called principal component. Principal component analysis is a statistical method of dimensionality reduction. It uses an orthogonal transformation to transform the original random vector whose components are correlated into new random variables whose components are uncorrelated. This is algebraically expressed as transforming the covariance matrix of the original random vector into a diagonal matrix, and geometrically expressed as transforming the original coordinate system into a new orthogonal coordinate system, so that it points to the p orthogonal directions with the largest sample point distribution. Then, the multi-dimensional variable system is subjected to dimensionality reduction processing so that it can be converted into a low-dimensional variable system with a higher accuracy. Then, by constructing an appropriate value function, the low-dimensional system is further converted into a one-dimensional system.
[0029] Watershed segmentation algorithm: It is an image region segmentation method. During the segmentation process, it takes the similarity between adjacent pixels as an important reference, thereby connecting pixels with similar spatial positions and similar grayscale values (gradient) to form a closed contour.
[0030] Example 1
[0031] According to an embodiment of the present invention, an embodiment of a method for acquiring phenotypic characteristics of a target object is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0032] Figure 1 is a method for acquiring phenotypic characteristics of a target object according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:
[0033] Step S101, obtaining an original image, wherein the original image includes a plurality of target object images and non-target object images;
[0034] Specifically, to facilitate subsequent processing, multiple target objects may be placed on a photographing board. More specifically, light-colored target objects may be placed on a black photographing board, and dark-colored target objects may be placed on a white photographing board.
[0035] Step S102, performing grayscale transformation and binary processing on the original image to obtain a binary image;
[0036] Step S103, using principal component analysis to process the plurality of target object images and non-target object images in the binary image to obtain phenotypic features of each of the target object images and non-target object images, wherein the phenotypic features include length and width;
[0037] Step S104: removing the non-target object image from the binary image.
[0038] In step S104, in order to facilitate the identification of the phenotypic characteristics of the target object, the non-target object image in the binary image may be removed.
[0039] Specifically, the target objects mentioned above may be plant seeds, leaves, fruits, stems or roots, etc., and the present solution may be used to achieve accurate measurement of plant phenotypic characteristics.
[0040] Specifically, the above-mentioned phenotypic characteristics may also include information such as area and perimeter.
[0041] In the above scheme, first, the original image is obtained, then the original image is gray-scale transformed and binary processed to obtain a binary image, and then the principal component analysis method is used to process the plurality of target object images and non-target object images in the binary image to obtain the phenotypic characteristics of each target object image and non-target object image. Then, the non-target object images in the binary image are removed. Combining gray-scale transformation, binary processing, principal component analysis and removal of non-target object images realizes accurate acquisition of the phenotypic characteristics of the target object.
[0042] In one embodiment of the present application, a principal component analysis method is used to process multiple target object images and non-target object images in the binary image to obtain phenotypic characteristics of each target object image and non-target object image, including: using the principal component analysis method to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and non-target object image; the major axis and minor axis of the image obtained by the principal component analysis method are directional and have rotation invariant characteristics, that is, no matter how the direction of the object changes, the major axis and minor axis of the image will not change. According to the major axis and minor axis, the directed bounding box of the target object image and the non-target object is determined, and the directed bounding box is a rectangle; according to the length of the line connecting the center points of the opposite sides of the directed bounding box, the length and width of the target object and the non-target object are determined. Specifically, the directed bounding box has four sides, two long sides and two short sides. The center points of the two long sides are connected to form a first line, and the center points of the two short sides are connected to form a second line. The width of the target object is determined according to the first line, and the length of the target object is determined according to the second line. Specifically, the length of the first line can be determined according to the number of pixels on the first line, and then the width of the target object can be determined according to the corresponding relationship between the length of the image and the length of the actual object. The corresponding relationship is determined by the relative position relationship between the microcomputer equipped with a lens and the target object and the resolution of the microcomputer equipped with a lens.
[0043] In one embodiment of the present application, the principal component analysis method is used to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and non-target object image, including: using the principal component analysis method to process multiple target object images and non-target object images to obtain pixel eigenvalues and eigenvectors of each target object image; determining the major axis and minor axis of each target object image and non-target object image based on the pixel eigenvalues and eigenvectors.
[0044] In a specific embodiment of the present application, the principal component analysis method is used to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and non-target object image: including 1) calculating the pixel matrix of the object to obtain its covariance matrix; 2) finding the eigenvectors and eigenvalues of the covariance matrix to determine the directions of the major axis and minor axis of the object; 3) using the eigenvectors to map the original pixel matrix; 4) finding the maximum and minimum points on the mapped coordinates, as well as the center point of the object; 5) calculating the mapped coordinates of the four vertices of the rectangle surrounding the object through the coordinates of the maximum point, the minimum point, and the center point; 6) rotating the mapped coordinates to the original image. At this time, the rectangular bounding box surrounding the object is also called a directed bounding box. The length and width of this rectangle represent the length and width of the object being measured, respectively.
[0045] In another embodiment of the present application, removing the above-mentioned non-target object image in the above-mentioned binary image includes: determining an area threshold; removing the above-mentioned non-target object image in the above-mentioned binary image according to the above-mentioned area threshold. That is, the area threshold is set according to actual needs, and the above-mentioned non-target object image in the binary image is removed by the area threshold. For example, the image includes two objects, dust and seeds, and we want to obtain the phenotypic characteristics of seeds. Since the area of dust is generally smaller than the area of seeds, we can set the area threshold to be greater than the area of dust and smaller than the area of seeds, and then remove the dust smaller than the area threshold; for another example, the image includes three objects, sesame, watermelon seeds, and peach leaves. We want to obtain the phenotypic characteristics of sesame and watermelon seeds. Since the area of peach leaves is generally larger than the area of sesame and the area of watermelon seeds, we set the area threshold to be greater than the area of watermelon seeds and smaller than the area of peach leaves, and then remove the peach leaves larger than the area threshold; if you want to measure the phenotypic characteristics of watermelon seeds, you can set the area threshold to the area of watermelon seeds, and remove the sesame smaller than the area threshold and the peach leaves larger than the area threshold. That is, the target objects and non-target objects in this application are relative. Those skilled in the art can set a suitable area threshold to remove non-target object images according to actual needs.
[0046] In yet another embodiment of the present application, the above method further includes: segmenting and labeling the plurality of the target object images and the non-target object images.
[0047] In one embodiment of the present application, multiple target object images and non-target object images are segmented and labeled, including: using a cyclic watershed segmentation algorithm to segment and label multiple target object images and non-target object images. When multiple target objects and non-target objects are placed on a photographic board at the same time, it is easy for multiple target objects to be close to each other, multiple non-target objects to be close to each other, and target objects and non-target objects to be close to each other. In order to achieve accurate detection of each target object and non-target object, it is necessary to segment the target object and non-target object into individuals one by one; further, in order to prevent confusion of phenotypic characteristics, each object can be labeled. For example, ten objects can be numbered from 1 to 10. In this way, the phenotypic characteristics of each object can be distinguished.
[0048] Preferably, the principal component analysis method and the cyclic watershed segmentation algorithm can be used to measure the phenotypic characteristics of multiple objects at one time, which greatly speeds up the measurement and saves time and manpower compared to the manual measurement scheme. For example, hundreds of seeds can be measured at one time.
[0049] In one embodiment of the present application, the color of the target object can also be measured. The specific implementation method is to extract the color values of the three layers of R, G, and B on each pixel of the marked object, and calculate the arithmetic mean of all the pixels of the object. The result is the specific color value of the object in the three layers. In addition, if the K-mean cluster analysis is performed on the color parameters of all points, the degree of color spots can be evaluated.
[0050] Example 2
[0051] The embodiment of the present application also provides a device for acquiring phenotypic characteristics of a target object. It should be noted that the device for acquiring phenotypic characteristics of a target object in the embodiment of the present application can be used to execute the method for acquiring phenotypic characteristics of a target object provided in the embodiment of the present application. The device for acquiring phenotypic characteristics of a target object provided in the embodiment of the present application is introduced below.
[0052] Figure 2 Schematic diagram of a device for acquiring phenotypic characteristics of a target object according to an embodiment of the present application. Figure 2 As shown, the device comprises:
[0053] An acquisition unit 10 is used to acquire an original image, wherein the original image includes a plurality of target object images and non-target object images;
[0054] The first processing unit 20 is used to perform grayscale conversion and binary processing on the original image to obtain a binary image;
[0055] The second processing unit 30 is used to process the plurality of target object images and non-target object images in the binary image by using a principal component analysis method to obtain phenotypic features of each of the target object images and non-target object images, wherein the phenotypic features include length and width.
[0056] A removal unit 40, configured to remove the non-target object image from the binary image;
[0057] In the above scheme, the acquisition unit acquires the original image, the first processing unit performs grayscale transformation and binary processing on the original image to obtain a binary image, and the second processing unit uses principal component analysis to process multiple target object images and non-target object images in the binary image to obtain the phenotypic characteristics of each target object image and non-target object image. The removal unit removes the non-target object images in the binary image, and combines grayscale transformation, binary processing, principal component analysis and removal of non-target object images to achieve accurate acquisition of the phenotypic characteristics of the target object.
[0058] In one embodiment of the present application, the second processing unit includes a processing module, a first determination module and a second determination module, the processing module is used to use the principal component analysis method to process multiple target object images and non-target object images to obtain the major axis and minor axis of each target object image and the non-target object image; the first determination module is used to determine the directed bounding box of the target object image and the non-target object based on the major axis and the minor axis, and the directed bounding box is a rectangle; the second determination module is used to determine the length and width of the target object and the non-target object based on the length of the line connecting the center points of the opposite sides of the directed bounding box.
[0059] In another embodiment of the present application, the processing module includes a processing submodule and a determination submodule. The processing submodule is used to use the above-mentioned principal component analysis method to process multiple target object images and non-target object images to obtain pixel feature values and feature vectors of each of the above-mentioned target object images; the determination submodule is used to determine the major axis and minor axis of each of the above-mentioned target object images and the non-target object images based on the above-mentioned pixel feature values and feature vectors.
[0060] In another embodiment of the present application, the removal unit includes a third determination submodule and a removal submodule, the third determination submodule is used to determine an area threshold; the removal submodule is used to remove the non-target object image in the binary image according to the area threshold, wherein the area of the non-target object image is smaller than the area threshold.
[0061] In yet another embodiment of the present application, the above-mentioned device further includes a segmentation unit, and the segmentation unit is used to segment and label the plurality of the target object images and the non-target object images.
[0062] In one embodiment of the present application, the segmentation unit is further configured to segment and label the plurality of target object images and the non-target object images using a cyclic watershed segmentation algorithm.
[0063] The device for acquiring the phenotypic characteristics of the target object includes a processor and a memory. The above-mentioned acquisition unit, first processing unit, removal unit, second processing unit, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0064] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the phenotypic characteristics of the target object can be accurately obtained by adjusting the kernel parameters.
[0065] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0066] Example 3
[0067] This embodiment relates to an image processing device, such as Figure 3 As shown, including:
[0068] The microcomputer 100 equipped with a lens is used to execute any one of the above methods.
[0069] Specifically, the microcomputer 100 equipped with a lens is mounted on a retractable tripod, and the image processing device also includes a two-dimensional code scanning device, which is used to scan the generated two-dimensional code, and the two-dimensional code is used to record information such as time and location;
[0070] The image processing device also has an interface that can be connected to an external display, and the image processing process can be displayed on the display.
[0071] The image processing device combines a microcomputer, a QR code scanner, a visual sensor, a lens, and built-in image processing and analysis software to quickly and accurately measure multiple traits of plant phenotypes, meeting the breeders' requirements for high-throughput phenotypic measurement of the traits under study. Since the device is small in size and can be powered by a mobile power supply, it can be carried around and used whenever needed.
[0072] The image processing device is used to obtain the phenotypic characteristics of the plant body, including the following steps:
[0073] Step 1: Use a QR code scanning device to scan the generated QR code to record the information and output it as a text file;
[0074] Step 2: Obtain the corresponding relationship between the actual distance and the number of pixels of the image captured by the microcomputer equipped with a lens, that is, determine the corresponding relationship between the actual distance and the size of the displayed image. The actual distance can be measured using a ruler. Specifically, during actual measurement, the distance between the lens and the object can be flexibly adjusted according to the size of the object to be measured to ensure that the predetermined number of objects can be measured;
[0075] Step 3: Adjust the focal length and aperture of the lens, and adjust the contrast, brightness, and saturation, and take photos after highlighting the plant object to be measured;
[0076] Step 4: Perform grayscale conversion and binary processing on the original image to obtain a binary image, where: Figure 4 and Figure 5 is a binary image;
[0077] Step 5: Perform contour detection on the binary image and highlight the detected contour to visualize the plant object contour;
[0078] Step 6: Use the area limitation method to eliminate noise for other small non-plant parts (such as dust);
[0079] Step 7: Use the cyclic watershed segmentation algorithm to analyze the plant binary image, and perform cyclic extraction and labeling of multiple plant objects. The labeling results are as follows: Figure 6 and Figure 7 As shown;
[0080] Step 8: Use the principal component analysis algorithm to loop through the pixels of each object to calculate the eigenvector and eigenvalue, and calculate the two directions (the major axis and minor axis) with the largest pixel variation of the plant object, the major axis and the minor axis, and draw a directed bounding box, such as Figure 6 and Figure 7 As shown, Figure 6 and Figure 7 In the , it is possible to measure multiple objects at once;
[0081] Step 9: Locate the midpoint of each of the four sides of the directed bounding box, and connect the midpoints of the opposite sides. Measure this line, which is the length and width of the object, such as Figure 7 As shown;
[0082] Step 10: Calculate the number of all pixels contained in the object;
[0083] Step 11: Convert pixels to length or area;
[0084] Step 12: Save the analyzed pictures and output each measured plant trait indicator into a text file.
[0085] Example 4
[0086] In one embodiment of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute any one of the above methods.
[0087] Example 5
[0088] In one embodiment of the present application, a processor is provided, and the processor is used to run a program, wherein the program executes any one of the above methods when running.
[0089] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0090] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0091] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0093] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0094] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0095] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for acquiring phenotypic characteristics of a target object, characterized in that: include: Acquire an original image, wherein the original image includes a plurality of target object images and non-target object images; Performing grayscale transformation and binary processing on the original image to obtain a binary image; Processing the plurality of target object images and non-target object images in the binary image using a principal component analysis method to obtain phenotypic features of each of the target object images and non-target object images, wherein the phenotypic features include length and width; removing the non-target object image from the binary image; The principal component analysis method is used to process the plurality of target object images and non-target object images in the binary image to obtain phenotypic features of each of the target object images and non-target object images, including: Processing the plurality of target object images and the non-target object images using the principal component analysis method to obtain the major axis and the minor axis of each of the target object images and the non-target object images; Determine a directed bounding box of the target object image and the non-target object according to the major axis and the minor axis, wherein the directed bounding box is a rectangle; Determining the length and width of the target object and the non-target object according to the length of the line connecting the center points of opposite sides of the directed bounding box; The major axis and minor axis obtained by the principal component analysis method are directional and rotationally invariant, and the major axis and minor axis of the image will not change regardless of how the direction of the object changes.
2. The method according to claim 1, characterized in that The principal component analysis method is used to process the plurality of target object images and the non-target object images to obtain the major axis and the minor axis of each of the target object images and the non-target object images, including: Processing the plurality of target object images and the non-target object images using the principal component analysis method to obtain pixel feature values and feature vectors of each target object image; The major axis and the minor axis of each of the target object image and the non-target object image are determined according to the pixel feature value and the feature vector.
3. The method according to claim 1, characterized in that: Removing the non-target object image from the binary image includes: Determine area threshold; The non-target object image in the binary image is removed according to the area threshold.
4. The method according to claim 1, characterized in that: The method further comprises: The plurality of target object images and the non-target object images are segmented and labeled.
5. The method according to claim 4, characterized in that Segmenting and labeling the plurality of target object images and the non-target object images, including: A cyclic watershed segmentation algorithm is used to segment and label the plurality of target object images and the non-target object images.
6. A device for acquiring phenotypic characteristics of a target object, characterized in that: include: An acquisition unit, configured to acquire an original image, wherein the original image includes a plurality of target object images and non-target object images; A first processing unit, configured to perform grayscale conversion and binary processing on the original image to obtain a binary image; A second processing unit is used to process the plurality of target object images and non-target object images in the binary image by using a principal component analysis method to obtain phenotypic characteristics of each of the target object images and non-target object images, wherein the phenotypic characteristics include length and width; a removal unit, configured to remove the non-target object image from the binary image; The second processing unit includes a processing module, a first determining module and a second determining module. The processing module is used to process the plurality of target object images and the non-target object images using the principal component analysis method to obtain the major axis and the minor axis of each of the target object images and the non-target object images; The first determination module is used to determine the directed bounding box of the target object image and the non-target object according to the major axis and the minor axis, wherein the directed bounding box is a rectangle; The second determination module is used to determine the length and width of the target object and the non-target object according to the length of the line connecting the center points of the opposite sides of the directed bounding box; The major axis and minor axis obtained by the principal component analysis method are directional and rotationally invariant, and the major axis and minor axis of the image will not change regardless of how the direction of the object changes.
7. An image processing device, characterized in that: The image processing device is used to execute the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 5.
9. A processor, characterized in that: The processor is used to run a program, wherein the program executes the method according to any one of claims 1 to 5 when running.
