CN115375892A - Large-size image preprocessing method and system - Google Patents

Large-size image preprocessing method and system Download PDF

Info

Publication number
CN115375892A
CN115375892A CN202211144905.7A CN202211144905A CN115375892A CN 115375892 A CN115375892 A CN 115375892A CN 202211144905 A CN202211144905 A CN 202211144905A CN 115375892 A CN115375892 A CN 115375892A
Authority
CN
China
Prior art keywords
image
energy
size
value
overlapping
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211144905.7A
Other languages
Chinese (zh)
Inventor
李丽
何旻昊
傅玉祥
蒋林
何书专
李伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University
Original Assignee
Nanjing University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nanjing University filed Critical Nanjing University
Priority to CN202211144905.7A priority Critical patent/CN115375892A/en
Publication of CN115375892A publication Critical patent/CN115375892A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/26Segmentation of patterns in the image field; Cutting or merging of image elements to establish the pattern region, e.g. clustering-based techniques; Detection of occlusion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/77Processing image or video features in feature spaces; using data integration or data reduction, e.g. principal component analysis [PCA] or independent component analysis [ICA] or self-organising maps [SOM]; Blind source separation
    • G06V10/774Generating sets of training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/82Arrangements for image or video recognition or understanding using pattern recognition or machine learning using neural networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Evolutionary Computation (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Databases & Information Systems (AREA)
  • Medical Informatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Computational Linguistics (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Biomedical Technology (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses a large-size image preprocessing method, which comprises the steps of constructing a filtering module and filtering repeated and invalid information; constructing a segmentation module, and providing a splicing segmentation method to effectively segment the image; and constructing an area protection module, and processing the area retaining important information containing the important target. The invention provides a feasible scheme for preprocessing the large-size image which can filter invalid information, effectively segment and protect key areas, can filter repeated and invalid information, furthest retains object information, improves cutting efficiency, avoids waste of hardware resources, protects the key areas and avoids loss of important information.

Description

Large-size image preprocessing method and system
Technical Field
The invention relates to the field of image processing, in particular to a large-size image preprocessing method.
Background
With the rapid development of the technology, the image preprocessing technology is rapidly developed, more and more modules with image processing functions are generated, and when the modules are used for image processing, the most important application is to filter, cut and retain important information on the content and background of an image. In the prior art, in the process of preprocessing an image, because the size of the image needs to meet limited hardware resources, the image needs to be preprocessed to improve the recognition accuracy in order to solve the problem of the recognition efficiency of the image.
The main purposes of preprocessing are to eliminate irrelevant information from the image, recover useful real information, enhance the detectability of relevant information, and simplify the data to the maximum extent, thereby improving the reliability of feature extraction, image segmentation, matching, and recognition. Image segmentation is a technique and process that divides an image into several specific regions with unique properties and proposes an object of interest. It is a key step from image processing to image analysis. When a neural network is deployed on hardware to realize the processing and target recognition of pictures, the hardware resources have to be limited, specifically, the size of an input image and the number of channels are limited. The traditional target identification method is mostly used for processing small-size images and is not suitable for processing large-size images and identifying targets. For example, large-size pictures such as satellites and remote sensing images have large sizes and small targets, and are difficult to process and detect in practice, so that the pictures need to be reduced, divided, and locally identified, so as to improve the identification accuracy. Meanwhile, part of methods adopt curves to carry out filtering, reduction and segmentation, the calculated amount is large, the process is complex, problems are easy to occur during splicing, small targets are lost, and more importantly, reverse reduction cannot be carried out.
Therefore, a new image preprocessing method is needed.
Disclosure of Invention
The purpose of the invention is as follows: the embodiment of the invention provides a large-size image preprocessing method, which aims to solve the problems of filtering invalid information, reducing the size of an input image and supporting large-size image recognition under the condition of limited hardware resources.
The technical scheme is as follows: the large-size image preprocessing method comprises the following steps:
s1, reading an image to be processed, calculating gradient values of all pixels on the image by a difference method, and forming an image gradient
The degree map is used for calculating an energy value according to the image gradient map, and obtaining and pre-storing an image energy map;
s2, reading the image energy chart, acquiring the energy value of each pixel of each row one by one and forming an energy line of the row,
calculating the average energy value of each column according to the energy values of all pixels of the column; judging whether the energy value of each row is lower than a threshold value one by one, if so, deleting the energy line corresponding to the row, and moving all row pixel points on the right side of the deleted energy line to the left, so that the image width is reduced by one unit width after each row of energy line is deleted, and obtaining a filtered image;
s3, reading the filtered image, and judging whether the size of the filtered image is larger than a cutting size threshold value, if so, judging whether the size of the filtered image is larger than the cutting size threshold value
Then, dividing according to the cutting size and the specified overlapping rate; if the number of the pixels is smaller than the preset value, carrying out partial zero filling operation on the filtered image.
According to one aspect of the application, the method further comprises the step S0 of correcting the image in a deviation correcting way
S0a, collecting pre-stored images similar to the images to be processed, constructing an image training set and a test set, calibrating a target object, and defining the area where the target object is located as a key area;
s0b, training the neural network based on the image training set, and testing the neural network by adopting a test set until the accuracy of the neural network reaches an expected value;
and S0c, receiving the image to be processed, and performing target identification and deviation correction on the image to be processed by adopting the trained neural network to obtain a plurality of groups of key areas containing target objects.
According to an aspect of the present application, the step S2 further includes determining whether there is a key area after obtaining the column average energy value, and if there is a key area, assigning each pixel point in the key area to the highest energy value.
According to one aspect of the present application, the process of segmenting according to the cropping size and the specified overlap ratio is as follows:
and (1-overlay) Chip _ W and (1-overlay) Chip _ H are used for segmenting the image, wherein the overlay is the overlapping proportion of two adjacent images, and the Chip _ W and the Chip _ H are respectively the width and the height of the segmented image.
According to one aspect of the application, when the last line is segmented, judging whether the last line of pictures needs to be spliced or not according to the remaining height of the last line;
calculating the size of H/Chip _ H, and splicing 1/(n/Chip _ H + overlay) pictures from top to bottom if the size of H/Chip _ H is less than 0.5-overlay, wherein H is the residual height of the large-size picture from the last line;
if the result is more than 0.5-Overlap, the required size is taken in the reverse direction by taking the image boundary as a reference.
According to one aspect of the application, the method further comprises the following steps:
and S4, performing gray level extraction on the cut picture, performing thresholding and anti-thresholding operations on a first point pixel value, if the matrix result is 0 after the two operations, indicating that the pixels are consistent, deleting the background image, normalizing the pixel value greater than x to 255 according to a pixel threshold value x, calculating the proportion that the pixel value is 0, and if the pixel value is less than a set screening threshold value, deleting the invalid picture.
According to an aspect of the present application, the step S2 further includes the following steps:
after obtaining the energy lines of each row, calculating whether the energy lines pass through the key area; and if so, calculating whether the quantity of the energy lines passing through the key area exceeds a threshold value, and if so, deleting the energy lines passing through the key area.
According to another aspect of the present application, there is provided a large-size image preprocessing system including:
at least one processor; and
a memory communicatively coupled to at least one of the processors; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the processor for execution by the processor to implement a large-scale image pre-processing method as in any one of the embodiments above.
The invention has the beneficial effects that:
the large-size image preprocessing method can protect key areas possibly having detection targets, effectively filter invalid information in the input large-size image and effectively segment the large-size image, thereby greatly reducing the size of the input image and supporting large-size image recognition under the condition of limited hardware resources.
Drawings
FIG. 1 is a flow chart of the pretreatment method.
Fig. 2 is a large-sized image of an original input.
FIG. 3 is a graph of the gradient after reading.
Fig. 4 is a graph of calculated energy.
Fig. 5 is a labeled diagram of a filtering module.
Fig. 6 is a diagram illustrating filtering mode effects.
FIG. 7 is a diagram of the effect of the segmentation module.
Fig. 8 is a schematic diagram of the last row optimization of the partitioning module.
Detailed Description
Technical principles and technical details of the present application are described in detail below. In order to highlight the improvement point of the present application, some prior arts are abbreviated, and those skilled in the art can know the related technical contents, and meanwhile, in combination with the technical contents of the present application, the technical problems proposed by the present application can be solved, and the corresponding technical effects can be obtained.
As shown in fig. 1, there is provided a large-size image preprocessing method, including:
step 1, acquiring a first image from an original image, adding a mask to the first image, and analyzing the image added with the mask, wherein the first image is an image to be subjected to preprocessing operation; constructing a region protection module, inputting the image added with the mask into the region protection module, adding region points through the region protection module, assigning the highest energy value to the region points, and outputting an image with a protection region; the process of building the zone protection module is as follows:
the added mask is used for processing the mask area, the energy value of the mask area is increased, and then the processed mask area is input into an area protection module to be used for identifying the important area of the target information.
Step 2, constructing a filtering module, inputting the image with the protection area into the filtering module, and obtaining an energy map of the image corresponding to the filtering module, wherein the energy map related parameters comprise: column energy lines and thresholds; the process of constructing the filtering module is as follows: the row energy lines are composed of energy values of a plurality of pixel points, each row of energy lines of the first image is calculated, and the average energy value of each row is obtained by dividing the sum of the energy values of the pixel points composed of each row by the number of the regional points of each row; deleting the energy lines lower than the threshold, moving the image on the right side of the energy lines lower than the threshold to the left, and recording the abscissa of a deletion column; the threshold is a predetermined multiple of the average energy value.
Step 3, constructing a cutting module, inputting the energy diagram into the cutting module, cutting the energy diagram into a plurality of images with specified sizes, judging whether the cut energy diagram has a vacant part or an overlapped part, if so,
and carrying out zero filling operation on the cut vacant part of the energy diagram, dividing the overlapped part according to the cutting size and the specified overlapping rate, judging whether the pictures need to be spliced according to the residual height overlapping rate of the last line of the energy diagram, and outputting the divided pictures.
Wherein the process of constructing the cutting module in step 3 is as follows:
overlapping parts of the pictures generate overlapping areas, overlapping rates are set for the overlapping areas, the percentage of the overlapping rates is determined, the parameter of the overlapping rates is Overlap, whether the critical value of the pictures to be spliced is 0.5-Overlap or not is judged, and if the overlapping rate H/Chip _ H is smaller than 0.5-Overlap, every 1/(n/Chip _ H + Overlap) image in the last line of the images is spliced from top to bottom; overlapping is larger than 0.5-Overlap, and the images with the required size can be obtained without splicing the images;
h is the residual height of the large-size image after being segmented to the last line, chip _ H is the height of the segmented image, and overlay is the overlapping rate of two adjacent images;
and extracting the gray level of the image after segmentation according to a segmentation module, wherein the gray level of the image is larger than the normalization of a pixel threshold value X to be 255, calculating the number of pixel points with a pixel value of 0, and if the proportion of the number of the pixel points is smaller than the threshold value set by the image, indicating that no detection target exists in the image, and deleting the image.
According to another aspect of the present application, a large-size image preprocessing system capable of filtering invalid information, effectively segmenting, and protecting key regions includes a filtering module, a segmentation module, and a region protection module:
a filtering module for: (1) calculating an energy map of the image, wherein the energy of the image is in direct proportion to the gradient value of the image pixel, and the larger the gradient value of the image pixel is, the higher the energy value at the point is, so that the gradient map of the image can be obtained by solving a difference method, and then the energy value is calculated according to the gradient to obtain the energy map;
(2) after the energy graph is obtained, calculating the energy line of each row, calculating the average energy value of each row according to the energy value of each row, setting a certain multiple of the average energy value as a threshold value, comparing the energy value of each row with the set threshold value, and marking row pixel points lower than the threshold value;
(3) deleting energy lines with energy lower than the threshold value energy, and shifting all rows of pixel points on the right side of the deleted energy lines to the left, so that the image width is reduced by one unit width after each row of energy lines is deleted, and the reduction of a large-size image is realized;
a segmentation module to: (1) reading in the input large-size color picture, and storing pixel values in the picture in a matrix form so as to facilitate subsequent operation;
(2) comparing the length and width of the input picture with the length and width of the picture to be cut, if the length and width of the cut is set to be larger than the length and width of the original image, zero padding is needed to be carried out on the picture, namely pixel points [0,0,0] are used for carrying out pixel padding on the original picture;
(3) dividing the image by (1-overlay) Chip _ W and (1-overlay) Chip _ H respectively, wherein the overlay is the overlapping proportion of two adjacent images, and the Chip _ W and the Chip _ H are the width and the height of the divided images respectively;
(4) when the last row is segmented, determining whether the last row of pictures need to be spliced or not according to the remaining height of the last row, namely calculating the size of H/Chip _ H, if the size of H/Chip _ H is smaller than 0.5-overlay, splicing 1/(n/Chip _ H + overlay) pictures from top to bottom, wherein H is the remaining height of the large-size picture segmented to the last row, and if the result is larger than 0.5-overlay, taking the image boundary as a reference and taking the required size in the reverse direction;
(5) performing gray extraction on the cut picture, performing thresholding and anti-thresholding operations on a first point pixel value, if the matrix result is 0 after the two operations, indicating that the pixels are consistent, deleting the background picture, normalizing the pixel value greater than x to 255 according to a pixel threshold value x, calculating the proportion that the pixel value is 0, and if the pixel value is less than a set screening threshold value, deleting the invalid picture;
(6) and according to the steps, the image segmentation based on the block can be realized. The target loss is avoided by setting the overlapping area, and meanwhile, the output of invalid pictures is reduced by setting the threshold value of the screening pictures based on the consistency of pixel points and the non-null setting of pixel information. The segmentation method is simple, so that the original information of the segmented object can be restored only according to the overlapping proportion and the central point coordinate of the segmented picture.
A region protection module: the module is a selectable module, if an important area of an identification target possibly exists, the coordinate of the important area is obtained, a layer of mask is added to the coordinate area, namely, the energy value of the area is assigned with a high value, and then the row energy lines of the area are promoted, so that the important area is reserved, and important information is prevented from being deleted.
In the field of image processing, in order to eliminate irrelevant information in an image and recover useful real information, region protection, filtering and cutting are required to be performed on the image, so that the requirement on an image preprocessing technology is high. For the existing pictures, in order not to be limited by hardware resources, the display of the image under the limited resources is realized by means of image preprocessing operation.
The image to be subjected to preprocessing operation is input, the image to be subjected to preprocessing operation is a first image obtained from an original image, a mask is added to the first image, and the mask is used for increasing the regional energy value of the image, so that the subsequent image preprocessing is facilitated.
In some scenes, the focal area may be deflected and inclined due to the problem of the shooting angle of the picture. There is a certain difficulty if it is directly divided. For example, if the picture given in the first embodiment is rotated by a certain angle due to the shooting problem, there is a certain difficulty. It needs to be rectified and rotated. The present application presents an embodiment, as follows.
In a further embodiment, the method further comprises a step S0 of correcting the image in a deviation manner
S0a, collecting pre-stored images similar to the images to be processed, constructing an image training set and a test set, calibrating a target object, and defining the area where the target object is located as a key area;
s0b, training the neural network based on the image training set, and testing the neural network by adopting a test set until the accuracy of the neural network reaches an expected value;
and S0c, receiving the image to be processed, and performing target identification and deviation correction on the image to be processed by adopting the trained neural network to obtain a plurality of groups of key areas containing target objects.
When this method is adopted, the step S2 further includes the steps of:
after obtaining the energy lines of each column, calculating whether the energy lines pass through a key area; and if so, calculating whether the quantity of the energy lines passing through the key area exceeds a threshold value, and if so, deleting the energy lines passing through the key area.
According to the target area, the image is rotated, so that the key area can extend in the column direction in the image, and therefore in the subsequent process of deleting the column vectors in an energy line mode, the non-key area can be better removed, and the key area is reserved. In a further embodiment, whether the energy lines can be deleted is judged by calculating whether the energy lines pass through the key areas and whether the number of the energy lines passing through the key areas reaches a threshold value, so that the key areas are prevented from being deleted mistakenly.
Because the method corrects the emphasized region to be arranged along the direction of the column vector, the actual content may be deflected, that is, the deflection of the emphasized region and the deflection of the actual content may not be on a central line.
Even if the above situation occurs, the images can be quickly aligned through a neural network or a mode of artificial calibration and neural network identification. Thereby avoiding the situation of oblique deflection of the actual content.
In other words, in the above embodiment, the key area may be adjusted to a certain direction, so as to facilitate deleting the non-key area, and if the key area and the actual image in the key area are not located on the same center line, the actual image may be rotated to a predetermined angle.
In a further preferred embodiment, in terms of area protection, corresponding area protection can be set for a specific scene, for example, in a large satellite remote sensing image aerial image, a convolutional neural network such as fast-rcnn can be used to train and identify the specific remote sensing aerial image scene, so as to determine the type and position of important target information, and the energy of an important area is boosted to ensure that the important target can be retained when a filtering module is used to filter out invalid information, so as to prevent the important target from being lost when the invalid information is filtered out. By doing so it is ensured that even small important objects are not lost in the filtering mode.
For example, four vertex coordinate information of an important target can be obtained through recognition of a convolutional neural network, whether the important target inclines or not and the calculated inclination angle can be determined by utilizing a CV (constant velocity) library of python according to the target information coordinates, and the image target is corrected by rotating through affine transformation according to the four vertex coordinates and the inclination angle of the image. The inclined picture is corrected and then filtered by the filtering module, so that the effect is greatly improved, and meanwhile, partial information of important targets can be prevented from being filtered.
Example one
As shown in fig. 2, the system inputs satellite-captured large-size terrestrial images selected from the DIOR data set, which have an original size of 1183 pixels by 947 pixels, outside the image processing range that can be supported by hardware. For example: adding a mask to the large-size ground image, increasing the area energy value of the image, and inputting an area protection module to a designated area. Therefore, the highest energy value is assigned to the region, and the energy lines in the row are guaranteed to be filtered under the filtering module and are not deleted, so that important targets are prevented from being lost.
As shown in fig. 3, an input large-size ground image is read in the filtering mode, and the large-size original input image in fig. 2 is stored in a matrix form, and an image gradient map is obtained by a difference method.
As shown in fig. 4, after the image gradient map obtained in fig. 3, the energy map of the large-size original input image in fig. 1 is obtained by calculating the energy value according to the gradient. The energy value of the image is in direct proportion to the gradient value of the image pixel, the larger the gradient value of the image pixel is, the higher the energy value at the point is, the gradient map of the image is obtained according to a differential method, and then the energy value is calculated through the gradient to obtain the energy map.
As shown in fig. 5, calculating the energy line of each column according to the calculated energy map, calculating the average energy value of each column according to the energy value of each column, setting a multiple of the average energy value as a threshold, comparing the energy value of each column with the set threshold, and marking the column pixel points lower than the threshold; comparing the row energy value in the satellite image shown in the figure 1 with a set threshold, deleting energy rays with energy lower than the threshold, moving all row pixel points on the right side of the deleted energy rays to the left, and reducing the image width by one unit width when deleting one row of energy rays, namely reducing the large-size image.
In the processing step shown in fig. 5, the satellite image column energy values are calculated and compared with the set threshold value, the column with the energy value lower than the specified threshold value is deleted, the image on the right side of the deleted energy line is moved to the left to obtain a new image, and the size of the large-size image after the filtering mode is reduced to 835 x 947, so that redundant data is reduced through the filtering operation, and the image size is reduced to meet the hardware input requirement.
Pixel values in the image are stored in a matrix form, so that a subsequent cutting module can conveniently perform cutting operation; comparing the length and width of the input large-size image with the length and width of the image to be cut, if the length and width of the cut are set to be larger than the length and width of the original image, performing zero filling operation on the image, namely performing pixel filling on the original image by using pixel points [0,0,0 ]; if the cutting length and width are set to be smaller than the original image length and width, zero filling operation is not needed, namely pixel filling is not needed to be carried out on the original image; and (1-overlay) Chip _ W and (1-overlay) Chip _ H are respectively segmented according to the cutting image.
Wherein Overlap is the overlapping ratio of two adjacent graphs, chip _ W is the width of the segmentation image, and Chip _ H is the height of the segmentation image.
And when the last line is segmented, determining whether the last line of images need to be spliced or not according to the remaining height of the last line, namely calculating the size of H/Chip _ H, if the size of H/Chip _ H is smaller than 0.5-overlay, splicing 1/(n/Chip _ H + overlay) images from top to bottom, wherein H is the remaining height from the segmentation of the large-size image to the last line, and if the result is larger than 0.5-overlay, taking the image boundary as the reference and taking the required size in the reverse direction.
Performing gray extraction on the cut image, performing thresholding and anti-thresholding operations on a first point pixel value, if the matrix result is 0 after the two operations, indicating that the pixels are consistent, deleting the background image, normalizing the pixel value greater than x to be 255 according to a pixel threshold value x, calculating the proportion that the pixel value is 0, and if the pixel value is less than a set screening threshold value, deleting the invalid image; the method is used for realizing block-based image segmentation, avoids losing targets by setting an overlapping area, reduces the output of invalid images by setting a threshold value of a screening image based on pixel point consistency and pixel information non-null, and then realizes the original information restoration of the segmented object according to the overlapping proportion and the central point coordinate of the segmented image.
Fig. 7 is a large-size image after the segmentation mode, and the large-size image after the filtering module shown in fig. 6 is cut into four small-size images according to the size of 512 x 512 with the overlapping degree of 20% so as to reduce the size of the input image.
FIG. 8 is a schematic diagram of optimizing whether to stitch the last line of the split images, when the large-size image is split into the last line, the remaining height H of the last line of the split images is calculated, whether to stitch the last line of the split images is determined by comparing the relationship between H/Chip _ H and 0.5-overlay, and if the Overlap ratio H/Chip _ H is less than 0.5-overlay, stitching is performed; if the Overlap is greater than 0.5-Overlap, the desired dimension is taken in the reverse direction, based on the image boundary. Therefore, the working efficiency of the segmentation module is improved, and redundant calculation is reduced.
In summary, as shown in fig. 1, the present application mainly describes a flowchart of the image preprocessing method, and the method mainly implements processing and optimization on a large-size image by constructing a filtering module, a segmentation module, and a region protection module. The region protection module is mainly used for endowing a designated region with a high energy value, so that the energy line is not deleted in a filtering mode, and important targets are prevented from being lost; the filtering module calculates an image energy chart to obtain a column energy value of the image, sets a certain multiple of the column energy line value as a threshold according to a specific use scene, deletes the column below the threshold, and moves the image on the right side of the deleted column energy line to the left, so that invalid information is reduced, and finally deletes the image size; the segmentation module mainly cuts and segments the large-size image after the filtering mode, avoids the problem of boundary cutting by setting a certain proportion of overlapping regions during segmentation, and judges whether splicing is needed or not according to the ratio of the residual height H to the segmentation size when the last line is segmented, thereby improving the segmentation efficiency.
If the curve mode is adopted and the image segmentation is carried out by comparing the most values, the calculation amount is greatly increased, and the system resource consumption exceeds the acceptable range of some users. For example, in the image with 10000 × 10000, the calculation amount is far larger than that in the present application by searching the minimum energy curve. According to the scheme, only 10000 columns of energy need to be calculated, then an average value is taken, a threshold value is calculated according to the average value, and then the energy value of each column is compared with the threshold value. And by the method of the present application, a coordinate value of the cutting can be acquired, so that the cut part can be restored. However, the reduction cannot be achieved by the curve method. In addition, in some scenarios, the small target is easy to lose through a curved cutting method.

Claims (10)

1. The large-size image preprocessing method is characterized by comprising the following steps of:
s1, reading an image to be processed, calculating gradient values of all pixels on the image by a difference method, and forming an image gradient
The degree map is used for calculating an energy value according to the image gradient map, and obtaining and pre-storing an image energy map;
s2, reading the image energy chart, acquiring the energy value of each pixel of each row one by one and forming an energy line of the row,
calculating the average energy value of each column according to the energy values of all pixels of the column; judging whether the energy value of each row is lower than a threshold value one by one, if so, deleting the energy line corresponding to the row, and moving all row pixel points on the right side of the deleted energy line to the left, so that the image width is reduced by one unit width after each row of energy line is deleted, and obtaining a filtered image;
s3, reading the filtered image, and judging whether the size of the filtered image is larger than a cutting size threshold value, if so, judging whether the size of the filtered image is larger than the cutting size threshold value
Then, dividing according to the cutting size and the specified overlapping rate; if the number of the pixels is smaller than the preset value, carrying out partial zero filling operation on the filtered image.
2. The method as claimed in claim 1, wherein the step S2 further comprises determining whether there is a key region after obtaining the column average energy value, and if so, assigning the highest energy value to each pixel in the region.
3. The pre-processing method for large-size images according to claim 1, wherein the process of segmenting according to the cropping size and the designated overlapping rate is as follows:
and (1-overlay) Chip _ W and (1-overlay) Chip _ H are used for segmenting the image, wherein the overlay is the overlapping proportion of two adjacent images, and the Chip _ W and the Chip _ H are respectively the width and the height of the segmented image.
4. The large-size image preprocessing method according to claim 3, wherein when the last line is segmented, judging whether the last line of images needs to be spliced according to the remaining height of the last line;
calculating the size of H/Chip _ H, and splicing 1/(n/Chip _ H + overlay) picture from top to bottom if the size is less than 0.5-overlay, wherein H is the residual height of the large-size picture from the last line;
if the result is more than 0.5-Overlap, the required size is taken in the reverse direction by taking the image boundary as a reference.
5. The large-size image preprocessing method according to claim 4, further comprising the steps of:
and S4, performing gray level extraction on the cut picture, performing thresholding and anti-thresholding operations on a first point pixel value, if the matrix result is 0 after the two operations, indicating that the pixels are consistent, deleting the background image, normalizing the pixel value greater than x to 255 according to a pixel threshold value x, calculating the proportion that the pixel value is 0, and if the pixel value is less than a set screening threshold value, deleting the invalid picture.
6. A large-size image preprocessing method is characterized by comprising the following steps:
step 1, reading a first image from an original image, wherein the first image is an image to be subjected to preprocessing operation, adding a mask to the first image, and analyzing the image added with the mask;
constructing a region protection module, inputting the image added with the mask into the region protection module, adding region points through the region protection module, assigning the highest energy value to the region points, and outputting the image with a protection region;
step 2, constructing a filtering module, inputting the image with the protection area into the filtering module, and obtaining an energy map of the image corresponding to the filtering module, wherein the energy map related parameters comprise: column energy lines and thresholds;
step 3, constructing a cutting module, inputting the energy diagram into the cutting module, cutting the energy diagram into a plurality of images with specified sizes, judging whether the cut energy diagram has a vacant part or an overlapped part, if so,
and carrying out zero filling operation on the cut vacant part of the energy diagram, dividing the overlapped part according to the cutting size and the specified overlapping rate, judging whether the pictures need to be spliced according to the residual height overlapping rate of the last line of the energy diagram, and outputting the divided pictures.
7. The large-size image preprocessing method according to claim 6, wherein the step 2 is further characterized
Comprises the following steps: the column energy lines are formed by energy values of a plurality of pixel points, each column of energy lines of the first image is calculated, and the average energy value of each column is obtained by dividing the sum of the energy values of the pixel points formed by each column by the number of the regional points of each column; deleting the energy lines lower than the threshold, moving the image on the right side of the energy lines lower than the threshold to the left, and recording the abscissa of a deletion column; the threshold is a predetermined multiple of the average energy value.
8. The large-size image preprocessing method according to claim 6, wherein said step 3 is further characterized
Comprises the following steps: overlapping parts of the pictures generate overlapping areas, overlapping rates are set for the overlapping areas, the percentage of the overlapping rates is determined, the parameter of the overlapping rates is overlapping, whether the critical value of the spliced pictures is 0.5-overlapping or not is judged, and if the overlapping rate H/Chip _ H is smaller than 0.5-overlapping, every 1/(n/Chip _ H + overlapping) image in the last line of the images is spliced from top to bottom; overlapping is more than 0.5-Overlap, and the images with the required size can be obtained without splicing the images; h is the residual height of the large-size image after being divided into the last line, chip _ H is the height of the divided image, and overlay is the overlapping rate of two adjacent images.
9. The large-size image preprocessing method according to claim 6, wherein the segmentation module further comprises: the method comprises the steps of obtaining a segmented image according to a segmentation module, extracting image gray for the segmented image, normalizing the image gray to be 255 when the image gray is larger than a pixel threshold value X, calculating the number of pixel points with a pixel value of 0, if the proportion of the pixel points is smaller than a threshold value set by the image, indicating that no detection target exists in the image, and deleting the image.
10. A large-sized image preprocessing system, comprising:
at least one processor; and
a memory communicatively coupled to at least one of the processors; wherein the content of the first and second substances,
the memory stores instructions executable by the processor for execution by the processor to implement the large-scale image pre-processing method of any of claims 1-9.
CN202211144905.7A 2022-09-20 2022-09-20 Large-size image preprocessing method and system Pending CN115375892A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211144905.7A CN115375892A (en) 2022-09-20 2022-09-20 Large-size image preprocessing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211144905.7A CN115375892A (en) 2022-09-20 2022-09-20 Large-size image preprocessing method and system

Publications (1)

Publication Number Publication Date
CN115375892A true CN115375892A (en) 2022-11-22

Family

ID=84070952

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211144905.7A Pending CN115375892A (en) 2022-09-20 2022-09-20 Large-size image preprocessing method and system

Country Status (1)

Country Link
CN (1) CN115375892A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495829A (en) * 2023-11-15 2024-02-02 广东昭明电子集团股份有限公司 Intelligent watch hardware quality detection method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117495829A (en) * 2023-11-15 2024-02-02 广东昭明电子集团股份有限公司 Intelligent watch hardware quality detection method
CN117495829B (en) * 2023-11-15 2024-04-30 广东昭明电子集团股份有限公司 Intelligent watch hardware quality detection method

Similar Documents

Publication Publication Date Title
CN110678901B (en) Information processing apparatus, information processing method, and computer-readable storage medium
US7127107B2 (en) Land partition data generating method and apparatus
US8401333B2 (en) Image processing method and apparatus for multi-resolution feature based image registration
US8170368B2 (en) Correcting device and method for perspective transformed document images
US7805003B1 (en) Identifying one or more objects within an image
JP4157620B2 (en) Moving object detection apparatus and method
US20030156739A1 (en) Rock fragmentation analysis system
US8275170B2 (en) Apparatus and method for detecting horizon in sea image
CN112580447B (en) Edge second-order statistics and fusion-based power line detection method
CN111046950A (en) Image processing method and device, storage medium and electronic device
CN115375892A (en) Large-size image preprocessing method and system
CN112052702A (en) Method and device for identifying two-dimensional code
CN114359286A (en) Insulator defect identification method, device and medium based on artificial intelligence
CN113989604A (en) Tire DOT information identification method based on end-to-end deep learning
US20020048402A1 (en) Segmentation of digital images
US6650362B1 (en) Movement detecting apparatus with feature point extractor based on luminance gradient in current frame
JP2006127056A (en) Image processing method and image processor
CN112991334B (en) Global positioning method and device for industrial particle continuous product
CN115619813A (en) SEM image foreground extraction method and device, computer equipment and storage medium
KR100917148B1 (en) Extract and judge image of topography based on domain expansion
CN113095104A (en) Defective two-dimensional code positioning method
CN117456371B (en) Group string hot spot detection method, device, equipment and medium
CN116580277B (en) Deep learning-based bottom electronic identification tag missing image identification method
CN116824183B (en) Image feature matching method and device based on multiple feature descriptors
CN117274817B (en) Automatic crack identification method and device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination