CN101620733A - Mixed connection assembly volume label algorithm - Google Patents

Mixed connection assembly volume label algorithm Download PDF

Info

Publication number
CN101620733A
CN101620733A CN200810129154A CN200810129154A CN101620733A CN 101620733 A CN101620733 A CN 101620733A CN 200810129154 A CN200810129154 A CN 200810129154A CN 200810129154 A CN200810129154 A CN 200810129154A CN 101620733 A CN101620733 A CN 101620733A
Authority
CN
China
Prior art keywords
label
pixel
respective pixel
foreground
reverse
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
Application number
CN200810129154A
Other languages
Chinese (zh)
Other versions
CN101620733B (en
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.)
RUIZHI TECHNOLOGY CO LTD
Vatics Inc
Original Assignee
RUIZHI TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by RUIZHI TECHNOLOGY CO LTD filed Critical RUIZHI TECHNOLOGY CO LTD
Priority to CN2008101291545A priority Critical patent/CN101620733B/en
Publication of CN101620733A publication Critical patent/CN101620733A/en
Application granted granted Critical
Publication of CN101620733B publication Critical patent/CN101620733B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

The invention discloses a mixed connection assembly volume label algorithm, comprising the following steps: performing a forward-direction scanning program, performing a reverse-direction scanning program, and performing a volume label resetting program; then, setting a label resetting condition according to a volume label connection relation table, a volume label pool parameter, an effective row parameter and a guiding volume label parameter, deleting a corresponding label according to the label resetting condition, and resetting the corresponding label.

Description

A kind of mixed connection assembly volume label algorithm
Technical field
The invention relates to a kind of connection assembly volume label algorithm, and particularly relevant for a kind of mixing coupling assembling volume label algorithm of scanning algorithm and rescan algorithm repeatedly.
Background technology
Present intelligent video signal safety monitoring system comprises intelligent safety monitoring system of low order and the intelligent safety monitoring system of high-order.Wherein, the intelligent safety monitoring system of low order has from image frame, the function of detecting object and feature thereof.Moreover according to the obtained data of the intelligent safety monitoring system of low order, the intelligent safety monitoring system of high-order then can be judged event further, and makes subsequent treatment.
By setting up the image background model, the intelligent safety monitoring system of low order can detect the foreground object of present image frame.Produce dualistic formula image light shield (binary mask) by the background subtracting mode.Afterwards, according to dualistic formula image light shield, produce image connection assembly (connected component).According to image object of connection, extract each object image feature (feature) thereafter.Prior art often adopts connection assembly volume label algorithm when analyzing dualistic formula image light shield.The method of common connection assembly volume label algorithm has repeatedly scanning algorithm (Multi-pass algorithm), twice scanning algorithm (Two-pass algorithm) and single pass algorithm (One-pass algorithm).
Repeatedly the practice of scanning algorithm is as follows:
1, scans dualistic formula image light shield from top to bottom, from left to right.
If 2 when running into foreground pixel, observe foreground pixel the upper left side, directly over, whether upper right side and left (L type) neighborhood pixels indicated connection assembly volume label.If have, then the method selects the minimal modules label to distribute to foreground pixel.If do not have, then the method is distributed to new label of this pixel.Repeat aforementioned activities, till whole image all marked label.
3, the method is constantly done the iteration action to image, to its L type neighborhood pixels of each pixel observation.If meet the neighborhood pixels with the different labels of respective pixel, then the method minimum label of getting correspondence is redistributed to this pixel, till all pixels of image frame all no longer change.
4, the method can reduce iterations by setting up label binding table.
Yet repeatedly scanning algorithm has many shortcomings, for example:
1, repeatedly scanning algorithm is in the label process, and a connection assembly may use a plurality of labels.
2, whole image label data need be constantly read in repeatedly scanning algorithm iteration action, seriously consume system resource.
The practice of twice scanning algorithm is as follows:
1, scans dualistic formula image light shield from top to bottom, from left to right.
If 2 when running into foreground pixel, observe foreground pixel the upper left side, directly over, whether upper right side and left (L type) neighborhood pixels indicated connection assembly volume label.If have, then the method selects the minimal modules label to distribute to foreground pixel, and sets up connection relationship for different connection assembly volume labels.If do not have, then the method is distributed to new label of this pixel.Repeat aforementioned activities, till whole image all marked label.
3, the method connection relationship of a step analytically, the final label that finds it to be associated for each label.
4, when the method execution scan-image label second time, for each foreground pixel distributes its final label.
Yet twice scanning algorithm also has many shortcomings, for example:
1, twice scanning algorithm is in the process of carrying out label, and a connection assembly may use a plurality of labels.
2, realize that with hardware twice scanning algorithm is comparatively complicated, use label too much will cause cost of manufacture too high, unfavorable industry is used.
The practice of single pass algorithm is as follows:
1, scans dualistic formula image light shield from top to bottom, from left to right.
If 2 when running into foreground pixel, give this pixel a new connection assembly volume label.And the method utilizes recursive fashion to be assembly profile label, up to getting back to starting point once more.Thereafter, the method is put on same label for the component internal pixel.Then, the method is looked for next foreground pixel once more, repeats aforementioned activities, till whole image all marked label.
Yet the single pass algorithm also has many shortcomings, and for example: the irregular recursive fashion of the method makes hardware be difficult for realizing the single pass algorithm.
By as can be known aforementioned, repeatedly scanning algorithm does not need label binding table, but the method need be carried out repeatedly computing and just can make tags stabilize.Though only need carrying out secondary, the rescan algorithm just can make tags stabilize,, the method is used too many label, and is difficult for realizing.Therefore, repeatedly the logical operation of scanning algorithm more easily realizes in hardware, but repeatedly scanning algorithm is met just before the shortcoming of repetitive read-write data, consume system resources repeatedly.Twice scanning algorithm number of times that reads and writes data is fixed, and the system resource that is consumed is fixed, but uses label too much will cause the internal memory use amount excessive or cause the phenomenon of label number deficiency in hardware inside.The phenomenon that the single pass algorithm does not have the label deficiency produces, but irregular recursive fashion is not suitable for using hardware to realize.
Prior art proposes the deletion label, the method that label can be reused in order to solve the problem of label deficiency.The dualistic formula image light shield that method produced by background subtracting can mix many noises, makes these noises can occupy the part connection assembly volume label.Prior art is done the action of deletion at less connection assembly volume label after finishing the label of connection assembly.In addition, by setting up each assembly volume label binding table, set up the image connection assembly.After connection assembly volume label was finished, prior art checked whether connection assembly meets the condition that continues to stay.If not, then prior art is deleted corresponding label, and to re-register all labels be available label.The advantage of the method is can reuse label, the situation of reduction label deficiency.But not enough is, in the label process, a connection assembly may use a plurality of labels, and the situation of this solution generation label deficiency is still very high, can't solve the problem of label deficiency.And, though prior art proposes the deletion label, and reuse the notion of label, shortcoming is deleted label at present, and can reuse the method for label.
Summary of the invention
In view of this, purpose of the present invention is providing a kind of mixed connection assembly volume label algorithm exactly.The present invention by analyzing the application of label, deletes label in conjunction with the principle with twice scanning algorithm of scanning algorithm repeatedly, label can be reused, to overcome the shortcoming of label deficiency.
For reaching above-mentioned and other purpose, the present invention proposes a kind of mixed connection assembly volume label algorithm, is applicable to image processing.Wherein, image data (dualistic formula image light shield) has M*N pixel, and these pixels comprise a plurality of foreground pixels.Being denoted as of each pixel correspondence (M, N), M wherein, N is more than or equal to 1, and M, and N is an integer.This method comprises: this method is carried out a forward scan program.Afterwards, this method scans (1,1) pixel seriatim and begins to (M, N) pixel.Then, this method judges whether respective pixel is foreground pixel.Next, if respective pixel is a foreground pixel,, decide the forward label of respective pixel then according to the label of forward neighborhood pixels.
Moreover this method is carried out a reverse scan program.Afterwards, this method scans seriatim (M, N) pixel begins to (1,1) pixel.Then, this method judges whether respective pixel is foreground pixel.Next, if respective pixel is a foreground pixel,, decide the reverse label of respective pixel then according to the reverse pairing label of neighborhood pixels and this respective pixel gained forward label after a last forward scan.
After this method was carried out forward scan program and reverse scan program, this method was carried out a replacement label program.Replacement label program comprises the following steps: if respective pixel is a foreground pixel, and the forward neighborhood pixels of respective pixel judges then whether respective pixel reverse label last time is refitted in the label parameter that leads when be not foreground pixel.If respective pixel reverse label last time was reset, then this method distribution pairing label of reverse label pond parameter last time is the forward label of respective pixel.If it is out-of-date that respective pixel reverse label last time is not reset, then this method distributes an available label to give label pond parameter, to become the forward label of respective pixel.Simultaneously, when respective pixel need be distributed available label, this method was upgraded corresponding label pond parameter.When if respective pixel need be distributed available label, then the row at this method record respective pixel place one are classified an effective row parameter as before.Label (value) before this method is distributed the available volume timestamp that takes out from label pond parameter, and this method record is replaced is in guiding label parameter.By label connection relation table, label pond parameter, effective row parameter and guiding label parameter setting one label replacement condition, according to label replacement condition, this method deletion corresponding label, and replacement corresponding label.
Described according to preferred embodiment of the present invention, above-mentioned method comprises: this method is carried out the forward scan program once.Afterwards, this method is carried out the reverse scan program once.Afterwards, this method is carried out replacement label program.
Described according to preferred embodiment of the present invention, above-mentioned method also comprises the following steps: to detect the foreground object in the present picture by setting up an image background model.And, by a kind of background subtracting algorithm, produce dualistic formula image light shield.
Described according to preferred embodiment of the present invention, above-mentioned (M, N) those forward neighborhood pixels of pixel are (M-1, N) pixel, (M-1, N-1) pixel, (M, N-1) pixel and (M+1, N-1) pixel.That is, the neighborhood pixels of L type around the top of respective pixel.
Described according to preferred embodiment of the present invention, above-mentioned (M, N) the reverse neighborhood pixels of those of pixel is (M+1, N) pixel, (M+1, N+1) pixel, (M, N+1) pixel and (M-1, N+1) pixel.That is, the neighborhood pixels of L type around the below of respective pixel.
Described according to preferred embodiment of the present invention, above-mentioned forward scan program also comprises the following steps: to begin from (1,1) pixel, and this method is by each respective pixel of column scan image data.Then, this method judges whether respective pixel is foreground pixel, if respective pixel is a foreground pixel, then this method judges whether those forward neighborhood pixels of respective pixel correspondence are foreground pixel.Afterwards, if the forward neighborhood pixels is a foreground pixel, then this method is got the forward label that the minimum value of the pairing label of forward neighborhood pixels is a respective pixel.
Described according to preferred embodiment of the present invention, above-mentioned reverse scan program also comprise the following steps: from the (M, N) pixel begins, this method is by each respective pixel of column scan image data.Then, this method judges whether respective pixel is foreground pixel, if respective pixel is a foreground pixel, then this method judges whether the reverse neighborhood pixels of respective pixel is foreground pixel.Afterwards, if oppositely neighborhood pixels is a foreground pixel, then this method negate is the reverse label of respective pixel to the minimum value of the pairing label of neighborhood pixels and this respective pixel gained forward label after a last forward scan.
Described according to preferred embodiment of the present invention, above-mentioned replacement label program also comprises the following steps: to begin from (1,1) pixel, by the respective pixel of column scan image data.Then, this method judges whether respective pixel is foreground pixel, if respective pixel is a foreground pixel, then this method judges whether those forward neighborhood pixels of respective pixel correspondence are foreground pixel.Afterwards, if the forward neighborhood pixels is a foreground pixel, then this method is got the forward label that the minimum value of the label of forward neighborhood pixels is a respective pixel, and sets up connection relationship for different connection assembly volume labels.In addition, in the process of carrying out replacement label program, this method is upgraded label pond parameter simultaneously, and sets up effective row parameter and guiding label parameter.Afterwards, scanned one at every turn and be listed as, the area that this method is surrounded according to the forward label, whether decision deletes corresponding forward label, and upgrades corresponding label pond parameter, effective row parameter and guiding label parameter.After waiting to finish whole picture, do forward scan for the second time again,, each pixel is updated to final label under it according to above-mentioned parameter.
Described according to preferred embodiment of the present invention, above-mentioned replacement label program also comprises the following steps: area critical value of this method setting.Afterwards, if the area that those forward labels are surrounded is lower than the area critical value, the label pond parameter that then those corresponding forward labels of this method deletion, and renewal are corresponding, effective row parameter and guiding label parameter.
Comprehensively above-mentioned, the present invention proposes a kind of mixed connection assembly volume label algorithm.The practice of the present invention is, simplifies connection assembly volume label earlier, and for example: the present invention uses the repeatedly scanning algorithm of fixed number of times earlier, to reduce connection assembly volume label action complexity.Afterwards, the present invention sets up the relation of label again, to discharge label.The present invention has following advantage at least:
1, because deleting label, the prior art shortcoming can reuse the method for label.The present invention proposes a kind of new method, promptly upgrades label pond parameter, and sets up effective row parameter and guiding label parameter.This method utilizes aforementioned parameters to discharge label, has novelty and progressive.
2, the present invention delete the opportunity of label be scanning process in, but not scanning finish the time.Therefore, the speed that the present invention deletes label is exceedingly fast, can quick-release tag.Therefore, the practice of the present invention can overcome the problem of prior art label deficiency effectively.
3, because the practice of the present invention is to simplify connection assembly volume label in advance, the label program that promptly begins subsequently to reset is done connection assembly volume label, and in time in the label process, discharge label, so the present invention can use minimum hardware resource, with minimum number of tags, compared to the time faster of scanning algorithm repeatedly, make the number of tags of whole light shield stable, have high industry applications, can not only finish label work efficiently, more can significantly reduce cost.According to experiment, this method carry out the forward scan program once, the reverse scan program once, once (wherein comprise secondary forward scan) with replacement label program, can obtain splendid effect.
4, since the present invention on hardware is realized, need only a spot of inner temporarily providing room, can reduce the cost of hardware, so the present invention can effectively overcome the unfavorable hard-wired shortcoming of prior art.
Description of drawings
For above and other objects of the present invention, feature and advantage can be become apparent, preferred embodiment cited below particularly, and conjunction with figs. are described in detail below:
The process flow diagram that shown in Figure 1 is according to the mixed connection assembly volume label algorithm of a preferred embodiment of the present invention;
The process flow diagram that shown in Figure 2 is according to the forward scan program of a preferred embodiment of the present invention;
The process flow diagram that shown in Figure 3 is according to the reverse scan program of a preferred embodiment of the present invention;
The process flow diagram that shown in Figure 4 is according to the replacement label program of a preferred embodiment of the present invention;
The synoptic diagram that shown in Figure 5 is according to the forward label of a preferred embodiment of the present invention;
The synoptic diagram that shown in Figure 6 is according to the reverse label of a preferred embodiment of the present invention;
Shown in Figure 7 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention;
Shown in Figure 8 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label parameter according to a preferred embodiment of the present invention;
Shown in Figure 9 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label parameter according to a preferred embodiment of the present invention;
Shown in Figure 10 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label parameter according to a preferred embodiment of the present invention;
Shown in Figure 11 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label parameter according to a preferred embodiment of the present invention;
Prior art that shown in Figure 12 is repeatedly the scanning times of scanning algorithm to the curve map of time;
Prior art that shown in Figure 13 is repeatedly the label number of scanning algorithm to the curve map of time;
Shown in Figure 14 is the curve map of the label number of prior art rescan algorithm to the time; And,
Shown in Figure 15 is the curve map of the label number of mixed connection assembly volume label algorithm of the present invention to the time.
Embodiment
Please refer to Fig. 1, shown in it is process flow diagram according to the mixed connection assembly volume label algorithm of a preferred embodiment of the present invention.This method is applicable to image processing, comprises the following steps: that this method sets up the image background model to an image frame, with detecting foreground object (S104).Afterwards, according to aforementioned image background model, this method produces corresponding dualistic formula image light shield (S106).Then, this method is carried out the forward scan program, to set up forward label (S108).Next, this method is carried out the reverse scan program, to set up reverse label (S110).Thereafter, this method is carried out replacement label program, does final connection assembly volume label program (S112).
Wherein, the dualistic formula light shield has M*N pixel, and aforementioned pixel comprises a plurality of foreground pixels, and being denoted as of each pixel correspondence (M, N), wherein, M, N are more than or equal to 1, and M, and N is an integer.When this method is carried out the forward scan program, this method by (1,1) pixel begin to the (M, N) pixel finishes, this method scans the pixel in the aforementioned dualistic formula light shield one by one.Afterwards, this method judges whether respective pixel is foreground pixel.If respective pixel is a foreground pixel,, decide the forward label of respective pixel then according to the pairing label of a plurality of forward neighborhood pixels.Moreover, when this method is carried out the reverse scan program, this method by the (M, N) pixel begins to (1,1) pixel to finish, this method scans the pixel in the aforementioned dualistic formula light shield one by one.Afterwards, this method judges whether respective pixel is foreground pixel.If respective pixel is foreground pixel, the pairing label of gained forward label after a last forward scan according to a plurality of reverse neighborhood pixels and this respective pixel then decides the reverse label of respective pixel.
At last, this method is carried out replacement label program.After this method is carried out aforementioned positive scanning sequence and aforementioned reverse scan program, carry out the aforementioned positive scanning sequence once more, in carrying out aforementioned positive scanning sequence process, carry out the following step: this method is except that setting up each assembly volume label connection relationship, when if respective pixel need be distributed new forward label, check from guiding label parameter earlier whether the reverse label of this respective pixel reverse scan for the second time gained has been refitted in guiding label parameter.If aforementioned reverse label was reset (that is, contain aforementioned reverse label in the guiding label parameter), then this method is the forward label of respective pixel with the label pond parameter of aforementioned reverse label correspondence.If aforementioned reverse label was not reset, then according to the label connection relation table, this method is selected the forward label that available label is a respective pixel, and effective row parameter of the previous column of the row at record respective pixel place.In addition, when respective pixel was assigned to new forward label, the label before the record displacement was in the guiding label parameter of correspondence.By aforementioned label connection relation table, aforementioned label pond parameter, aforementioned effective row parameter and a label replacement of aforementioned guiding label parameter setting condition.Afterwards, according to aforementioned label replacement condition deletion corresponding label, and the replacement corresponding label.
Please refer to Fig. 2, shown in it is process flow diagram according to the forward scan program of a preferred embodiment of the present invention.The forward scan program comprises the following steps: to begin from (1,1) pixel, by each respective pixel (S204) of column scan dualistic formula light shield.Afterwards, this method judges whether respective pixel is foreground pixel (S206).Then, if respective pixel is a foreground pixel, then this method judges whether the pairing forward neighborhood pixels of respective pixel is foreground pixel (S208).Thereafter, if in the aforementioned positive neighborhood pixels, as long as one of them is a foreground pixel, then these labels that belong to the forward neighborhood pixels of foreground pixel can form a label value ordered series of numbers L, and ordered series of numbers L contains X label, and X is more than or equal to 1.This method is the forward label (S210) of respective pixel with the minimum value of ordered series of numbers L.Next, this method judges whether to scan the end (S212) of row.Afterwards, if this method scans the end of row, then this method judges whether respective column is last row (S214).If correspondence is classified last row as, then this method finishes forward scan program (S216).
If respective pixel is not a foreground pixel, then this method judges whether respective pixel is last pixel (S218).If respective pixel is not last pixel, then scan next pixel, get back to step (S204).If respective pixel is foreground pixel, and the forward neighborhood pixels of respective pixel be foreground pixel, and then this method distributes new label to respective pixel, becomes forward label (S220).
Please refer to Fig. 3, shown in it is process flow diagram according to the reverse scan program of a preferred embodiment of the present invention.The reverse scan program comprises the following steps: that (M, N) pixel begins, by each respective pixel (S304) of column scan dualistic formula light shield from the.Afterwards, this method judges whether respective pixel is foreground pixel (S306).Then, if respective pixel is a foreground pixel, then this method judges whether the pairing reverse neighborhood pixels of respective pixel is foreground pixel (S308).Thereafter, if in the aforementioned reverse neighborhood pixels, as long as one of them is a foreground pixel, then these label and this respective pixel gained forward labels after a last forward scan that belong to the reverse neighborhood pixels of foreground pixel can form a label value ordered series of numbers H, ordered series of numbers H contains Y label, and Y is more than or equal to 1.This method is the reverse label (S310) of respective pixel with the minimum value of ordered series of numbers Y.Next, this method judges whether to scan the end (S312) of row.Afterwards, if this method scans the end of row, then this method judges whether respective column is last row (S314).If correspondence is classified last row as, then this method finishes reverse scan program (S316).
If respective pixel is not a foreground pixel, then this method judges whether respective pixel is last pixel (S318).If respective pixel is not last pixel, then scan next pixel, get back to step (S304).If respective pixel is foreground pixel, and the reverse neighborhood pixels of respective pixel be foreground pixel, and then this method distributes this respective pixel gained forward label after a last forward scan to become reverse label (S320) to respective pixel.
Please refer to Fig. 4, shown in it is process flow diagram according to the replacement label program of a preferred embodiment of the present invention.Replacement label program comprises the following steps: to begin from (1,1) pixel, by each respective pixel (S404) of column scan dualistic formula light shield.Afterwards, this method judges whether respective pixel is foreground pixel (S406).Then, if respective pixel is a foreground pixel, then this method judges whether the pairing forward neighborhood pixels of respective pixel is foreground pixel (S408).Thereafter, if in the aforementioned positive neighborhood pixels, as long as one of them is a foreground pixel, then these labels that belong to the forward neighborhood pixels of foreground pixel can form a label value ordered series of numbers L, and ordered series of numbers L contains X label, and X is more than or equal to 1.This method is the forward label of respective pixel with the minimum value of ordered series of numbers L, and this method is that different connection assembly volume labels are set up connection relationship, with the change conditions (S410) of record label.Next, this method judges whether to scan the end (S412) of row.Afterwards, if this method scans the end of row, that is, respective pixel is last of respective column, then according to an area critical value, and the corresponding forward label of this method deletion, and corresponding label pond parameter, the effective row parameter and guiding label parameter of renewal, that is, if the area that the forward label is surrounded is lower than the area critical value, the forward label (S414) of then deletion correspondence.Thereafter, this method judges whether to scan last row (S416).Then, if this method scans last row, then rearrange the label (S418) of whole dualistic formula light shield.At last, this method finishes replacement label program (S420).
If respective pixel is not a foreground pixel, then this method judges whether respective pixel is last pixel (S422).If respective pixel is not last pixel, then scan next pixel, get back to step (S404).If respective pixel is foreground pixel, and the forward neighborhood pixels of respective pixel be foreground pixel, and then this method checks on the respective pixel whether one time reverse label is refitted in the label parameter (S424) that leads.Afterwards, if the last one time reverse label of respective pixel is refitted in guiding label parameter, represent that one time reverse label has been reset to the forward label of this scanning, then this method is used the forward label (S426) of the pairing label of reverse label pond parameter as replacement label program of resetting.If the reverse label of respective pixel was not reset, then this method selects an available volume to be designated as the forward label of replacement label program by the label connection relation table, and upgrade label pond parameter, effective row parameter and guiding label parameter, with the change conditions (S428) of record label.
Please refer to Fig. 5, shown in it is synoptic diagram according to the forward label of a preferred embodiment of the present invention.Dualistic formula image light shield 500 has 20*16 pixel, and label connection relation table 502 contains label pond parameter 504, effective row parameter 506 and guiding label 508.This method is divided into 20 row and 16 row with dualistic formula image light shield 500.The most upper left pixel is (1,1) pixel, the most bottom-right pixel (20,16) pixel.Wherein, (6,1) pixel, the (9,1) pixel, (12,1) pixel, (15,1) pixel, the (6,2) pixel, (9,2) pixel, (12,2) pixel, the (15,2) pixel, (6,3) pixel, (7,3) pixel, the (8,3) pixel, (9,3) pixel, (12,3) pixel, the (13,3) pixel, (14,3) pixel, (15,3) pixel, the (9,4) pixel, (12,4) pixel, (9,5) pixel, the (10,5) pixel, (11,5) pixel, (12,5) pixel, the (7,9) pixel, the (9,9) pixel, (8,10) pixel and (14,11) pixel are foreground pixel.When handling foreground pixel, the forward scan of this method is in regular turn by (6,1) pixel, the (9,1) pixel, (12,1) pixel, (15,1) pixel, the (6,2) pixel, (9,2) pixel, (12,2) pixel, the (15,2) pixel, (6,3) pixel, (7,3) pixel, the (8,3) pixel, the (9,3) pixel, (12,3) pixel, (13,3) pixel, the (14,3) pixel, the (15,3) pixel, (9,4) pixel, (12,4) pixel, the (9,5) pixel, the (10,5) pixel, (11,5) pixel, (12,5) pixel, the (7,9) pixel, the (9,9) pixel, (8,10) pixel and (14,11) pixel are inserted the forward label one by one.
For instance, when this method will be inserted the forward label of (6,1) pixel, corresponding forward adjacent tags was (5,1) pixel, but (5,1) pixel is not a foreground pixel, so this method begins by 0, distributing a new label is the forward label.When this method will be inserted the forward label of (6,2) pixel, corresponding forward adjacent tags was (5,2) pixel, (5,1) pixel, (6,1) pixel and (7,1) pixel.Because aforementioned four pixels, except (6,1) pixel is outside the foreground pixel, rest of pixels is neither to be foreground pixel, and therefore the forward label by (6,1) pixel is the forward label of (6,2) pixel.When this method will be inserted the forward label of (9,3) pixel, corresponding forward adjacent tags was the (8,3) pixel, (8,2) pixel, (9,2) pixel and the (10,2) pixel, that is, the (M, N) the forward neighborhood pixels of pixel is (M-1, N) pixel, (M-1, N-1) pixel, (M, N-1) pixel and (M+1, N-1) pixel.Because in aforementioned four pixels, (8,3) pixel and (9,2) pixel are foreground pixel, so this method is the forward label of (9,3) pixel with the minimum value of (8,3) pixel and (9,2) pixel institute corresponding label.The rest may be inferred for rest of pixels point, promptly can insert the forward label.
Please refer to Fig. 6, shown in it is synoptic diagram according to the reverse label of a preferred embodiment of the present invention.After this method executes the forward scan program, carry out the reverse scan program.Please cooperate with reference to the 5th figure, when handling foreground pixel, the reverse scan of this method is in regular turn by the (14,11) pixel, (8,10) pixel, (9,9) pixel, the (7,9) pixel, (12,5) pixel, (11,5) pixel, the (10,5) pixel, (9,5) pixel, (12,4) pixel, the (9,4) pixel, (15,3) pixel, (14,3) pixel, the (13,3) pixel, the (12,3) pixel, (9,3) pixel, (8,3) pixel, the (7,3) pixel, the (6,3) pixel, (15,2) pixel, (12,2) pixel, the (9,2) pixel, the (6,2) pixel, (15,1) pixel, (12,1) pixel, the (9,1) pixel and (6,1) pixel are inserted reverse label one by one.The reverse scan program determines the method for reverse label and forward scan program to be similar to, and different is that oppositely neighborhood pixels is different with the forward neighborhood pixels.
For instance, when this method will be inserted the reverse label of (14,11) pixel, corresponding reverse adjacent tags is (15,11) pixel, (15,12) pixel the (14,12) pixel and (13,12) pixel, that is, (M, N) the reverse neighborhood pixels of pixel is (M+1, N) pixel, (M+1, N+1) pixel, (M, N+1) pixel and (M-1, N+1) pixel.But aforementioned 4 pixels are neither to be foreground pixel, so according to the result of forward scan program, this method is reverse label with forward scan first time label.When this method will be inserted the reverse label of (9,9) pixel, corresponding reverse adjacent tags was (10,9) pixel, (10,10) pixel, (9,10) pixel and (8,10) pixel.Because aforementioned four pixels, except (8,10) pixel is outside the foreground pixel, rest of pixels is neither to be foreground pixel, and therefore the minimum value by (8,10) and (9,9) pixel forward scan for the first time label is the reverse label of (9,9) pixel.The rest may be inferred for rest of pixels point, promptly can insert reverse label.
Please refer to Fig. 7, shown in it is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention.After this method is carried out forward scan program and reverse scan program, carry out replacement label program.Please cooperate with reference to Fig. 6, when handling foreground pixel, the replacement label program of this method is carried out the forward scan program once more.In carrying out the forward scan program process, this method is except that setting up the label connection relationship, and renewal label pond parameter, writes down effective row parameter and guiding label parameter.For instance, when this method was inserted the forward label of (6,1) pixel, taking out present available label 0 from the parameter of label pond was the forward label of (6,1) pixel, and to write down effective row parameter be 0, and guiding label parameter is 0.Please refer to Fig. 8, shown in it is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention.For instance, when this method was inserted the forward label of (15,1) pixel, taking out present available label 1 from the parameter of label pond was the forward label of (15,1) pixel, and to write down effective row parameter be 0, and guiding label parameter is 2.
Moreover, please refer to Fig. 7 and Fig. 8.When this method is reset the label program, if this method will determine the forward label of (15,1) pixel, then since last time the reverse label of (the 7th figure) be 2, this method is checked guiding label parameter, finds not have 2, then this method is distributed an available label 1.If this method will determine the forward label of (9,1) pixel, then since last time the reverse label of (the 7th figure) be 0, this method is checked guiding label parameter, finds to have 0, then this method distributes the label pond parameter 0 of reverse label 0 correspondence to be the forward label.
Please refer to Fig. 9, shown in it is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention.For instance, when this method was inserted the forward label of (7,9) pixel, taking out present available label 2 from the parameter of label pond was the forward label of (7,9) pixel, and to write down effective row parameter be 8, and guiding label parameter is 4.Wherein, be meaningless more than 2 pairs the 8th row of row parameter 8 expression forward labels effectively, guiding label parameter is that the old label of 4 expressions is 4.Please refer to Figure 10, shown in it is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention.For instance, when this method was inserted the forward label of (14,11) pixel, taking out present available label 3 from the parameter of label pond was the forward label of (14,11), and effectively the row parameter is 10, and guiding label parameter is 6.Please refer to Figure 11, shown in it is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding label according to a preferred embodiment of the present invention.For instance, because forward label 2 is lower than the area critical value with the area that forward label 3 is surrounded, therefore this method is deleted forward label 2 and forward label 3, again upgrade label pond parameter, effective row parameter and guiding label parameter, forward label 2 and forward label 3 can be reused, exempt the problem of label deficiency.
What deserves to be explained is that according to experimental result, this method is carried out the forward scan program once, then, this method is carried out the reverse scan program once, afterwards, this method is carried out replacement label program, can reduce the complexity of label action, and effectively solves the problem of label deficiency.This method is with experiment film (AVSS 2007Abandoned Baggage Easy Case, 720 * 576,5053 frames) cut out the connection assembly that area surpasses the area critical value, and compare repeatedly scanning algorithm, rescan algorithm and the present invention's difference of prior art.Please refer to Figure 12, shown in it be prior art repeatedly the scanning times of scanning algorithm to the curve map of time.Please refer to Figure 13, shown in it be prior art repeatedly the label number of scanning algorithm to the curve map of time.Among Figure 13, curve 1 is the label number of scanning for the first time, and curve 2 is for removing the label number before the noise, and curve 3 is the connection assembly number.The maximum scan number of times of experiment is 20 times, and for the first time the highest label of scanning uses several 638, and removing before the noise the highest label, to use number be 337, the highest label internal memory use amount 801bytes (label area).
Please refer to Figure 14, shown in it is the curve map of the scanning times of prior art rescan algorithm to the time.Curve 4 is the label number, and curve 5 is the connection assembly number.In the experiment, scanning times is 2 times, and it is 354 that the highest label uses number, and the highest label internal memory use amount is 2,080 bytes (label pond parameter, effective row parameter, label connection relation table, label areas)
Please refer to Figure 15, shown in it is the curve map of the label of mixed connection assembly volume label algorithm of the present invention to the time.The longitudinal axis of figure is the label number, and curve 6 is the highest label numbers of having used in the replacement label process, and 7 of curves are the connection assembly numbers.In the experiment, scanning times is 4 times, wherein, forward scan program 1 time, reverse scan program 1 time, forward scan is 2 times in the replacement label program, and the highest label number that the program of forward scan is for the first time used is 638 (the 13rd figure curves 1), the highest label number that replacement label program is used is 80 (curves 6), and the highest label internal memory use amount is 570 bytes (label pond parameter, effective row parameter, guiding label parameter, label connection relation table, label areas).Hence one can see that, and the present invention is in three algorithms and final connection assembly number gap minimum, is enough to effectively illustrate that the present invention has the more efficient effect of connection assembly volume label program that makes that reaches really.
It should be noted that above-mentioned explanation only is in order to explain the present invention, and be not in order to limiting operational feasibility of the present invention that the purpose of narration specific details is for the present invention is at large understood.Simultaneously, for one of ordinary skill in the art, according to thought of the present invention, the part that all can change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (16)

1, a kind of mixed connection assembly volume label algorithm is applicable to image processing, it is characterized in that, one image data has M*N pixel, described pixel comprises at least one foreground pixel, and being denoted as of each pixel correspondence (M, N), wherein, M, N are more than or equal to 1, and M, N is an integer, and this method comprises the following steps:
Carry out a forward scan program, carry out the following step in order:
By (1,1) pixel begin to the (M, N) pixel finishes, and scans this image data;
Judge whether respective pixel is this foreground pixel; And,
If respective pixel is this foreground pixel, then according to the pairing label of at least one forward neighborhood pixels, with a forward label of decision respective pixel;
Carry out a reverse scan program, carry out the following step in order:
By the (M, N) pixel begins to finish to (1,1) pixel, scans this image data;
Judge whether respective pixel is this foreground pixel; And,
If respective pixel be this foreground pixel, then according to this forward label of the pairing label of at least one reverse neighborhood pixels and this respective pixel gained after forward scan last time, to determine a reverse label of respective pixel; And,
Carry out a replacement label program, after this forward scan program of execution and this reverse scan program, carry out this forward scan program once more, in carrying out this forward scan program process, carry out the following step:
If respective pixel be this foreground pixel, and this forward neighborhood pixels of respective pixel is not when being not foreground pixel, judges then whether this respective pixel this reverse label last time is refitted in the label parameter that leads;
If respective pixel this reverse label last time was reset, the distribution pairing label pond parameter of this reverse label last time this forward label that is this respective pixel then;
If it is out-of-date that respective pixel this reverse label last time is not reset, distribute an available label, to become this forward label of this respective pixel;
Need distribute this available volume timestamp when respective pixel, upgrade this label pond parameter;
If respective pixel obtains this available volume timestamp, one classifies an effective row parameter as before the row at record respective pixel place;
When respective pixel obtains this available volume timestamp, the label before the record displacement is this label parameter that leads;
By this label connection relation table, this label pond parameter, this effective row parameter and this guiding label parameter setting one label replacement condition, according to this label replacement condition deletion corresponding label, and the replacement corresponding label.
2, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, this image data is a dualistic formula image light shield.
3, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, described method also comprises the following steps: to carry out this forward scan program once, afterwards, carries out this reverse scan program once, afterwards, carries out this replacement label program.
4, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, described method also comprises the following steps:
By setting up an image background model, detect the foreground object in the present picture; And,
By a background subtracting algorithm, produce a dualistic formula image light shield.
5, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, (M, N) this forward neighborhood pixels of pixel is (M-1, N) pixel, (M-1, N-1) pixel, (a M, N-1) (M+1 is N-1) one of in the pixel for pixel and one.
6, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, (M, N) the reverse neighborhood pixels of this of pixel is (M+1, N) pixel, (M+1, N+1) pixel, (a M, N+1) (M-1 is N+1) one of in the pixel for pixel and one.
7, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, described forward scan program also comprises the following steps:
(1,1) pixel begins, by each respective pixel of this image data of column scan;
Judge whether respective pixel is this foreground pixel;
If respective pixel is this foreground pixel, judge then whether this forward neighborhood pixels of respective pixel correspondence is this foreground pixel; And,
If this forward neighborhood pixels is this foreground pixel, then the Dui Ying pairing label of forward neighborhood pixels forms a label value ordered series of numbers L, and ordered series of numbers L contains X label, and X is more than or equal to 1, is this forward label of respective pixel with the minimum value of ordered series of numbers L.
8, mixed connection assembly volume label algorithm as claimed in claim 7 is characterized in that, described forward scan program also comprises the following steps:
If respective pixel is not this foreground pixel, judge then whether respective pixel is last pixel;
If respective pixel is last pixel, then finish this forward scan program; And,
If respective pixel is not last pixel, then scan next pixel.
9, mixed connection assembly volume label algorithm as claimed in claim 7 is characterized in that, described forward scan program also comprises the following steps:
If respective pixel is this foreground pixel, and this forward neighborhood pixels of respective pixel correspondence is not this foreground pixel, and then distributing new label is this forward label of respective pixel.
10, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, described reverse scan program also comprises the following steps:
The (M, N) pixel begins, by each respective pixel of this image data of column scan;
Judge whether respective pixel is this foreground pixel;
If respective pixel is this foreground pixel, judge then whether this reverse neighborhood pixels of respective pixel correspondence is this foreground pixel; And,
If this reverse neighborhood pixels is this foreground pixel, then the pairing label of the reverse neighborhood pixels of Dui Ying this and this respective pixel form a label value ordered series of numbers H at last time this forward label, ordered series of numbers H contains Y label, and Y is more than or equal to 1, is this reverse label of respective pixel with the minimum value of ordered series of numbers H.
11, mixed connection assembly volume label algorithm as claimed in claim 10 is characterized in that, described reverse scan program also comprises the following steps:
If respective pixel is not this foreground pixel, judge then whether respective pixel is last pixel;
If respective pixel is last pixel, then finish this reverse scan program; And,
If respective pixel is not last pixel, then scan next pixel.
12, mixed connection assembly volume label algorithm as claimed in claim 10 is characterized in that, described reverse scan program also comprises the following steps:
If respective pixel is this foreground pixel, and this reverse neighborhood pixels of respective pixel correspondence is not this foreground pixel, this reverse label that then to distribute this respective pixel this forward label last time be respective pixel.
13, mixed connection assembly volume label algorithm as claimed in claim 1 is characterized in that, described replacement label program also comprises the following steps:
(1,1) pixel begins, by each respective pixel of this image data of column scan;
Judge whether respective pixel is this foreground pixel;
If respective pixel is this foreground pixel, judge then whether this forward neighborhood pixels of respective pixel correspondence is this foreground pixel; And,
If this forward neighborhood pixels is this foreground pixel, then the Dui Ying pairing label of this forward neighborhood pixels forms a label value ordered series of numbers L, and ordered series of numbers L contains X label, and X is more than or equal to 1, is this forward label of respective pixel with the minimum value of ordered series of numbers L;
Set up connection relationship between different connection assembly volume labels;
According to the area that this forward label is surrounded, whether decision deletes this corresponding forward label; And,
This forward label that deletion is corresponding, and upgrade this corresponding label pond parameter, this effective row parameter and this guiding label parameter.
14, mixed connection assembly volume label algorithm as claimed in claim 13 is characterized in that, described replacement label program also comprises the following steps:
If respective pixel is not this foreground pixel, judge then whether respective pixel is last pixel;
If respective pixel is last pixel, then finish this forward scan program; And,
If respective pixel is not last pixel, then scan next pixel.
15, mixed connection assembly volume label algorithm as claimed in claim 13 is characterized in that, described replacement label program also comprises the following steps:
Set an area critical value; And,
If the area that this forward label is surrounded is lower than this area critical value, this label pond parameter that then this corresponding forward label of deletion, and renewal is corresponding, this effective row parameter and this guiding label parameter.
16, mixed connection assembly volume label algorithm as claimed in claim 13 is characterized in that, described replacement label program also comprises the following steps:
Judge that whether respective pixel is last of respective column;
If respective pixel is respective column last, then according to an area critical value, this forward label that deletion is corresponding, and upgrade this corresponding label connection relation table, this label pond parameter, this effective row parameter and this guiding label parameter.
CN2008101291545A 2008-06-30 2008-06-30 Mixed connection assembly volume label algorithm Active CN101620733B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2008101291545A CN101620733B (en) 2008-06-30 2008-06-30 Mixed connection assembly volume label algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2008101291545A CN101620733B (en) 2008-06-30 2008-06-30 Mixed connection assembly volume label algorithm

Publications (2)

Publication Number Publication Date
CN101620733A true CN101620733A (en) 2010-01-06
CN101620733B CN101620733B (en) 2012-01-11

Family

ID=41513950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2008101291545A Active CN101620733B (en) 2008-06-30 2008-06-30 Mixed connection assembly volume label algorithm

Country Status (1)

Country Link
CN (1) CN101620733B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104715247A (en) * 2013-12-12 2015-06-17 夏普株式会社 Method and device for identifying closed regions

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5841903A (en) * 1992-01-17 1998-11-24 Yamaha Corporation Method and device for extracting a connected component of image data
JP4221534B2 (en) * 1999-02-19 2009-02-12 日本ケミコン株式会社 Feature extraction method for binary image

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104715247A (en) * 2013-12-12 2015-06-17 夏普株式会社 Method and device for identifying closed regions

Also Published As

Publication number Publication date
CN101620733B (en) 2012-01-11

Similar Documents

Publication Publication Date Title
JP5455038B2 (en) Image processing apparatus, image processing method, and program
US20060050791A1 (en) Scene change detection method using two-dimensional DP matching, and image processing apparatus for implementing the method
WO2006019165A1 (en) Method for generating label image and image processing system
CN113361257B (en) PDF document analysis method, system, electronic device and storage medium
US8290255B2 (en) Image processing method, image processing apparatus, and program
CN111598076B (en) Method and device for detecting and processing date in label image
CN113902641A (en) Data center hot area distinguishing method and system based on infrared image
CN112950554A (en) Lung lobe segmentation optimization method and system based on lung segmentation
CN105828081A (en) Encoding method and encoding device
CN105516540A (en) Compression method and device of binary image
Appiah et al. A run-length based connected component algorithm for FPGA implementation
CN104794726B (en) A kind of underwater picture Parallel segmentation method and device
CN115937065A (en) Foreign matter detection method, device and equipment of display module and storage medium
TWI386030B (en) Algorithm for hybrid connected-component-labeling
CN102496146B (en) Image segmentation method based on visual symbiosis
CN101620733B (en) Mixed connection assembly volume label algorithm
US20160055643A1 (en) Image processing apparatus and image processing method
CN105741300A (en) Region segmentation screenshot method
CN104036141A (en) Open computing language (OpenCL)-based red-black tree acceleration algorithm
CN115761580A (en) Detection method of water surface floater, edge calculation terminal and storage medium
US20130083377A1 (en) Image processing apparatus and image processing method
CN101930593A (en) Single object image extracting system and method
Delon et al. Color image segmentation using acceptable histogram segmentation
CN114419630A (en) Text recognition method based on neural network search in automatic machine learning
CN114626994A (en) Image processing method, video processing method, computer equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant