CN109146908A - A kind of bianry image stream quick region identification algorithm - Google Patents
A kind of bianry image stream quick region identification algorithm Download PDFInfo
- Publication number
- CN109146908A CN109146908A CN201810828549.8A CN201810828549A CN109146908A CN 109146908 A CN109146908 A CN 109146908A CN 201810828549 A CN201810828549 A CN 201810828549A CN 109146908 A CN109146908 A CN 109146908A
- Authority
- CN
- China
- Prior art keywords
- data
- flag
- value
- assigned
- count
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/187—Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/10—Image acquisition modality
- G06T2207/10004—Still image; Photographic image
Abstract
The invention discloses a kind of bianry image stream quick region identification algorithms, carry out connected domain for the consecutive image stream that line scan image sensor is formed and quickly identify, propose a kind of bianry image quick region identification algorithm of suitable FPGA Parallel Implementation.Algorithm to image from left to right, it progressively scans from top to bottom, the target pixel points of appearance are marked, the horizontal and vertical target pixel points maximum quantity of each connected domain is counted while calculating connected domain number, it only needs two adjacent row data that judgement is marked every time, and only needs to image scanning once.Algorithm can not only realize the connected component labeling of two-value consecutive image stream, but also static bianry image connected component labeling may be implemented.
Description
Technical field
The present invention relates to technical field of image information processing, specifically disclose a kind of bianry image quick region identification calculation
Method, suitable for High-motion picture stream and the connected domain analysis of static image.
Background technique
As computer image processing technology is constantly progressive, in pattern-recognition, robot vision, numerous phases such as detection technique
It closes subject constantly to develop, bianry image connected domain detection efficiency has become the underlying issue of this kind of image related fields researchs
One of, there is more scholar to study bianry image connected component labeling problem both at home and abroad.The two-value in this kind of applications
Image connectivity field mark efficiency of algorithm is the bottleneck problem of a facing always.Many documents introduce connected component labeling at present
Algorithm mainly has element marking algorithm and distance of swimming connected component labeling algorithm.Such as local neighborhood algorithm, there are many different for this kind of algorithm
Form, basic thought are to check each Connected component one by one from part to entirety, to each first to determine one " kind
Sub- point ", then label is inserted with extending to surrounding neighbors;There are also " dividing and rule " algorithm, basic thought is from entirety to part, first
It determines different Connected components, then each region is inserted with fill method and is marked.For example, using region segmentation method, wheel
Wide method for tracing, equal tag class algorithm, can distinguish different connected domains.Two class methods are all difficult to avoid doing image
Multiple-Scan, it is inefficient.Label rectified is used first to reduce image scanning number, so based on distance of swimming connected component labeling algorithm
Combined efficiency is improved using RLE Run- Length Coding to label again afterwards.This innovatory algorithm can be one to most of shape objects
In secondary scanning complete pixel label, but the algorithm cannot the connection shape (such as bifurcated) to all complexity take one kind it is general
Mode is handled, and different bifurcated directions can only be handled using different scanning mode, does not have versatility.And algorithm above
It is required that image will have a complete frame just can be with the image stream formed for linear array CCD scanning then can not be continuously connected to
Domain detection, is unable to satisfy the labeling algorithm requirement based on image stream moving object real-time tracking.
Summary of the invention
It is an object of the invention in view of the above-mentioned problems, proposing a kind of bianry image stream quick region identification algorithm, needle
Connected domain is carried out to the consecutive image stream that line scan image sensor is formed quickly to identify, proposes a kind of suitable FPGA Parallel Implementation
Bianry image quick region identification algorithm.Algorithm from left to right, progressively scans image from top to bottom, to the target picture of appearance
Vegetarian refreshments is marked, and the horizontal and vertical target pixel points that each connected domain is counted while calculating connected domain number are maximum
Quantity only needs two adjacent row data that judgement is marked every time, and only needs to image scanning once.Algorithm not only may be used
It realizes the connected component labeling of two-value consecutive image stream, but also static bianry image connected component labeling may be implemented.
Thus the invention discloses a kind of bianry image stream quick region identification algorithm, labeling algorithm to image from a left side to
The right side progressively scans from top to bottom, and the target pixel points of appearance are marked, and sets pixel value in bianry image as 0 pixel
It is background pixel point, the pixel that pixel value is 1 is target pixel points.In carrying out connected domain detection process, while counting each
The horizontal and vertical target pixel points maximum quantity of connected region, the lateral target pixel points maximum quantity of each connected domain
It is stored in one-dimension array X [], longitudinal target pixel points maximum quantity is stored in one-dimension array Y [].Target picture
Vegetarian refreshments Dj,iMark value be stored in one-dimension array Flag_data [], and the target pixel points in the same connected domain have
Identical mark value, connected domain counter are indicated with n.Repeating label connection domain identifier is stored in one-dimension array Flag_data_
In bak [], repeating label connected domain counter is indicated with m.Present image detection row has the target pixel points of same tag value
Number is indicated with X_count.
It mainly comprises the steps that
A. pre-processing image data: after to each initialization of variable, one is respectively inserted into original image left end and right end first
The pixel that column pixel value is 0 guarantees that the pixel value of every row is all to start with 0 and terminate with 0 with this;
B. reading data: progressively scanning image from top to bottom, is successively read adjacent rows data and carries out connected domain detection,
Connected domain detection is carried out to each target pixel points using 8 neighborhoods, current pixel vertex neighborhood is divided into 8 kinds of feelings according to 8 neighborhoods
Current pixel point is labeled as D by conditionj,i, the row of j expression current pixel point, the column of i expression current pixel point;To Dj,i8 neighborhoods
When communication with detection, it is only necessary to detect Dj,i-1、Dj-1,i-1、Dj-1,iAnd Dj-1,i+1Pixel value, if Dj,i=0, then mark the point for back
Scene vegetarian refreshments, if Dj,i=1, then marking the point is target pixel points;
C. connected domain detects: being carried out using priority level sequence to target pixel points according to the different situations of current pixel value
Processing;Wherein, priority level sequence is shown in a to h: priority level sequence is as follows:
A:Dj,i=0 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
B:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=0;
C:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=0, Dj-1,i+1=1;
D:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
E:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
F:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=X, Dj-1,i+1=X;
G:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=1, Dj-1,i+1=X;
H:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
Wherein, X indicates 1 or 0.
Furthermore connected domain detecting step and algorithm described in step C are as follows:
If neighborhood situation meets condition a:
C1-1:DATA [i] corresponding pixel points Dj,i, DATA [i-1] corresponding pixel points Dj,i-1, judge the picture of current pixel point
Element value, if DATA [i]=0, marking the point is background pixel point, does not do connected domain analysis processing to the point, only carries out X
[] updates;Judge whether DATA [i-1] is equal to 1, if then carrying out step C1-2, if not then carrying out step C1-4;
C1-2: comparing the size of X_count and X [Flag_data [i-1]], if X_count is greater than X [Flag_data
[i-1]], then step C1-3 is carried out, step C1-4 is otherwise carried out;
C1-3: X [Flag_data [i-1]] is updated with X_count;
C1-4: terminate;
If neighborhood situation meets condition b:
C2-1: connected domain counting n is added 1, X_count is assigned a value of 1, carries out step C2-2;
C2-2: judging whether m is greater than 0, carries out step C2-3 if more than 0, otherwise carries out step C2-4;
C2-3: X [Flag_data_bak [i-1]] and Y [Flag_data_bak [i-1]] is assigned a value of 1, Flag_data
[i] is assigned a value of Flag_data_bak [m], and then m subtracts 1, carries out step C2-5;
C2-4: being labeled as n for Flag_data [i], and X [n] and Y [n] are assigned a value of 1, carry out step C2-5;
C2-5: terminate;
If field situation meets condition c:
C3-1: Flag_data [i] is assigned a value of Flag_data [i-1];
C3-2: judging whether Flag_data [i+1] is equal to Flag_data [i-1], if unequal, carries out step C3-3,
Otherwise step C3-4 is carried out;
C3-4: judge Dj,i-1Whether it is equal to 1, carries out step C3-5 if not equal to 1, otherwise carries out step C3-6;
C3-5: X_count is assigned a value of 1, carries out step C3-7;
C3-6:X_count adds up 1, Y [Flag_data [i-1]] cumulative 1, goes to and carries out step C3-7;
C3-7: terminate;
If neighborhood situation meets condition d:
C4-1: portion's counting variable of setting a trap is k, and k is assigned a value of X_count first, and X_count is then added up 1, is walked
Rapid C4-2;
C4-2: judging whether Flag_data [i-1] is greater than Flag_data [i+1], no if more than step C4-6 is then carried out
Then carry out step C4-3;
C4-3: judging whether Flag_data [i-1] is less than Flag_data [i+1], carries out step C4-4 if being less than, no
Then carry out step C4-5;
C4-4: m 1, the n that adds up is subtracted 1 first, Y [Flag_data [i+1]] is then assigned a value of 0, Flag_data_bak
[m] is assigned a value of Flag_data [i+1], and Flag_data [i+1] is assigned a value of Flag_data [i-1], and Flag_data [i] is assigned a value of
Flag_data [i-1] then carries out step C4-7;
C4-5:Flag_data [i] is assigned a value of Flag_data [i-1], carries out step C4-7;
C4-6: subtracting 1 for n first, Y [Flag_data [i+1]] cumulative 1, then by Dj,i-1There is continuous k target picture in front
Vegetarian refreshments mark value is updated to Flag_data [i+1], goes to step C4-7;
C4-7: terminate;
If neighborhood situation meets condition e:
C5-1:X_count cumulative 1, goes to step C5-2;
C5-2: judge whether Flag_data [i] is equal to Flag_data [i-1] and otherwise goes to equal to step C5-3 is gone to
C5-4;
C5-3: Flag_data [i] is assigned a value of Flag_data [i-1], goes to C5-4;
C5-4: terminate;
If neighborhood situation meets condition f:
C6-1:X_count assignment 1, Flag_data [i] are assigned a value of Flag_data [i-1], Y [Flag_data [i-1]]
Cumulative 1, go to C6-2;
C6-2: terminate;
If neighborhood situation meets condition g:
C7-1:X_count assignment 1, Y [Flag_data [i]] cumulative 1, goes to C7-2;
C7-2: terminate;
If neighborhood situation meets condition h:
C8-1:X_count assignment 1, Y [Flag_data [i+1]] cumulative 1, Flag_data [i] are assigned a value of Flag_data
[i+1], goes to C8-2;
C8-2: terminate;
D. step B is returned to if target pixel points are not detected and finished, until the detection of all target pixel points terminates.
The beneficial effects of the present invention are:
1, the target pixel points of appearance are marked in inventive algorithm, and two adjacent row data is only needed to be marked every time
Note judgement, and only need to the primary both achievable connected component labeling of image scanning, while it is statistics available go out each connected domain transverse direction and
Longitudinal target pixel points maximum quantity.
2, inventive algorithm can not only realize the connected component labeling of two-value consecutive image stream, but also static state two may be implemented
It is worth image connectivity field mark.
3, inventive algorithm uses parallel architecture, and FPGA is suitble to realize, algorithm operational efficiency is high.
Detailed description of the invention:
Fig. 1 is algorithm flow chart of the invention.
8 adjacent region data distribution maps when Fig. 2 is connected domain detection of the invention.
Fig. 3 is neighborhood situation a Processing Algorithm flow chart of the invention.
Fig. 4 is neighborhood situation b Processing Algorithm flow chart of the invention.
Fig. 5 is neighborhood situation c Processing Algorithm flow chart of the invention.
Fig. 6 is neighborhood situation d Processing Algorithm flow chart of the invention.
Fig. 7 is neighborhood situation e Processing Algorithm flow chart of the invention.
Fig. 8 is neighborhood situation f Processing Algorithm flow chart of the invention.
Fig. 9 is neighborhood situation g Processing Algorithm flow chart of the invention.
Figure 10 is neighborhood situation h Processing Algorithm flow chart of the invention.
Specific embodiment
The invention will be further described With reference to embodiment.
With reference to Fig. 1-Figure 10, the content announced according to the present invention, the present embodiment provides a kind of bianry image stream high-speed communications
Field mark algorithm, labeling algorithm from left to right, progressively scan image from top to bottom, mark to the target pixel points of appearance
Note, set in bianry image pixel value as 0 pixel is background pixel point, and pixel value is target pixel points for 1 pixel.Into
In row connected domain detection process, while counting the horizontal and vertical target pixel points maximum quantity of each connected region, Mei Gelian
The lateral target pixel points maximum quantity in logical domain is stored in one-dimension array X [], and longitudinal target pixel points maximum quantity is stored in
In one-dimension array Y [].Target pixel points Dj,iMark value be stored in one-dimension array Flag_data [], and the same connection
Target pixel points mark value having the same in domain, connected domain counter are indicated with n.Repeating label connection domain identifier is stored in
In one-dimension array Flag_data_bak [], repeating label connected domain counter is indicated with m.Present image detection row has identical
The target pixel points number of mark value is indicated with X_count.
It mainly comprises the steps that
A. pre-processing image data: after to each initialization of variable, one is respectively inserted into original image left end and right end first
The pixel that column pixel value is 0 guarantees that the pixel value of every row is all to start with 0 and terminate with 0 with this;
B. reading data: progressively scanning image from top to bottom, is successively read adjacent rows data and carries out connected domain detection,
Connected domain detection is carried out to each target pixel points using 8 neighborhoods, current pixel vertex neighborhood is divided into a-h eight according to 8 neighborhoods
Current pixel point is labeled as D by kind situationj,i, the row of j expression current pixel point, the column of i expression current pixel point;To Dj,i8
When neighborhood communication with detection, it is only necessary to detect Dj,i-1、Dj-1,i-1、Dj-1,iAnd Dj-1,i+1Pixel value, if Dj,i=0, then mark the point
For background pixel point, if Dj,i=1, then marking the point is target pixel points;
C. connected domain detects: being carried out using priority level sequence to target pixel points according to the different situations of current pixel value
Processing;It must successively be detected according to the sequence of a-h when detection, wherein priority level sequence is shown in a to h:
A:Dj,i=0 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
B:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=0;
C:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=0, Dj-1,i+1=1;
D:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
E:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
F:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=X, Dj-1,i+1=X;
G:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=1, Dj-1,i+1=X;
H:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
Wherein, X indicates 1 or 0.
Furthermore connected domain detecting step and algorithm described in step C are as follows:
As shown in figure 3, if neighborhood situation meets condition a:
C1-1:DATA [i] corresponding pixel points Dj,i, DATA [i-1] corresponding pixel points Dj,i-1, judge the picture of current pixel point
Element value, if DATA [i]=0, marking the point is background pixel point, does not do connected domain analysis processing to the point, only carries out X
[] updates;Judge whether DATA [i-1] is equal to 1, if then carrying out step C1-2, if not then carrying out step C1-4;
C1-2: comparing the size of X_count and X [Flag_data [i-1]], if X_count is greater than X [Flag_data
[i-1]], then step C1-3 is carried out, step C1-4 is otherwise carried out;
C1-3: X [Flag_data [i-1]] is updated with X_count;
C1-4: terminate;
As shown in figure 4, if neighborhood situation meets condition b:
The condition b of satisfaction then illustrates to be possible to occur a new connected domain, while Dj,iIt must be a left side for some connected domain
Lateral boundaries, at this point, operation in the following manner:
C2-1: connected domain counting n is added 1, X_count is assigned a value of 1, carries out step C2-2;
C2-2: judging whether m is greater than 0, is the connected domain for duplicating label if more than 0, carries out step C2-3, otherwise
Carry out step C2-4;
C2-3: X [Flag_data_bak [i-1]] and Y [Flag_data_bak [i-1]] is assigned a value of 1, Flag_data
[i] is assigned a value of Flag_data_bak [m], and then m subtracts 1, carries out step C2-5;
C2-4:m is equal to 0 and illustrates the connected domain for having occurred new, and Flag_data [i] is labeled as n, X [n] and Y [n] assignment
It is 1, carries out step C2-5;
C2-5: terminate;
As shown in figure 5, if field situation meets condition c:
C3-1: Flag_data [i] is assigned a value of Flag_data [i-1];
C3-2: judge whether Flag_data [i+1] is equal to Flag_data [i-1] and illustrates adjacent lastrow if unequal
Element Dj-1,i-1And Dj-1,i+1Label connected domain is duplicated, step C3-3 is carried out, otherwise carries out step C3-4;
C3-4: judge Dj,i-1Whether it is equal to 1, illustrates D if not equal to 1j,iFor the boundary of connected domain, step C3-5 is carried out,
Otherwise step C3-6 is carried out;
C3-5: X_count is assigned a value of 1, carries out step C3-7;
C3-6:X_count adds up 1, Y [Flag_data [i-1]] cumulative 1, goes to and carries out step C3-7;
C3-7: terminate;
As shown in fig. 6, if neighborhood situation meets condition d:
C4-1: portion's counting variable of setting a trap is k, and k is assigned a value of X_count first, and X_count is then added up 1, is walked
Rapid C4-2;
C4-2: judging whether Flag_data [i-1] is greater than Flag_data [i+1], no if more than step C4-6 is then carried out
Then carry out step C4-3;
C4-3: judging whether Flag_data [i-1] is less than Flag_data [i+1], carries out step C4-4 if being less than, no
Then carry out step C4-5;
C4-4: m 1, the n that adds up is subtracted 1 first, Y [Flag_data [i+1]] is then assigned a value of 0, Flag_data_bak
[m] is assigned a value of Flag_data [i+1], and Flag_data [i+1] is assigned a value of Flag_data [i-1], and Flag_data [i] is assigned a value of
Flag_data [i-1] then carries out step C4-7;
C4-5:Flag_data [i] is assigned a value of Flag_data [i-1], carries out step C4-7;
C4-6: subtracting 1 for n first, Y [Flag_data [i+1]] cumulative 1, then by Dj,i-1There is continuous k target picture in front
Vegetarian refreshments mark value is updated to Flag_data [i+1], goes to step C4-7;
C4-7: terminate;
As shown in fig. 7, if neighborhood situation meets condition e:
C5-1:X_count cumulative 1, goes to step C5-2;
C5-2: judge whether Flag_data [i] is equal to Flag_data [i-1] and otherwise goes to equal to step C5-3 is gone to
C5-4;
C5-3: Flag_data [i] is assigned a value of Flag_data [i-1], goes to C5-4;
C5-4: terminate;
As shown in figure 8, if neighborhood situation meets condition f:
C6-1:X_count assignment 1, Flag_data [i] are assigned a value of Flag_data [i-1], Y [Flag_data [i-1]]
Cumulative 1, go to C6-2;
C6-2: terminate;
As shown in figure 9, if neighborhood situation meets condition g:
C7-1:X_count assignment 1, Y [Flag_data [i]] cumulative 1, goes to C7-2;
C7-2: terminate;
As shown in Figure 10, if neighborhood situation meets condition h:
C8-1:X_count assignment 1, Y [Flag_data [i+1]] cumulative 1, Flag_data [i] are assigned a value of Flag_data
[i+1], goes to C8-2;
C8-2: terminate;
D. step B is returned to if target pixel points are not detected and finished, until the detection of all target pixel points terminates.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the invention, all in essence of the invention
Within mind and principle, any modification, equivalent replacement, improvement and so on be should all be included in the protection scope of the present invention.
Claims (3)
1. a kind of bianry image stream quick region identification algorithm, which is characterized in that itself the following steps are included:
A. pre-processing image data: after to each initialization of variable, a column picture is respectively inserted into original image left end and right end first
The pixel that plain value is 0 guarantees that the pixel value of every row is all to start with 0 and terminate with 0 with this;
B. reading data: progressively scanning image from top to bottom, is successively read adjacent rows data and carries out connected domain detection, uses
8 neighborhoods carry out connected domain detection to each target pixel points, and current pixel vertex neighborhood is divided into 8 kinds of situations according to 8 neighborhoods, will
Current pixel point is labeled as Dj,i, the row of j expression current pixel point, the column of i expression current pixel point;To Dj,i8 neighborhoods connection
When detection, it is only necessary to detect Dj,i-1、Dj-1,i-1、Dj-1,iAnd Dj-1,i+1Pixel value, if Dj,i=0, then marking the point is background picture
Vegetarian refreshments, if Dj,i=1, then marking the point is target pixel points;
C. connected domain detect: according to the different situations of current pixel value using priority level sequence to target pixel points at
Reason;
D. step B is returned to if target pixel points are not detected and finished, until the detection of all target pixel points terminates.
2. a kind of bianry image stream quick region identification algorithm as described in claim 1, which is characterized in that institute in step C
The priority level sequence stated is as follows:
A:Dj,i=0 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
B:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=0;
C:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=0, Dj-1,i+1=1;
D:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
E:Dj,i=1 and Dj,i-1=1, Dj-1,i-1=X, Dj-1,i=X, Dj-1,i+1=X;
F:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=1, Dj-1,i=X, Dj-1,i+1=X;
G:Dj,i=1 and Dj,i-1=X, Dj-1,i-1=X, Dj-1,i=1, Dj-1,i+1=X;
H:Dj,i=1 and Dj,i-1=0, Dj-1,i-1=0, Dj-1,i=0, Dj-1,i+1=1;
Wherein, X indicates 1 or 0.
3. a kind of bianry image stream quick region identification algorithm as claimed in claim 2, which is characterized in that described in step C
Connected domain detecting step and algorithm it is as follows:
If neighborhood situation meets condition a:
C1-1:DATA [i] corresponding pixel points Dj,i, DATA [i-1] corresponding pixel points Dj,i-1, judge the pixel value of current pixel point,
If DATA [i]=0, marking the point is background pixel point, does not do connected domain analysis processing to the point, only carries out X [] more
Newly;Judge whether DATA [i-1] is equal to 1, if then carrying out step C1-2, if not then carrying out step C1-4;
C1-2: comparing the size of X_count and X [Flag_data [i-1]], if X_count is greater than X [Flag_data [i-
1]], then step C1-3 is carried out, step C1-4 is otherwise carried out;
C1-3: X [Flag_data [i-1]] is updated with X_count;
C1-4: terminate;
If neighborhood situation meets condition b:
C2-1: connected domain counting n is added 1, X_count is assigned a value of 1, carries out step C2-2;
C2-2: judging whether m is greater than 0, carries out step C2-3 if more than 0, otherwise carries out step C2-4;
C2-3: X [Flag_data_bak [i-1]] and Y [Flag_data_bak [i-1]] is assigned a value of 1, Flag_data [i] and is assigned
Value is Flag_data_bak [m], and then m subtracts 1, carries out step C2-5;
C2-4: being labeled as n for Flag_data [i], and X [n] and Y [n] are assigned a value of 1, carry out step C2-5;
C2-5: terminate;
If field situation meets condition c:
C3-1: Flag_data [i] is assigned a value of Flag_data [i-1];
C3-2: judging whether Flag_data [i+1] is equal to Flag_data [i-1], if unequal, carries out step C3-3, otherwise
Carry out step C3-4;
C3-4: judge Dj,i-1Whether it is equal to 1, carries out step C3-5 if not equal to 1, otherwise carries out step C3-6;
C3-5: X_count is assigned a value of 1, carries out step C3-7;
C3-6:X_count adds up 1, Y [Flag_data [i-1]] cumulative 1, goes to and carries out step C3-7;
C3-7: terminate;
If neighborhood situation meets condition d:
C4-1: portion's counting variable of setting a trap is k, and k is assigned a value of X_count first, and X_count is then added up 1, carries out step
C4-2;
C4-2: judge Flag_data [i-1] whether be greater than Flag_data [i+1], if more than step C4-6 is then carried out, otherwise into
Row step C4-3;
C4-3: judge Flag_data [i-1] whether be less than Flag_data [i+1], if be less than if carry out step C4-4, otherwise into
Row step C4-5;
C4-4: subtracting 1 for m 1, the n that adds up first, and Y [Flag_data [i+1]] is then assigned a value of 0, Flag_data_bak [m] and is assigned
Value is Flag_data [i+1], and Flag_data [i+1] is assigned a value of Flag_data [i-1], and Flag_data [i] is assigned a value of Flag_
Data [i-1] then carries out step C4-7;
C4-5:Flag_data [i] is assigned a value of Flag_data [i-1], carries out step C4-7;
C4-6: subtracting 1 for n first, Y [Flag_data [i+1]] cumulative 1, then by Dj,i-1There are continuous k target pixel points in front
Mark value is updated to Flag_data [i+1], goes to step C4-7;
C4-7: terminate;
If neighborhood situation meets condition e:
C5-1:X_count cumulative 1, goes to step C5-2;
C5-2: judge whether Flag_data [i] is equal to Flag_data [i-1] and otherwise goes to C5- equal to step C5-3 is gone to
4;
C5-3: Flag_data [i] is assigned a value of Flag_data [i-1], goes to C5-4;
C5-4: terminate;
If neighborhood situation meets condition f:
C6-1:X_count assignment 1, Flag_data [i] are assigned a value of Flag_data [i-1], and Y [Flag_data [i-1]] is cumulative
1, go to C6-2;
C6-2: terminate;
If neighborhood situation meets condition g:
C7-1:X_count assignment 1, Y [Flag_data [i]] cumulative 1, goes to C7-2;
C7-2: terminate;
If neighborhood situation meets condition h:
C8-1:X_count assignment 1, Y [Flag_data [i+1]] cumulative 1, Flag_data [i] are assigned a value of Flag_data [i+
1], C8-2 is gone to;
C8-2: terminate;
Wherein, X [] is the array of the lateral target pixel points maximum quantity of each connected domain, Y [] be longitudinal target pixel points most
The array of big quantity;Flag_data [] is target pixel points Dj,iMark value, and target pixel points in the same connected domain
Mark value having the same;N is the counting of connected domain, and Flag_data_bak [] is the number of the connected component labeling value of repeating label
Group, m are the counting of the connected domain of repeating label, and X_count is the object pixel that current pixel detection row has same tag value
The number of point.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810828549.8A CN109146908A (en) | 2018-07-25 | 2018-07-25 | A kind of bianry image stream quick region identification algorithm |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810828549.8A CN109146908A (en) | 2018-07-25 | 2018-07-25 | A kind of bianry image stream quick region identification algorithm |
Publications (1)
Publication Number | Publication Date |
---|---|
CN109146908A true CN109146908A (en) | 2019-01-04 |
Family
ID=64798041
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810828549.8A Pending CN109146908A (en) | 2018-07-25 | 2018-07-25 | A kind of bianry image stream quick region identification algorithm |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109146908A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110533678A (en) * | 2019-07-26 | 2019-12-03 | 杭州电子科技大学 | Image processing method based on the parallel connected domain screening characteristic target of FPGA frame |
CN110736688A (en) * | 2019-10-25 | 2020-01-31 | 陕西科技大学 | crude oil emulsion particle size detection method, device and readable storage medium |
CN111833398A (en) * | 2019-04-16 | 2020-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for marking pixel points in image |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1147485A1 (en) * | 1999-11-17 | 2001-10-24 | Koninklijke Philips Electronics N.V. | Video stream classifiable symbol isolation method and system |
EP1184808A2 (en) * | 2000-08-29 | 2002-03-06 | Eastman Kodak Company | Method for detection of skew angle and border of document images in a production scanning environment |
CN106412374A (en) * | 2016-12-13 | 2017-02-15 | 长沙麦斯森信息科技有限公司 | Connected-domain one-pass scanning method and device of image based on projection |
CN107067400A (en) * | 2016-11-30 | 2017-08-18 | 南京航空航天大学 | A kind of bianry image method for marking connected region based on the distance of swimming |
-
2018
- 2018-07-25 CN CN201810828549.8A patent/CN109146908A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP1147485A1 (en) * | 1999-11-17 | 2001-10-24 | Koninklijke Philips Electronics N.V. | Video stream classifiable symbol isolation method and system |
EP1184808A2 (en) * | 2000-08-29 | 2002-03-06 | Eastman Kodak Company | Method for detection of skew angle and border of document images in a production scanning environment |
CN107067400A (en) * | 2016-11-30 | 2017-08-18 | 南京航空航天大学 | A kind of bianry image method for marking connected region based on the distance of swimming |
CN106412374A (en) * | 2016-12-13 | 2017-02-15 | 长沙麦斯森信息科技有限公司 | Connected-domain one-pass scanning method and device of image based on projection |
Non-Patent Citations (1)
Title |
---|
曲立国等: "基于FPGA的线阵CCD雨滴图像快速连续识别方法", 《光电工程》 * |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111833398A (en) * | 2019-04-16 | 2020-10-27 | 杭州海康威视数字技术股份有限公司 | Method and device for marking pixel points in image |
CN111833398B (en) * | 2019-04-16 | 2023-09-08 | 杭州海康威视数字技术股份有限公司 | Pixel point marking method and device in image |
CN110533678A (en) * | 2019-07-26 | 2019-12-03 | 杭州电子科技大学 | Image processing method based on the parallel connected domain screening characteristic target of FPGA frame |
CN110533678B (en) * | 2019-07-26 | 2022-02-11 | 杭州电子科技大学 | Image processing method for screening feature targets based on FPGA frame parallel connected domain |
CN110736688A (en) * | 2019-10-25 | 2020-01-31 | 陕西科技大学 | crude oil emulsion particle size detection method, device and readable storage medium |
CN110736688B (en) * | 2019-10-25 | 2022-04-01 | 陕西科技大学 | Crude oil emulsion particle size detection method and device and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109146908A (en) | A kind of bianry image stream quick region identification algorithm | |
CN108734696B (en) | System and method for white point Mura detection | |
CN106682629B (en) | Identification algorithm for identity card number under complex background | |
CN106446894B (en) | A method of based on outline identification ball-type target object location | |
CN111246204A (en) | Relative brightness deviation-based dirt detection method and device | |
CN103413311B (en) | A kind of fuzzy detection method based on edge | |
CN111612757B (en) | Screen crack detection method, device, equipment and storage medium | |
CN109472271B (en) | Printed circuit board image contour extraction method and device | |
CN106770321B (en) | A kind of plastic part defect inspection method based on multi-threshold section | |
EP3396359A1 (en) | Damage information processing device and damage information processing method | |
KR20090101356A (en) | Defect detecting device, and defect detecting method | |
CN104331695B (en) | A kind of circle marker symbol shape quality detection method of robust | |
CN100473141C (en) | Image angle detection device and scan line interpolation device having the same | |
CN111882528A (en) | Screen visual inspection-oriented sub-pixel sorting method and device | |
CN113012096B (en) | Display screen sub-pixel positioning and brightness extraction method, device and storage medium | |
EP1605407A1 (en) | Image processing device | |
CN110596139A (en) | Screen defect detection method and system | |
CN110070560A (en) | Movement direction of object recognition methods based on target detection | |
CN110108724A (en) | Strip-shaped work vision detection system | |
CN107316318B (en) | Air target automatic detection method based on multi-subregion background fitting | |
US6038335A (en) | Flaw detection apparatus using digital image data indicative of a surface of an object | |
CN1898555A (en) | Substrate inspection device | |
CN112213314B (en) | Detection method and detection system for wafer side surface defects | |
JPH05215547A (en) | Method for determining corresponding points between stereo images | |
CN111640122B (en) | LED special-shaped display screen facula positioning and dividing method based on connected domain |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20190104 |