CN111476799A - Image analysis method and storage medium - Google Patents

Image analysis method and storage medium Download PDF

Info

Publication number
CN111476799A
CN111476799A CN202010205817.8A CN202010205817A CN111476799A CN 111476799 A CN111476799 A CN 111476799A CN 202010205817 A CN202010205817 A CN 202010205817A CN 111476799 A CN111476799 A CN 111476799A
Authority
CN
China
Prior art keywords
image
analysis
target
sub
analysis result
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
CN202010205817.8A
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.)
Fujian Star Net Joint Information System Co ltd
Original Assignee
Fujian Star Net Joint Information System Co ltd
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 Fujian Star Net Joint Information System Co ltd filed Critical Fujian Star Net Joint Information System Co ltd
Priority to CN202010205817.8A priority Critical patent/CN111476799A/en
Publication of CN111476799A publication Critical patent/CN111476799A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/136Segmentation; Edge detection involving thresholding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

The invention relates to the technical field of image analysis, and discloses an image analysis method and a storage medium, wherein the image analysis method comprises the following steps: segmenting an image to be analyzed into a plurality of sub-images; respectively inputting the subimages into an analysis model for analysis processing; zooming an image to be analyzed to a preset size and inputting the image to the analysis model for analysis processing; and removing repeated targets in the two analysis results to obtain a final result. According to the technical scheme, the small target can be effectively detected, the large target can also be effectively detected, so that the detection accuracy is effectively guaranteed, and meanwhile, the image input into the analysis model every time is smaller than the requirement, so that the time consumed by image analysis is reduced, and the analysis accuracy is guaranteed while the analysis timeliness is considered.

Description

Image analysis method and storage medium
Technical Field
The present invention relates to the field of image analysis technologies, and in particular, to an image analysis method and a storage medium.
Background
The visual AI is to analyze and process an image through an artificial intelligence technology so as to obtain a desired result, and is widely applied to face recognition, license plate recognition, image garbage classification and the like. In the visual AI algorithm, the size of an input image has a direct relationship with the amount of analysis processing calculation, and therefore, in order to improve the analysis processing efficiency, the visual AI algorithm generally performs analysis calculation after scaling an original image to a specific resolution. When the difference between the resolution of the original image and the target resolution specified by the AI algorithm model is large, zooming the original image to the target resolution results in loss of more details of the image, and further results in that small targets (such as human faces, human heads and target objects) with small resolution points in the original image cannot be detected and identified, and the detection rate of the algorithm is reduced. Therefore, in the prior art, the analysis processing effect of the visual AI and the accuracy of the analysis processing cannot be simultaneously considered in the same way as the coin.
Disclosure of Invention
Therefore, it is necessary to provide an image analysis method for solving the technical problem that the image analysis processing effect and the accuracy of the image analysis processing cannot be considered in the image processing in the prior art.
To achieve the above object, the inventors provide an image analysis method comprising the steps of:
segmenting an image to be analyzed into a plurality of sub-images;
respectively inputting the subimages into an analysis model for analysis processing to obtain a first analysis result;
zooming the image to be analyzed to a preset size and inputting the image to the analysis model for analysis processing to obtain a second analysis result;
and removing repeated targets in the first analysis result and the second analysis result to obtain a final result.
Further, when the sub-image is input into the analysis model for analysis processing to obtain the target, the position of the target in the sub-image is also recorded, and the position of the target in the image to be analyzed is calculated according to the offset position of the sub-image in the image to be analyzed and the position of the target in the sub-image.
Further, the first analysis result and the second analysis result both comprise a target and a position of the target in the image to be analyzed;
and judging whether the area overlapping of the target in the first analysis result and the target in the second analysis result exceeds a preset value or not, and judging whether the target in the first analysis result and the target in the second analysis result are repeated targets or not.
Further, when the area overlap of the objects in the first analysis result and the second analysis result exceeds 80%, the objects are determined to be the repeated objects.
Further, the segmenting the image to be analyzed into a plurality of sub-images comprises the steps of:
setting an image segmentation frame according to the image requirement of the analysis model;
and translating the image segmentation frame along the transverse direction and the longitudinal direction of the image to be analyzed to obtain a plurality of sub-images, wherein the transverse translation distance of the image segmentation frame is less than the transverse size of the image segmentation frame, and the longitudinal translation distance of the image segmentation frame is less than the longitudinal size of the image segmentation frame.
Further, the distance of the horizontal translation of the image segmentation frame is half of the horizontal size of the image segmentation frame, and the distance of the vertical translation of the image segmentation frame is half of the vertical size of the image segmentation frame.
Further, the analysis model is a visual AI analysis model.
In order to solve the above technical problem, the present invention further provides another technical solution:
a computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of any of the above claims.
Different from the prior art, the technical scheme includes that the image to be analyzed is divided into a plurality of sub-images to be analyzed, the image to be analyzed is zoomed to a preset size and then is input into the analysis model to be analyzed, duplicate removal is carried out on analysis results of two times, so that a plurality of small targets in the original image can be detected, the technical scheme further carries out analysis processing on the original image after the original image is zoomed integrally, and therefore the situation that the larger target is divided and cannot be detected is avoided.
Drawings
FIG. 1 is a flow chart of a method of image analysis according to an embodiment;
FIG. 2 is a diagram illustrating an embodiment of an image for laterally segmenting sub-images;
FIG. 3 is a diagram illustrating longitudinal segmentation of a sub-image from an image according to an embodiment;
FIG. 4 is a block diagram of an embodiment of a computer-readable storage medium;
description of reference numerals:
400. a computer-readable storage medium;
Detailed Description
To explain technical contents, structural features, and objects and effects of the technical solutions in detail, the following detailed description is given with reference to the accompanying drawings in conjunction with the embodiments.
Referring to fig. 1 to 4, the present embodiment provides an image analysis method. The image analysis method analyzes and processes an image through a visual AI analysis model and then obtains a target, and comprises the following steps:
s101, dividing an image to be analyzed into a plurality of sub-images; the size of the sub-image may be determined according to the size requirement of the visual AI analysis model on the image, and the combination of the plurality of sub-images obtained by segmentation should include all the content in the original image, that is, the content of the original image cannot be lost. In particular, the size of the sub-image may be less than or equal to the size requirement of the visual AI analysis model for the image. The image segmentation is performed to step S102.
And S102, respectively inputting the sub-images into an analysis model for analysis processing to obtain a first analysis result. The sub-image is input into an analysis model, the analysis model analyzes and calculates the content of the sub-image, and whether a preset target exists in the sub-image is judged. The first analysis result is a set including the target obtained by the analysis processing of each sub-image. The target of the analysis is determined by the visual AI analysis model, and in some embodiments, the target is a human target, and in other embodiments, the target may be a license plate target, a garbage classification, or the like. The order of analysis processing of the sub-images may be in the order of the positions of the sub-images in the original image. Since the size of the sub-image obtained by the segmentation in step S101 is smaller than or equal to the size requirement of the visual AI analysis model for the image, the analysis processing time of each sub-image is short. Step S103 is performed after each sub-image has been analyzed.
S103, zooming the image to be analyzed to a preset size, and inputting the image to the analysis model for analysis processing to obtain a second analysis result. The image to be analyzed (i.e. the original image which is not segmented) can be zoomed by the image editing software, so that the resolution of the zoomed image meets the requirement of the analysis model, and then the zoomed image is input into the analysis model to be analyzed to obtain a second analysis result.
It should be noted that, step S102 and step S103 are not in a fixed time sequence, and step S102 may be executed first, and then step S103 is executed, or in other embodiments, step S103 may be executed first, and then step S102 is executed, as long as the first analysis result and the second analysis result are obtained.
Since some objects in the first analysis result and the second analysis result of step S102 and step S103 are necessarily repeatedly detected, step S104 needs to be performed in order to remove the repeated objects.
And S104, removing repeated targets in the first analysis result and the second analysis result to obtain a final result. The repetitive targets in the first analysis result and the second analysis result may be determined according to the positions of the targets in the image to be analyzed (i.e., the original image), and when the two targets are located at the same position or the positions of the two targets overlap mostly, the two targets are determined to be repetitive targets, so that one of the two targets is removed.
As can be seen from the foregoing steps S101 to S104, by dividing the image to be analyzed into a plurality of sub-images, respectively performing analysis processing, scaling the image to be analyzed to a preset size, inputting the scaled image to the analysis model for analysis processing, and then performing deduplication on the analysis results of the two times, many small targets in the original image can be detected, so as to ensure the detection accuracy, and at the same time, the size of the image input in each analysis can be reduced, so as to reduce the time consumed by image analysis, thereby ensuring both the analysis accuracy and the analysis timeliness.
In the image segmentation process, if a detected target falls on a segmentation boundary, the target cannot be detected. Therefore, in order to avoid missing detection, in an embodiment, the image segmentation is performed by using a translation segmentation method to segment the image to be analyzed into a plurality of sub-images, wherein the translation segmentation method comprises the following steps:
setting an image segmentation frame according to the image requirement of the analysis model; and the resolution of the image segmentation frame is less than or equal to the requirement of the analysis model on the image.
And translating the image segmentation frame along the transverse direction and the longitudinal direction of the image to be analyzed to obtain a plurality of sub-images, wherein the transverse translation distance of the image segmentation frame is less than the transverse size of the image segmentation frame, and the longitudinal translation distance of the image segmentation frame is less than the longitudinal size of the image segmentation frame. As shown in fig. 2 and 3, the resolution of the image segmentation frame is a × b, where a is the horizontal resolution and b is the vertical resolution, the image segmentation frame in fig. 2 is moved in the horizontal direction in turn, and a sub-image is acquired from the image to be original at each position of the movement, and the distance of the horizontal movement of the image segmentation frame is less than the horizontal resolution (i.e., the horizontal size) of the image segmentation frame. Also, as shown in fig. 3, the image segmentation frame is moved in the longitudinal direction by a distance less than the longitudinal resolution (i.e., the longitudinal dimension) of the image segmentation frame. Therefore, the two sub-images which are adjacent in the transverse direction and the longitudinal direction are partially overlapped, so that the object can be prevented from being cut and being undetected.
Preferably, the distance of the horizontal translation of the image segmentation frame is half of the horizontal size of the image segmentation frame, and the distance of the vertical translation of the image segmentation frame is half of the vertical size of the image segmentation frame. As shown in fig. 2 and fig. 3, it is assumed that the resolution of the original image is W × H, the image resolution width required by the analysis model is a × b, the resolution of the image segmentation frame is also set to a × b, and then the abscissa of the image segmentation frame performs offset segmentation on the sub-image according to an integer multiple of a/2; the ordinate image segmentation frame is shifted by an integer multiple of b/2, and the original image is cut into a plurality of small graphs P1, P2.
As shown in fig. 3, for a larger object in the original image, there is still a possibility that the object may be divided into two incomplete parts (such as the object B in fig. 3) during the division, and therefore, the object B is not detected by the analysis processing of the sub-images. Therefore, in order to avoid missing detection of a large target such as the target B, the original image needs to be reduced in size and then input to the analysis model for analysis processing in step S103. Therefore, by combining the step S102 and the step S103, a small target and a large target can be detected, and the size of the image input into the analysis model at each time can meet the requirement, so that the analysis processing time is reduced, the timeliness of the analysis processing is improved, and the higher the resolution of the original image is, the more obvious the improvement effect is.
In step S104 and step S103, when the sub-image and the scaled image are input to the analysis model analysis process, it is necessary to record the positions of the objects, that is, the positions of the objects and the positions of the objects in the image, in addition to the detected objects, in step S102 and step S103. in the analysis process of the sub-image, the positions of the objects and the positions of the objects in the image are also recorded, wherein, when the sub-image is analyzed, the positions of the objects in the sub-image and the offsets of the sub-image in the original image are superimposed to each other, as shown in fig. 2, the position of the object a in the sub-image P is a (x, y, w, h), and then the position a (x + α, y + β, w, h) of the object in the original image is obtained according to the offset position (α) of the sub-image P in the original image.
Judging whether the overlapping area of the position of the target in the first analysis result and the area of the target in the second analysis result exceeds a preset value, judging whether the targets in the first analysis result and the second analysis result are repetitive targets, judging that the two targets are repetitive targets when the overlapping area of the two targets is equal to or exceeds the preset value, and judging that the two targets are not repetitive targets when the overlapping area of the two targets is smaller than the preset value.
Preferably, in one embodiment, the overlapping area of the two objects is set to be more than 80%, i.e., the two objects are considered to be the same object. According to the position in the subgraph at present, the position of the target in the original image can be calculated by combining the offset position. And then judging the overlapping area of the target in the first analysis result and the second analysis result according to the area of the target in the original image and the area of the target in the original image. Therefore, when the overlapping area of the objects in the first analysis result and the second analysis result exceeds 80%, the objects are determined to be the repetitive objects.
In another embodiment, as shown in fig. 4, a computer-readable storage medium 400 is provided, where the computer-readable storage medium 400 stores thereon a computer program, and the computer program, when executed by a processor, implements the steps of any of the above embodiments, and thus, has the technical effects of any of the above embodiments.
It should be noted that, although the above embodiments have been described herein, the invention is not limited thereto. Therefore, based on the innovative concepts of the present invention, the technical solutions of the present invention can be directly or indirectly applied to other related technical fields by making changes and modifications to the embodiments described herein, or by using equivalent structures or equivalent processes performed in the content of the present specification and the attached drawings, which are included in the scope of the present invention.

Claims (8)

1. An image analysis method, comprising the steps of:
segmenting an image to be analyzed into a plurality of sub-images;
respectively inputting the subimages into an analysis model for analysis processing to obtain a first analysis result;
zooming the image to be analyzed to a preset size and inputting the image to the analysis model for analysis processing to obtain a second analysis result;
and removing repeated targets in the first analysis result and the second analysis result to obtain a final result.
2. The image analysis method according to claim 1, wherein when the sub-image is input into the analysis model for analysis processing to obtain the target, the position of the target in the sub-image is further recorded, and the position of the target in the image to be analyzed is calculated according to the offset position of the sub-image in the image to be analyzed and the position of the target in the sub-image.
3. The image analysis method according to claim 2, wherein the first analysis result and the second analysis result each include a target and a position of the target in the image to be analyzed;
and judging whether the area overlapping of the target in the first analysis result and the target in the second analysis result exceeds a preset value or not, and judging whether the target in the first analysis result and the target in the second analysis result are repeated targets or not.
4. The image analysis method according to claim 2, wherein the objects in the first analysis result are determined to be repetitive objects when the area overlap of the objects in the second analysis result exceeds 80%.
5. The image analysis method according to claim 1, wherein the segmenting of the image to be analyzed into a plurality of sub-images comprises the steps of:
setting an image segmentation frame according to the image requirement of the analysis model;
and translating the image segmentation frame along the transverse direction and the longitudinal direction of the image to be analyzed to obtain a plurality of sub-images, wherein the transverse translation distance of the image segmentation frame is less than the transverse size of the image segmentation frame, and the longitudinal translation distance of the image segmentation frame is less than the longitudinal size of the image segmentation frame.
6. The image analysis method of claim 5, wherein the image segmentation frame is translated laterally by half of the lateral dimension of the image segmentation frame, and wherein the image segmentation frame is translated longitudinally by half of the longitudinal dimension of the image segmentation frame.
7. The image analysis method according to claim 1, wherein the analysis model is a visual AI analysis model.
8. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, carries out the steps of any of claims 1 to 7.
CN202010205817.8A 2020-03-23 2020-03-23 Image analysis method and storage medium Pending CN111476799A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010205817.8A CN111476799A (en) 2020-03-23 2020-03-23 Image analysis method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010205817.8A CN111476799A (en) 2020-03-23 2020-03-23 Image analysis method and storage medium

Publications (1)

Publication Number Publication Date
CN111476799A true CN111476799A (en) 2020-07-31

Family

ID=71747716

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010205817.8A Pending CN111476799A (en) 2020-03-23 2020-03-23 Image analysis method and storage medium

Country Status (1)

Country Link
CN (1) CN111476799A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116866666A (en) * 2023-09-05 2023-10-10 天津市北海通信技术有限公司 Video stream picture processing method and device in rail transit environment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477692A (en) * 2009-02-13 2009-07-08 阿里巴巴集团控股有限公司 Method and apparatus for image characteristic extraction
KR20180096101A (en) * 2017-02-20 2018-08-29 엘아이지넥스원 주식회사 Apparatus and Method for Intelligent Infrared Image Fusion
US20190050681A1 (en) * 2017-08-09 2019-02-14 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
CN110310264A (en) * 2019-06-25 2019-10-08 北京邮电大学 A kind of large scale object detection method, device based on DCNN
CN110327013A (en) * 2019-05-21 2019-10-15 北京至真互联网技术有限公司 Eye fundus image detection method, device and equipment and storage medium
CN110390666A (en) * 2019-06-14 2019-10-29 平安科技(深圳)有限公司 Road damage detecting method, device, computer equipment and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101477692A (en) * 2009-02-13 2009-07-08 阿里巴巴集团控股有限公司 Method and apparatus for image characteristic extraction
KR20180096101A (en) * 2017-02-20 2018-08-29 엘아이지넥스원 주식회사 Apparatus and Method for Intelligent Infrared Image Fusion
US20190050681A1 (en) * 2017-08-09 2019-02-14 Canon Kabushiki Kaisha Image processing apparatus, image processing method, and non-transitory computer-readable storage medium
CN110327013A (en) * 2019-05-21 2019-10-15 北京至真互联网技术有限公司 Eye fundus image detection method, device and equipment and storage medium
CN110390666A (en) * 2019-06-14 2019-10-29 平安科技(深圳)有限公司 Road damage detecting method, device, computer equipment and storage medium
CN110310264A (en) * 2019-06-25 2019-10-08 北京邮电大学 A kind of large scale object detection method, device based on DCNN

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116866666A (en) * 2023-09-05 2023-10-10 天津市北海通信技术有限公司 Video stream picture processing method and device in rail transit environment
CN116866666B (en) * 2023-09-05 2023-12-08 天津市北海通信技术有限公司 Video stream picture processing method and device in rail transit environment

Similar Documents

Publication Publication Date Title
Oliveira et al. dhSegment: A generic deep-learning approach for document segmentation
US8401333B2 (en) Image processing method and apparatus for multi-resolution feature based image registration
CN107679437B (en) Bar code image recognition method based on Zbar
Lee et al. Object detection-based video retargeting with spatial–temporal consistency
CN115797962B (en) Wall column identification method and device based on assembly type building AI design
WO2019177639A1 (en) Artificial intelligence system and methods for performing image analysis
CN113221895A (en) Small target detection method, device, equipment and medium
CN111476799A (en) Image analysis method and storage medium
Zheng et al. Advanced Radon transform using generalized interpolated Fourier method for straight line detection
CN113780118A (en) Building video highlight automatic detection method and equipment based on vision and storage medium
Fang et al. 1-D barcode localization in complex background
CN112364863A (en) Character positioning method and system for license document
CN115588109B (en) Image template matching method, device, equipment and application
CN111178192A (en) Position identification method and device for target object in image
Lefevre et al. A local approach for fast line detection
CN116128826A (en) YOLOv 5-based lithium battery defect detection method, system, equipment and storage medium
CN111260723B (en) Barycenter positioning method of bar and terminal equipment
JPH04275685A (en) Image area identification processing method
CN110674778B (en) High-resolution video image target detection method and device
EP2631813A1 (en) Method and device for eliminating cracks within page
JPH11339017A (en) License plate recognizing device
CN114647361A (en) Touch screen object positioning method and device based on artificial intelligence
CN113921412A (en) Method, device and equipment for calculating chip period in wafer
CN113409246A (en) Method and system for counting and positioning reinforcing steel bar heads
CN111862144A (en) Method and device for determining object movement track fraction

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