CN101620733B - Mixed connection assembly volume label algorithm - Google Patents

Mixed connection assembly volume label algorithm Download PDF

Info

Publication number
CN101620733B
CN101620733B CN2008101291545A CN200810129154A CN101620733B CN 101620733 B CN101620733 B CN 101620733B CN 2008101291545 A CN2008101291545 A CN 2008101291545A CN 200810129154 A CN200810129154 A CN 200810129154A CN 101620733 B CN101620733 B CN 101620733B
Authority
CN
China
Prior art keywords
pixel
label
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.)
Active
Application number
CN2008101291545A
Other languages
Chinese (zh)
Other versions
CN101620733A (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 method, 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 stamp methods
Technical field
The invention relates to a kind of connection assembly stamp methods, and particularly relevant for a kind of mixing coupling assembling stamp methods of scan method and rescan method 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 characteristic thereof.Moreover according to the data that the intelligent safety monitoring system of low order is obtained, the intelligent safety monitoring system of high-order then can be judged event further, and makes subsequent treatment.
Through 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) through 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 the connection assembly labeling algorithm when analyzing dualistic formula image light shield.The method of common connection assembly labeling 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 following:
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 the connection assembly label.If have, then the method selects the minimal modules label distribution to give foreground pixel.If do not have, then the method is distributed to new label of this pixel.Repeat aforementioned activities, till whole image is all by 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 through 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 imaged tag data need be constantly read in repeatedly scanning algorithm iteration action, seriously consume system resource.
The practice of twice scanning algorithm is following:
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 the connection assembly label.If have, then the method selects the minimal modules label distribution to give foreground pixel, and sets up connection relationship for different connection assembly labels.If do not have, then the method is distributed to new label of this pixel.Repeat aforementioned activities, till whole image is all by 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, be that 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 application in industry.
The practice of single pass algorithm is following:
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 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, up to whole image all till the 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.
Know that by 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 is prone in hardware, realize, 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 not enough phenomenon of label number in hardware inside.The single pass algorithm does not have the not enough phenomenon of label and 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 not enough problem of label.The dualistic formula image light shield that method produced through background subtracting can mix many noises, makes these noises can occupy part connection assembly label.Prior art is done the action of deletion to less connection assembly label after finishing the label of connection assembly.In addition, through setting up each labelled component binding table, be able to set up the image connection assembly.After the connection assembly label was accomplished, whether prior art inspection connection assembly met the condition that continues to stay.If not, then prior art is deleted corresponding label, and to register all labels again be available label.The advantage of the method is can reuse label, the not enough situation of reduction label.But not enough is, in the label process, a connection assembly may use a plurality of labels, and the situation that this solution generation label is not enough is still very high, can't solve the not enough problem of label.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, the object of the invention is providing a kind of mixed connection assembly stamp methods exactly.The present invention combines repeatedly the principle of scan method and twice scan method, and through the application of analyzing tags, the deletion label can be reused label, to overcome the not enough shortcoming of label.
For reaching above-mentioned and other purpose, the present invention proposes a kind of mixed connection assembly stamp methods, 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.Each pixel is corresponding is denoted as (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 tag program.The replacement tag 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 tag 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.When this method was distributed the available label that parameter is taken out from the label pond, the label (value) before the displacement of this method record was in the guiding tag parameter.Through 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.
Said 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 the replacement tag program.
Said 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 through setting up an image background model.And, through a kind of background subtracting method, produce dualistic formula image light shield.
Said according to preferred embodiment of the present invention, above-mentioned the (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.
Said according to preferred embodiment of the present invention, above-mentioned the (M, N) those reverse 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 below of respective pixel.
Said 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 corresponding forward neighborhood pixels of respective pixel 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.
Said 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 reverse 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.
Said according to preferred embodiment of the present invention, above-mentioned replacement tag 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 corresponding forward neighborhood pixels of respective pixel 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 labels.In addition, in the process of carrying out the replacement tag program, this method is upgraded label pond parameter simultaneously, and sets up effective row parameter and guiding tag 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 tag parameter.After waiting to accomplish whole picture, do forward scan for the second time again,, each pixel is updated to final label under it according to above-mentioned parameter.
Said according to preferred embodiment of the present invention, above-mentioned replacement tag 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 tag parameter.
Comprehensively above-mentioned, the present invention proposes a kind of mixed connection assembly stamp methods.The practice of the present invention is, simplifies the connection assembly label earlier, and for example: the present invention uses the repeatedly scan method of fixed number of times earlier, to reduce connection assembly 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 tag 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 completion 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 not enough problem of prior art label effectively.
3, because the practice of the present invention is to simplify the connection assembly label in advance, the tag program that promptly begins subsequently to reset is made the connection assembly label, and in time in the label process, discharges label; So the present invention can use minimum hardware resource, with minimum number of tags, compared to the time faster of scan method repeatedly; Make the number of tags of whole light shield stable; Have high industry applications, can not only accomplish 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 the replacement tag 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 letting above and other objects of the present invention, characteristic and the advantage can be more obviously understandable, hereinafter is special lifts preferred embodiment, and conjunction with figs., elaborates as follows:
Shown in Figure 1 is the process flow diagram according to the mixed connection assembly stamp methods of the present invention's one preferred embodiment;
Shown in Figure 2 is the process flow diagram according to the forward scan program of the present invention's one preferred embodiment;
Shown in Figure 3 is the process flow diagram according to the reverse scan program of the present invention's one preferred embodiment;
Shown in Figure 4 is the process flow diagram according to the replacement tag program of the present invention's one preferred embodiment;
Shown in Figure 5 is the synoptic diagram according to the forward label of the present invention's one preferred embodiment;
Shown in Figure 6 is the synoptic diagram according to the reverse label of the present invention's one preferred embodiment;
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 the present invention's one preferred embodiment;
Shown in Figure 8 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding tag parameter according to the present invention's one preferred embodiment;
Shown in Figure 9 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding tag parameter according to the present invention's one preferred embodiment;
Shown in Figure 10 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding tag parameter according to the present invention's one preferred embodiment;
Shown in Figure 11 is the synoptic diagram of record label connection relation table, label pond parameter, effective row parameter and guiding tag parameter according to the present invention's one preferred embodiment;
Prior art that shown in Figure 12 is repeatedly the scanning times of scan method to the curve map of time;
Prior art that shown in Figure 13 is repeatedly the number of tags of scan method to the curve map of time;
Shown in Figure 14 is the curve map of the number of tags of prior art rescan method to the time; And,
Shown in Figure 15 is the curve map of the number of tags of mixed connection assembly stamp methods of the present invention to the time.
Embodiment
Please with reference to Fig. 1, shown in it is the process flow diagram according to the mixed connection assembly stamp methods of the present invention's one preferred embodiment.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 the replacement tag program, does final connection assembly tag program (S112).
Wherein, the dualistic formula light shield has M*N pixel, and aforementioned pixel comprises a plurality of foreground pixels, each pixel is corresponding is denoted as (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 a foreground pixel,, decide the reverse label of respective pixel then according to a plurality of reverse neighborhood pixels and this respective pixel pairing label of gained forward label after a last forward scan.
At last, this method is carried out the replacement tag 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 in the time of need distributing new forward label as if respective pixel, checks from the guiding tag parameter earlier whether the reverse label of this respective pixel reverse scan for the second time gained has been refitted in the guiding tag parameter except that setting up each labelled component connection relationship.If aforementioned reverse label was reset (that is guiding contains aforementioned reverse label in the tag parameter), then this method is the forward label of respective pixel with the corresponding label pond parameter of aforementioned reverse label.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 tag parameter of correspondence.Through 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 with reference to Fig. 2, shown in it is the process flow diagram according to the forward scan program of the present invention's one preferred embodiment.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 with reference to Fig. 3, shown in it is the process flow diagram according to the reverse scan program of the present invention's one preferred embodiment.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 labels that belong to the reverse neighborhood pixels of foreground pixel can form a label value ordered series of numbers H with this respective pixel gained forward label after a last forward scan, and 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 with reference to Fig. 4, shown in it is the process flow diagram according to the replacement tag program of the present invention's one preferred embodiment.The replacement tag 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 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 tag 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 tag 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 tag parameter (S424) that leads.Afterwards; If the last one time reverse label of respective pixel is refitted in the guiding tag 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 the replacement tag program of resetting.If the reverse label of respective pixel was not reset; Then this method is selected the forward label that available label is the replacement tag program through the label connection relation table; And upgrade label pond parameter, effective row parameter and guiding tag parameter, with the change conditions (S428) of record label.
Please with reference to Fig. 5, shown in it is the synoptic diagram according to the forward label of the present invention's one preferred embodiment.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, (9,1) pixel, (12,1) pixel, (15,1) pixel, the (6; 2) pixel, (9,2) pixel, (12,2) pixel, (15,2) pixel, (6,3) pixel, (7,3) pixel, the (8; 3) pixel, (9,3) pixel, (12,3) pixel, (13,3) pixel, (14,3) pixel, (15,3) pixel, the (9; 4) pixel, (12,4) pixel, (9,5) pixel, (10,5) pixel, (11,5) pixel, the (12; 5) pixel, (7,9) pixel, (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, (9,1) pixel, (12,1) pixel, the (15; 1) pixel, (6,2) pixel, (9,2) pixel, (12,2) pixel, (15,2) pixel, the (6; 3) pixel, (7,3) pixel, (8,3) pixel, (9,3) pixel, (12,3) pixel, the (13; 3) pixel, (14,3) pixel, (15,3) pixel, (9,4) pixel, (12,4) pixel, the (9; 5) pixel, (10,5) pixel, (11,5) pixel, (12,5) pixel, the (7; 9) pixel, (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 (8,3) pixel, the (8; 2) pixel, (9,2) pixel and (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 with reference to Fig. 6, shown in it is the synoptic diagram according to the reverse label of the present invention's one preferred embodiment.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 (14,11) pixel, (8,10) pixel, the (9; 9) pixel, (7,9) pixel, (12,5) pixel, (11,5) pixel, (10,5) pixel, the (9; 5) pixel, (12,4) pixel, (9,4) pixel, (15,3) pixel, (14,3) pixel, the (13; 3) pixel, (12,3) pixel, (9,3) pixel, (8,3) pixel, (7,3) pixel, the (6; 3) pixel, (15,2) pixel, (12,2) pixel, (9,2) pixel, (6,2) pixel, the (15; 1) pixel, (12,1) pixel, (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 reverse 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 was the (15; 11) pixel, (15,12) pixel (14,12) pixel and (13,12) pixel; That is, the (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 with reference 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 the present invention's one preferred embodiment.After this method is carried out forward scan program and reverse scan program, carry out the replacement tag program.Please cooperate with reference to Fig. 6, when handling foreground pixel, the replacement tag 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 tag parameter.For instance, when this method was inserted the forward label of (6,1) pixel, from the parameter of label pond, taking out present available label 0 was the forward label of (6,1) pixel, and to write down effective row parameter be 0, and the guiding tag parameter is 0.Please with reference 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 the present invention's one preferred embodiment.For instance, when this method was inserted the forward label of (15,1) pixel, from the parameter of label pond, taking out present available label 1 was the forward label of (15,1) pixel, and to write down effective row parameter be 0, and the guiding tag parameter is 2.
Moreover, please with reference to Fig. 7 and Fig. 8.When this method is reset tag 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 the guiding tag 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 the guiding tag parameter, finds to have 0, then this method distributes reverse label 0 corresponding label pond parameter 0 to be the forward label.
Please with reference 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 the present invention's one preferred embodiment.For instance, when this method was inserted the forward label of (7,9) pixel, from the parameter of label pond, taking out present available label 2 was the forward label of (7,9) pixel, and to write down effective row parameter be 8, and the guiding tag parameter is 4.Wherein, be meaningless more than 2 pairs the 8th row of row parameter 8 expression forward labels effectively, the guiding tag parameter is that the old label of 4 expressions is 4.Please with reference 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 the present invention's one preferred embodiment.For instance, when this method was inserted the forward label of (14,11) pixel, from the parameter of label pond, taking out present available label 3 was the forward label of (14,11), and effectively the row parameter is 10, and the guiding tag parameter is 6.Please with reference 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 the present invention's one preferred embodiment.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 tag parameter, forward label 2 and forward label 3 can be reused, exempt the problem of label deficiency.
What be worth explanation 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 the replacement tag program, can reduce the complexity of label action, and effectively solves the not enough problem of label.This method is with experiment film (AVSS 2007Abandoned Baggage Easy Case; 720x576; 5053 frames) cut out the connection assembly that area surpasses the area critical value, and compare repeatedly scan method, rescan method and the present invention's difference of prior art.Please with reference to Figure 12, shown in it be prior art repeatedly the scanning times of scan method to the curve map of time.Please with reference to Figure 13, shown in it be prior art repeatedly the number of tags of scan method to the curve map of time.Among Figure 13, curve 1 is the number of tags of scanning for the first time, and curve 2 is for removing the number of tags 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 with reference to Figure 14, shown in it is the curve map of the scanning times of prior art rescan method to the time.Curve 4 is a number of tags, 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 with reference to Figure 15, shown in it is the curve map of the label of mixed connection assembly stamp methods of the present invention to the time.The longitudinal axis of figure is a number of tags, and curve 6 is the highest number of tags 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 tag program, and the highest number of tags that the program of forward scan is for the first time used is 638 (the 13rd figure curves 1); The highest number of tags that the replacement tag 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 tag parameter, label connection relation table, label areas).Hence one can see that, and the present invention is minimum with final connection assembly number gap in three methods, is enough to effectively explain that the present invention has the more efficient effect of connection assembly tag 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 on embodiment and range of application, all can change, in sum, this description should not be construed as limitation of the present invention.

Claims (14)

1. a mixed connection assembly stamp methods is applicable to image processing, it is characterized in that, an image data has M*N pixel; Said pixel comprises at least one foreground pixel, each pixel is corresponding is denoted as (M, N); Wherein, M, N is more than or equal to 1; And M, N is an integer, 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; (M; N) the forward neighborhood pixels of pixel comprises: (M-1, N) pixel, (M-1, N-1) pixel, (M; N-1) pixel and (M+1, N-1) 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; (M; N) the reverse neighborhood pixels of pixel comprises: (M+1, N) pixel, (M+1, N+1) pixel, (M; N+1) pixel and (M-1, N+1) pixel; And,
Carry out a replacement tag 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 tag 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;
When respective pixel need be distributed this available label, upgrade this label pond parameter;
When if respective pixel obtains this available label, one classifies an effective row parameter as before the row at record respective pixel place;
When respective pixel obtained this available label, the label before the record displacement was this guiding tag parameter;
Through label connection relation table, 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 stamp methods as claimed in claim 1 is characterized in that, this image data is a dualistic formula image light shield.
3. mixed connection assembly stamp methods as claimed in claim 1 is characterized in that, said method also comprises the following steps: to carry out this forward scan program once, afterwards, carries out this reverse scan program once, and afterwards, execution should the replacement tag program.
4. mixed connection assembly stamp methods as claimed in claim 1 is characterized in that said method also comprises the following steps:
Through setting up an image background model, detect the foreground object in the present picture; And,
Through a background subtracting method, produce a dualistic formula image light shield.
5. mixed connection assembly stamp methods as claimed in claim 1 is characterized in that, said 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 corresponding forward neighborhood pixels of respective pixel is this foreground pixel; And,
If this forward neighborhood pixels be this foreground pixel, then the pairing label of forward neighborhood pixels of correspondence 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.
6. mixed connection assembly stamp methods as claimed in claim 5 is characterized in that, said 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.
7. mixed connection assembly stamp methods as claimed in claim 5 is characterized in that, said forward scan program also comprises the following steps:
If respective pixel be 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.
8. mixed connection assembly stamp methods as claimed in claim 1 is characterized in that, said 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 corresponding reverse neighborhood pixels of respective pixel is this foreground pixel; And,
If this reverse neighborhood pixels is this foreground pixel; The then corresponding pairing label of this reverse neighborhood pixels and this respective pixel form a label value ordered series of numbers H at this forward label last time; 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.
9. mixed connection assembly stamp methods as claimed in claim 8 is characterized in that, said 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.
10. mixed connection assembly stamp methods as claimed in claim 8 is characterized in that, said reverse scan program also comprises the following steps:
If respective pixel be 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.
11. mixed connection assembly stamp methods as claimed in claim 1 is characterized in that, said replacement tag 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 corresponding forward neighborhood pixels of respective pixel is this foreground pixel; And,
If this forward neighborhood pixels be this foreground pixel, then the pairing label of this forward neighborhood pixels of correspondence 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 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 tag parameter.
12. mixed connection assembly stamp methods as claimed in claim 11 is characterized in that, said replacement tag 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.
13. mixed connection assembly stamp methods as claimed in claim 11 is characterized in that, said replacement tag 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 tag parameter.
14. mixed connection assembly stamp methods as claimed in claim 11 is characterized in that, said replacement tag 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 tag 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 CN101620733A (en) 2010-01-06
CN101620733B true 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)

Families Citing this family (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

Citations (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
US6973259B1 (en) * 1999-02-19 2005-12-06 Nippon Chemi-Con Corporation Method for extracting feature of binary image

Patent Citations (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
US6973259B1 (en) * 1999-02-19 2005-12-06 Nippon Chemi-Con Corporation Method for extracting feature of binary image

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
孔斌.快速连通域分析算法及其实现.《模式识别与人工智能》.2003,第16卷(第1期), *
张修军,等.带标记矫正的二值图象连通域像素标记算法.《中国图象图形学报》.2003,第8卷(第2期), *
徐正光,等.基于递归的二值图像连通域像素标记算法.《计算机工程》.2006,第32卷(第24期), *
王亮,等.一种改进的二值图像像素标记算法.《南京师范大学学报(工程技术版)》.2006,第6卷(第2期), *

Also Published As

Publication number Publication date
CN101620733A (en) 2010-01-06

Similar Documents

Publication Publication Date Title
JP6151763B2 (en) Word segmentation for document images using recursive segmentation
CN101453575B (en) Video subtitle information extracting method
JP5455038B2 (en) Image processing apparatus, image processing method, and program
US8208728B2 (en) Method of generating a labeled image and image processing system with pixel blocks
CN112183511A (en) Method, system, storage medium and equipment for deriving table from image
CN105516540A (en) Compression method and device of binary image
CN112950554A (en) Lung lobe segmentation optimization method and system based on lung segmentation
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
TWI386030B (en) Algorithm for hybrid connected-component-labeling
CN101620733B (en) Mixed connection assembly volume label algorithm
CN106991753A (en) A kind of image binaryzation method and device
CN102496146B (en) Image segmentation method based on visual symbiosis
JP2010102568A (en) Information processing apparatus
CN115761580A (en) Detection method of water surface floater, edge calculation terminal and storage medium
Delon et al. Color image segmentation using acceptable histogram segmentation
CN114626994A (en) Image processing method, video processing method, computer equipment and storage medium
Santiago et al. Fast block-based algorithms for connected components labeling
Bailey History and evolution of single pass connected component analysis
JP5104528B2 (en) Image processing apparatus and image processing program
CN101930591B (en) Image processing method for removing backgrounds
US20020028023A1 (en) Moving image encoding apparatus and moving image encoding method
CN116994261B (en) Intelligent recognition system for big data accurate teaching intelligent question card image
WO2022022310A1 (en) Method and apparatus for identifying optical splitter ports
CN101833769A (en) Method and device for maintaining image background utilizing multiple Gaussian models

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