A method for synthesizing occluded image dataset of Alpinia fasciata

By processing RGB pictures of black-skinned chicken mushrooms, an occlusion gallery is generated and individual contour binarization pictures are moved to meet the occlusion conditions, the problems of high labor intensity and low efficiency of manual shooting and labeling in the prior art are solved, and more efficient and accurate measurement of phenotypic parameters of black-skinned chicken mushrooms are achieved.

CN119149764BActive Publication Date: 2025-04-25JIANGXI AGRICULTURAL UNIVERSITY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411658292.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-20
Publication Date
2025-04-25
Estimated Expiration
2044-11-20

AI Technical Summary

Technical Problem

In the prior art, large amounts of photos are relied on manual shooting and manual annotation to measure the phenotypic parameters of black-skinned chicken mushrooms, which are highly labor-intensive, inefficient and highly subjective.

Method used

By obtaining the RGB picture of the black-skinned chicken mushroom, the base image library and the occlusion picture library are obtained, and the initial point is randomly generated as the position of the occlusion picture. The individual outline binarization diagram is moved to determine whether the relative position relationship meets the occlusion conditions. If it is satisfied, copy the black-skinned chicken mushroom individual into the RGB picture until the obtained image meets the user's preset requirements.

Benefits of technology

The labor intensity and subjectivity of manual labeling are reduced, the measurement efficiency is improved, and the generated image data is more accurate and consistent.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119149764B_ABST
    Figure CN119149764B_ABST
Patent Text Reader

Abstract

The present invention provides a method for synthesizing a black-skinned Alpinia thunbergii occlusion image data set, and relates to the technical field of image processing. The method comprises: obtaining a base map pair and generating an initial point in the RGB map of the base map pair as the initial position of the occlusion map, mapping the center coordinates of the individual contour binary map in the occlusion map pair to the initial position, and determining the position coordinates of the individual contour binary map in the picture binary map according to the mapping relationship; selecting an unobstructed black-skinned Alpinia thunbergii, moving the individual contour binary map to determine whether the unobstructed black-skinned Alpinia thunbergii meets all occlusion conditions; if so, obtaining the corresponding black-skinned Alpinia thunbergii individual according to the individual contour binary map, copying it into the RGB map to obtain a new RGB map, and constructing a new base map pair with the corresponding new picture binary map into a base map library to update the base map library until the obtained new RGB map meets the preset requirements. The application has low labor intensity, high efficiency and low subjectivity.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of image processing, and in particular to a method for synthesizing a black-skinned Alpinia thunbergii occluded image data set. Background Art

[0002] Black-skinned Alpinia fasciata is rich in nutrition, has high edible value, and is widely favored in the market. In order to meet market demand, researchers must select and breed excellent varieties.

[0003] The phenotype includes a variety of agronomic traits. By observing the changes in phenotypic parameters, we can know the adaptability of the black-skinned Alpinia ternata to the environment, which is an important basis in the selection of excellent varieties.

[0004] In order to solve the problem of high labor intensity and high subjectivity in manual data collection, existing technologies have begun to use machine vision methods combined with deep learning algorithms to automatically measure the phenotypic parameters of black-skinned Alpinia ternata. However, this method requires taking a large amount of image data, which can only be used after manual labeling. The labor intensity is also very high, and in many cases, individuals occlude each other. During manual labeling, the occluded parts need to be guessed by the labeler based on experience, which is obviously inaccurate. Summary of the invention

[0005] Based on this, the purpose of the present invention is to provide a method for synthesizing an occluded image data set of Alpinia thunbergii, which is used to solve the technical problems of the prior art that the method relies on manually taking a large number of photos and manually labeling to measure the phenotypic parameters of Alpinia thunbergii, which has high labor intensity, low efficiency and high subjectivity.

[0006] On one hand, the present invention provides a method for synthesizing a black-skinned Alpinia thunbergii occluded image data set, comprising:

[0007] Obtain a base map library B of the black-skinned Alpinia fasciata, wherein the base map library B includes a plurality of base map pairs B i , each base map is B i Includes an RGB image R i And the RGB map R i The corresponding image binarization map C i , the RGB map R i Including multiple black-skinned Acanthopanax individuals E i , the image binarization map C i Binarized image F of individual contours of multiple black-skinned Alpinia fasciata i , E i and individual contour binarization map F i One-to-one correspondence, each black-skinned Alpinia fasciata individual E i and individual contour binarization map F i Occlusion map pair <E i ,Fi >, multiple occlusion map pairs <E i ,F i >Construct an occlusion gallery A, where i is the image number of the black-skinned Alpinia fasciata, and i is a positive integer;

[0008] Obtain a base map pair B from the base map library B i And use the base map to compare B i Binarization of the image in C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in C i An initial point is randomly generated in the occlusion map to be used as the initial position O1 (x1, y1) of the occlusion map, and an occlusion map pair is obtained from the occlusion map library A. <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Mapped to the initial position O1 (x1, y1), and according to the center coordinates O2 ( x 2, y 2) The mapping relationship with the initial position O1 (x1, y1) determines the individual contour binary map F i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i ;

[0009] Binarize image C from the image i Randomly select a target black skinned Alternaria albuminosa C m As the occluded target, move the individual contour binary map F i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i Whether the relative position relationship between them satisfies all occlusion conditions;

[0010] If the target is Alternaria albuminosa C m and individual contour binarization map F i The relative position relationship between them satisfies all occlusion conditions, then according to the individual contour binary map F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual profile binarization map F iIn the image binarization figure C i The current position in the i Copy to RGB image R i To get the new RGB image R ni ;

[0011] Determine the new RGB image R ni Whether it meets the user's preset requirements;

[0012] If the new RGB image R ni If it does not meet the user's preset requirements, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into the base map library B to update the base map library B, return to execute to obtain a base map pair B from the base map library B i And use the base map to compare B i Binarization of the image in C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in Figure C i In the step of randomly generating an initial point and using the initial point as the initial position O1 (x1, y1) of the occlusion map until the new RGB map R ni Meet the user's preset requirements.

[0013] The above-mentioned method for synthesizing the occlusion image dataset of black-skinned Alpinia fasciata is to process the RGB image of black-skinned Alpinia fasciata to obtain a base image library B and an occlusion image library A, and then select a base image pair B from the base image library B. i , in the base map for B i Binarization of the image in Figure C i A random initial point is generated in the occlusion map to be used as the initial position O1 ( x 1 ,y 1) Get an occlusion map pair from the occlusion map library A <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Mapped to the initial position O1 ( x 1 ,y 1) and establish a mapping relationship, and determine the individual contour binary map F according to the mapping relationship i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i ; Binarize the image C iRandomly select a target black skinned Alternaria albuminosa C m As the occluded target, move the individual contour binary map F i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i Whether the relative position relationship between them meets all the occlusion conditions; if the target black-skinned Alpinia fasciata C m and individual contour binarization map F i The relative position relationship between them satisfies all occlusion conditions, then according to the individual contour binary map F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual profile binarization map F i In the image binarization figure C i The current position in the i Copy to RGB image R i To get the new RGB image R ni ; Determine the new RGB image R ni Whether it meets the user's preset requirements; if the new RGB image R ni If it does not meet the user's preset requirements, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into basemap library B to update basemap library B, return to execute to obtain a basemap pair B from basemap library B i And use the base map to compare B i Binarization of the image in Figure C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in Figure C i In the step of randomly generating an initial point and using the initial point as the initial position O1 (x1, y1) of the occlusion map until the new RGB map R ni Meet the user's preset requirements.

[0014] In addition, the above-mentioned method for synthesizing the black-skinned Alpinia terrestris occluded image data set of the present invention may also have the following additional technical features:

[0015] Furthermore, the occlusion condition is:

[0016] The bottom ordinate of the occlusion map is greater than the bottom ordinate of the occluded object;

[0017] The bottom ordinate of the occluded object is between the bottom ordinate and the top ordinate of the occlusion map;

[0018] The occluded target and the occlusion map intersect in the horizontal direction.

[0019] Furthermore, the occlusion condition is:

[0020] When the individual contour binarization graph F i In addition to blocking the target, the black skinned Alpinia fasciata C m When there is an intersection with other black-skinned Alpinia ternata, the other black-skinned Alpinia ternata at least includes the unobstructed black-skinned Alpinia ternata C T ;

[0021] Determine the individual contour binary image F i Is the bottom of the target black skinned Alpinia fasciata C m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of the figure, and the individual contour binarization map F i The top of the target m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of

[0022] If so, perform the binarization of the individual contour image F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i Steps;

[0023] If not, the current occlusion position is unreasonable, the current occlusion information is discarded, and the execution of the moving individual contour binarization image F is returned. i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i The step of determining whether the relative position relationship between them satisfies all occlusion conditions.

[0024] Further, a base map pair B is obtained from the base map library B. i And use the base map to compare B i Binarization of the image in C i The steps of establishing a coordinate system with the upper left corner of as the origin also include:

[0025] Align the base map to B i Binarization of the middle picture C i The corresponding RGB image R i Convert to grayscale image, and convert multiple candidate occlusion images <E i ,F i >The black skinned Alpinia fasciata individual E i Convert to grayscale image to form grayscale image library Hi ;

[0026] Calculate the RGB image R i The corresponding grayscale image and grayscale image library H i The brightness similarity and contrast similarity of each grayscale image in the image are matched with the RGB image R by brightness similarity and contrast similarity. i The most similar individual E i , the black-skinned Alternaria albuminosa individual E i And the corresponding individual contour binary map F i For a reasonable occlusion map <E i ,F i >.

[0027] Furthermore, the calculation formula of brightness similarity is:

[0028] ;

[0029] The calculation formula for contrast similarity is:

[0030] ;

[0031] In the formula, u R and u H Represents RGB image R i and Grayscale Library H i The mean value of the pixel value of each grayscale image in ; σ R and σ H Represents RGB image R i and Grayscale Library H i The variance of the pixel values ​​of each grayscale image in ; C 1=( k 1 L ) 2 , C 2=( k 2 L ) 2 , k 1 and k 2 are 0.01 and 0.03 respectively, and the L value is 255; luminance is brightness similarity; contrast is the contrast similarity.

[0032] Further, according to the center coordinate O2 ( x 2, y 2) The mapping relationship with the initial position O1 (x1, y1) determines the individual contour binary map F i Each pixel in the image binarization map Ci In the step of calculating the position coordinates in , the calculation formula of the mapping relationship is:

[0033] ;

[0034] ;

[0035] In the formula, ( x Ni ,y Ni ) is the individual contour binary map F i Pixel coordinates in ;( C x , C y )for( x Ni ,y Ni ) is mapped to the image binary map C i The coordinates in ; W O and H O They are the individual contour binarization images F i The width and individual contour binarization map F i of high. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 Flow chart of a method for synthesizing a black-skinned Alpinia fasciata occluded image data set in an embodiment of the present invention;

[0037] Figure 2 The RGB image R of the present invention i And its corresponding image binarization map C i Schematic diagram of

[0038] Figure 3 The present invention is the black skin Alpinia thunbergii individual E i The corresponding individual contour binary map F i Schematic diagram of

[0039] Figure 4 The present invention uses the image binarization graph C i The upper left corner is a schematic diagram of establishing a coordinate system with the origin of the coordinate system;

[0040] Figure 5 The present invention uses individual contour binarization image F i Schematic diagram of establishing a coordinate system in the upper left corner;

[0041] Figure 6 A schematic diagram of a randomly generated initial position in an embodiment of the present invention;

[0042] Figure 7 The moving individual contour binarization image F in the embodiment of the present invention i Schematic diagram of

[0043] The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings. DETAILED DESCRIPTION

[0044] In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which the present invention belongs. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.

[0046] In order to solve the technical problems of the prior art that the method of measuring the phenotypic parameters of Alpinia thunbergii relies on manually taking a large number of photos and manually annotating them, which is labor-intensive, inefficient and highly subjective, the present application provides a method for synthesizing an occluded image dataset of Alpinia thunbergii, by processing the RGB image of Alpinia thunbergii to obtain a base image library B and an occluded image library A, and then selecting a base image pair B from the base image library B. i , in the base map for B i Binarization of the image in C i A random initial point is generated in the occlusion map to be used as the initial position O1 (x1, y1) of the occlusion map, and an occlusion map pair is obtained from the occlusion map library A. <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Map to the initial position O1 (x1, y1) and establish a mapping relationship, and determine the individual contour binary map F according to the mapping relationship i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i ; Binarize the image C from the image i Randomly select a target black skinned Alternaria albuminosa C m As the occluded target, move the individual contour binary map F iAs an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i Whether the relative position relationship between them meets all the occlusion conditions; if the target black-skinned Alpinia fasciata C m and individual contour binarization map F i The relative position relationship between them satisfies all occlusion conditions, then according to the individual contour binary map F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual profile binarization map F i In the image binarization figure C i The current position in the i Copy to RGB image R i To get the new RGB image R ni ; Determine the new RGB image R ni Whether it meets the user's preset requirements; if the new RGB image R ni If it does not meet the user's preset requirements, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into basemap library B to update basemap library B, return to execute to obtain a basemap pair B from basemap library B i And use the base map to compare B i Binarization of the image in Figure C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in Figure C i In the step of randomly generating an initial point and using the initial point as the initial position O1 (x1, y1) of the occlusion map until the new RGB map R ni Meet the user's preset requirements.

[0047] In order to facilitate understanding of the present invention, several embodiments of the present invention are provided below. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.

[0048] Embodiment 1

[0049] See also Figure 1 , which shows a method for synthesizing a black-skinned Alpinia fasciata occluded image data set in a first embodiment of the present invention, comprising steps S101 to S110:

[0050] S101, obtaining a base map library B of Alpinia cerana, wherein the base map library B includes a plurality of base map pairs B i , each base map is B i Includes an RGB image R i And with RGB image R i The corresponding image binarization map C i , RGB image R i Including multiple black-skinned Acanthopanax individuals E i , picture binarization map C i Binarized image F of individual contours of multiple black-skinned Alpinia fasciata i , E i and individual contour binarization map F i One-to-one correspondence, each black-skinned Alpinia fasciata individual E i and individual contour binarization map F i Occlusion map pair <E i ,F i >, multiple occlusion map pairs <E i ,F i >Construct an occlusion gallery A.

[0051] Select an unobstructed RGB image R from the original image library i , and for the RGB image R i Each independent individual of the black-skinned Alpinia thunbergii is labeled to obtain the outline image D of the black-skinned Alpinia thunbergii. The outline image D of the black-skinned Alpinia thunbergii is then binarized to obtain the binary image C of the black-skinned Alpinia thunbergii. i , RGB image R i The corresponding image binarization map C i Constitute a base map pair B i In this way, all the pictures in the original library are processed to obtain multiple labeled base map pairs B i , multiple basemaps for B i A base map library B is constructed, wherein, in the technical solution of the present application, i is the image number of the black-skinned Gallus gallinulatus, i is a positive integer, and in the base map B i In the figure, the black-skinned Alpinia albuminosa pictures with corresponding serial numbers construct the base map pairs with corresponding serial numbers. For example, the RGB image R1 and its corresponding image binarization image C1 constitute a base map pair B1. Figure 2 As shown, Figure 2 (a) is the RGB image R i , Figure 2 (b) is the RGB image R i The corresponding image binarization map C i .

[0052] The black-skinned Alpinia tremula outline image D includes multiple black-skinned Alpinia tremula, and the black-skinned Alpinia tremula outline image D is cut to obtain multiple black-skinned Alpinia tremula individuals E with RGB information i , for each individual E i In the image binarization figure C i Find the corresponding contour in the image and cut it to get the contour of the black-skinned Alpinia fasciata individual E i The corresponding individual contour binary map F i , each individual E i and individual contour binarization map F i Occlusion map pair <E i ,F i >, multiple occlusion map pairs <E i ,F i >Constitute an occlusion image library A, where i is the image number of the black-skinned Alpinia fasciata, i is a positive integer, and in the occlusion image pair <E i ,F i >, the black-skinned Alpinia fasciata pictures with corresponding serial numbers construct the occlusion map pairs with corresponding serial numbers. For example, the black-skinned Alpinia fasciata individual E1 and the individual contour binary map F1 constitute an occlusion map pair<E1,F1> Specific examples: Figure 3 As shown, in Figure 3 middle, Figure 3 (a) is the individual E of Alpinia fasciata i ; Figure 3 (b) is the individual contour binarization map F i .

[0053] S102, obtain a base map pair B from base map library B i And use the base map to compare B i Binarization of the image in C i The coordinate system is established with the upper left corner of as the origin.

[0054] Randomly select a base map pair B from the base map library B i As the target object, in this embodiment, the base map is i For RGB image R i And the image binarization map C i , using the image binarization graph C i The upper left corner of the coordinate system is used as the origin of the coordinate system. According to the image binarization, Figure C i The annotation in calculates the width and height of each black-skinned Alpinia fasciata outline D, corresponding to the coordinate system, the width W i =x i,max -x i,min , high H i =y i,max -y i,min , where (x i,max ,y i,max) is the top coordinate of the i-th black-skinned Alpinia fasciata outline map D; (x i,min ,y i,min ) is the bottom coordinate of the i-th black-skinned Alpinia fasciata outline map D. Figure 4 As shown, Figure 4 M i It is the center of the obscured black-skinned Alpinia terrestris in the base image.

[0055] Furthermore, n pairs of occlusion images are randomly selected from the occlusion image library A, that is, n pairs of occlusion images are selected. <E i ,F i >, n≥1, each occlusion map pair <E i ,F i >The individual contour binarization map F in i The coordinate system is established in the upper left corner to calculate the width and height of the black-skinned Alpinia fasciata in the occlusion image. Corresponding to the coordinate system, the width W o =x o,max -x o,min , high H o =y o,max -y o,min , where (x o,max ,y o,max ) is the individual contour binarization graph F i The top coordinate of o,min ,y o,min ) is the individual contour binarization map F i The bottom coordinates of . Figure 5 shown.

[0056] Since the light in the picture and the color of the soil covering the black-skinned Alpinia fasciata are affected by the environment, in order to maintain the authenticity of the synthesized image, it is necessary to first calculate the similarity between the base image to be synthesized and the occlusion image. The specific method includes: i Binarization of the middle picture C i The corresponding RGB image R i Convert to grayscale image, and convert multiple candidate occlusion images <E i ,F i >The black skinned Alpinia fasciata individual E i Convert to grayscale image to form grayscale image library H i ; Calculate RGB image R i The corresponding grayscale image and grayscale image library H i The brightness similarity and contrast similarity of each grayscale image in the image are matched with the RGB image R by brightness similarity and contrast similarity. i The most similar individual E i , the black-skinned Alternaria japonica individual E i And the corresponding individual contour binary map F iFor a reasonable occlusion map <E i ,F i >.

[0057] The calculation formula of brightness similarity is:

[0058] ;

[0059] The calculation formula for contrast similarity is:

[0060] ;

[0061] In the formula, u R and u H Represents RGB image R i and Grayscale Library H i The mean value of the pixel value of each grayscale image in ; σ R and σ H Represents RGB image R i and Grayscale Library H i The variance of the pixel values ​​of each grayscale image in ; C 1=( k 1 L ) 2 , C 2=( k 2 L ) 2 , k 1 and k 2 are 0.01 and 0.03 respectively, and the L value is 255; luminance is brightness similarity; contrast is the contrast similarity.

[0062] The closer the brightness similarity and contrast similarity are to 1, the better the corresponding occlusion map is. <E i ,F i >Base map in B i Binarization of the middle picture C i The corresponding RGB image R i and occlusion map <E i ,F i >The black skinned Alpinia fasciata individual E i By comparing the brightness similarity and contrast similarity, the matching is obtained with the RGB image R i The most similar individuals of the black-skinned Alpinia fasciata E i , that is, the matching is obtained with the RGB image R i The n occlusion graphs with the highest similarity. In this embodiment, luminance The threshold is 0.8, contrast The threshold value is 0.8, n is 1, which is understandable. luminance and contrast The similarity is more than 0.8. luminance and contrast The highest occlusion map.

[0063] S103, on the base map i Binarization of the image in C i A random initial point is generated in the occlusion map to be used as the initial position O1 ( x 1 ,y 1) Get an occlusion map pair from the occlusion map library A <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Mapped to the initial position O1 ( x 1 ,y 1), and according to the center coordinates O2 ( x 2, y 2) with the initial position O1 ( x 1 ,y 1) The mapping relationship determines the individual contour binary map F i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i .

[0064] like Figure 6 As shown, Figure 6 Medium i is the randomly generated initial position. In this embodiment, the calculation formula of the mapping relationship is:

[0065] ; ;

[0066] In the formula, ( x Ni ,y Ni ) is the individual contour binary map F i Pixel coordinates in ;( C x , C y )for( x Ni ,y Ni ) is mapped to the image binary map C i The coordinates in ; WO and H O They are the individual contour binarization images F i width and height.

[0067] S104, binarize image C from image i Randomly select a target black skinned Alternaria albuminosa C m as an obscured target.

[0068] Binarize image C from the image i Randomly select a target black skinned Alternaria albuminosa C m As the occluded target, it is convenient for subsequent occlusion processing.

[0069] S105, moving individual contour binary image F i The position of is used as the occlusion map.

[0070] S106, determine the target black skinned Alpinia thunbergii C m and individual contour binarization map F i Whether the relative position relationship between them satisfies all occlusion conditions.

[0071] If the target is Alternaria albuminosa C m and individual contour binarization map F i If the relative position relationship between them satisfies all the occlusion conditions, step S107 is executed.

[0072] If the target is Alternaria albuminosa C m and individual contour binarization map F i If the relative position relationship between them does not satisfy all the occlusion conditions, the process returns to step S105.

[0073] Since the camera takes pictures of the black-skinned Alpinia thunbergii from top to bottom at an inclined angle during the image acquisition process, combined with the shooting angle, the bottom of the black-skinned Alpinia thunbergii in the image must be below the bottom of the black-skinned Alpinia thunbergii being blocked. At the same time, it is necessary to ensure that the two black-skinned Alpinia thunbergii have an intersection. Therefore, the moving individual contour binary map F i The position needs to meet the following conditions, that is, the occlusion condition is:

[0074] When the individual contour binarization graph F i Only one target is blocked, Alpinia fasciata C m When , the occlusion conditions are: the bottom ordinate of the occlusion map is greater than the bottom ordinate of the occluded target; the bottom ordinate of the occluded target is between the bottom ordinate and the top ordinate of the occlusion map; the occluded target and the occlusion map have an intersection in the horizontal direction;

[0075] Furthermore, when the individual contour binarization graph F i In addition to blocking the target, the black-skinned Alpinia fasciata Cm When there is an intersection with other black-skinned Alpinia thunbergii, other black-skinned Alpinia thunbergii include unobstructed black-skinned Alpinia thunbergii C T ; The occlusion condition is also: judging the individual contour binary image F i Is the bottom of the black-skinned Alpinia fasciata C lower than the above target m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of the figure, and the individual contour binarization map F i The top of the target m Compared with the unshaded black-skinned Alpinia fasciata C T if yes, execute step S107; if no, the current occlusion position is unreasonable, the current occlusion information is discarded, and the process returns to step S104.

[0076] In order to avoid the unreasonable situation caused by blocking two black-skinned Alpinia fasciata at the same time, Figure 7 As shown, that is: individual contour binary map F i The root of is located between the upper and lower black-skinned Alpinia fasciata, but the cap or stipe covers both black-skinned Alpinia fasciata. Therefore, it is also necessary to judge the individual contour binary image F i In addition to the currently selected target, Alternaria albuminosa C m Whether there is overlap between other black-skinned Alpinia fasciata, that is, whether the overlap between the two black-skinned Alpinia fasciata is 0. If it is 0, there is no overlap. Save the information and obtain the binary image F containing the individual contours. i And the image binarization map C i The new binary image C ni , and execute step S107;

[0077] If the individual contour binarization graph F i With the target of m There is overlap, and there are other unobstructed black-skinned Alpinia fasciata C T and individual contour binarization map F i There is an intersection, when the individual contour binary graph F i The bottom of the target m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of the figure, and the individual contour binarization map F i The top of the target m Compared with the unshaded black-skinned Alpinia fasciata C T When the bottom of the image is reached, the information is saved and a binary image F containing individual contours is obtained. i And the image binarization map C i The new binary image C ni , and execute step S107;

[0078] If the individual contour binarization graph Fi With the target of m There is overlap, and there is no obstruction of the black skinned Alpinia fasciata C T and individual contour binarization map F i There is an intersection, and the individual contour binary graph F i The bottom of the target is located at the m Compared with the unshaded black-skinned Alpinia fasciata C T If the occlusion position is in the middle of the bottom, the occlusion position is unreasonable, the current occlusion information is discarded, and the process returns to step S104. Figure 7 shown.

[0079] S107, binarize the image F according to the individual profile i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual profile binarization map F i In the image binarization figure C i The current position in the i Copy to RGB image R i To get the new RGB image R ni .

[0080] S108, determine the new RGB image R ni Whether it meets the user's preset requirements.

[0081] As a specific example, when the new RGB image R ni When the number of black-skinned Alpinia fasciata in the image reaches 10, the new RGB image R ni Meet the user's preset requirements, that is, in this embodiment, the preset requirement is the new RGB image R ni The number threshold of the black-skinned Alpinia thunbergii in the new RGB image is 10. It should be further explained that in order to avoid the situation where there are too many black-skinned Alpinia thunbergii in one image, which makes the black-skinned Alpinia thunbergii in the image too dense and inconsistent with the actual situation, the new RGB image R ni The number threshold of the black-skinned Alpinia terrestris is generally 2-20, and the specific selection can be made according to the actual needs of the user.

[0082] If the new RGB image R ni If the new RGB image R does not meet the user's preset requirements, step S109 is executed, and the process returns to step S103 until the new RGB image R ni Meet the user's preset requirements; if the new RGB image R ni If it meets the preset requirements of the user, then execute step S110;

[0083] S109, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into base map library B to update base map library B.

[0084] S110, outputting image data of Alpinia cerana.

[0085] In summary, the method for synthesizing the occlusion image data set of the black-skinned Alpinia tremula in the above embodiment of the present invention is to process the RGB image of the black-skinned Alpinia tremula to obtain the base image library B and the occlusion image library A, and then select a base image pair B from the base image library B. i , in the base map for B i Binarization of the image in C i A random initial point is generated in the occlusion map to be used as the initial position O1 (x1, y1) of the occlusion map, and an occlusion map pair is obtained from the occlusion map library A. <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Map to the initial position O1 (x1, y1) and establish a mapping relationship, and determine the individual contour binary map F according to the mapping relationship i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i ; Binarize the image C from the image i Randomly select a target black skinned Alternaria albuminosa C m As the occluded target, move the individual contour binary map F i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i Whether the relative position relationship between them meets all the occlusion conditions; if the target black-skinned Alpinia fasciata C m and individual contour binarization map F i The relative position relationship between them satisfies all occlusion conditions, then according to the individual contour binary map F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual profile binarization map F i In the image binarization figure C iThe current position in the i Copy to RGB image R i To get the new RGB image R ni ; Determine the new RGB image R ni Whether it meets the user's preset requirements; if the new RGB image R ni If it does not meet the user's preset requirements, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into basemap library B to update basemap library B, return to execute to obtain a basemap pair B from basemap library B i And use the base map to compare B i Binarization of the image in C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in C i In the step of randomly generating an initial point and using the initial point as the initial position O1 (x1, y1) of the occlusion map until the new RGB map R ni Meet the user's preset requirements.

[0086] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0087] The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.

Claims

1. A method for synthesizing a black-skinned Alpinia fasciata occluded image data set, characterized in that: include: Obtain a base map library B of the black-skinned Alpinia fasciata, wherein the base map library B includes a plurality of base map pairs B i , each base map is B i Includes an RGB image R i And the RGB map R i The corresponding image binarization map C i , the RGB map R i Including multiple black-skinned Acanthopanax individuals E i , the image binarization map C i Binarized image F of individual contours of multiple black-skinned Alpinia fasciata i , E i and individual contour binarization map F i One-to-one correspondence, each black-skinned Alpinia fasciata individual E i and individual contour binarization map F i Occlusion map pair <E i ,F i >, multiple occlusion map pairs <E i ,F i >Construct an occlusion gallery A, where i is the image number of the black-skinned Alpinia fasciata, and i is a positive integer; Obtain a base map pair B from the base map library B i And use the base map to compare B i Binarization of the image in Figure C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in Figure C i An initial point is randomly generated in the occlusion map to be used as the initial position O1 (x1, y1) of the occlusion map, and an occlusion map pair is obtained from the occlusion map library A. <E i ,F i > and the occlusion map <E i ,F i > Individual contour binarization map F i The center coordinates O2 ( x 2, y 2) Mapped to the initial position O1 (x1, y1), and according to the center coordinates O2 ( x 2, y 2) The mapping relationship with the initial position O1 (x1, y1) determines the individual contour binary map F i Each pixel in the image binarization map C i The position coordinates in order to move the individual contour binary map F i ; Binarize image C from the image i Randomly select a target black skinned Alternaria albuminosa C m As the occluded target, move the individual contour binary map F i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i Whether the relative position relationship between them satisfies all occlusion conditions; If the target is Alternaria albuminosa C m and individual contour binarization map F i The relative position relationship between them satisfies all occlusion conditions, then according to the individual contour binarization map F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i , according to the image binarization map C i Get the corresponding RGB image R i , according to the individual contour binarization map F i In the image binarization figure C i The current position in the i Copy to RGB image R i To get the new RGB image R ni ; Determine the new RGB image R ni Whether it meets the user's preset requirements; If the new RGB image R ni If it does not meet the user's preset requirements, the new RGB image R ni And the corresponding new image binarization map C ni Construct a new base map pair B i And put it into the base map library B to update the base map library B, return to execute to obtain a base map pair B from the base map library B i And use the base map to compare B i Binarization of the image in C i The upper left corner of the coordinate system is used as the origin of the coordinate system. i Binarization of the image in Figure C i In the step of randomly generating an initial point and using the initial point as the initial position O1 (x1, y1) of the occlusion map until the new RGB map R ni Meet the user's preset requirements.

2. The method for synthesizing the occluded image data set of Alpinia fasciata according to claim 1, characterized in that: The occlusion conditions are: The bottom ordinate of the occlusion map is greater than the bottom ordinate of the occluded object; The bottom ordinate of the occluded object is between the bottom ordinate and the top ordinate of the occlusion map; The occluded target and the occlusion map intersect in the horizontal direction.

3. The method for synthesizing the occluded image data set of Alpinia cerasifera according to claim 2, characterized in that: The occlusion condition is also: When the individual contour binarization graph F i In addition to blocking the target, the black skinned Alpinia fasciata C m When there is an intersection with other black-skinned Alpinia ternata, the other black-skinned Alpinia ternata at least includes the unobstructed black-skinned Alpinia ternata C T ; Determine the individual contour binary image F i Is the bottom of the target black skinned Alpinia fasciata C m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of the figure, and the individual contour binarization map F i The tops of the target m Compared with the unshaded black-skinned Alpinia fasciata C T The bottom of If so, perform the binarization of the individual contour image F i In the occlusion map <E i ,F i > to obtain the corresponding black-skinned Alpinia fasciata individual E i Steps; If not, the current occlusion position is unreasonable, the current occlusion information is discarded, and the execution of moving the individual contour binarization image F is returned. i As an occlusion map to determine the target black skinned Alpinia fasciata C m and individual contour binarization map F i The step of determining whether the relative position relationship between them satisfies all occlusion conditions.

4. The method for synthesizing the occluded image data set of Alpinia fasciata according to claim 1, characterized in that: Obtain a base map pair B from the base map library B i And use the base map to compare B i Binarization of the image in Figure C i The steps of establishing the coordinate system with the upper left corner of as the origin also include: Align the base map to B i Binarization of the middle picture C i The corresponding RGB image R i Convert to grayscale image, and convert multiple candidate occlusion images <E i ,F i >The black skinned Alpinia fasciata individual E i Convert to grayscale image to form grayscale image library H i ; Calculate the RGB image R i The corresponding grayscale image and grayscale image library H i The brightness similarity and contrast similarity of each grayscale image in the image are matched with the RGB image R by brightness similarity and contrast similarity matching. i The most similar individual E i , the black-skinned Alternaria albuminosa individual E i And the corresponding individual contour binary map F i For a reasonable occlusion map <E i ,F i >.

5. The method for synthesizing the occluded image data set of Alpinia fasciata according to claim 4, characterized in that: The calculation formula for brightness similarity is: ; The calculation formula for contrast similarity is: ; In the formula, u R and u H Represents RGB image R i and Grayscale Library H i The mean value of the pixel value of each grayscale image in ; σ R and σ H Represents RGB image R i and Grayscale Library H i The variance of the pixel values ​​of each grayscale image in ; C 1=( k 1 L ) 2 , C 2=( k 2 L ) 2 , k 1 and k 2 are 0.01 and 0.03 respectively, and the L value is 255; luminance is brightness similarity; contrast is the contrast similarity.

6. The method for synthesizing the occluded image data set of Alpinia cerasifera according to claim 1, characterized in that: According to the center coordinates O2 ( x 2, y 2) with the initial position O1 ( x 1 ,y 1) The mapping relationship determines the individual contour binary map F i Each pixel in the image binarization map C i In the step of calculating the position coordinates in , the calculation formula of the mapping relationship is: ; ; In the formula, ( x Ni ,y Ni ) is the individual contour binary map F i Pixel coordinates in ;( C x , C y )for( x Ni ,y Ni ) is mapped to the image binary map C i The coordinates in ; W O and H O They are the individual contour binarization images F i The width and individual contour binarization map F i of high.

Citation Information

Patent Citations

  • Collybia albuminosa-based pileus size in-situ measurement method

    CN114838664A

  • In-situ size measurement method based on termitomyces albuminosus

    CN114838665A