Invented by Zhenkun Song, Quan Yang, Hongzhen Xue, BOE Technology Group Co Ltd
The BOE Technology Group Co Ltd invention works as follows
The present disclosure provides a method for obtaining the maximum connected area. It also includes a target tracking method, an AR (Augmented Reality), and a VR (Virtual Reality). The maximum connected-domain marking method includes: marking the connected domains in pixels of a binary picture and recording the equivalent relationship; merging the equivalent connections according to these equivalent relationships for pixels that have the equivalent relationship in the marked results, counting the pixels in each merged connection; determining the connected-domain label for the maximum connectable domain based on this counted number; and determining the coordinates of boundary pixels within the maximum connected area based on this connected-domain label.
Background for Maximum connected Domain Marking Method, Target Tracking Method, and Augmented Reality/Virtual Reality Apparatus
Connected Domain Marking is an important step for machine vision, tracking, and target recognition applications. The connected domain marking’s purpose is to identify connected areas within a binary image, and then assign a label for each area.
At the moment, the connected domain marking can only be obtained by obtaining the centroid position of all connected domains, or only all connected domains are marked.
The embodiments of this disclosure provide a method for marking a domain with the maximum number of connected points, a method to track targets and an AR/VR (Augmented Reality/Virtual Reality), apparatus.
According to a first aspect, the present disclosure provides a method for marking the maximum connected area. This includes marking the connected areas of pixels and recording equivalent relationships; merging the equivalent results according to the equivalent relationship for pixels; storing the final results marked for all pixels in a computer memory; counting the number pixels within each connected area; determining the connected label for the maximum-connected domain based on the counted pixels; simultaneously generating the row counts and columns counts; and recording the coordinates for all pixels in the first and last
The following may be included: marking connected pixels of pixels from a binary picture and recording equivalent relations, merging the equivalent pixels according to equivalent results in marked results and counting the numbers of pixels within each connected area.
In some embodiments, the binary image can be obtained by binarizing the grayscale image with an adaptive threshold binarization technique.
The threshold of the previous image is used to binarize the grayscale images of previous frames. If the number is less than the minimum amount of white pixel, the threshold of the prior frame plus a can be used as the threshold of the current image for binarizing grayscale images of present frame.
The present disclosure may allow marking connected labels on pixels by: determining if a pixel’s gray value is zero. If the gray is not zero, the pixel will be marked with the smallest non-zero connected label from four adjacent pixels. Otherwise, the pixel would receive a label greater than the other connected labels.
In some embodiments, recording equivalent relationships can include: determining if the connected labels of pixels with coordinates (x?1,y+1) and (x?1,y?1) are zero respectively when the connected label of pixel with coordinate (x?1,y+1) is not zero. If not zero and the connected labels of corresponding pixels are not equal to the pixel with coordinate (x?1,y+1), recording the relationship equivalent between the two domain labels.
According to some embodiments, updating the domain labels for the pixels of the (i?)th row based on the inter-row relationships between pixels of the (i?)th row and pixels of the ith rows may include changing the greater connected label of the pixel of the (i?)th row to a smaller equivalent connected label. Updating the domain labels for the pixels of the ith column based on the intra-row relationships between pixels of the ith section may include changing the greater connected label of the pixel of the it
In some embodiments, the update of the connected-domain labels for pixels of the (i?)th row based on the inter-row-equivalent relationships between pixels of the (i?)th row, the pixels of the (i?)th row, and pixels of the ith-row may include: When marking the connected-domain labels for pixels of the (i?)th row, recording the equivalent relationship, transferring connected-domain labels of pixels of the (i?)th row between two shift registers and updating the connected-domain
Before marking the connected pixels of pixels on the (i+1),th row, and recording equivalent relationships between pixels of the (i+1),th row, updating connected domain label of pixels of the ith column according to intra-row equal relationships between pixels of the ith cell may include: transferring the linked domain labels between two shift registers once, then updating the connected labels between pixels of the ith cell according to intra-row similar relationships between pixels of the ith cell.
In some embodiments, the marked results may include: “Counting the number of pixels within each connected domain, and storing them in memory.
S1″: In the scan stage of the first line of pixels, traversing each pixel from left to right, marking connected domain labels and recording equivalent relationships. Then sequentially entering the initial marked results into a first shiftregister;
S2″: In the scan stage of the second line of pixels, traversing each pixel from left to right, marking connected domain labels and recording equivalent relationships and sequentially putting the marked results into the first shift-register, while an output terminal in the shift-register sequentially outputs initial marked results for the pixels of the first column, updating the connected labels according to inter-row equivalent relations between the pixels of the first and second rows, to obtain the final marked results, and sequentially putting the same in a second shift
The following is an example of how to implement the “S3” stage.
S4″: In the scan stage of the third column of pixels, traversing each pixel from left to right, marking its connected domain label and recording equivalent relationships; at the same, the output terminals of the two shift registers sequentially output the intermediate marked results for the pixels of the second column; updating the connected labels of the pixel in the 2nd row according to inter-row equivalent relations between the pixels of the 2nd row and pixels of the 3rd row to obtain the final marked results, and sequentially putting
The following is an example of how to implement the “S5” method.
wherein S4 and S5 are performed for each successive row of pixels. Wherein, upon traversing the Mth column of pixels, the initial results marked for the pixels of the Mth column are sequentially inputted into a non zero shift register, 4MN?N. The number of pixels in all connected domains are obtained until the final results marked of the pixels of the last row is stored in memory.
In some embodiments, after the grayscale image is binarized to produce the binary image, the method can include performing noise reduction and cropping on the grayscale picture.
In some embodiments, after marking connected domains and recording equivalent relationships on the binary images, the method can include further: performing erosion and distortion processing on the binary images.