Image size optimization-based target detection method, system, device and medium
By optimizing the image size processing method, meaningless fill areas in security inspection images are reduced, solving the problem of wasted computing resources and improving detection efficiency and performance.
Patent Information
- Application Number
- CN202310679231.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-09
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-06-09
AI Technical Summary
Existing image resizing methods lead to wasted computational resources and unstable performance in image target detection, especially in security inspection scenarios, particularly when the aspect ratio of images from passive terahertz and active millimeter-wave security inspection equipment is less than 1:2, resulting in a large number of redundant computational regions.
By acquiring security inspection images, marking target locations, cropping images, and performing stitching and filling processes according to image size requirements, meaningless filling areas are reduced, and image size is optimized to reduce the waste of computing resources.
It effectively reduces meaningless fill areas after image normalization, saves computing resources, improves the training and inference speed of the network, increases data diversity, and enhances the performance of convolutional neural networks.
Smart Images

Figure CN116645515B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, and in particular to a target detection method, system, device, and medium based on image size optimization. Background Technology
[0002] As deep learning is increasingly used in image object detection, images from many specific scenarios generate a large number of data samples, which are then fed into convolutional neural networks for training. However, due to the varying sizes and aspect ratios of the images, their dimensions are "normalized" (generally referred to as image resizing) before being input into the convolutional neural network for training.
[0003] Image resizing methods include image upsampling / downsampling, mainly including nearest neighbor interpolation, bilinear interpolation, bicubic interpolation, etc. However, although this method can resize the image, the aspect ratio of the target in the image will also change. There are certain differences between the objects in the image and the objects in the real world, which affects the final target detection performance.
[0004] The Letterbox-based image resizing method can maintain the aspect ratio of objects in the image without distortion. However, the Letterbox method has meaningless padding regions, which can lead to a lot of redundant calculations, especially in some practical applications where the aspect ratio of the image is large or small. In such cases, the amount of redundant calculations can exceed the amount of calculations required for the actual image.
[0005] When dealing with security checks in public places, traditional security methods are inefficient and prone to congestion under high passenger flow conditions. Therefore, passive terahertz security checks, due to their non-intrusive detection, ability to detect items hidden by clothing, fast detection speed, and ability to handle large passenger flows, have been piloted in rail transit. However, for places with higher security measures and requirements, passive terahertz security checks also have issues with detection rates and false alarm rates that cannot meet the needs of these places. Therefore, in these places, active millimeter wave-based security checks can compensate for the shortcomings of passive terahertz equipment and effectively improve the detection rate and false alarm rate.
[0006] Therefore, due to the imaging principle and system design of the aforementioned security inspection methods based on passive terahertz and active millimeter waves, the aspect ratio of their images is less than 1:2, or even reaches 1:5. If the image resize method based on letterbox is used, a large number of redundant calculation areas will be generated, which will result in a waste of computing power and unstable performance. Therefore, the letterbox method is not suitable in this scenario. Summary of the Invention
[0007] To address the aforementioned issues, this invention proposes a target detection method, system, device, and medium based on image size optimization. This effectively reduces the meaningless fill regions after image normalization, decreases the computational involvement of fill regions, saves computational resources, and improves the training and inference speed of the network.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] In a first aspect, the present invention provides a target detection method based on image size optimization, comprising:
[0010] Acquire security inspection images and mark the target locations;
[0011] The security inspection image is cropped according to the target location and the set cropping size to obtain the target image, and a training set is constructed based on this.
[0012] Based on the image size requirements, determine the width and height adjustment ratios of the target image;
[0013] Set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then select at least one other target image in the training set to stitch with the current target image, and then perform size adjustment and filling processing on the stitched target image according to the image size requirements.
[0014] Based on the cropping and padding dimensions, the target coordinates in the processed target image are transformed before and after processing. This transformation is then used to train the constructed network for target detection.
[0015] As an alternative implementation, the security inspection image is a passive terahertz image and / or an active millimeter-wave image.
[0016] As an alternative implementation, after adjusting the size according to the image size requirements, the parts that do not meet the image size requirements are filled with a solid color until the width and height of the target image after filling meet the image size requirements. The filled area is a region with no practical meaning.
[0017] As an alternative implementation, the splicing process includes:
[0018] If the width adjustment ratio is not less than the ratio threshold and the height adjustment ratio is less than the ratio threshold, then the number of other target images selected is the width adjustment ratio rounded down and then minus one. The other target images selected are then stitched together sequentially along the width direction of the current target image.
[0019] If the width adjustment ratio is less than the ratio threshold and the height adjustment ratio is not less than the ratio threshold, then the number of other target images selected is the height adjustment ratio rounded down by one, and the other target images are stitched together sequentially along the height direction of the current target image.
[0020] As an alternative implementation, if both the width adjustment ratio and the height adjustment ratio are not less than the ratio threshold, then the number of other target images selected first is the width adjustment ratio rounded down and then minus one, and the other target images selected at this time are stitched along the width direction; then each target image in the width direction is stitched along the height direction, and the number of selected images is the height adjustment ratio rounded down and then minus one.
[0021] Alternatively, first select the number of other target images by rounding down from the height adjustment ratio and then subtracting one. Then stitch the other target images selected at this time along the height direction. Then stitch each target image in the height direction along the width direction, with the number of selected images being the number of images rounded down from the width adjustment ratio and then subtracting one.
[0022] As an alternative implementation, the coordinate transformation includes a horizontal coordinate transformation, specifically including: adding the fill size to the horizontal coordinate of the first target image, and adding the width and fill size of all previous target images to the horizontal coordinates of the other target images in the width direction of the first target image.
[0023] As an alternative implementation, the coordinate transformation includes a ordinate transformation, specifically including:
[0024]
[0025] in, The vertical coordinate of the target image before transformation is given in the m-th row and n-th column. The ordinate of the target image after transformation is shown in the m-th row and n-th column. For the cut dimensions, The height of the target image.
[0026] Secondly, the present invention provides a target detection system based on image size optimization, comprising:
[0027] The image acquisition module is configured to acquire security inspection images and mark the target locations;
[0028] The cropping module is configured to crop the security inspection image according to the target location and the set cropping size to obtain the target image, and use it to build a training set;
[0029] The scaling module is configured to determine the width and height scaling of the target image based on the image size requirements.
[0030] The stitching module is configured to set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then at least one other target image in the training set is selected to stitch with the current target image, and the stitched target image is resized and filled according to the image size requirements.
[0031] The object detection module is configured to transform the coordinates of the target in the processed target image before and after processing based on the cropping size and padding size, and use this transformation to train the constructed network to perform object detection.
[0032] Thirdly, the present invention provides an electronic device including a memory and a processor, and computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in the first aspect.
[0033] Fourthly, the present invention provides a computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in the first aspect.
[0034] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0035] This invention proposes a target detection method, system, device, and medium based on image size optimization. It improves the image resizing method based on letterbox. Since letterbox processing generates some meaningless padding regions that consume computational resources, this invention selects other images that meet the requirements in the training set and stitches them with the current target image. This effectively reduces the meaningless padding regions after image normalization, reduces the computation involved in padding regions, saves computational resources, and improves the training and inference speed of the network. Furthermore, the final training image contains at least two original images, indirectly increasing the number of data points used for training the convolutional neural network in a single run, reducing the training time by at least half, and increasing data diversity, which improves the performance of the convolutional neural network.
[0036] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0037] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0038] Figure 1 This is a flowchart of the target detection method based on image size optimization provided in Embodiment 1 of the present invention. Detailed Implementation
[0039] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0040] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0041] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the exemplary embodiments of the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that the terms “comprising” and “having”, and any variations thereof, are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0042] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0043] Example 1
[0044] The implementation process of the image resize method based on Letterbox described in the background technology includes:
[0045] (1) Calculate the scaling factor for width and height, and select the smaller scaling factor;
[0046] If the network size of the convolutional neural network is 416*416, and the width and height of the input image are 800 and 600 respectively, then the size of the image with a width and height of 800*600 needs to be transformed to the size required by the convolutional neural network of 416*416. Specifically, the required width (416) and height (416) are divided by the width (800) and height (600) of the image respectively, resulting in two scaling factors of 0.52 and 0.69. The smaller scaling factor is selected.
[0047] (2) Calculate the scaled dimensions;
[0048] Based on the scaling factor of 0.52, the width and height of the input image are multiplied by the scaling factor of 0.52, so the width becomes 416 and the height becomes 312, that is, the size of the scaled image is 416*312.
[0049] (3) The size of the scaled image still does not meet the requirement of 416*416. At this time, the height of the scaled image in step (2) needs to be filled. The height to be filled on both sides is (416-312) / 2=52. The filled area is a meaningless area.
[0050] This shows that the letterbox-based image resize method can normalize the image size while maintaining the aspect ratio without distortion. However, if the image aspect ratio is 1:2 or even smaller, the letterbox method will generate a large number of redundant calculation areas.
[0051] Therefore, this embodiment provides a target detection method based on image size optimization, which can be used in the field of security inspection, such as... Figure 1 As shown, it specifically includes:
[0052] Acquire security inspection images and mark the target locations;
[0053] The security inspection image is cropped according to the target location and the set cropping size to obtain the target image, and a training set is constructed based on this.
[0054] Based on the image size requirements, determine the width and height adjustment ratios of the target image;
[0055] Set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then select at least one other target image in the training set to stitch with the current target image, and then perform size adjustment and filling processing on the stitched target image according to the image size requirements.
[0056] Based on the cropping and padding dimensions, the target coordinates in the processed target image are transformed before and after processing. This transformation is then used to train the constructed network for target detection.
[0057] In this embodiment, the security inspection image is a passive terahertz image and / or an active millimeter wave image, which is acquired by passive terahertz and active millimeter wave devices. After the security inspection image is acquired, the pixels in the security inspection image are normalized. Since the pixel value distribution range of the security inspection image is an integer from 0 to 255, all pixel values are normalized to floating-point values from 0 to 1.
[0058] Since image data itself carries a lot of information, but not all of the information is needed by the convolutional neural network, the image itself will also have redundancy, which will cause the convolutional neural network to waste time in invalid calculation and training process. Therefore, this embodiment first cropped the redundant parts in the image.
[0059] Specifically, the target area is marked on the normalized security inspection image. This marking process can be carried out manually or by other existing technical means, thereby determining the target location.
[0060] Therefore, the cropping position and cropping size of the security inspection image are determined based on the target location and the set cropping size, and the security inspection image is cropped to obtain the target image.
[0061] In this embodiment, all security inspection images are the same size, with the width of the security inspection image being src_w and the height being src_h; the target image after cropping the security inspection image is also the same size, with the width of the target image being src_w_croped and the height being src_h_croped; the required image size has a width of dst_w and a height of dst_h.
[0062] Therefore, based on the image size requirements, the width adjustment ratio of the target image is determined to be dst_w / src_w_croped, and the height adjustment ratio is dst_h / src_h_croped.
[0063] Set a ratio threshold; in this embodiment, the ratio threshold is set to 2. If both the width adjustment ratio and the height adjustment ratio are less than the ratio threshold, there is no need to stitch them together. The current target image is directly processed according to the width adjustment ratio and the height adjustment ratio. For the parts that still do not meet the image size requirements, solid color areas need to be filled until the width and height of the target image meet the image size requirements after filling.
[0064] If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then the concatenation is performed according to the following logic:
[0065] (1) If the width adjustment ratio is not less than the ratio threshold and the height adjustment ratio is less than the ratio threshold, then the number of other target images selected is the width adjustment ratio rounded down and then minus one; if dst_w / src_w_croped is greater than 2 and less than 3, then 1 other target image is selected in the training set; if dst_w / src_w_croped is greater than 3 and less than 4, then 2 other target images are selected in the training set, and so on; then, the selected other target images are stitched together along the width direction of the current target image.
[0066] (2) If the width adjustment ratio is less than the ratio threshold and the height adjustment ratio is not less than the ratio threshold, then the number of other target images selected is the high adjustment ratio rounded down and then minus one; if dst_h / src_h_croped is greater than 2 and less than 3, then 1 other target image is selected in the training set; if dst_h / src_h_croped is greater than 3 and less than 4, then 2 other target images are selected in the training set, and so on; then, the selected other target images are stitched together sequentially along the height direction of the current target image.
[0067] (3) If both the width adjustment ratio and the height adjustment ratio are not less than the ratio threshold, then, firstly, the number of other target images selected is the width adjustment ratio minus one, and the other target images selected at this time are stitched along the width direction; then, each target image in the width direction is stitched along the height direction, and the number of selected images is the height adjustment ratio minus one.
[0068] Alternatively, first, select the number of other target images by rounding down from the height adjustment ratio and subtracting one, then stitch the selected other target images along the height direction; then, stitch each target image along the width direction, with the number of selected images being the number of images rounded down from the width adjustment ratio and subtracting one.
[0069] In this embodiment, the size of the stitched target image is adjusted according to the image size requirements. For parts that still do not meet the image size requirements, solid color areas are filled until the width and height of the filled image meet the image size requirements.
[0070] As an alternative implementation, the solid color area is a region without practical meaning.
[0071] Understandably, the process of adjusting and filling the target image according to the image size requirements is to use the letterbox-based image resize method, which will not be elaborated here.
[0072] In this embodiment, for any target image in the training set, other target images that meet the conditions are selected for stitching, and the other target images selected for stitching do not need to be selected again.
[0073] In target detection, in addition to image data, target coordinates are also required. Therefore, this embodiment performs a coordinate transformation on the target coordinates in the processed target image before and after processing. The processed target image is an M×N array image, and the target coordinates are ( , );
[0074] Let's take the example of two images being horizontally spliced together along their width to illustrate:
[0075] Let the coordinates of the first target be (x1, y1) and the coordinates of the second target be (x2, y2);
[0076] If the image size still cannot be met after two images are horizontally stitched and resized, zero padding is required on both sides. Therefore, the target coordinates in the original target image are based on the top left corner of the original target image. After stitching and padding, the target coordinates of the two target images will change accordingly.
[0077] First, only the coordinates after stitching are changed: the coordinates of the first target image will not change, and the x-coordinate of the second target image will be increased by the width of the first target image; in other words, the origin of the second target image's coordinates changes from the top left corner of the original image to the top left corner of the first target image. Therefore, the x-coordinate is increased by the width of the first target image, while the y-coordinate remains unchanged.
[0078] Secondly, after the fill operation, the origin of the coordinate system of the first target image changes from the top-left corner of the original image to the top-left corner of the entire image after the fill operation. Therefore, the x-coordinate of the first target image needs to be increased by the fill size. The target in the second target image also needs to have its fill size added on top of the stitching, while the vertical coordinate remains unchanged;
[0079] Therefore, the target coordinates are transformed as follows:
[0080]
[0081]
[0082] in, , Let x and y be the transformed x and y coordinates of the i-th target image. , Let x and y be the x and y coordinates of the i-th target image before transformation.
[0083] In this embodiment, the following example is taken to crop and stitch four original security inspection images. The height of each security inspection image is cropped by 1 / 2. The cropped size of the upper and lower halves is determined according to a random algorithm. Then, the upper and lower halves of the security inspection image are cropped according to the cropped size. As long as the cropped size is 1 / 2 of the original security inspection image, it is acceptable.
[0084] Therefore, in the target coordinate transformation after stitching together the four target images, the horizontal coordinate transformation follows the same principle as above and will not be repeated. The vertical coordinate transformation is as follows:
[0085] After cropping, the origin of the coordinate system becomes the top left corner of the cropped image, and the ordinate is reduced by the cropped size src_h_crop accordingly. Taking four target images as an example: the ordinate of the first target image is the original ordinate minus the cropped size src_h_crop; the second target image is located to the right of the first target image, and its ordinate is the original ordinate minus the cropped size src_h_crop; the third target image is located below the first target image, and its ordinate is the original ordinate minus the cropped size src_h_crop, plus the height src_h_croped of the cropped image; the fourth target image is located below the second target image, and its ordinate is the original ordinate minus the cropped size src_h_crop, plus the height src_h_croped of the cropped image.
[0086] Therefore, the target coordinates are transformed as follows:
[0087]
[0088]
[0089] in, , The x and y coordinates of the target image in the m-th row and n-th column before transformation are: , Let x and y be the transformed x and y coordinates of the target image in row m and column n.
[0090] In this embodiment, a deep convolutional neural network is used for training and learning to identify targets in the security inspection image to be detected, determine the target category, and thus achieve the detection of contraband targets. It is understood that the process of target detection based on the trained deep convolutional neural network can be achieved by conventional means, and will not be described in detail here.
[0091] The method in this embodiment effectively reduces a large amount of redundant information, focuses only on the target region, and also reduces the meaningless filling regions after image normalization, reducing the computation involved in the filling regions, saving computing resources, improving the training and inference speed of the network, and the final training image contains at least two original images, which indirectly increases the number of data used for training the convolutional neural network in one run, reducing the training time by at least half, while also increasing data diversity, which improves the performance of the convolutional neural network to a certain extent.
[0092] Example 2
[0093] This embodiment provides a target detection system based on image size optimization, including:
[0094] The image acquisition module is configured to acquire security inspection images and mark the target locations;
[0095] The cropping module is configured to crop the security inspection image according to the target location and the set cropping size to obtain the target image, and use it to build a training set;
[0096] The scaling module is configured to determine the width and height scaling of the target image based on the image size requirements.
[0097] The stitching module is configured to set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then at least one other target image in the training set is selected to stitch with the current target image, and the stitched target image is resized and filled according to the image size requirements.
[0098] The object detection module is configured to transform the coordinates of the target in the processed target image before and after processing based on the cropping size and padding size, and use this transformation to train the constructed network to perform object detection.
[0099] It should be noted that the above modules correspond to the steps described in Embodiment 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the content disclosed in Embodiment 1. It should also be noted that the above modules, as part of the system, can be executed in a computer system such as a set of computer-executable instructions.
[0100] In further embodiments, the following is also provided:
[0101] An electronic device includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, wherein the computer instructions, when executed by the processor, perform the method described in Embodiment 1. For brevity, further details are omitted here.
[0102] It should be understood that in this embodiment, the processor can be a central processing unit (CPU), or it can be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor, etc.
[0103] Memory may include read-only memory and random access memory, and provides instructions and data to the processor. A portion of memory may also include non-volatile random access memory. For example, memory may also store information about the device type.
[0104] A computer-readable storage medium for storing computer instructions, which, when executed by a processor, perform the method described in Embodiment 1.
[0105] The method in Example 1 can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor. The software modules can reside in readily available storage media in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method. To avoid repetition, a detailed description is not provided here.
[0106] Those skilled in the art will recognize that the units, i.e., algorithm steps, of the various examples described in connection with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0107] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A target detection method based on image size optimization, characterized in that, include: Acquire security inspection images and mark the target locations; The security inspection image is cropped according to the target location and the set cropping size to obtain the target image, and a training set is constructed based on this. Based on the image size requirements, determine the width and height adjustment ratios of the target image; Set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then select at least one other target image in the training set to stitch with the current target image, and then perform size adjustment and filling processing on the stitched target image according to the image size requirements. Based on the cropping and padding dimensions, the target coordinates in the processed target image are transformed before and after processing. This transformation is then used to train the constructed network for target detection.
2. The target detection method based on image size optimization as described in claim 1, characterized in that, The security inspection images are passive terahertz images and / or active millimeter-wave images.
3. The target detection method based on image size optimization as described in claim 1, characterized in that, After adjusting the image size according to the requirements, fill the parts that do not meet the requirements with a solid color until the width and height of the target image meet the requirements. The filled areas are areas with no practical meaning.
4. The target detection method based on image size optimization as described in claim 1, characterized in that, The splicing process includes: If the width adjustment ratio is not less than the ratio threshold and the height adjustment ratio is less than the ratio threshold, then the number of other target images selected is the width adjustment ratio rounded down and then minus one. The other target images selected are then stitched together sequentially along the width direction of the current target image. If the width adjustment ratio is less than the ratio threshold and the height adjustment ratio is not less than the ratio threshold, then the number of other target images selected is the height adjustment ratio rounded down by one, and the other target images are stitched together sequentially along the height direction of the current target image.
5. The target detection method based on image size optimization as described in claim 4, characterized in that, If both the width adjustment ratio and the height adjustment ratio are not less than the ratio threshold, then the number of other target images selected is the width adjustment ratio rounded down minus one, and the other target images selected at this time are stitched along the width direction; then each target image in the width direction is stitched along the height direction, and the number of selected images is the height adjustment ratio rounded down minus one. Alternatively, first select the number of other target images by rounding down from the height adjustment ratio and then subtracting one. Then stitch the other target images selected at this time along the height direction. Then stitch each target image in the height direction along the width direction, with the number of selected images being the number of images rounded down from the width adjustment ratio and then subtracting one.
6. The target detection method based on image size optimization as described in claim 1, characterized in that, The coordinate transformation includes a horizontal coordinate transformation, specifically including: adding the padding size to the horizontal coordinate of the first target image, and adding the width and padding size of all previous target images to the horizontal coordinate of the other target images in the width direction of the first target image.
7. The target detection method based on image size optimization as described in claim 1, characterized in that, The coordinate transformation includes a ordinate transformation, specifically including: in, The vertical coordinate of the target image before transformation is given in the m-th row and n-th column. The vertical coordinate of the target image after transformation is shown in the m-th row and n-th column. For the cut dimensions, The height of the target image.
8. A target detection system based on image size optimization, characterized in that, include: The image acquisition module is configured to acquire security inspection images and mark the target locations; The cropping module is configured to crop the security inspection image according to the target location and the set cropping size to obtain the target image, and use it to build a training set; The aspect ratio determination module is configured to determine the width and height adjustment ratios of the target image based on the image size requirements. The stitching module is configured to set a ratio threshold. If at least one of the width adjustment ratio and the height adjustment ratio is not less than the ratio threshold, then at least one other target image in the training set is selected to stitch with the current target image, and the stitched target image is resized and filled according to the image size requirements. The object detection module is configured to transform the coordinates of the target in the processed target image before and after processing based on the cropping size and padding size, and use this transformation to train the constructed network to perform object detection.
9. An electronic device, characterized in that, It includes a memory and a processor, as well as computer instructions stored in the memory and running on the processor, which, when executed by the processor, perform the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Used to store computer instructions, which, when executed by a processor, perform the method described in any one of claims 1-7.
Citation Information
Patent Citations
Teacher position detection method and system based on deep learning
CN110246180A
Heuristic image scale normalization method based on attention mechanism
CN113298075A