CN109961079A - Image detecting method and device - Google Patents
Image detecting method and device Download PDFInfo
- Publication number
- CN109961079A CN109961079A CN201711420991.9A CN201711420991A CN109961079A CN 109961079 A CN109961079 A CN 109961079A CN 201711420991 A CN201711420991 A CN 201711420991A CN 109961079 A CN109961079 A CN 109961079A
- Authority
- CN
- China
- Prior art keywords
- current
- window
- current window
- weak classifier
- classifier
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/285—Selection of pattern recognition techniques, e.g. of classifiers in a multi-classifier system
Abstract
The present invention provides a kind of image detecting method and device.The described method includes: using current Weak Classifier to be traversed with behavior window-unit a frame image, and after the current Weak Classifier has traversed current window, current window is traversed in the row direction using next Weak Classifier;If the current Weak Classifier does not pass through in current window, by the current window not as target window, next Weak Classifier is in the current window without verifying again;If all Weak Classifiers pass through in current window, using the current window as target window.The present invention can be effectively reduced the influence of high speed miss, promote the performance of image detection.
Description
Technical field
The present invention relates to technical field of image processing more particularly to a kind of image detecting methods and device.
Background technique
Embedded device or PC machine with Cache (cache), when CPU carries out memory access data, first
Data needed for checking whether in Cache, if there is, so that it may be directly accessed data therein without being inserted into any waiting
State, this is best state, and also referred to as high speed is hit.When the information required for CPU is not in Cache, needs to switch and deposit
It stores up main memory and needs to be inserted into waiting, such case is high speed miss, also referred to as Dcachemiss since speed is slower.
Direction gradient figure is that the gradient magnitude for seeking a frame image and direction, gradient magnitude project to the gradient side of unit
To.For example, 0-180 degree is divided into 9 units, i.e., it is used as a unit every 20 degree, generates 9 direction gradient figures altogether.Unit
That divides is more careful, and the direction gradient figure of generation takes up space bigger.For example it is used as one every 20 degree, to use the space of 9 figures.
The core concept of cascade classifier is the classifier (Weak Classifier) different for the training of the same training set, then
These weak classifier sets are got up, a stronger final classification device (strong classifier) is constituted.
The space of 9 figures will be used by calculating feature based on direction gradient figure, in the application of embedded device, it is contemplated that face
Long-pending and cost, the size of Cache can be all restricted, so can reduce Dcachemiss becomes a key for influencing performance
Problem.
Currently, in image-detection process, traditional scheme process are as follows: one frame image of input, with step for 1 cycling among windows,
Each window traverses all Weak Classifiers, if there is Weak Classifier does not pass through, exits, this window not as target window,
Target window is used as if through whole Weak Classifiers.
According to above scheme, if there is 3000 grades of Weak Classifiers, 9 Weak Classifiers of arbitrary continuation may correspond to different
9 direction gradient figures need constantly from memory read data, and the Cache that will result in data in this way jolts, and occur
Cachemiss influences image detection performance.
Summary of the invention
Image detecting method and device provided by the invention can be effectively reduced the influence of high speed miss, promote image
The performance of detection.
In a first aspect, the present invention provides a kind of image detecting method, comprising:
For a frame image, current Weak Classifier is used to be traversed with behavior window-unit, and described weak point current
After class device has traversed current window, current window is traversed in the row direction using next Weak Classifier;
If the current Weak Classifier does not pass through in current window, by the current window not as target window,
Next Weak Classifier is in the current window without verifying again;
If all Weak Classifiers pass through in current window, using the current window as target window.
Optionally, if the current Weak Classifier does not pass through in current window, the current window is not made
For target window, if next Weak Classifier includes: the current weak typing without verifying again in the current window
Device does not pass through in current window, then setting flag bit is 1, by the current window not as target window, next Weak Classifier
Judged in the current window according to the flag bit without verifying again.
Optionally, the method also includes:
Array is set, and the size of initialize array is the width of data line;
After a Weak Classifier has traversed a line, record can by classifier number, and update the size of array;
When the size of array is updated to zero, circulation is directly exited, into next line.
Optionally, the record can by classifier number, and the size for updating array includes: often by one point
The size of array is subtracted 1 by class device.
Second aspect, the present invention provide a kind of image detection device, comprising:
Traversal Unit, for using current Weak Classifier to be traversed with behavior window-unit for a frame image, and
After the current Weak Classifier has traversed current window, current window is carried out in the row direction using next Weak Classifier
Traversal;
First processing units, for when the current Weak Classifier is not when current window passes through, by the current window
Not as target window, next Weak Classifier is in the current window without verifying again;
The second processing unit, for when all Weak Classifiers are when current window passes through, using the current window as
Target window.
Optionally, the first processing units, for setting mark when the current Weak Classifier is not when current window passes through
Will position is 1, and by the current window not as target window, next Weak Classifier judges to work as described according to the flag bit
Front window without verifying again.
Optionally, described device further include:
Initialization unit, for array to be arranged, and the size of initialize array is the width of data line;
Updating unit, for when a Weak Classifier has traversed a line after, record can by classifier number, and more
The size of new array;
Converting unit, for directly exiting circulation when the size of array is updated to zero, into next line.
Optionally, the updating unit, for often by a classifier, subtracting 1 for the size of array.
Image detecting method and device provided in an embodiment of the present invention, for a frame image, use current Weak Classifier with
Behavior window-unit is traversed, and after the current Weak Classifier has traversed current window, using next weak typing
Device in the row direction traverses current window, will be described if the current Weak Classifier does not pass through in current window
Current window not as target window, next Weak Classifier in the current window without verifying again, if all weak
Classifier passes through in current window, then using the current window as target window.Compared with prior art, in the present invention
Each Weak Classifier only uses a direction gradient figure in the window calculation of an entire line direction, and does not have to frequently from memory
Data are read, so as to promote the algorithm performance of image detection;Control loop exits in a manner of dynamic array, can be effective
Reduce calculation amount.
Detailed description of the invention
Fig. 1 is the flow chart of one embodiment of the invention image detecting method
Fig. 2 is the structural schematic diagram of one embodiment of the invention image detection device.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
The embodiment of the present invention provides a kind of image detecting method, as shown in Figure 1, which comprises
S11, for a frame image, use current Weak Classifier to be traversed with behavior window-unit, and described current
After Weak Classifier has traversed current window, current window is traversed in the row direction using next Weak Classifier.
If S12, the current Weak Classifier do not pass through in current window, by the current window not as target window
Mouthful, next Weak Classifier is in the current window without verifying again.
If S13, all Weak Classifiers pass through in current window, using the current window as target window.
Image detecting method provided in an embodiment of the present invention uses current Weak Classifier with behavior window one frame image
Mouth unit is traversed, and after the current Weak Classifier has traversed current window, is expert at using next Weak Classifier
Current window is traversed on direction, if the current Weak Classifier does not pass through in current window, described will work as front window
Mouthful not as target window, next Weak Classifier in the current window without verifying again, if all Weak Classifiers
Pass through in current window, then using the current window as target window.Compared with prior art, each of present invention
Weak Classifier only uses a direction gradient figure in the window calculation of an entire line direction, and does not have to frequently read number from memory
According to so as to promote the algorithm performance of image detection;Control loop exits in a manner of dynamic array, can be effectively reduced meter
Calculation amount.
Image detecting method of the present invention is described in detail below.
Firstly, one frame image of input, each Weak Classifier have traversed all windows in line direction, have gone further next weak point
Class device, that is to say, that an original window-unit is replaced with a line;
Then, if current class device does not pass through in current window, setting flag bit is 1, not using current window as mesh
Window is marked, next Weak Classifier is according to flag bit without verifying again;
If whole Weak Classifiers pass through in current window, using current window as target window.
Using the image detecting method, each Weak Classifier only uses one in the window calculation of an entire line direction
Direction gradient figure, and do not have to frequently from memory read data, so as to boosting algorithm performance.
It in order to further make being optimal of algorithm, control loop can be exited by the way of dynamic array, effectively be dropped
Low calculation amount, concrete scheme are as follows:
One array is set, and the size of initialize array is the width of data line;
After a Weak Classifier has traversed a line, record can by classifier number, update the size of array, use
In controlling next Weak Classifier, saves major part and loop to determine, save the time;Specifically, it will often be counted by a classifier
The size of group subtracts 1;
When the size of array is updated to zero, circulation is directly exited, into next line.
The embodiment of the present invention also provides a kind of image detection device, as shown in Fig. 2, described device includes:
Traversal Unit 11, for using current Weak Classifier to be traversed with behavior window-unit for a frame image, and
After the current Weak Classifier has traversed current window, using next Weak Classifier in the row direction to current window into
Row traversal;
First processing units 12, for when the current Weak Classifier is not when current window passes through, general is described to work as front window
Mouth is not as target window, and next Weak Classifier is in the current window without verifying again;
The second processing unit 13, for when all Weak Classifiers are when current window passes through, the current window to be made
For target window.
Image detection device provided in an embodiment of the present invention uses current Weak Classifier with behavior window one frame image
Mouth unit is traversed, and after the current Weak Classifier has traversed current window, is expert at using next Weak Classifier
Current window is traversed on direction, if the current Weak Classifier does not pass through in current window, described will work as front window
Mouthful not as target window, next Weak Classifier in the current window without verifying again, if all Weak Classifiers
Pass through in current window, then using the current window as target window.Compared with prior art, each of present invention
Weak Classifier only uses a direction gradient figure in the window calculation of an entire line direction, and does not have to frequently read number from memory
According to so as to promote the algorithm performance of image detection;Control loop exits in a manner of dynamic array, can be effectively reduced meter
Calculation amount.
Optionally, the first processing units 12, for setting when the current Weak Classifier is not when current window passes through
Flag bit is 1, and by the current window not as target window, next Weak Classifier judges according to the flag bit described
Current window without verifying again.
Optionally, described device further include:
Initialization unit, for array to be arranged, and the size of initialize array is the width of data line;
Updating unit, for when a Weak Classifier has traversed a line after, record can by classifier number, and more
The size of new array;
Converting unit, for directly exiting circulation when the size of array is updated to zero, into next line.
Optionally, the updating unit, for often by a classifier, subtracting 1 for the size of array.
The device of the present embodiment can be used for executing the technical solution of above method embodiment, realization principle and technology
Effect is similar, and details are not described herein again.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with
Relevant hardware is instructed to complete by computer program, the program can be stored in a computer-readable storage medium
In, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic
Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access
Memory, RAM) etc..
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any
In the technical scope disclosed by the present invention, any changes or substitutions that can be easily thought of by those familiar with the art, all answers
It is included within the scope of the present invention.Therefore, protection scope of the present invention should be subject to the protection scope in claims.
Claims (8)
1. a kind of image detecting method characterized by comprising
For a frame image, current Weak Classifier is used to be traversed with behavior window-unit, and in the current Weak Classifier
After having traversed current window, current window is traversed in the row direction using next Weak Classifier;
If the current Weak Classifier does not pass through in current window, next by the current window not as target window
A Weak Classifier is in the current window without verifying again;
If all Weak Classifiers pass through in current window, using the current window as target window.
If 2. the method according to claim 1, wherein the current Weak Classifier current window not
Pass through, then by the current window not as target window, next Weak Classifier is in the current window without testing again
If card includes: that the current Weak Classifier does not pass through in current window, setting flag bit is 1, and the current window is not made
For target window, next Weak Classifier judges in the current window according to the flag bit without verifying again.
3. method according to claim 1 or 2, which is characterized in that the method also includes:
Array is set, and the size of initialize array is the width of data line;
After a Weak Classifier has traversed a line, record can by classifier number, and update the size of array;
When the size of array is updated to zero, circulation is directly exited, into next line.
4. according to the method described in claim 3, it is characterized in that, the record can by classifier number, and update
The size of array includes: often to subtract 1 for the size of array by a classifier.
5. a kind of image detection device characterized by comprising
Traversal Unit, for using current Weak Classifier to be traversed with behavior window-unit, and described for a frame image
After current Weak Classifier has traversed current window, using next Weak Classifier in the row direction to current window progress time
It goes through;
First processing units, for when the current Weak Classifier is not when current window passes through, the current window not to be made
For target window, next Weak Classifier is in the current window without verifying again;
The second processing unit, for when all Weak Classifiers are when current window passes through, using the current window as target
Window.
6. device according to claim 5, which is characterized in that the first processing units, for when described weak point current
For class device when current window does not pass through, setting flag bit is 1, by the current window not as target window, next weak typing
Device judges in the current window according to the flag bit without verifying again.
7. device according to claim 5 or 6, which is characterized in that described device further include:
Initialization unit, for array to be arranged, and the size of initialize array is the width of data line;
Updating unit, for when a Weak Classifier has traversed a line after, record can by classifier number, and update number
The size of group;
Converting unit, for directly exiting circulation when the size of array is updated to zero, into next line.
8. device according to claim 7, which is characterized in that the updating unit will for often passing through a classifier
The size of array subtracts 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711420991.9A CN109961079B (en) | 2017-12-25 | 2017-12-25 | Image detection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711420991.9A CN109961079B (en) | 2017-12-25 | 2017-12-25 | Image detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109961079A true CN109961079A (en) | 2019-07-02 |
CN109961079B CN109961079B (en) | 2021-06-04 |
Family
ID=67020833
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711420991.9A Active CN109961079B (en) | 2017-12-25 | 2017-12-25 | Image detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109961079B (en) |
Citations (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101398893A (en) * | 2008-10-10 | 2009-04-01 | 北京科技大学 | Adaboost arithmetic improved robust human ear detection method |
CN101853389A (en) * | 2009-04-01 | 2010-10-06 | 索尼株式会社 | Detection device and method for multi-class targets |
CN101996405A (en) * | 2010-08-30 | 2011-03-30 | 中国科学院计算技术研究所 | Method and device for rapidly detecting and classifying defects of glass image |
CN102509259A (en) * | 2011-09-28 | 2012-06-20 | 上海大学 | Image scaling method based on directions of pixels in image |
CN102713934A (en) * | 2009-12-30 | 2012-10-03 | 诺基亚公司 | Method, device and computer program product for detecting objects in digital images |
CN102722723A (en) * | 2012-05-24 | 2012-10-10 | 杭州海康威视数字技术股份有限公司 | Multi-scale-based Adaboost detection method and system |
WO2012168538A1 (en) * | 2011-06-07 | 2012-12-13 | Nokia Corporation | Method, apparatus and computer program product for object detection |
CN104504397A (en) * | 2014-12-31 | 2015-04-08 | 云智视像科技(上海)有限公司 | Monitoring video abstraction method and system based on face identification |
CN104636749A (en) * | 2013-11-14 | 2015-05-20 | 中国移动通信集团公司 | Target object detection method and device |
CN107077621A (en) * | 2014-09-30 | 2017-08-18 | 高通股份有限公司 | For scanning window in the hardware of low-power object detection in image |
-
2017
- 2017-12-25 CN CN201711420991.9A patent/CN109961079B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101398893A (en) * | 2008-10-10 | 2009-04-01 | 北京科技大学 | Adaboost arithmetic improved robust human ear detection method |
CN101853389A (en) * | 2009-04-01 | 2010-10-06 | 索尼株式会社 | Detection device and method for multi-class targets |
CN102713934A (en) * | 2009-12-30 | 2012-10-03 | 诺基亚公司 | Method, device and computer program product for detecting objects in digital images |
CN101996405A (en) * | 2010-08-30 | 2011-03-30 | 中国科学院计算技术研究所 | Method and device for rapidly detecting and classifying defects of glass image |
WO2012168538A1 (en) * | 2011-06-07 | 2012-12-13 | Nokia Corporation | Method, apparatus and computer program product for object detection |
US20140314273A1 (en) * | 2011-06-07 | 2014-10-23 | Nokia Corporation | Method, Apparatus and Computer Program Product for Object Detection |
CN102509259A (en) * | 2011-09-28 | 2012-06-20 | 上海大学 | Image scaling method based on directions of pixels in image |
CN102722723A (en) * | 2012-05-24 | 2012-10-10 | 杭州海康威视数字技术股份有限公司 | Multi-scale-based Adaboost detection method and system |
CN104636749A (en) * | 2013-11-14 | 2015-05-20 | 中国移动通信集团公司 | Target object detection method and device |
CN107077621A (en) * | 2014-09-30 | 2017-08-18 | 高通股份有限公司 | For scanning window in the hardware of low-power object detection in image |
CN104504397A (en) * | 2014-12-31 | 2015-04-08 | 云智视像科技(上海)有限公司 | Monitoring video abstraction method and system based on face identification |
Non-Patent Citations (1)
Title |
---|
韩艺: "《基于视频图像的运动车辆检测与跟踪算法研究》", 《中国优秀硕士学位论文全文数据库信息科技辑》 * |
Also Published As
Publication number | Publication date |
---|---|
CN109961079B (en) | 2021-06-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104583891B (en) | For the devices, systems and methods that the adaptable caching in non-volatile main memory system is changed | |
WO2021120789A1 (en) | Data writing method and apparatus, and storage server and computer-readable storage medium | |
TW202008237A (en) | Method and device for training prediction model for new scenario | |
KR102351085B1 (en) | Method, apparatus and electronic device for risk identification related to transaction to be processed | |
US11593117B2 (en) | Combining load or store instructions | |
US20130166846A1 (en) | Hierarchy-aware Replacement Policy | |
CN106663060A (en) | Methods and systems for cache lines de-duplication | |
Dai et al. | SMASH: A malware detection method based on multi-feature ensemble learning | |
CN110673789B (en) | Metadata storage management method, device, equipment and storage medium of solid state disk | |
CN104778778B (en) | A kind of banknote detection method and system | |
CN111179066B (en) | Batch processing method and device for business data, server and storage medium | |
CN109753443A (en) | A kind of data processing method, device and electronic equipment | |
US20160232093A1 (en) | Computing apparatus and method for cache management | |
CN108027859A (en) | Detect the software attacks to the process in computing device | |
CN109215037A (en) | Destination image partition method, device and terminal device | |
CN110572416A (en) | blacklist generation method and device, electronic equipment and medium | |
CN109086141A (en) | EMS memory management process and device and computer readable storage medium | |
CN108876102A (en) | A kind of risk trade method for digging, device and equipment | |
CN109447080A (en) | A kind of character identifying method and device | |
US20100037025A1 (en) | Method and apparatus for detecting a data access violation | |
CN110414514A (en) | Image processing method and device | |
CN109800675A (en) | A kind of method and device of the identification image of determining face object | |
CN106780415B (en) | Histogram statistical circuit and multimedia processing system | |
US20150347303A1 (en) | Adjusting allocation of storage devices | |
CN112750038B (en) | Transaction risk determination method, device and server |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |