Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //step1
- Mat edges;
- adaptiveThreshold(vertical, edges, 255, CV_ADAPTIVE_THRESH_MEAN_C, THRESH_BINARY, 3, -2);
- imshow("edges", edges);
- // Step 2
- Mat kernel = Mat::ones(2, 2, CV_8UC1);
- dilate(edges, edges, kernel);
- imshow("dilate", edges);
- // Step 3
- Mat smooth;
- vertical.copyTo(smooth);
- // Step 4
- blur(smooth, smooth, Size(2, 2));
- // Step 5
- smooth.copyTo(vertical, edges);
- // Show final result
- imshow("smooth", vertical);
- #step1
- edges = cv2.adaptiveThreshold(vertical,255,cv2.ADAPTIVE_THRESH_MEAN_C,cv2.THRESH_BINARY,3,-2)
- #step2
- kernel = np.ones((2, 2), dtype = "uint8")
- dilated = cv2.dilate(edges, kernel)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement