zhengchun
zhengchun

Reputation: 1291

image segmentation for connected character in morphology

before i asked a same similar question,i tried using a watershed to segmentation the connected character but it does not well.a weeks ago,i get same question at stackoverflow in google search,Segmentation for connected characters, in the answer users,the author mmgp provide a solution that use a morphology method and closing operation but i not understand all.

i just thinning a image in hit-and-miss morphology.

enter image description here the original image

enter image description here the thinning image enter image description here the big image for the thinning image (enlarge)

the 4-connectivity can split a digit 9 to individual character but 44 still connected.

i have a some of question about Segmentation for connected characters

1.why need resize the original image to 200-pixel and then thinning it.

why not thinning the original image by immediate.

2.how extract these branch points and apply a morphological closing to thinning image.

i just know the closing morphology is a erosion and dilation combine operation.

the closing's vertical line need a 2*height+1(this a structure element height?),i don't know and how setting.the structure element how to constructre(3*3 or other?).

the finally they get a following image

enter image description here

i need some help, someone can tell me how apply closing operation and get above a image. thanks.

Upvotes: 1

Views: 993

Answers (2)

Pratik Prajapati
Pratik Prajapati

Reputation: 71

Use the below method for closing operation:

kernel = cv2.getStructuringElement(cv2.MORPH_RECT,(2*h+1,1))
closed_img = cv.morphologyEx(img, cv.MORPH_CLOSE, kernel)

Upvotes: 0

zhengchun
zhengchun

Reputation: 1291

i have solved this problem use a foreground-feature and background-feature.

some of people that details about this algorithm below:

Agenetic framework using contextual knowledge for segmentation and recognition of handwritten numeral strings

Segmentation of Handwritten Numeral Strings in Farsi and English Languages.

the flowing image is my capture.

foreground-region and foreground-skeleton

enter image description here enter image description here

background-region and background-skeleton

enter image description here enter image description here

the skeleton image for 44.

enter image description here

based on the above feature-points ,we can constructing a segmentation path to split 449 digit.

Upvotes: 1

Related Questions