Large size image preprocessing method and system

By combining the differential method and neural networks, the problems of filtering out invalid information and low target recognition accuracy in large-size image processing are solved. This method achieves efficient image reduction and segmentation under limited hardware resources, improves recognition accuracy, and simplifies computational complexity.

CN115375892BActive Publication Date: 2025-12-16NANJING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211144905.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-20
Publication Date
2025-12-16
Estimated Expiration
2042-09-20

AI Technical Summary

Technical Problem

Existing technologies struggle to effectively process large images, especially satellite and remote sensing images, resulting in low target recognition accuracy and computational complexity, making effective processing impossible with limited hardware resources.

Method used

An energy map is formed by calculating the gradient values ​​of the image using the finite difference method. Energy lines below a threshold are deleted. Combined with neural network training for correction, cropping and segmentation techniques are used to protect key areas, thereby achieving the reduction and segmentation of large-size images.

Benefits of technology

It effectively filters out invalid information, protects key areas, reduces image size, supports large-size image recognition under limited hardware resources, improves recognition accuracy, and simplifies computation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115375892B_ABST
    Figure CN115375892B_ABST
Patent Text Reader

Abstract

The application discloses a large-size image preprocessing method, which comprises a filtering module, a segmentation module and a region protection module.The filtering module is used for filtering repeated and invalid information; the segmentation module is used for providing a splicable segmentation method to effectively segment an image; and the region protection module is used for processing a region containing important targets to reserve important information.The application provides a feasible scheme for large-size image preprocessing, which can filter repeated and invalid information, maximally reserve object information, improve cutting efficiency, avoid wasting hardware resources, implement region protection on important information, and avoid losing important information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of image processing, and in particular to a large-size image preprocessing method. BACKGROUND

[0002] With the rapid development of technology, image preprocessing technology has developed rapidly, and more and more modules with image processing function have appeared. When image processing is performed through these modules, the most important application is to filter out, cut and retain important information of the content and background of the image. In the existing technology, in the process of preprocessing the image, in order to meet the limited hardware resources, in order to improve the recognition accuracy, the image needs to be preprocessed.

[0003] The main purpose of preprocessing is to eliminate irrelevant information in the image, restore useful real information, enhance the detectability of relevant information, and maximize data simplification, thereby improving the reliability of feature extraction, image segmentation, matching and recognition. Image segmentation is a technology and process of dividing an image into several specific regions with unique properties and extracting target of interest. It is a key step from image processing to image analysis. When deploying a neural network on hardware to process and recognize targets, it is limited by hardware resources, specifically by the size of the input image and the number of channels. Traditional target recognition methods are mostly used for small-size image processing and are not suitable for large-size image processing and target recognition. For example, satellite and remote sensing images are large in size and small in target, which makes it difficult to process and detect targets in practice. Therefore, it is necessary to perform operations such as image reduction, segmentation, and local area recognition to improve recognition accuracy. At the same time, some methods use curves to filter, reduce and segment, which requires a large amount of calculation and a complex process, and is prone to problems during splicing, resulting in loss of small targets. More importantly, it cannot be reversed.

[0004] Therefore, there is an urgent need for a new image preprocessing method. SUMMARY

[0005] The present application provides a large-size image preprocessing method to solve the problems of filtering out invalid information, reducing the size of the input image, and supporting large-size image recognition under limited hardware resources.

[0006] Technical scheme: The large-size image preprocessing method comprises the following steps:

[0007] Step S1, reading an image to be processed, calculating gradient values of each pixel on the image by difference method, forming an image gradient map, calculating energy values according to the image gradient map, obtaining an image energy map and pre-storing it;

[0008] Step S2, reading the image energy map, calculating the gradient values of each pixel on the image energy map by difference method, forming an image energy gradient map, calculating the energy values according to the image energy gradient map, obtaining an image energy gradient map and pre-storing it;

[0009] Step S2, reading the image energy map, collecting the energy value of each pixel in each column one by one and composing the energy line of the column,

[0010] calculating the average energy value of each column according to the energy value of all pixels in the column; judging whether the energy value of each column is lower than the threshold value one by one, if yes, deleting the energy line corresponding to the column, and left shifting all column pixel points on the right side of the deleted energy line, so that the image width is reduced by one unit width for each deleted energy line, and a filtered image is obtained;

[0011] Step S3, reading the filtered image, and judging whether the size of the filtered image is greater than the clipping size threshold, if yes,

[0012] according to the clipping size and the specified overlap rate to split; if no, performing a partial zero padding operation on the filtered image.

[0013] According to one aspect of the present application, it further includes step S0, performing a rectification correction on the image

[0014] Step S0a, collecting pre-stored images similar to the image to be processed, constructing an image training set and a test set, calibrating a target object, and marking the area where the target object is located as a key area;

[0015] Step S0b, training a neural network based on the image training set, and testing the neural network using the test set until the accuracy of the neural network reaches the expected value;

[0016] Step S0c, receiving an image to be processed, and using the trained neural network to perform target recognition and rectification correction on the image to be processed, and obtaining a plurality of key areas containing target objects.

[0017] According to one aspect of the present application, the step S2 further includes, after obtaining the column average energy value, judging whether there is a key area, if yes, assigning the highest energy value to each pixel point in the area.

[0018] According to one aspect of the present application, the process of splitting according to the clipping size and the specified overlap rate is:

[0019] Splitting the image by (1-Overlap)*Chip_W and (1-Overlap)*Chip_H, where Overlap is the overlap ratio of adjacent two images, Chip_W and Chip_H are the width and height of the split picture respectively.

[0020] According to one aspect of the present application, when the last row is split, it is judged whether the last row of pictures needs to be spliced according to the remaining height of the last row;

[0021] Calculate H / Chip_H size, if less than 0.5-Overlap, then 1 / (n / Chip_H+Overlap) pictures are spliced from top to bottom, wherein h is the remaining height of the large size picture divided into the last row;

[0022] If the result is greater than 0.5-Overlap, the required size is taken in the opposite direction based on the image boundary.

[0023] According to one aspect of the present application, further comprising the following steps:

[0024] S4, the cropped picture is extracted in gray scale, the first point pixel value is thresholded and de-thresholded, if the matrix results are both 0 after two operations, it means that the pixels are consistent, the background picture is deleted, and according to the pixel threshold x, the pixel value greater than x is normalized to 255, the proportion of the pixel value of 0 is calculated, if it is less than the set screening threshold, the invalid picture is deleted.

[0025] According to one aspect of the present application, step S2 further comprises the following steps:

[0026] After obtaining the energy line of each column, it is calculated whether the energy line passes through the key area; if so, it is calculated whether the number of energy lines passing through the key area exceeds the threshold value, and if so, the energy lines passing through the key area are deleted.

[0027] According to another aspect of the present application, a large size image preprocessing system is provided, comprising:

[0028] At least one processor; and

[0029] The memory is in communication connection with the at least one processor; wherein,

[0030] The memory stores instructions executable by the processor, and the instructions are executed by the processor to implement the large size image preprocessing method of any one of the above embodiments.

[0031] The present application has the following advantages:

[0032] The large size image preprocessing method of the present application can protect the key area where the detection target may exist, effectively filter out the invalid information in the input large size image, and effectively segment the large size image, thereby greatly reducing the input image size and supporting large size image recognition under limited hardware resource conditions. BRIEF DESCRIPTION OF DRAWINGS

[0033] Figure 1 The preprocessing method flowchart.

[0034] Figure 2For the large size image of the original input.

[0035] Figure 3 For the gradient map after reading.

[0036] Figure 4 For the calculated energy map.

[0037] Figure 5 For the labeled map of the filtering module.

[0038] Figure 6 For the filtering mode effect map.

[0039] Figure 7 For the segmentation module effect map.

[0040] Figure 8 For the last row of the segmentation module optimization schematic diagram. DETAILED DESCRIPTION

[0041] The technical principles and technical details of the present application are described in detail below. In order to highlight the improvements of the present application, some prior art is omitted, and those skilled in the art can know the related technical content, and at the same time, combined with the technical content of the present application, the technical problems proposed by the present application can be solved, and the corresponding technical effects can be obtained.

[0042] As shown in Figure 1 , a large size image preprocessing method is provided, comprising:

[0043] Step 1, obtaining a first image from an original image, the first image being an image to be executed for a preprocessing operation, adding a mask to the first image, and parsing the image after adding the mask; constructing a region protection module, inputting the image after adding the mask into the region protection module, adding a region point through the region protection module, and assigning the highest energy value to the region point, and outputting an image with a protected region; the process of constructing the region protection module is as follows:

[0044] The added mask is used to process the mask region, increase the energy value of the mask region, and then input the processed mask region into the region protection module for identifying the important region of the target information.

[0045] Step 2, constructing a filter module, the image input filter module with a protected area, obtaining the energy map of the image corresponding to the filter module, the energy map related parameters include: column energy line and threshold; the process of constructing the filter module is as follows: the column energy line is composed of the energy value of a plurality of pixel points, calculate the energy line of each column of the first image, according to the total energy value of each column of pixel points divided by the number of each column of area points to obtain the average energy value of each column; delete the energy line below the threshold, left shift the image to the right of the energy line below the threshold, record the horizontal coordinate of the deleted column; the threshold is a predetermined multiple of the average energy value.

[0046] Step 3, constructing a cutting module, the energy map input cutting module, cutting the energy map into a plurality of images of a specified size, judging whether the cut energy map has a spare part or an overlapping part, if so,

[0047] The spare part of the cut energy map is zero-filled, and the overlapping part is divided according to the cutting size and the specified overlap rate, whether the last row of the energy map needs to be spliced according to the remaining height overlap rate, and the divided picture is output.

[0048] In step 3, the process of constructing the cutting module is as follows:

[0049] The overlapping part of the plurality of pictures produces an overlapping area, the overlapping area is set with an overlap rate, the overlap rate percentage is determined, the overlap rate parameter is overlap, and the critical value of whether to splice the picture is 0.5-Overlap. If the overlap rate h / Chip_H is less than 0.5-Overlap, the last row of each 1 / (n / Chip_H + Overlap) image is spliced from top to bottom; if the overlap is greater than 0.5-Overlap, the picture does not need to be spliced, and the image of the required size can be obtained;

[0050] Wherein, H is the remaining height of the large size image divided into the last row, Chip_H is the height of the divided image, and Overlap is the overlap rate size of the adjacent two images;

[0051] According to the divided module, the gray scale of the divided image is extracted, the image gray scale greater than the pixel threshold X is normalized to 255, the number of pixel points with a pixel value of 0 is calculated, and if the proportion is less than the threshold set by the image, it means that there is no detection target in the image, and the image is deleted.

[0052] According to another aspect of the present application, the large size image preprocessing system which can filter out invalid information, effectively divide and protect key areas includes a filter module, a division module and a region protection module:

[0053] The filtering module is used to: ①, calculate the energy map of the image, the energy of the image is proportional to the gradient value of the image pixel, the greater the gradient value of the image pixel, the higher the energy value at the point, so the gradient map of the image can be obtained by the difference method, and the energy map is obtained according to the gradient calculation energy value;

[0054] ②, after obtaining the energy map, the energy line of each column is calculated, the column average energy value is calculated according to the energy value of each column, a certain multiple of the column average energy value is set as a threshold value, the energy value of each column is compared with the set threshold value, and the column pixel points below the threshold value are marked;

[0055] ③, deleting the energy line below the threshold energy, and moving all the column pixel points to the right of the deleted energy line to the left, so that the image width is reduced by one unit width for each deleted column energy line, and the reduction of the large-size image is realized;

[0056] The segmentation module is used to: ①, read the input large-size color picture, store the pixel value in the picture in the form of a matrix for subsequent operation;

[0057] ②, compare the size of the input picture with the size of the picture to be cropped, if the set cropping length and width are greater than the length and width of the original image, the picture needs to be zero-padded, that is, the pixel point [0, 0, 0] is used to fill the pixels of the original picture;

[0058] ③, the image is segmented by (1-Overlap)*Chip_W and (1-Overlap)*Chip_H respectively, wherein Overlap is the overlap ratio of adjacent two pictures, Chip_W and Chip_H are the width and height of the segmented picture respectively;

[0059] ④, when the last row is segmented, whether the last row of the picture needs to be spliced is determined according to the remaining height of the last row, that is, the size of H / Chip_H is calculated, if it is less than 0.5-Overlap, then 1 / (n / Chip_H + Overlap) pictures are spliced from top to bottom, wherein h is the remaining height of the large-size picture segmented to the last row, if the result is greater than 0.5-Overlap, the image boundary is taken as the reference, and the required size is taken in the reverse direction;

[0060] ⑤, the cropped picture is extracted to gray, the first pixel value is thresholded and de-thresholded, if the matrix results of the two operations are all 0, it means that the pixels are consistent, the background picture is deleted, and the pixel value greater than x is normalized to 255 according to the pixel threshold x, the proportion of the pixel value of 0 is calculated, and if it is less than the set screening threshold, the invalid picture is deleted;

[0061] ⑥、According to the above steps, the block-based picture segmentation can be realized. By setting the overlapping area, the loss of the target can be avoided, and by setting the threshold for screening the picture based on the pixel consistency and the non-empty pixel information, the output of invalid pictures can be reduced. Since the segmentation method is simple, the original information of the segmented object can be restored, and only the overlapping ratio and the center point coordinates of the segmented picture are needed to achieve the restoration.

[0062] Region protection module: this module is a selectable module. If it is known that there is an important region of the identified target, the coordinates of the important region are obtained, and then a mask layer is added to the coordinates region, that is, the energy value of the region is assigned a high value, and then the column energy line of the region is improved, so as to retain the key region to prevent important information from being deleted.

[0063] In the field of image processing, in order to eliminate irrelevant information in the image and restore useful real information, region protection, filtering and cutting of the image are needed, so the image preprocessing technology is required to be high. For the existing picture, in order to not be limited by hardware resources, the image is displayed under limited resources by means of image preprocessing operation.

[0064] An image to be executed for preprocessing operation is input, and the image to be processed is a first image obtained from an original image. A mask is added to the first image, and the mask is used to raise the region energy value of the image, which is convenient for subsequent image preprocessing.

[0065] In some scenarios, due to the problem of shooting angle, the key region may be deflected and inclined. If it is directly segmented, there will be certain difficulties. For example, if the picture given in embodiment one is rotated by a certain angle due to the problem of shooting, there will be certain difficulties. Therefore, it is necessary to correct the deviation and rotate it. An embodiment is given in the present application, which is as follows.

[0066] In a further embodiment, it further includes step S0, correcting the deviation of the image

[0067] Step S0a, collecting pre-stored images similar to the image to be processed, constructing an image training set and a test set, calibrating a target object, and marking the region where the target object is located as a key region;

[0068] Step S0b, training a neural network based on the image training set, and testing the neural network using the test set until the accuracy of the neural network reaches the expected value;

[0069] Step S0c, receiving the image to be processed, and using the trained neural network to identify the target and correct the deviation of the image to be processed, and obtaining a plurality of key regions containing the target object.

[0070] When this method is adopted, the following step is further included in step S2:

[0071] After obtaining the energy lines of each column, it is determined whether the energy lines pass through the key region; if so, it is determined whether the number of energy lines passing through the key region exceeds a threshold value, and if so, the energy lines passing through the key region are deleted.

[0072] According to the target region, the image is rotated so that the key region can extend in the column direction in the image, so that in the subsequent process of deleting the column vector by the energy line, the non-key region can be better removed and the key region can be reserved. In further embodiments, it is determined whether the energy line can be deleted by calculating whether the energy line passes through the key region and whether the number of energy lines passing through the key region reaches a threshold value, thereby avoiding false deletion of the key region.

[0073] Since the above method corrects the key region to be arranged along the column vector, the actual content may be deflected, that is, the deflection of the key region and the deflection of the actual content may not be on the same center line.

[0074] Even if the above situation occurs, the image can be quickly aligned by a neural network or manual calibration, neural network recognition, thereby avoiding the situation of actual content deflection.

[0075] In other words, in the above embodiments, the key region can be adjusted to a certain direction first, thereby facilitating the deletion of non-key regions, and if the key region and the actual image in the key region are not on the same center line, the actual image can be rotated to a predetermined angle.

[0076] In further preferred embodiments, in terms of region protection, corresponding region protection can be set for specific scenes, such as in large satellite remote sensing images, a convolutional neural network such as faster-rcnn can be used to train and identify specific remote sensing aerial images, thereby determining the type and position of important target information, and the important region energy can be improved to ensure that the important target can be retained in the filtering module, so as to prevent important targets from being lost in the filtering of invalid information. By such operation, even smaller important targets can be prevented from being lost in the filtering mode.

[0077] For example, the four vertex coordinate information of the important target can be obtained by the recognition of the convolutional neural network, and according to the target information coordinates and using the CV library of python, it can be determined whether the important target is tilted and the tilt angle is calculated, and according to the four vertex coordinates of the image and the tilt angle, the image target is corrected by affine transformation. After the tilted picture is corrected and then passes through the filtering module, the effect will be greatly improved, and at the same time, part of the information of the important target can be avoided to be filtered out.

[0078] Example 1

[0079] like Figure 2 As shown, the large-size ground image input to the system, taken by a satellite and selected from the DIOR dataset, has an original size of 1183*947 pixels, exceeding the image processing range supported by the hardware. For example, a mask is first added to the large-size ground image to increase the regional energy value, and then a region protection module is applied to the specified region. This assigns the highest energy value to the region, ensuring that the energy lines in that column are not deleted during filtering by the filtering module, thus preventing the loss of important targets.

[0080] like Figure 3 As shown, the large-size ground image is read from the input in the filtering mode. Figure 2 The large-size original input image is used to store the pixel values ​​in the image in matrix form, and the image gradient map is obtained through the difference method.

[0081] like Figure 4 As shown, in Figure 3 After obtaining the image gradient map, the energy value is then calculated based on the gradient. Figure 1 Energy map of medium to large-sized original input image. The energy value of the image is proportional to the gradient value of the image pixels. The larger the gradient value of the image pixels, the higher the energy value at that point. The gradient map of the image is obtained by calculating the gradient, and then the energy value is calculated by calculating the gradient to obtain the energy map.

[0082] like Figure 5 As shown, based on the calculated energy map, the energy line of each column is calculated, and the average energy value of each column is calculated. A certain multiple of this average energy value is set as a threshold. The energy value of each column is compared with the set threshold, and the column pixels below the threshold are marked. Figure 1 The column energy values ​​in the satellite image are compared with the set threshold. Energy lines with energy values ​​below the threshold are deleted. All column pixels to the right of the deleted energy line are shifted to the left. When each column energy line is deleted, the image width is reduced by one unit width, thus achieving the reduction of large-size images.

[0083] Figure 6 The image shown is the one after the filtering mode has been removed. Figure 5 In the processing steps described above, the energy values ​​of satellite image columns are calculated and compared with a set threshold. Columns with energy values ​​lower than the specified threshold are deleted, and the image to the right of the deleted energy line is shifted to the left to obtain a new image. After the filtering mode, the size of the large image is reduced to 835*947. Thus, through this filtering operation, redundant data is reduced and the image size is reduced to meet the hardware input requirements.

[0084] The pixel value in the image is stored in a matrix form, facilitating subsequent cutting module for cutting operation; the input large size image is compared with the size of the image to be cut, if the set cutting size is greater than the original image size, zero padding is needed, i.e. pixel filling is performed on the original image with pixel [0, 0, 0]; if the set cutting size is smaller than the original image size, zero padding is not needed, i.e. pixel filling is not needed on the original image; the cutting image is segmented according to (1-Overlap)*Chip_W and (1-Overlap)*Chip_H respectively.

[0085] wherein Overlap is the overlap ratio of adjacent two images, Chip_W is the width of the segmented image, and Chip_H is the height of the segmented image.

[0086] When the segmentation reaches the last row, whether the last row image needs to be spliced is determined according to the remaining height of the last row, i.e. the size of H / Chip_H is calculated, if it is less than 0.5-Overlap, then 1 / (n / Chip_H + Overlap) images are spliced from top to bottom, wherein h is the remaining height of the large size image segmented to the last row, if the result is greater than 0.5-Overlap, then the required size is taken in the reverse direction based on the image boundary.

[0087] The cut image is subjected to gray extraction, thresholding and inverse thresholding operation with the first point pixel value, if the matrix results of the two operations are both 0, it means that the pixels are consistent, the background image is deleted, and then according to the pixel threshold x, the pixel value greater than x is normalized to 255, the proportion of the pixel value of 0 is calculated, if it is less than the set screening threshold, the invalid image is deleted; the above process is used to realize block-based image segmentation, the loss of the target is avoided by setting the overlap area, the threshold of the screening image is set based on the pixel consistency and non-empty pixel information to reduce the output of invalid images, and then the original information of the segmented object is restored according to the overlap ratio and the center point coordinates of the segmented image.

[0088] Figure 7 is the large size image after segmentation, and Figure 6 The large size image after filtering is cut into four small size images with the size of 512*512 and the overlap degree of 20%, so as to reduce the size of the input image.

[0089] Figure 8is the principle of optimization whether the last row of the segmented image is spliced, when the last row of the large size image is segmented, the remaining height H of the last row of the segmented image is calculated, by comparing the relationship of h / Chip_H and 0.5-Overlap, it is determined whether the last row of the segmented image is spliced, if the overlap rate h / Chip_H is less than 0.5-Overlap, the splicing is performed; if the overlap is greater than 0.5-Overlap, the required size is taken in the reverse direction based on the image boundary. Thus, the working efficiency of the segmentation module is improved, and the redundant calculation is reduced.

[0090] In summary, as Figure 1 shown, the present application mainly describes the flowchart of the image preprocessing method, the method mainly realizes the processing and optimization of the large size image through the construction of the filtering module, the segmentation module and the region protection module. The region protection module mainly assigns a high energy value to the specified region, so as to ensure that the column energy line is not deleted in the filtering mode, so as to prevent the loss of important targets; the filtering module calculates the column energy value of the image through the image energy graph, and then sets a multiple of the column energy line value as the threshold value according to the specific use scene, deletes the column lower than the threshold value, and moves the image to the left of the deleted column energy line, so as to reduce the invalid information, and finally deletes the image size; the segmentation module mainly cuts and segments the large size image after the filtering mode, avoids the boundary cutting problem by setting a certain proportion of the overlapping area during segmentation, and judges whether splicing is needed by the ratio of the remaining height H to the segmentation size when the last row is segmented, so as to improve the segmentation efficiency.

[0091] If the curve method is used, the calculation amount will be greatly increased by comparing the maximum value to perform image segmentation, and the system resource consumption exceeds the acceptable range of some users. For example, for a 10000*10000 image, the calculation amount is much larger than that of the present application by searching for the minimum energy curve. The scheme of the present application only needs to calculate the energy of 10000 columns, then take the average value, calculate the threshold value according to the average value, and then compare each column energy value with the threshold value. Moreover, through the method of the present application, the coordinate value of the cutting can be obtained, so that the cut part can be restored. Through the curve method, the restoration cannot be realized. In addition, in some scenes, the cutting method by the curve method is easy to cause the loss of small targets.

Claims

1. A method for preprocessing large-size images, characterized in that, Includes the following steps: Step S1: Read the image to be processed, calculate the gradient value of each pixel in the image using the finite difference method, and form the image gradient. The energy map is obtained by calculating the energy value based on the image gradient map and pre-storing it. Step S2: Read the image energy map, collect the energy value of each pixel in each column, and form the energy line for that column. Calculate the average energy value of each column based on the energy values ​​of all pixels in that column; check whether the average energy value of each column is lower than the threshold. If it is, delete the corresponding energy line of that column and shift all the pixels to the right of the deleted energy line to the left, so that the image width is reduced by one unit width for each energy line deleted, thus obtaining the filtered image. Step S3: Read the filtered image and determine whether the size of the filtered image is larger than the cropping size threshold. If the size is smaller than the specified overlap ratio, the filtered image is partially padded with zeros. The process of segmenting according to the cropping size and the specified overlap rate is as follows: The image is segmented using (1-Overlap)*Chip_W and (1-Overlap)*Chip_H, where Overlap is the overlap ratio between two adjacent images, and Chip_W and Chip_H are the width and height of the segmented image, respectively.

2. The large-size image preprocessing method according to claim 1, characterized in that, Step S2 further includes determining whether there is a key area after obtaining the column average energy value. If there is, assigning the highest energy value to each pixel in that area.

3. The large-size image preprocessing method according to claim 1, characterized in that, When segmenting to the last row, determine whether the images in the last row need to be stitched together based on the remaining height of the last row; Calculate the size H / Chip_H. If it is less than 0.5-Overlap, then stitch 1 / (H / Chip_H+Overlap) images together from top to bottom, where H is the remaining height of the large image after being divided to the last row. If the result is greater than 0.5-Overlap, then take the required size in the opposite direction, using the image boundary as a reference.

4. The large-size image preprocessing method according to claim 3, characterized in that, It also includes the following steps: S4. Extract grayscale from the cropped image. Perform thresholding and dethresholding operations on the first pixel value. If the matrix result is 0 after both operations, it means the pixels are consistent. Delete the pixels with a matrix result of 0. Then, based on the pixel threshold x, normalize the pixel values ​​greater than x to 255 and calculate the proportion of pixels with a value of 0. If it is less than the set filtering threshold, delete the cropped image.

5. A method for preprocessing large-size images, characterized in that, include: Step 1: Read the first image from the original image. The first image is the image to be preprocessed. Add a mask to the first image and parse the image after adding the mask. A region protection module is constructed. The image after adding the mask is input into the region protection module. Region points are added through the region protection module, and the highest energy value is assigned to the region points. The image with the protected region is then output. Step 2: Construct a filtering module. The image with the protected region is input into the filtering module to obtain the energy map of the image corresponding to the filtering module. The relevant parameters of the energy map include: column energy lines and threshold. Step 3: Construct a cutting module. The energy map is input into the cutting module, which cuts the energy map into several images of a specified size. It determines whether there are empty or overlapping parts in the cut energy map. If so, the empty parts of the cut energy map are padded with zeros. The overlapping parts are divided according to the cropping size and the specified overlap rate. It is determined whether the images need to be stitched together based on the remaining height overlap rate of the last row of the energy map. The segmented images are then output. Step 2 further comprises: the column energy line is composed of the energy values ​​of several pixels; calculate the energy value of each column energy line of the first image; divide the sum of the energy values ​​of the pixels in each column by the number of points in each column to obtain the average energy value of each column; delete energy lines with an average energy value lower than the threshold; shift the image to the right of the energy line with an average energy value lower than the threshold to the left; and record the horizontal coordinate of the deleted column; the threshold is a predetermined multiple of the average energy value. Step 3 further comprises: generating overlapping regions from the overlapping portions of the plurality of images, setting an overlap rate for the overlapping regions, determining the overlap rate percentage, the overlap rate parameter being overlap, and the threshold value for whether to stitch the images being stitched being 0.5-Overlap. If the overlap rate H / Chip_H is less than 0.5-Overlap, then every 1 / (H / Chip_H + Overlap) images in the last row of the image are stitched from top to bottom; if the overlap is greater than 0.5-Overlap, no stitching is required, and an image of the required size can be obtained; where H is the remaining height of the large image segmented to the last row, Chip_H is the height of the segmented image, and Overlap is the overlap rate between two adjacent images.

6. The large-size image preprocessing method according to claim 5, characterized in that, The segmentation module further includes: extracting image grayscale from the segmented image obtained by the segmentation module, normalizing the image grayscale values ​​greater than a pixel threshold X to 255, calculating the number of pixels with a pixel value of 0, and deleting the image if the proportion is less than the threshold set by the image.

7. A large-size image preprocessing system, characterized in that, include: At least one processor; as well as, A memory communicatively connected to at least one of the processors; wherein, The memory stores instructions that can be executed by the processor to implement the large image preprocessing method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Image scaling method based on content awareness

    CN105488758A

  • Offshore culture area image splicing method based on non-uniform precision

    CN113160052A