Method for extracting cephalopod keratinojaw pigmentation by using computer vision

By using computer vision technology, image preprocessing, and deep learning models, the problem of automated and quantitative measurement of pigment deposition in the horny jaws of cephalopods has been solved, achieving accurate pigment deposition measurement and intelligent and consistent data processing.

CN121837178APending Publication Date: 2026-04-10SHANGHAI OCEAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511950403.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-23
Publication Date
2026-04-10

Smart Images

  • Figure CN121837178A_ABST
    Figure CN121837178A_ABST
Patent Text Reader

Abstract

The invention discloses a method for extracting cephalopod keratinojaw pigmentation by using computer vision, and belongs to the technical field of crossing of aquatic science and computer vision. The method comprises the following steps: firstly, acquiring a color image of a cutin jaw sample and preprocessing; converting the image into an HSV color space, setting a threshold value of each color component through an interactive threshold value adjustment tool, and segmenting to generate a binary mask of a target area; performing morphological optimization on the mask, and converting the mask into a grey-scale map; and finally, the pigmentation is divided into a plurality of grades according to a predefined gray value range, the pixel proportion of each grade is counted, and a visual result is generated. According to the method, the computer vision technology is adopted, accurate measurement and quantitative analysis of keratinojaw pigmentation are achieved, the pigmentation measurement accuracy is improved, and the intelligence and consistency of data processing are remarkably enhanced. And important support is provided for the ecology and taxonomy of cephalopods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the interdisciplinary field of aquaculture and computer vision, and in particular to a method for extracting pigment deposits from cephalopod horny jaws using computer vision, thereby achieving automated and quantitative extraction of pigment deposits from horny jaws using computer vision. Background Technology

[0002] The horny jaw is the primary feeding organ of cephalopods, composed of the upper and lower jaws. Due to its stable morphology and excellent information storage properties, it is one of the main materials for cephalopod research. The horny jaw exhibits varying degrees of melanin distribution, with pigment deposition typically deepening as the cephalopod grows. Different pigment compositions result in varying hardness of the horny jaw; the darker the color, the harder the jaw. Therefore, pigment deposition is related to the feeding choices and ecological habits of cephalopods. The description of horny jaw pigment deposition was first proposed by Wolff, who described 18 cephalopod species from the Pacific Ocean. Later, based on the growth of the cephalopods and the degree of horny jaw pigment deposition, he divided it into an 8-level and a 7-level classification, specifically describing the characteristics of the pigment deposition levels.

[0003] In the study of the Toyama squid from the Northwest Pacific, quantitative analysis of pigment deposition in the horny jaws during ontogeny was performed for the first time, but the process was quite cumbersome. With the advent of the artificial intelligence era, computer vision can combine informatization and automation. Computer vision mainly uses computers to simulate human visual functions to extract information from images of objective things, process and understand it, and ultimately apply it to practical applications. Currently, computer vision is also widely used in the field of fisheries, using elliptical Fourier transform to reconstruct the contours of fish morphology. The Canny algorithm was used to extract the contour of the horny jaws, and a spatial coordinate system was established to obtain the coordinates of the feature points of the horny jaws, resulting in the contour map of the horny jaws and the location of pigment mutations. Based on the Mask-RCNN deep learning model, image recognition and segmentation of the horny jaws and their pigment deposition were achieved. The concept of using the area of ​​pigment deposition to obtain its proportion was proposed to achieve automated measurement of horny jaw pigment deposition.

[0004] Existing research methods mainly rely on image measurement software processes or edge detection to quantify pigment deposition. Image measurement software processes are cumbersome, and segmentation models based on Mask-RCNN deep learning require time to label data. They can only extract pigment area and cannot distinguish grades. Edge detection methods are sensitive to changes in illumination and are easily affected by noise, leading to incorrect boundaries. Summary of the Invention

[0005] This invention was made to solve the above-mentioned problems, and its purpose is to provide a method for extracting pigment deposition in the keratinous jaws of cephalopods using computer vision.

[0006] This invention provides a computer vision-based method for extracting pigment deposition in the horny jaws of cephalopods, comprising the following steps: Step 1, acquiring a color digital image of the horny jaw sample to be analyzed; Step 2, performing size reduction and color smoothing filtering on the color digital image to obtain a filtered image; Step 3, converting the filtered image from the RGB color space to the HSV color space, and setting a threshold range based on at least one color component among hue, saturation, and luminance in the HSV color space to perform threshold segmentation on the image, generating a binary mask for identifying the target region of the horny jaw; Step 4, performing morphological processing on the binary mask to obtain an optimized target region mask; Step 5, converting the optimized target region mask into a grayscale image, and dividing the pigment deposition in the horny jaw region into multiple levels according to a predefined grayscale value range; Step 6, counting the number of pixels in each pigment deposition level within the target region, calculating the proportion of each pigment deposition level based on the number of pixels, and generating a pigment deposition image for visualization.

[0007] Preferably, in step 2, a mean-shift filtering algorithm is used for color smoothing.

[0008] Preferably, in step 3, the threshold range of each component in the HSV color space is set using an interactive threshold adjustment tool, and threshold segmentation is performed according to the set range to generate a binary mask. The formula for generating the binary mask of the keratinized jaw image is:

[0009] .

[0010] Preferably, in step 4, the morphological processing includes at least opening and closing operations, where opening is used to remove small noise and closing is used to fill holes.

[0011] Preferably, in step 5, the specific formula for grayscale grading is as follows:

[0012]

[0013] And generate a corresponding mask for each level.

[0014] Preferably, in step 6, the formula for counting the number of pixels at each level is:

[0015]

[0016] In the formula, The number of pixels for each gray level. To classify the grayscale of pixels, For different pigment deposition levels, This is an indicator function that takes the value 1 when the condition is met, and 0 otherwise.

[0017] Preferably, in step 6, the pigment deposition level ratio is the ratio of the number of pixels in each region level to the total number of pixels in the entire keratinous jaw target region.

[0018] Preferably, in step 6, the pigment deposition image used for visualization includes one or more of the following: original image, mask image, grayscale image, and grayscale grading image.

[0019] Preferably, in step 1, a color two-dimensional side view of the keratinous jaw is taken using a blue background.

[0020] Beneficial effects

[0021] This invention employs computer vision technology to achieve precise measurement and quantitative analysis of pigment deposition in horny jaws, improving the accuracy of pigment deposition measurement and significantly enhancing the intelligence and consistency of data processing. This provides important support for the ecology and taxonomy of cephalopods. Attached Figure Description

[0022] Figure 1 This is a flowchart of a computer vision-based method for extracting pigment deposition in the horny jaws of cephalopods, as described in this embodiment of the invention.

[0023] Figure 2 This is a schematic diagram of the HSV threshold controller in an embodiment of the present invention;

[0024] Figure 3 This is a visualization of pigment deposition in the keratinized jaw in an embodiment of the present invention. Detailed Implementation

[0025] To make the technical means, creative features, objectives and effects of this invention easier to understand, the following embodiments, in conjunction with the accompanying drawings, specifically illustrate a method for extracting pigment deposition in the horny jaws of cephalopods using computer vision.

[0026] This embodiment provides a method for extracting pigment deposition from the horny jaws of cephalopods using computer vision.

[0027] Figure 1 This is a flowchart of a computer vision-based method for extracting pigment deposition in the horny jaws of cephalopods, as described in an embodiment of the present invention.

[0028] like Figure 1 As shown, the method for extracting pigment deposition in the cephalopod keratinous jaws using computer vision in this embodiment includes the following steps:

[0029] Step S1: Remove the keratinous jaw from the cephalopod sample, wash and dry it, place the keratinous jaw in a fixed position, and use a tripod to fix a Canon EOS 6D Mark II SLR camera (Japan) to take pictures, capturing color two-dimensional side views of the upper and lower keratinous jaws, and saving the captured images in JPEG (Joint Photographic Experts Group) file format to reduce compression loss. In this embodiment, the shooting is done with a blue background to obtain a color digital image of the target to be analyzed.

[0030] Step S2: The input image is loaded using the OpenCV library and scaled down by 40% of its original resolution to reduce computational complexity while preserving image detail. Subsequently, a Mean Shift filtering algorithm is applied for color smoothing to enhance the contrast between the target and the background. The filtering formula used in this embodiment is as follows:

[0031]

[0032] In the formula, Pixels after filtering The color value; and These represent the current pixel and its neighboring pixels, respectively. This is a bandwidth parameter that controls the size of the neighborhood. The Gaussian kernel function measures pixel similarity. This represents the color value of the neighboring pixels. In this way, color details in the image are smoothed, reducing interference caused by image noise and uneven lighting.

[0033] Step S3: Convert the filtered image from the RGB color space to the HSV color space, where the HSV color space includes a hue component. Based on the hue, saturation, and lightness components in the HSV color space, set a threshold range and perform threshold segmentation on the image to generate a binary mask for identifying the target region. The keratinous jaw differs significantly in color from the background; therefore, this embodiment uses the HSV color space for segmentation. HSV is more robust than RGB and can effectively distinguish different regions under varying lighting conditions. The hue (H), saturation (S), and lightness (V) components in the HSV space represent the color type, purity, and brightness, respectively. The specific segmentation steps are as follows:

[0034]

[0035] In the formula, H represents hue, i.e. color type, with an effective range of 0 to 179; S represents saturation, i.e. color purity, with an effective range of 0 to 255; and V represents value, i.e. color brightness, with an effective range of 0 to 255.

[0036] Figure 2 This is a schematic diagram of the HSV threshold controller in an embodiment of the present invention.

[0037] In this embodiment, based on experimental data and the color characteristics of the image, the effective ranges for hue, saturation, and brightness are set by adjusting the HSV threshold range. This embodiment creates a Trackbar to facilitate setting the HSV threshold range, such as... Figure 2 As shown. In this embodiment, the selected values ​​are hmin=100, hmax=140, smin=175, smax=255, vmin=150, vmax=255. These parameters can effectively extract the blue background. The mask formula for generating the keratinous jaw image is as follows: (The formula is missing from the provided text.)

[0038]

[0039] This mask can effectively distinguish the keratinous jaw from the background, further extract the target area, and assign a value of 1 (foreground) to pixels that meet the threshold range, and 0 (background) otherwise, thereby separating the keratinous jaw region from the background.

[0040] Step S4: To optimize the mask quality in the image, morphological optimization operations are performed on the obtained binary mask, including opening operations to remove small noise and closing operations to fill holes, thereby obtaining a complete and smooth keratinous jaw region mask. The specific operation formula is as follows:

[0041] Opening operation (denoising): Open(A) = Dilation(Erosion(A, B), B)

[0042] Close operation (filling holes): Close(A) = Erosion(Dilation(A, B), B)

[0043] Here, A is the input mask, and B is a morphological structuring element (usually a square or a circle) used to control the shape of the operation.

[0044] Step S5: To achieve quantitative analysis of pigment deposition, this embodiment converts the filtered and masked image into a grayscale image and grades it according to the grayscale value range. The grayscale value of each pixel in the target area is divided into four levels of keratinocyte pigment deposition, from darkest to lightest, based on predefined, non-overlapping grayscale value ranges. The grayscale grading rules are as follows:

[0045] When the pixel grayscale value is in [0, 60), it is level 1. At this time, the pigment deposition of the keratinous jaw is the deepest, and it appears black in the reconstructed image. When the pixel grayscale value is in [60, 90), it is level 2. At this time, the pigment deposition of the keratinous jaw is relatively significant, and it appears gray in the reconstructed image. When the pixel grayscale value is in [90, 150), it is level 3. At this time, the pigment deposition of the keratinous jaw has just begun, and it appears light gray in the reconstructed image. The remaining pixels in the keratinous jaw image are level 4. At this time, the keratinous jaw has almost no pigment deposition.

[0046] The specific formula for grayscale grading is as follows:

[0047]

[0048] A corresponding mask is generated for each pigment deposition level; the pigment deposition area of ​​different levels is represented by calculating the number of pixels at each gray level, and a new keratinous jaw pigment deposition image is drawn.

[0049] Figure 3 This is a visualization of pigment deposition in the keratinized jaw in an embodiment of the present invention.

[0050] Step S6: After grayscale grading, the generated pigment deposition image will be used for visualization, such as... Figure 3 As shown, the visualized image includes the original image, mask image, grayscale image, and grayscale grading image. Each image is statistically analyzed through the following steps: counting the number of pixels for each pigment deposition level within the target area; calculating the proportion of each pigment deposition level based on the number of pixels; and performing interspecies difference analysis based on these statistical data.

[0051] The regional statistical formula is:

[0052]

[0053] In the formula, The number of pixels for each grayscale level; To classify the grayscale of pixels; Different pigment deposition levels; This is an indicator function; it takes the value 1 when the condition is met, and 0 otherwise. To ensure uniformity in the units used to calculate the pigment deposition area, this embodiment selects the ratio of the number of pixels at each region level to the number of pixels in the entire keratinous jaw area as the level proportion for statistical analysis.

[0054] 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 or all of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for extracting pigment deposition from the keratinous jaws of cephalopods using computer vision, characterized in that, Includes the following steps: Step 1: Obtain a color digital image of the keratinous jaw sample to be analyzed; Step 2: Perform size reduction and color smoothing filtering on the color digital image to obtain the filtered image; Step 3: Convert the filtered image from RGB color space to HSV color space, and set a threshold range based on at least one color component among hue, saturation and brightness in the HSV color space to perform threshold segmentation on the image and generate a binary mask for identifying the target region of the keratin jaw. Step 4: Perform morphological processing on the binary mask to obtain the optimized target region mask; Step 5: Convert the optimized target area mask into a grayscale image, and classify the pigment deposition in the keratinous jaw region into multiple levels according to the predefined grayscale value range; Step 6: Count the number of pixels for each pigment deposition level in the target area, calculate the proportion of each pigment deposition level based on the number of pixels, and generate a pigment deposition image for visualization.

2. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 2, the mean-shift filtering algorithm is used for color smoothing.

3. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 3, the threshold range of each component in the HSV color space is set using an interactive threshold adjustment tool, and threshold segmentation is performed according to the set range to generate the binary mask. The formula for generating the binary mask of the keratinized jaw image is as follows: 。 4. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 4, the morphological processing includes at least opening and closing operations. The opening operation is used to remove small noises, and the closing operation is used to fill holes.

5. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 5, pigment deposition is classified into four levels, according to the following rules: A pixel's grayscale value is in the range [0, 60) when it is classified as level 1; A pixel's grayscale value is in the range [60, 90) when it is classified as level 2. A pixel's grayscale value is in the range [90, 150) when it is classified as level 3; A pixel's grayscale value is in the range of [150, 255] when it is classified as level 4.

6. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, Its features are: in, In step 5, the specific formula for grayscale grading is as follows: ; And generate a corresponding mask for each level.

7. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 6, the formula for counting the number of pixels at each level is: ; In the formula, The number of pixels for each gray level. To classify the grayscale of pixels, For different pigment deposition levels, This is an indicator function that takes the value 1 when the condition is met, and 0 otherwise.

8. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 6, the pigment deposition level ratio is the ratio of the number of pixels in each region level to the total number of pixels in the entire keratinous jaw target region.

9. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 6, the pigment deposition image used for visualization includes one or more of the following: original image, mask image, grayscale image, and grayscale grading image.

10. The method for extracting pigment deposition from cephalopod keratinous jaws using computer vision according to claim 1, characterized in that: in, In step 1, a color two-dimensional side view of the keratinous jaw is taken using a blue background.