Find border for an image
outm = bwborder(inm, conn)
Source Image (must be in binary)
4 or 8 neighbourhood
Output image (in double)
Extracts contours from binary images, by detecting which pixel valued 1 has at least one neighbor valued 0. conn is 4 or 8 dependig if the detection is to be made in 4 or 8-neighborhood. The final border is 8-connected if 4-neighbors are used, and 4-connected if 8-neighbors are used.
inm = imread(fullpath(getIPCVpath() + "/images/big_sq.png")); outm = bwborder(im2bw(inm,0.5), 4); imshow(outm); | ![]() | ![]() |