Image processing system and method for automatically extracting sample plots
By designing an image processing system for automatically extracting sample parties and using the combined processing of multiple modules, the problems of low efficiency and large error of sample parties in the prior art are solved, and high-precision automated segmentation is achieved.
Patent Information
- Application Number
- CN202410441137.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-12
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-04-12
AI Technical Summary
In the prior art, the process of manually observing and cutting sample square pictures is time-consuming and affected by subjective factors, resulting in a large difference between the size and shape of the sample square pictures and the actual sample square, making it difficult to achieve high-precision automated segmentation.
An image processing system for automatically extracting sample parties is designed, which includes six modules: resolution processing, U-net semantic segmentation network processing, edge segmentation algorithm processing, edge convex mask algorithm processing and mask cutting processing, through these The combination of modules realizes automatic segmentation of sample squares.
High-precision automated segmentation of sample squares is realized, manual intervention is reduced, processing efficiency is improved, and the position, shape and size information of sample frames can be accurately captured, and errors are reduced.
Smart Images

Figure CN118229947B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data image processing, and in particular relates to an image processing system and a processing method for automatically extracting sample plots. Background Art
[0002] In the field of ecology and remote sensing, it is very important to measure data such as vegetation coverage and aboveground biomass in a certain area and study the correlation between them and the corresponding image data.
[0003] When measuring ecological and remote sensing data such as vegetation coverage and aboveground biomass in a certain area, the usual approach is to take a square sample frame of a certain size, sample in the target area, and obtain an RGB image of the area. This is used to actually measure data, process related data, and study the RGB images of the area. However, since the size and position of the RGB image taken in reality may not completely correspond to the sample frame, the content of the image usually includes the sample frame and the area outside the sample frame.
[0004] However, the data actually measured, such as vegetation coverage and aboveground biomass, are only data within the sample frame. If we want to study the relationship between the RGB image and these data, we must extract the actual position and size of the sample frame from the photograph. The extraction methods currently used are all empirical cropping methods. Manually observe the situation of this batch of data, subjectively select a certain threshold, and use 90%, 80% or 70% of the shortest side (i.e., the threshold selected by humans) as the side length of the square, and crop a square image of the same size from the center of the original image as the extracted sample image.
[0005] However, the size and position of the sample frame in each picture are not fixed, and due to the deformation of the sample frame when placed, the photo cannot be taken orthophotoically, resulting in a huge difference in the size and shape of the cropped sample picture and the actual sample. In addition, if the amount of data is large, the process of manually observing and classifying pictures and selecting thresholds is very time-consuming and greatly affected by subjective factors.
[0006] Therefore, a high-precision automated method for segmenting the area within a sample plot is needed. Summary of the invention
[0007] Technical solution: In order to solve the above technical problems, the present invention provides an image processing system for automatically extracting sample plots, which is specifically provided with six modules, including module one, module two, module three, module four, module five, and module six. The modules are information-exchanged, specifically:
[0008] The module 1 is a module for processing the resolution of the collected original image, and uses a bilinear interpolation algorithm to reduce the resolution and output the image to the module 2;
[0009] The module 2 is a module for processing the received image using a U-net semantic segmentation network, which is used to segment the sample frame and the background and output them to the module 3;
[0010] The module three is a module that uses a bilinear interpolation algorithm to perform resolution processing on the received image after selecting an appropriate edge segmentation algorithm or pixel approximation algorithm, and is used to obtain a picture with the same resolution as the original acquisition after processing and output it to the module five;
[0011] The module five is a module for processing the received image using an edge convex hull mask algorithm, and outputting the mask result to the module six;
[0012] The module six is a module for performing mask cropping processing on the received image, outputting the area within the sample frame, and cropping out the sample square.
[0013] As an improvement, the bilinear interpolation algorithm increases or decreases the image resolution by interpolating on a two-dimensional grid and estimating the values between the four nearest known points based on the values of these points. The specific steps are:
[0014] 1) Determine the position of the target point: Determine the position of the target point in the grid based on the floating point coordinates of the target point, usually by rounding down or rounding off;
[0015] 2) Determine the nearest four known points: According to the position of the target point, find the coordinates of the four known points around the target point;
[0016] 3) Calculate the interpolation in the horizontal direction:
[0017] 4) Calculate the interpolation in the vertical direction:
[0018] 5) Return the interpolation result: Return the interpolation result as the estimated value at the target point.
[0019] As an improvement, the specific method of calculating the interpolation in the horizontal direction in step 3) includes:
[0020] ①Use the linear interpolation formula to interpolate between the two known points on the left and right of the target point;
[0021] ② Calculate two temporary values in the horizontal direction;
[0022] Step 4) The specific method of calculating the interpolation in the vertical direction includes:
[0023] ①Use the linear interpolation formula to interpolate between the two known points on the left and right of the target point;
[0024] ②Calculate two temporary values in the horizontal direction.
[0025] As an improvement, the edge convex hull mask algorithm first finds the outer contour of the input image, innovatively saves the endpoints of the outer contour instead of the outer contour, and converts the outer contour problem into finding the convex hull of the points (the minimum convex polygon surrounding a set of points), then calculates the convex hull of the contour endpoints, and draws this convex hull on the mask image, so as to innovatively find the minimum circumscribed polygon of the sample frame as the mask image. It solves the pain points that the discontinuous sample frame cannot find the complete outer contour, and the irregular shape cannot approximate the sample frame, resulting in large errors; the specific steps are:
[0026] 1) Read the image: First, traverse all the image files in the input folder, read the binary image, and use the cv2.imread function to read the binary image;
[0027] 2) Find contours: Use Open CV's cv2.findContours function to find the outer contour of the image; Use cv2.findContours function to find the outer contour of the image and get the contour list contours;
[0028] 3) Calculate the convex hull: For all the contours found, use the cv2.convexHull function to calculate their convex hull; the convex hull is the smallest convex polygon that contains all the points in the contour; merge all the contours, and then use the cv2.convexHull function to calculate their convex hull;
[0029] 4) Create a blank mask image: Create a blank mask image of the same size as the original image. Use the np.zeros_like function to create a blank mask image of the same size as the original image;
[0030] 5) Draw the convex hull: Use the cv2.draw Contours function to draw the convex hull on the mask image;
[0031] 6) Save the mask image: Save the generated mask image to the output folder using the cv2.imwrite function. As an improvement, the U-net semantic segmentation network is used. The specific steps are:
[0032] 1) Build the encoder and decoder: Create a U-net model where the encoder part is responsible for extracting features from the input image and the decoder part maps these features back to the resolution of the original input image;
[0033] 2) Add skip connections: At each stage of the decoder, connect the feature map of the corresponding stage of the encoder with the input of the decoder to preserve more spatial information;
[0034] 3) Define the loss function and optimizer: Use the binary cross entropy loss function nn.BCE With Logits Loss to calculate the loss between the prediction result and the label; the optimizer selects the RMSprop algorithm and is instantiated through optim.RMSprop;
[0035] 4) Training network: Use labeled image data to train the U-net network, iterate the training set once per epoch, and update the network parameters to minimize the loss;
[0036] 5) Save the best model: During the training process, monitor the loss value, and if a model with a smaller loss is found, save the model parameters;
[0037] 6) Prediction stage: The above five steps are the pre-training stage. The final model parameters are determined, and then the saved model parameters are imported. The original resolution image is input for end-to-end output and segmentation to obtain the result. For example, the original resolution is 512×512.
[0038] At the same time, the present invention also provides an image processing method for automatically extracting sample plots, using any of the above-mentioned image processing systems, and the specific steps are:
[0039] (1) Reduce resolution operation
[0040] The bilinear interpolation algorithm is used to process the original image to be processed, and the output resolution is 512x512 RGB color image;
[0041] (2) Pixel-level segmentation
[0042] The image output from step (1) is segmented at the pixel level using a trained U-net semantic segmentation network, and a binary image of the segmented sample frame and background is output at a set pixel value.
[0043] (3)Restoring resolution
[0044] The image outputted in step (2) is adjusted to the resolution in step (1) by a bilinear interpolation algorithm to output a binary image;
[0045] (4) Generate preliminary sample mask
[0046] For the image outputted in step (3), a sample square with accurate sample square position and size information including the sample frame is obtained, and the sample square is saved and outputted in the form of a mask;
[0047] (5) Preliminary sample cutting
[0048] The mask output in step (4) is cropped using a mask cropping algorithm to output the area inside and outside the sample frame, completing the preliminary image processing. The image includes two parts: the sample frame and the sample square.
[0049] (6) Final sample cutting
[0050] The grayscale image of the sample frame output in step (3) is used as a mask, and the mask cropping algorithm is used to crop the preliminary cropping result output in step (5), and the area within the sample frame is output to complete the final image processing. The image only contains the sample quadrat part.
[0051] As an improvement, step (4) first uses an edge detection algorithm to detect edge information in the binary image and stores it in the form of points. The edge information is converted into point form, and the convex hull algorithm is used to find the minimum circumscribed convex polygon of these edge information points, thereby accurately extracting the sample frame and the part inside the sample frame.
[0052] As an improvement, after the preliminary extraction of the sample frame and the area within the sample frame, step (6) uses the binary image obtained in step (3) as a mask to extract the image again, accurately excluding the sample frame part and retaining the sample frame, i.e., the sample square part.
[0053] Beneficial effects: The image processing system and method for automatically extracting sample plots proposed by the present invention have the following advantages compared with conventional ones:
[0054] (1) The present invention uses a pre-trained deep learning network and can achieve accurate segmentation of the sample frame and the background through an end-to-end automated process.
[0055] (2) The present invention innovatively transforms the segmentation of sample plots using semantic segmentation methods into segmentation of grassland and sample frames, solving the problem that semantic segmentation cannot achieve segmentation of objects with the same semantics and thus cannot automatically determine the location of sample plots using a deep learning framework.
[0056] (3) The edge convex hull mask algorithm used in the present invention can flexibly adapt to different sample square shapes and positions, and minimize the influence of factors such as shooting angle and height.
[0057] (4) The present invention adopts pixel-level segmentation technology, which can accurately determine the position of the sample frame, minimize errors, and accurately segment the sample squares inside the sample frame. This can accurately capture the position, shape and size information of the sample frame in each picture, thereby achieving accurate segmentation of the sample square, reducing errors, and avoiding the influence of factors such as sample frame deformation, shooting angle and height on the results.
[0058] (5) The present invention innovatively uses two mask and operations to successfully solve the problem of accurately extracting the area within the sample frame and excluding the sample frame part. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 The figure is a flow chart of the processing method of the present invention.
[0060] Figure 2 It is a schematic diagram of the structural framework of the system of the present invention.
[0061] Figure 3 This is a schematic diagram of an original image in Example 1 of the present invention.
[0062] Figure 4 This is a schematic diagram of an RGB color image after reducing the resolution in Example 1 of the present invention.
[0063] Figure 5 Schematic diagram of a binary image after segmentation in Example 1 of the present invention.
[0064] Figure 6 This is a schematic diagram of an image after resolution processing in step 3 of embodiment 1 of the present invention.
[0065] Figure 7 Schematic diagram of the sample plot and frame mask after step 4 in Example 1 of the present invention.
[0066] Figure 8 It is a schematic diagram of the image after the sample frame and sample square are initially trimmed in Example 1 of the present invention.
[0067] Fig. 9 This is a schematic diagram of the image after the sample is finally trimmed in Example 1 of the present invention. DETAILED DESCRIPTION
[0068] The technical solutions in the embodiments of the present invention will be described clearly and completely below so that those skilled in the art can better understand the advantages and features of the present invention, thereby making a clearer definition of the protection scope of the present invention. The embodiments described in the present invention are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present invention.
[0069] See Figure 1 As shown, the usage process is shown. Figure 2 The core technical solution of the present invention is to realize the automatic segmentation of the sample frame and the background through computer image processing technology and deep learning technology, combined with a pre-trained network structure, and then use the original edge convex hull mask algorithm in the segmentation result to accurately find the position, size and shape of the sample square.
[0070] See Figure 3 As shown in the figure, it is a schematic diagram of the specific process steps, and the specific steps are:
[0071] 1. Resolution reduction operation: The original image is subjected to a resolution reduction operation in module 1, and a bilinear interpolation algorithm is used to compress the original image to an RGB color image with a resolution of 512×512.
[0072] 2. Pixel-level segmentation: The RGB color image with a resolution of 512×512 is segmented at the pixel level through module 2, using the trained U-net semantic segmentation network to obtain a binary image with a resolution of 512×512. In this binary image, the pixel value of the sample frame is 255 (white) and the pixel value of the background is 0 (black).
[0073] This step is based on pixel-level segmentation technology, which can accurately determine the position, size and shape of the sample frame in the image. This step specifically applies semantic segmentation to the system, converting the difficult-to-segment internal sample squares into the easily segmented sample boxes, innovatively solving the problem that semantic segmentation is difficult to segment for objects with the same semantics, resulting in the inability to automatically segment the sample squares.
[0074] 3. Resolution restoration: The classified 512×512 resolution binary image is restored to the resolution of the original image through module 4, and a bilinear interpolation algorithm is used to obtain a binary image with the same resolution as the original image.
[0075] 4. Generate mask: First find the outer contour of the input image, and innovatively save the endpoints of the outer contour instead of the outer contour, and convert the outer contour problem into finding the convex hull of the points (the minimum convex polygon surrounding a set of points). Then calculate the convex hull of the contour endpoints and draw this convex hull on the mask image. In this way, the minimum circumscribed polygon of the sample frame is found as the mask image in an innovative way.
[0076] 5. Preliminary sample plot cropping: Based on the mask generated in module 4, the mask cropping algorithm is used in module 5 to accurately crop the sample plot and sample frame area.
[0077] 6. Final sample plot cropping: Based on the binary image generated by module three as the sample frame mask, the image obtained by module five is again subjected to the mask cropping algorithm by module six, and the sample frame part is also set to black, and finally the sample plot area is accurately obtained.
[0078] Through the above process, the original image is automatically processed and the required sample information is extracted successfully.
[0079] As a specific embodiment of the present invention, the present invention provides an image processing system for automatically extracting sample plots, which is provided with six modules, including module one, module two, module three, module four, module five, and module six, wherein information is exchanged between the modules, specifically:
[0080] The module 1 is a module for processing the resolution of the collected original image, and uses a bilinear interpolation algorithm to reduce the resolution and output the image to the module 2;
[0081] The module 2 is a module for processing the received image using a U-net semantic segmentation network, which is used to segment the sample frame and the background and output them to the module 3;
[0082] The module three is a module for performing resolution processing on the received image using a bilinear interpolation algorithm, and is used to obtain a picture with the same resolution as the original acquisition after processing and output it to the module four;
[0083] The module 4 is a module for performing mask processing on the received image using the edge convex hull algorithm, and outputting the mask result to the module 5;
[0084] The module five is a module for performing mask cropping processing on the received image, outputting the area within and outside the sample frame, and cropping out a preliminary sample square.
[0085] The module six is a module for performing masking and operations on the received image, outputting the internal area of the sample frame, and cutting out the final sample square.
[0086] The edge convex hull mask algorithm is to first find the outer contour of the input image, innovatively save the endpoints of the outer contour instead of the outer contour, and convert the outer contour problem into the convex hull of the points (the minimum convex polygon surrounding a set of points), and then calculate the convex hull of the contour endpoints, and draw this convex hull on the mask image, so as to innovatively find the minimum circumscribed polygon of the sample frame as the mask image. This algorithm of the present invention solves the pain points that the discontinuity of the sample frame leads to the inability to find the complete outer contour, and the irregular shape leads to the inability of the polygon to approximate the sample frame with large errors.
[0087] The following are the logic and implementation steps of the edge convex hull mask algorithm in the present invention:
[0088] 1) Read the image: First, traverse all image files in the input folder and read the binary image, for example, using the cv2.imread function to read the binary image.
[0089] 2) Find contours: Use OpenCV's cv2.findContours function to find the outer contour of the image, save the endpoints of the outer contour, and get the contour list contours.
[0090] 3) Calculate the convex hull: For all the contour endpoints found, use the cv2.convexHull function to calculate their convex hull, which is the smallest convex polygon that contains all the points in the contour. Merge all contours and then use the cv2.convexHull function to calculate their convex hull.
[0091] 4) Create a blank mask image: Create a blank mask image of the same size as the original image, and use the np.zeros_like function to create a blank mask image of the same size as the original image.
[0092] 5) Draw the convex hull: Use the cv2.drawContours function to draw the convex hull on the mask image.
[0093] 6) Save the mask image: Save the generated mask image to the output folder using the cv2.imwrite function.
[0094] The image processing method for automatically extracting samples of the present invention is introduced in detail below.
[0095] Example 1
[0096] 1. Reduce the resolution:
[0097] For the original image ( Figure 3 ) After the module 1 performs the resolution reduction operation, the original image is compressed to a 512x 512 resolution RGB color image using the bilinear interpolation algorithm. The processed image is shown in Figure 4 shown.
[0098] This step is to reduce the computational pressure of the subsequent step 2 and save computing resources. Specifically, the original image size is about 9.8MB, and the 512x 512 image size is about 96KB, which greatly saves computing resources.
[0099] 2. Pixel-level segmentation: The RGB color image with a resolution of 512 x 512 is segmented at the pixel level by module 2, using the trained U-net semantic segmentation network to obtain a binary image with a resolution of 512 x 512 (see Figure 5 shown).
[0100] In this binary image, the pixel value of the sample frame is 255 (white) and the pixel value of the background is 0 (black). This step is based on pixel-level segmentation technology, which can accurately determine the position, size and shape of the sample frame in the image.
[0101] 3. Resolution restoration: The classified 512x 512 resolution binary image is restored to the resolution of the original image through module 4, and a bilinear interpolation algorithm is used to obtain a binary image with the same resolution as the original image (see Figure 6shown).
[0102] 4. Generate sample mask: The binary image restored to the original resolution is passed through module 5 to generate a sample mask.
[0103] Enter the edge detection algorithm step, use the contour detection algorithm to detect the outer contour of the white sample frame in the binary image, and save the endpoints of the outer contour. Then calculate the convex hull (the smallest convex polygon surrounding a set of points) surrounding these endpoints, and use this convex polygon as the obtained mask (see Figure 7 shown).
[0104] This step innovatively proposes to save the outer contour as the endpoint, and find the minimum circumscribed rectangle of the sample frame by finding the convex hull of the endpoint, which solves the pain points that the sample frame is discontinuous and cannot find the complete outer contour, and the polygon cannot approximate the sample frame due to irregular shape, and the error is large, which enhances the robustness of image mask processing. Through this step, the accurate sample position and size information is obtained and saved in the form of a mask.
[0105] 5. Preliminary sample cropping: Based on the mask generated in module 4, the mask cropping algorithm in module 5 is used to retain the white mask area on the original image, and the black area of the original image is also set to black, accurately cropping the sample and sample frame areas (see Figure 8 shown).
[0106] 6. Final sample plotting: Based on the binary image generated by module 3 as the sample frame mask, the image obtained by module 5 is subjected to the mask cropping algorithm again by module 6. The sample frame part, that is, the white area of the binary image, is also set to black on the original image, and finally the sample plot area is accurately obtained (see Fig. 9 shown).
[0107] Through the above process, the present invention successfully realizes the automatic processing of the original image and extracts the required sample plot information.
[0108] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. 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, and these 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. An image processing system for automatically extracting samples, characterized in that: Six modules are provided, including module 1, module 2, module 3, module 4, module 5 and module 6, and information is exchanged between the modules. Specifically, module 1 is a resolution processing module for the collected original image, and a bilinear interpolation algorithm is used to reduce the resolution and output the image to module 2; The module 2 is a module for processing the received image using a U-net semantic segmentation network, which is used to segment the sample frame and the background and output them to the module 3; The module three is a module for performing resolution processing on the received image using a bilinear interpolation algorithm, and is used to obtain a picture with the same resolution as the original acquisition after processing and output it to the module four; The module 4 is a module for processing the received image using the edge convex hull mask algorithm, and outputting the mask result to the module 5; The module five is a module for performing mask cropping processing on the received image, outputting the area within the sample frame and the sample frame, and cropping out a preliminary sample square; The module six is a module for performing masking and operations on the received image, outputting the internal area of the sample frame, and cutting out the final sample square. The binary image generated by module three is used as the sample frame mask, and the image obtained by module five is subjected to the mask cutting algorithm again through module six, and the sample frame part is also set to black, and finally the sample square area is accurately obtained; wherein, the edge convex hull mask algorithm described in module four is to first find the outer contour of the input image, then calculate the convex hull of the contour, and draw this convex hull on the mask image to find the minimum circumscribed polygon of the sample frame as the mask image; the specific steps are: 1) Read the image: First, traverse all image files in the input folder, read binary images, and use the cv2.imread function to read binary images; 2) Find contours: Use Open CV's cv2.findContours function to find the outer contour of the image; Use cv2.findContours function to find the outer contour of the image and get the contour list contours; 3) Calculate the convex hull: For all the contours found, use the cv2.convexHull function to calculate their convex hull; The convex hull is the smallest convex polygon that contains all the points in the contour. All contours are merged, and then the convex hull of all the endpoints of the contour is calculated using the cv2.convexHull function. 4) Create a blank mask image: Create a blank mask image of the same size as the original image, and use the np.zeros_like function to create a blank mask image of the same size as the original image; 5) Draw the convex hull: Use the cv2.draw Contours function to draw the convex hull on the mask image; 6) Save the mask image: Save the generated mask image to the output folder using the cv2.imwrite function.
2. The image processing system for automatically extracting samples according to claim 1, characterized in that: The bilinear interpolation algorithm increases or decreases the image resolution by interpolating on a two-dimensional grid and estimating the values between the four nearest known points based on the values of these points. The specific steps are: 1) Determine the target point location: According to the floating point coordinates of the target point, the position of the target point in the grid is determined, usually by rounding down or rounding off; 2) Determine the four nearest known points: According to the position of the target point, find the coordinates of the four known points around the target point; 3) Calculate the interpolation in the horizontal direction: 4) Calculate the interpolation in the vertical direction: 5) Return the interpolation result: The interpolated result is returned as an estimate of the value at the target point.
3. The image processing system for automatically extracting samples according to claim 2, characterized in that: Step 3) The specific method of calculating the interpolation in the horizontal direction includes: ①Use the linear interpolation formula to interpolate between the two known points on the left and right of the target point; ② Calculate two temporary values in the horizontal direction; Step 4) The specific method of calculating the interpolation in the vertical direction includes: ①Use the linear interpolation formula to interpolate between the two known points on the left and right of the target point; ②Calculate two temporary values in the horizontal direction.
4. The image processing system for automatically extracting samples according to claim 1, characterized in that: The specific steps in performing mask clipping are to first traverse the pixels, and then set the pixels to black ([0,0,0]) when they are not in the mask area; including: 1) Read the image: First, read the background as 0, and make the image size to be cropped the same as the set mask image; 2) Traverse the pixels: Traverse each pixel of the mask image and check whether its value is the mask area; This is specifically achieved through the np.where function in the numpy library. When np.where mask == mask area value, the row and column indices of the pixels in the mask image whose values are the mask area values are returned. 3) Processing pixels: According to the pixel position of the mask area, the pixel value of the corresponding position in the original image is set to black ([0,0,0]); 4) Return result: Return the processed image as result.
5. The image processing system for automatically extracting samples according to claim 1, characterized in that: The specific steps of using U-net semantic segmentation network are: 1) Build the encoder and decoder: Create a U-net model where the encoder part is responsible for extracting features from the input image and the decoder part maps the extracted features back to the resolution of the original input image; 2) Add skip connections: At each stage of the decoder, the feature map of the corresponding stage of the encoder is concatenated with the input of the decoder to preserve more spatial information; 3) Define the loss function and optimizer: Use the binary cross entropy loss function nn.BCE With Logits Loss to calculate the loss between the prediction results and the labels; The optimizer selects the RMSprop algorithm, instantiated through optim.RMSprop; 4) Training the network: Use labeled image data to train the U-net network, iterate the training set once per epoch, and update the network parameters to minimize the loss; 5) Save the best model: During the training process, monitor the loss value, and if a model with lower loss is found, save the model parameters; 6) Prediction stage: The above five steps are the pre-training stage. After the final model parameters are determined, the saved model parameters are imported, and the original resolution image is input for end-to-end output and segmentation to obtain the results.
6. An image processing method for automatically extracting sample plots, characterized in that: Using the image processing system described in any one of claims 1 to 5, the specific steps are: (1) Reduce resolution operation The bilinear interpolation algorithm is used to process the original image to be processed, and the output resolution is 512x512 RGB color image; (2) Pixel-level segmentation The image output from step (1) is segmented at the pixel level using a trained U-net semantic segmentation network, and a binary image of the segmented sample frame and background is output at a set pixel value. (3)Restoring resolution The image outputted in step (2) is adjusted to the resolution in step (1) by a bilinear interpolation algorithm to output a binary image; (4) Generate preliminary sample mask For the image outputted in step (3), a sample square with accurate sample square position and size information including the sample frame is obtained, and the sample square is saved and outputted in the form of a mask; (5) Preliminary sample cutting The mask outputted in step (4) is cropped using a mask cropping algorithm, and the area inside and outside the sample frame is outputted to complete preliminary image processing. The image includes two parts: the sample frame and the sample quadrat. (6) Final sample cutting The grayscale image of the sample frame output in step (3) is used as a mask, and the mask cropping algorithm is used to crop the preliminary cropping result output in step (5), and the area within the sample frame is output to complete the final image processing. The image only contains the sample quadrat part.
Citation Information
Patent Citations
Fungus fluorescence detection method
CN112634257A
Quadrat grassland coverage calculation method and system
CN112651987A