2. Label connected component: Use <b>cv2.connectedComponentsWithStats</b> (whose detail information is given in function part) to label. Draw rectangles on the selected connected components if in Debug mode.
3. Get delete list according to the ratio of length and height, and area of connected components ( use <b>func_get_delete_strict_list</b> in <b>NEAR</b> mode and with <b>func_get_delete_loose_list</b> in <b>MID</b> mode to get the list of connecetd components to be deleted ). If not connected components are remained after deletion, reutun.
4. Get y coordinate and x coordinate of mid point for both top line and bottom line of the light bar. Draw a cirlce on both points when in debug mode.
5. Calculate bar length, bar angle and get weighted sum.
6. Threshold weighted sum, select pairs by threshold.
7. Calculate the x and y distance of selected paris.
8. Calculate the height sum and select pairs with maximum pixel to be the target.