A method for measuring the chest width of mosquito pupae based on image processing

By automatically measuring the thorax width of mosquito pupae based on an image processing method, the subjectivity and inefficiency of traditional measurement methods are solved, and efficient and accurate mechanized measurement of the thorax width of mosquito pupae is achieved.

CN119090808BActive Publication Date: 2025-09-16SUN YAT SEN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411054536.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2025-09-16
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

The traditional manual method of measuring the thorax width of mosquito pupae has problems such as high subjectivity, low efficiency, and unstable accuracy, and cannot meet the needs of mosquito pupa research and breeding.

Method used

An image processing-based method was used to automatically identify and measure the thorax width of mosquito pupae by taking RGB images and performing grayscale and HSV color model conversion, binarization, connected domain analysis, and skeletonization processing. The actual size was converted using a micrometer.

Benefits of technology

The objective, efficient and accurate mechanized measurement of the thorax width of mosquito pupae is achieved, which reduces manual intervention and improves measurement accuracy and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119090808B_ABST
    Figure CN119090808B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for measuring the chest width of mosquito pupae based on image processing, which relates to the technical field of mosquito pupae breeding and mosquito pupae research. The key points of the technical solution are to process the pixels of an image to divide the image into a mosquito pupae part and a background part, and determine the ROI image area of ​​the mosquito pupae based on the maximum connected domain of the mosquito pupae part, then determine the darker mosquito pupae cephalothorax area, draw a perpendicular line to the center line of the mosquito pupae cephalothorax, determine the chest width of the mosquito pupae in the image by the intersection of the perpendicular line and the outline of the mosquito pupae cephalothorax, and convert the mosquito pupae chest width in the image into the mosquito pupae chest width in real space with a micrometer image and a micrometer body taken at the same distance as a reference. This embodiment provides a method for measuring the chest width of mosquito pupae through programmed image processing, which can objectively, efficiently and accurately perform mechanized measurement of the chest width of mosquito pupae. The present invention solves the problems of high subjectivity, low efficiency and unstable accuracy in manual measurement of the chest width of mosquito pupae.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of mosquito pupa breeding and mosquito pupa research, and more particularly to a mosquito pupa chest width measurement method based on image processing. Background Art

[0002] In the breeding and research of mosquito pupae, the thorax width of mosquito pupae is an important biological parameter used to determine the growth status of mosquito pupae, identify species, and assess the risk of disease transmission. Traditional methods for measuring the thorax width of mosquito pupae rely mainly on manual measurement, usually by manually pulling a wire under a calibrated microscope. This method suffers from high subjectivity, low efficiency, and unstable accuracy. In order to improve the measurement accuracy of the thorax width of mosquito pupae and reduce manpower input, the existing technology urgently needs a more accurate, efficient, and automated mosquito pupae thorax width measurement solution to meet the needs of mosquito pupae research and breeding. Summary of the Invention

[0003] In view of the problems of high subjectivity, low efficiency, and unstable accuracy in the manual measurement of the thorax width of mosquito pupae in the prior art, the object of the present invention is to provide a method for measuring the thorax width of mosquito pupae based on image processing, which comprises the following steps:

[0004] S1. Place a single mosquito pupa on a horizontal background surface. Position a camera directly above the pupa, with its abdomen facing upward, and capture an RGB image. The color of the horizontal background surface in the RGB image will differ from the color of the mosquito pupa. Maintaining the camera's position, place a micrometer directly below the camera on the horizontal background surface and capture an image of the micrometer. The color of the horizontal background surface in the micrometer image will differ from the color of the micrometer.

[0005] S2. Convert the RGB image into a grayscale image, set a grayscale threshold, perform binarization on the grayscale image, divide the pixels in the grayscale image into the mosquito pupa part and the background part, and obtain a grayscale binary image.

[0006] The area in the RGB image that belongs to the mosquito pupa in the grayscale binary image is taken as the research area.

[0007] S3. Perform connected domain analysis and use the largest connected domain in the study area as the ROI image area of ​​mosquito pupae.

[0008] S4. Given a cephalothorax pixel threshold, the area in the ROI image region where the pixels are greater than or equal to the cephalothorax pixel threshold is taken as the mosquito pupa cephalothorax region.

[0009] S5. Calculate the minimum bounding rectangle of the mosquito pupa's cephalothorax. Use the longest midline of the minimum bounding rectangle as the centerline of the mosquito pupa's cephalothorax. Select multiple points on the centerline of the mosquito pupa's cephalothorax to create perpendicular lines. Each perpendicular line has two intersections with the mosquito pupa's cephalothorax outline. The distance between the two intersections on each perpendicular line is the width of the perpendicular line. The maximum value among all the width values ​​is used as the image thorax width of the mosquito pupa.

[0010] S6. Establish a conversion ratio based on the actual size of the micrometer and the size of the micrometer in the micrometer image. Convert the chest width of the mosquito pupa in the image to the chest width of the mosquito pupa in real space using the conversion ratio.

[0011] The present invention is further configured as follows: converting an RGB image into an HSV color model, giving a binarization threshold, performing binarization processing on the RGB image, dividing pixels in the RGB image into a mosquito pupa part and a background part, and obtaining an HSV binarized image; the binarization threshold is any one of a hue value, a saturation value, and a brightness value; and taking an area in the RGB image that belongs to the mosquito pupa part in both the grayscale binarized image and the HSV binarized image as a research area.

[0012] The present invention is further configured as follows: S4 further includes skeletonizing the mosquito pupa head and thorax region in the RGB image, and refining the contour of the mosquito pupa head and thorax region into a single pixel.

[0013] The present invention is further configured such that: the skeletonization process adopts the Zhang-Suen algorithm.

[0014] The present invention is further configured such that the RGB image of the mosquito pupa captured by the capturing device is filtered and then used as the RGB image used in S2.

[0015] The present invention is further configured such that: the filtering process includes at least one of Gaussian filtering and median filtering.

[0016] The present invention is further configured such that: the grayscale threshold is determined by an Otsu algorithm.

[0017] The present invention is further configured as follows: a method for determining a cephalothorax pixel threshold is as follows: pixels outside the ROI image area in the RGB image are unified as background pixels, the Euclidean distance from each pixel in the ROI image area to the nearest background pixel is calculated, a distance threshold is given, and pixels whose Euclidean distance from the ROI image area to the nearest background pixel is equal to the distance threshold are used as the cephalothorax pixel threshold.

[0018] The present invention is further configured such that the number of pixels of the largest connected domain in S3 is greater than 30,000.

[0019] The present invention is further configured as follows: in S6, at least 30 points are selected on the center line of the mosquito pupa head and thorax to form a vertical line.

[0020] The present invention is further configured as follows: in S1, the posture of the mosquito pupa is adjusted by a fine brush so that the abdomen of the mosquito pupa faces upward.

[0021] In summary, the present invention has the following advantages over the prior art: By processing image pixels, the present invention divides the image into a mosquito pupa portion and a background portion, and determines the ROI image region of the mosquito pupa based on the maximum connected domain of the mosquito pupa portion. The darker cephalothorax region of the mosquito pupa is then determined, and a perpendicular line is drawn to the centerline of the cephalothorax. The thorax width of the mosquito pupa in the image is determined by the intersection of the perpendicular line and the cephalothorax contour. The thorax width in the image is converted to the thorax width in real space using a micrometer image and the micrometer itself taken at the same distance as a reference. The present invention provides a method for measuring the thorax width of mosquito pupa through programmed image processing, which can objectively, efficiently, and accurately perform mechanized measurement of the thorax width of mosquito pupa. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 Schematic diagram of the process of the embodiment. DETAILED DESCRIPTION

[0023] The technical solution of the present invention will be clearly described below in conjunction with the accompanying drawings. Obviously, the described embodiments are not all embodiments of the present invention. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the invention.

[0024] It should be noted that the terms "center", "up", "down", "horizontal", "left", "right", "front", "back", "lateral", "longitudinal", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.

[0025] Example

[0026] like Figure 1 FIG. 1 is a flow chart of a preferred embodiment of the present invention. This embodiment provides a method for measuring the chest width of mosquito pupae based on image processing, which includes the following steps:

[0027] S1. Place a single mosquito pupa on a horizontal background surface. Position the camera directly above the pupa. Use a fine brush to adjust the pupa's posture so that its abdomen faces upward. Capture an RGB image. The color of the horizontal background surface in the RGB image will differ from that of the pupa. Maintaining the camera's position, place a micrometer directly below the camera on the horizontal background surface. Capture an image of the micrometer. The color of the horizontal background surface in the micrometer image will differ from that of the micrometer.

[0028] Preferably, in this embodiment S1, the RGB image of the mosquito pupa captured by the camera is further filtered to reduce noise in the RGB image and improve processing accuracy in subsequent steps. The filtering process includes at least one of Gaussian filtering and median filtering. In this embodiment, the filtering process is Gaussian filtering and median filtering.

[0029] S2, the RGB image is converted into a grayscale image, a grayscale threshold is given, the grayscale image is binarized, the pixels in the grayscale image are divided into a mosquito pupa part and a background part, and a grayscale binary image is obtained. The grayscale threshold described in the present embodiment is determined by the Otsu algorithm. The Otsu algorithm uses a threshold to divide the data in the image into two categories: the mosquito pupa part and the background part. The grayscale of the pixels of the image in one category is less than this threshold, and the grayscale of the pixels of the image in the other category is greater than or equal to this threshold. The greater the inter-class variance between the mosquito pupa part and the background part, the greater the difference between the two parts constituting the image. The algorithm is simple and fast to calculate, and the probability of misclassification is minimized.

[0030] Furthermore, the RGB image is converted into the HSV color model, a binarization threshold is given, and the RGB image is binarized, whereby the pixels in the RGB image are divided into the mosquito pupa portion and the background portion to obtain an HSV binary image. The binarization threshold is any one of a hue value, a saturation value, and a brightness value. The HSV color model objectively describes color using three dimensions: hue, saturation, and brightness. The HSV color model is more sensitive to color information in an image. In this embodiment, the binarization threshold is a saturation value.

[0031] Then, the area in the RGB image that belongs to the mosquito pupa in both the grayscale binary image and the HSV binary image is used as the research area. By combining the grayscale and HSV color models, both color and grayscale information are utilized to reduce the impact of image noise on the accuracy of the segmentation results.

[0032] S3. Perform a connected domain analysis and use the largest connected domain in the study area as the ROI image area of ​​the mosquito pupa. When the number of pixels in the largest connected domain is greater than 30,000, subsequent measurement accuracy is better.

[0033] S4. Given a cephalothorax pixel threshold. Based on the different color of the mosquito cephalothorax and torso, the region within the ROI image region with pixels greater than or equal to the cephalothorax pixel threshold—that is, the darker cephalothorax region—is designated as the mosquito cephalothorax region. In this embodiment, pixels outside the ROI image region in the RGB image are unified as background pixels. After calculating the Euclidean distance from each pixel in the ROI image region to the nearest background pixel, a distance threshold is assigned. Pixels within the ROI image region whose Euclidean distance to the nearest background pixel is equal to the distance threshold are designated as the cephalothorax pixel threshold. In this embodiment, the background horizontal plane in the RGB image is white, and the distance threshold is 160.

[0034] Specifically, this embodiment also skeletonizes the mosquito pupa cephalothorax region in the RGB image, refining its outline down to single pixels. This facilitates intuitive and rapid identification of the cephalothorax contour. The skeletonization process in this embodiment utilizes the Zhang-Suen algorithm, which iteratively refines the outline or target object in the image down to single pixels. The Zhang-Suen algorithm can be implemented using the skeletonize function in the skimage.morphology module in Python.

[0035] S5. Calculate the minimum circumscribed rectangle of the mosquito pupa cephalothorax, and use the longest midline of the minimum circumscribed rectangle as the centerline of the mosquito pupa cephalothorax. Use the centerline of the mosquito pupa cephalothorax as the mosquito pupa cephalothorax skeleton, and select multiple points on the centerline of the mosquito pupa cephalothorax to make perpendicular lines. Each perpendicular line has two intersections with the outline of the mosquito pupa cephalothorax. The distance between the two intersections on each perpendicular line is the width value corresponding to the perpendicular line. The maximum value of all width values ​​is used as the image chest width of the mosquito pupa. Specifically, select at least 30 points on the centerline of the mosquito pupa cephalothorax to make perpendicular lines.

[0036] S6. Establish a conversion ratio based on the actual size of the micrometer and the size of the micrometer in the micrometer image. Convert the chest width of the mosquito pupa in the image to the chest width of the mosquito pupa in real space using the conversion ratio.

[0037] In summary, this embodiment processes the image pixels to divide it into a mosquito pupa portion and a background portion, and determines the ROI image region of the mosquito pupa based on the maximum connected domain of the mosquito pupa portion. The darker cephalothorax region of the mosquito pupa is then determined, and a perpendicular line is drawn to the centerline of the cephalothorax. The thorax width of the mosquito pupa in the image is determined by the intersection of the perpendicular line and the cephalothorax contour. The thorax width in the image is converted to the thorax width of the mosquito pupa in real space using a micrometer image and the micrometer body taken at the same distance as a reference. This embodiment provides a method for measuring the thorax width of mosquito pupa through programmed image processing, which can objectively, efficiently, and accurately perform mechanized measurement of the thorax width of mosquito pupa.

[0038] The foregoing description is intended to be merely a preferred embodiment of the present invention and is not intended to limit the present invention. Persons skilled in the art will readily appreciate that the present invention is susceptible to various modifications and variations. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.

Claims

1. A method for measuring the chest width of mosquito pupae based on image processing, characterized in that: The steps include: S1. Place a single mosquito pupa on a horizontal background plane, place a camera directly above the single mosquito pupa with its abdomen facing upward, and capture an RGB image; the color of the horizontal background plane in the RGB image is different from the color of the mosquito pupa; keep the camera in the same position, place a micrometer directly below the camera on the horizontal background plane, and capture an image of the micrometer; the color of the horizontal background plane in the micrometer image is different from the color of the micrometer; S2, converting the RGB image into a grayscale image, giving a grayscale threshold, performing binarization processing on the grayscale image, dividing the pixels in the grayscale image into mosquito pupa part and background part, and obtaining a grayscale binary image; The area in the RGB image that belongs to the mosquito pupa part in the grayscale binary image is taken as the research area; S3, performing connected domain analysis, and taking the largest connected domain in the study area as the ROI image area of ​​mosquito pupae; S4, setting a cephalothorax pixel threshold, and taking the area in the ROI image region where the pixels are greater than or equal to the cephalothorax pixel threshold as the mosquito pupa cephalothorax region; S5. Calculate the minimum circumscribed rectangle of the mosquito pupa's cephalothorax, and use the longest midline of the minimum circumscribed rectangle as the centerline of the mosquito pupa's cephalothorax; select multiple points on the centerline of the mosquito pupa's cephalothorax to draw perpendicular lines, each perpendicular line having two intersections with the mosquito pupa's cephalothorax contour; the distance between the two intersections on each perpendicular line is the width value corresponding to the perpendicular line; and the maximum value among all the width values ​​is used as the image chest width of the mosquito pupa; S6. Establish a conversion ratio according to the actual size of the micrometer and the size of the micrometer in the micrometer image; convert the chest width of the mosquito pupa in the image into the chest width of the mosquito pupa in the actual space using the conversion ratio.

2. The method for measuring the thorax width of mosquito pupae based on image processing according to claim 1, characterized in that: Convert the RGB image to the HSV color model, give a binarization threshold, perform binarization on the RGB image, divide the pixels in the RGB image into a mosquito pupa part and a background part, and obtain an HSV binary image; the binarization threshold is any one of a hue value, a saturation value, and a brightness value; The area in the RGB image that belongs to the mosquito pupa part in both the grayscale binary image and the HSV binary image is taken as the research area.

3. A mosquito pupa chest width measurement method based on image processing according to any one of claims 1-2, characterized in that: S4 also includes skeletonization processing of the mosquito pupa head and thorax region in the RGB image, and refines the outline of the mosquito pupa head and thorax region into a single pixel.

4. The method for measuring the thorax width of mosquito pupae based on image processing according to claim 3, characterized in that: The skeletonization process adopts the Zhang-Suen algorithm.

5. A mosquito pupa chest width measurement method based on image processing according to any one of claims 1-2, characterized in that: The RGB image of the mosquito pupa taken by the shooting device is filtered and used as the RGB image used by S2.

6. The method for measuring the thorax width of mosquito pupae based on image processing according to claim 5, characterized in that: The filtering process includes at least one of Gaussian filtering and median filtering.

7. A method for measuring the thorax width of mosquito pupae based on image processing according to any one of claims 1-2, characterized in that: The grayscale threshold is determined by the Otsu algorithm.

8. The method for measuring the thorax width of mosquito pupae based on image processing according to any one of claims 1-2, characterized in that: The method for determining the pixel threshold of the cephalothorax is as follows: the pixels outside the ROI image area in the RGB image are unified as background pixels, the Euclidean distance from each pixel in the ROI image area to the nearest background pixel is calculated, and a distance threshold is given. The pixel whose Euclidean distance to the nearest background pixel in the ROI image area is equal to the distance threshold is used as the pixel threshold of the cephalothorax.

9. The method for measuring the thorax width of mosquito pupae based on image processing according to any one of claims 1-2, characterized in that: The number of pixels in the largest connected region in S3 is greater than 30,000.

10. The method for measuring the thorax width of mosquito pupae based on image processing according to claim 9, characterized in that: In S5, at least 30 points were selected on the center line of the mosquito pupa head and thorax to make a perpendicular line.

Citation Information

Patent Citations

  • Method and system for extracting disease region-of-interest based on block tag

    CN103778428A

  • Method and system for measuring and calculating body posture of silkworm pupa based on image processing

    CN113112541A