[go: up one dir, main page]

CN109146908A - A kind of bianry image stream quick region identification algorithm - Google Patents

A kind of bianry image stream quick region identification algorithm Download PDF

Info

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
count
connected domain
pixel
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
CN201810828549.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.)
Anhui Normal University
Original Assignee
Anhui Normal University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Anhui Normal University filed Critical Anhui Normal University
Priority to CN201810828549.8A priority Critical patent/CN109146908A/en
Publication of CN109146908A publication Critical patent/CN109146908A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/187Segmentation; Edge detection involving region growing; involving region merging; involving connected component labelling
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10004Still image; Photographic image

Landscapes

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

Abstract

本发明公布了一种二值图像流快速连通域标记算法,针对线阵图像传感器形成的连续图像流进行连通域快速识别,提出一种适合FPGA并行实现的二值图像快速连通域标记算法。算法对图像从左到右,从上到下逐行扫描,对出现的目标像素点进行标记,计算连通域数目的同时统计出每个连通域的横向和纵向的目标像素点最大数量,每次只需要相邻的两行数据进行标记判断,且只需对图像扫描一次既可。算法不但可实现二值连续图像流的连通域标记,而且还可以实现静态二值图像连通域标记。

The invention discloses a fast connected domain labeling algorithm of binary image stream, which is suitable for FPGA parallel implementation for fast connected domain labeling algorithm for continuous image stream formed by a linear image sensor for fast connected domain identification. The algorithm scans the image line by line from left to right and from top to bottom, marks the target pixels that appear, calculates the number of connected domains, and counts the maximum number of horizontal and vertical target pixels in each connected domain. Only two adjacent lines of data are required to be marked and judged, and the image only needs to be scanned once. The algorithm can not only realize the connected domain labeling of binary continuous image stream, but also realize the connected domain labeling of static binary image.

Description

A kind of bianry image stream quick region identification algorithm
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.一种二值图像流快速连通域标记算法,其特征在于,其包括以下步骤:1. a binary image flow fast connected domain labeling algorithm, is characterized in that, it comprises the following steps: A.图像数据预处理:在对各个变量初始化后,首先在原图像左端和右端各插入一列像素值为0的像素点以此保证每行的像素值都是以0开始并以0结束;A. Image data preprocessing: After initializing each variable, first insert a column of pixels with a pixel value of 0 at the left end and the right end of the original image to ensure that the pixel value of each row starts with 0 and ends with 0; B.数据读取:对图像从上到下逐行扫描,依次读取相邻两行数据进行连通域检测,采用8邻域对每个目标像素点进行连通域检测,将当前像素点邻域按照8邻域划分为8种情况,将当前像素点标记为Dj,i,j表示当前像素点的行,i表示当前像素点的列;对Dj,i的8邻域连通检测时,只需要检测Dj,i-1、Dj-1,i-1、Dj-1,i和Dj-1,i+1的像素值,若Dj,i=0,则标记该点为背景像素点,若Dj,i=1,则标记该点为目标像素点;B. Data reading: Scan the image line by line from top to bottom, read the adjacent two lines of data in turn for connected domain detection, use 8 neighborhoods to detect the connected domain of each target pixel, According to the 8 neighborhoods, it is divided into 8 cases, and the current pixel is marked as D j,i , j represents the row of the current pixel, and i represents the column of the current pixel; when the 8 neighborhoods of D j,i are connected, Only need to detect the pixel values of D j,i-1 , D j-1,i-1 , D j-1,i and D j-1,i+1 , if D j,i =0, mark the point is the background pixel, if D j,i =1, then mark the point as the target pixel; C.连通域检测:根据当前像素值的不同情况采用优先等级顺序对目标像素点进行处理;C. Connected domain detection: According to the different conditions of the current pixel value, the target pixel is processed in the order of priority; D.若目标像素点没有检测完毕则回到步骤B,直到所有目标像素点检测结束。D. If the target pixel is not detected, go back to step B until all target pixels are detected. 2.如权利要求1所述的一种二值图像流快速连通域标记算法,其特征在于,步骤C中所述的优先等级顺序如下所示:2. a kind of binary image stream fast connected domain marking algorithm as claimed in claim 1, is characterized in that, the priority order described in step C is as follows: a:Dj,i=0且Dj,i-1=X,Dj-1,i-1=X,Dj-1,i=X,Dj-1,i+1=X;a: D j,i =0 and D j,i-1 =X, D j-1,i-1 =X, D j-1,i =X, D j-1,i+1 =X; b:Dj,i=1且Dj,i-1=0,Dj-1,i-1=0,Dj-1,i=0,Dj-1,i+1=0;b: D j,i =1 and D j,i-1 =0, D j-1,i-1 =0, D j-1,i =0, D j-1,i+1 =0; c:Dj,i=1且Dj,i-1=X,Dj-1,i-1=1,Dj-1,i=0,Dj-1,i+1=1;c: D j,i =1 and D j,i-1 =X, D j-1,i-1 =1, D j-1,i =0, D j-1,i+1 =1; d:Dj,i=1且Dj,i-1=1,Dj-1,i-1=0,Dj-1,i=0,Dj-1,i+1=1;d: D j,i =1 and D j,i-1 =1, D j-1,i-1 =0, D j-1,i =0, D j-1,i+1 =1; e:Dj,i=1且Dj,i-1=1,Dj-1,i-1=X,Dj-1,i=X,Dj-1,i+1=X;e: D j,i =1 and D j,i-1 =1, D j-1,i-1 =X, D j-1,i =X, D j-1,i+1 =X; f:Dj,i=1且Dj,i-1=X,Dj-1,i-1=1,Dj-1,i=X,Dj-1,i+1=X;f: D j,i =1 and D j,i-1 =X, D j-1,i-1 =1, D j-1,i =X, D j-1,i+1 =X; g:Dj,i=1且Dj,i-1=X,Dj-1,i-1=X,Dj-1,i=1,Dj-1,i+1=X;g: D j,i =1 and D j,i-1 =X, D j-1,i-1 =X, D j-1,i =1, D j-1,i+1 =X; h:Dj,i=1且Dj,i-1=0,Dj-1,i-1=0,Dj-1,i=0,Dj-1,i+1=1;h: D j,i =1 and D j,i-1 =0, D j-1,i-1 =0, D j-1,i =0, D j-1,i+1 =1; 其中,X表示1或0。Wherein, X represents 1 or 0. 3.如权利要求2所述的一种二值图像流快速连通域标记算法,其特征在于,步骤C所述的连通域检测步骤及算法如下:3. a kind of binary image flow fast connected domain labeling algorithm as claimed in claim 2, is characterized in that, the described connected domain detection step and algorithm of step C are as follows: 若邻域情况满足条件a:If the neighborhood situation satisfies the condition a: C1-1:DATA[i]对应像素点Dj,i,DATA[i-1]对应像素点Dj,i-1,判断当前像素点的像素值,若DATA[i]=0,则标记该点为背景像素点,并不对该点做连通域分析处理,只进行X[]更新;判断DATA[i-1]是否等于1,若是则进行步骤C1-2,若不是则进行步骤C1-4;C1-1: DATA[i] corresponds to the pixel point D j,i , DATA[i-1] corresponds to the pixel point D j,i-1 , judge the pixel value of the current pixel point, if DATA[i]=0, then mark This point is a background pixel, and no connected domain analysis is performed on this point, only X[] is updated; judge whether DATA[i-1] is equal to 1, if so, go to step C1-2, if not, go to step C1- 4; C1-2:比较X_count和X[Flag_data[i-1]]的大小,如果X_count大于X[Flag_data[i-1]],则进行步骤C1-3,否则进行步骤C1-4;C1-2: Compare the size of X_count and X[Flag_data[i-1]], if X_count is greater than X[Flag_data[i-1]], go to step C1-3, otherwise go to step C1-4; C1-3:用X_count更新X[Flag_data[i-1]];C1-3: update X[Flag_data[i-1]] with X_count; C1-4:结束;C1-4: end; 若邻域情况满足条件b:If the neighborhood situation satisfies condition b: C2-1:将连通域计数n加1,将X_count赋值为1,进行步骤C2-2;C2-1: Add 1 to the connected domain count n, assign X_count to 1, and go to step C2-2; C2-2:判断m是否大于0,若大于0则进行步骤C2-3,否则进行步骤C2-4;C2-2: judge whether m is greater than 0, if it is greater than 0, go to step C2-3, otherwise go to step C2-4; C2-3:将X[Flag_data_bak[i-1]]与Y[Flag_data_bak[i-1]]赋值为1,Flag_data[i]赋值为Flag_data_bak[m],然后m减1,进行步骤C2-5;C2-3: Assign X[Flag_data_bak[i-1]] and Y[Flag_data_bak[i-1]] to 1, Flag_data[i] to Flag_data_bak[m], then decrease m by 1, and go to step C2-5; C2-4:将Flag_data[i]标记为n,X[n]与Y[n]赋值为1,进行步骤C2-5;C2-4: Mark Flag_data[i] as n, assign X[n] and Y[n] to 1, and go to step C2-5; C2-5:结束;C2-5: end; 若领域情况满足条件c:If the domain situation satisfies condition c: C3-1:将Flag_data[i]赋值为Flag_data[i-1];C3-1: Assign Flag_data[i] to Flag_data[i-1]; C3-2:判断Flag_data[i+1]是否等于Flag_data[i-1],若不相等,进行步骤C3-3,否则进行步骤C3-4;C3-2: Determine whether Flag_data[i+1] is equal to Flag_data[i-1], if not, go to step C3-3, otherwise go to step C3-4; C3-4:判断Dj,i-1是否等于1,若不等于1则进行步骤C3-5,否则进行步骤C3-6;C3-4: judge whether D j, i-1 is equal to 1, if not equal to 1, go to step C3-5, otherwise go to step C3-6; C3-5:将X_count赋值为1,进行步骤C3-7;C3-5: Assign X_count to 1, and go to step C3-7; C3-6:X_count累加1,Y[Flag_data[i-1]]累加1,转至进行步骤C3-7;C3-6: X_count is incremented by 1, Y[Flag_data[i-1]] is incremented by 1, and go to step C3-7; C3-7:结束;C3-7: end; 若邻域情况满足条件d:If the neighborhood situation satisfies the condition d: C4-1:设局部计数变量为k,首先将k赋值为X_count,然后将X_count累加1,进行步骤C4-2;C4-1: Set the local count variable to k, first assign k to X_count, then add 1 to X_count, and go to step C4-2; C4-2:判断Flag_data[i-1]是否大于Flag_data[i+1],若大于则进行步骤C4-6,否则进行步骤C4-3;C4-2: judge whether Flag_data[i-1] is greater than Flag_data[i+1], if it is greater than, go to step C4-6, otherwise go to step C4-3; C4-3:判断Flag_data[i-1]是否小于Flag_data[i+1],若小于则进行步骤C4-4,否则进行步骤C4-5;C4-3: Determine whether Flag_data[i-1] is less than Flag_data[i+1], if it is less than, go to step C4-4, otherwise go to step C4-5; C4-4:首先将m累加1,n减1,然后将Y[Flag_data[i+1]]赋值为0,Flag_data_bak[m]赋值为Flag_data[i+1],Flag_data[i+1]赋值为Flag_data[i-1],Flag_data[i]赋值为Flag_data[i-1],然后进行步骤C4-7;C4-4: First add 1 to m, decrease n to 1, then assign Y[Flag_data[i+1]] to 0, Flag_data_bak[m] to Flag_data[i+1], and Flag_data[i+1] to be Flag_data[i-1], Flag_data[i] is assigned as Flag_data[i-1], and then go to step C4-7; C4-5:Flag_data[i]赋值为Flag_data[i-1],进行步骤C4-7;C4-5: Flag_data[i] is assigned as Flag_data[i-1], go to step C4-7; C4-6:首先将n减1,Y[Flag_data[i+1]]累加1,然后将Dj,i-1前面有连续k个目标像素点标记值更新为Flag_data[i+1],转至步骤C4-7;C4-6: First subtract 1 from n, add 1 to Y[Flag_data[i+1]], then update the mark values of consecutive k target pixels in front of D j, i-1 to Flag_data[i+1], turn to step C4-7; C4-7:结束;C4-7: end; 若邻域情况满足条件e:If the neighborhood situation satisfies the condition e: C5-1:X_count累加1,转至步骤C5-2;C5-1: X_count is accumulated by 1, go to step C5-2; C5-2:判断Flag_data[i]是否等于Flag_data[i-1],等于转至步骤C5-3,否则转至C5-4;C5-2: Determine whether Flag_data[i] is equal to Flag_data[i-1], which is equal to go to step C5-3, otherwise go to C5-4; C5-3:将Flag_data[i]赋值为Flag_data[i-1],转至C5-4;C5-3: Assign Flag_data[i] to Flag_data[i-1], go to C5-4; C5-4:结束;C5-4: end; 若邻域情况满足条件f:If the neighborhood situation satisfies the condition f: C6-1:X_count赋值1,Flag_data[i]赋值为Flag_data[i-1],Y[Flag_data[i-1]]累加1,转至C6-2;C6-1: X_count is assigned 1, Flag_data[i] is assigned as Flag_data[i-1], Y[Flag_data[i-1]] is incremented by 1, and go to C6-2; C6-2:结束;C6-2: end; 若邻域情况满足条件g:If the neighborhood situation satisfies the condition g: C7-1:X_count赋值1,Y[Flag_data[i]]累加1,转至C7-2;C7-1: Assign 1 to X_count, add 1 to Y[Flag_data[i]], go to C7-2; C7-2:结束;C7-2: end; 若邻域情况满足条件h:If the neighborhood condition satisfies the condition h: C8-1:X_count赋值1,Y[Flag_data[i+1]]累加1,Flag_data[i]赋值为Flag_data[i+1],转至C8-2;C8-1: X_count is assigned 1, Y[Flag_data[i+1]] is added by 1, Flag_data[i] is assigned as Flag_data[i+1], go to C8-2; C8-2:结束;C8-2: end; 其中,X[]为每个连通域的横向目标像素点最大数量的数组,Y[]为纵向目标像素点最大数量的数组;Flag_data[]为目标像素点Dj,i的标记值,且同一个连通域内的目标像素点具有相同的标记值;n为连通域的计数,Flag_data_bak[]为重复标记的连通域标记值的数组,m为重复标记的连通域的计数,X_count为当前像素检测行具有相同标记值的目标像素点的个数。Among them, X[] is the array of the maximum number of horizontal target pixels of each connected domain, Y[] is the array of the maximum number of vertical target pixels; Flag_data[] is the mark value of the target pixel D j, i , and the same as The target pixels in a connected domain have the same label value; n is the count of the connected domain, Flag_data_bak[] is the array of the label values of the repeatedly marked connected domain, m is the count of the repeatedly marked connected domain, and X_count is the current pixel detection line The number of target pixels with the same tag value.
CN201810828549.8A 2018-07-25 2018-07-25 A kind of bianry image stream quick region identification algorithm Pending CN109146908A (en)

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 (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110533678A (en) * 2019-07-26 2019-12-03 杭州电子科技大学 Image processing method for screening feature targets based on FPGA frame-parallel connected domains
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 杭州海康威视数字技术股份有限公司 A method and device for marking pixel points in an image
CN116580096A (en) * 2023-05-19 2023-08-11 武汉中观自动化科技有限公司 A visual landmark extraction method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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)

* Cited by examiner, † Cited by third party
Title
曲立国等: "基于FPGA的线阵CCD雨滴图像快速连续识别方法", 《光电工程》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111833398A (en) * 2019-04-16 2020-10-27 杭州海康威视数字技术股份有限公司 A method and device for marking pixel points in an image
CN111833398B (en) * 2019-04-16 2023-09-08 杭州海康威视数字技术股份有限公司 A method and device for marking pixels in images
CN110533678A (en) * 2019-07-26 2019-12-03 杭州电子科技大学 Image processing method for screening feature targets based on FPGA frame-parallel connected domains
CN110533678B (en) * 2019-07-26 2022-02-11 杭州电子科技大学 An Image Processing Method for Screening Feature Targets Based on Parallel Connected Domains of FPGA Frames
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
CN116580096A (en) * 2023-05-19 2023-08-11 武汉中观自动化科技有限公司 A visual landmark extraction method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN109146908A (en) A kind of bianry image stream quick region identification algorithm
CN110047770B (en) Substrate defect inspection apparatus, substrate defect inspection method, and storage medium
CN103117005B (en) Lane deviation warning method and system
CN108734696B (en) System and method for white point mura detection
CN109472271B (en) Printed circuit board image contour extraction method and device
CN111612757B (en) Screen crack detection method, device, equipment and storage medium
CN111246204A (en) Relative brightness deviation-based dirt detection method and device
US9025853B2 (en) Method for determining markings in relief on the outer surface of the sidewall of a tyre
KR20090101356A (en) Fault detection device and fault detection method
CN104331695B (en) A kind of circle marker symbol shape quality detection method of robust
CN106054421A (en) Liquid crystal display panel defect detecting method and device
CN113012096B (en) Display screen sub-pixel positioning and brightness extraction method, device and storage medium
CN111046843A (en) A monocular ranging method in intelligent driving environment
CN101014975A (en) Object detection device
CN112465775B (en) Touch panel defect detection system and touch panel defect detection method
CN107016699A (en) A kind of color coding approach of the variegated particle of automatic identification
CN120431087A (en) Inorganic mineral casting detection method based on image processing
US5621825A (en) Image processor, image processing method and apparatus applying same
TW201915443A (en) Positioning and measuring system based on image scale
CN114170246B (en) Positioning method for precision displacement platform
Seo Edge modeling by two blur parameters in varying contrasts
CN114638805B (en) Track slab crack detection method, system and storage medium
CN111209912A (en) A method for removing long interference lines in Chinese text and pictures
Liu et al. Detecting and tracking motion of myxococcus xanthus bacteria in swarms
Yang et al. A novel binarization approach for license plate

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

Application publication date: 20190104

RJ01 Rejection of invention patent application after publication