Dividing up a word into letters based on the coordinates already present?
조회 수: 1 (최근 30일)
이전 댓글 표시
I was able to detect the letters in an Arabic word and record/save its coordinates. The word or image in question is:
The points are represented by red and yellow markers (Which were plotted using the plot command)
I got these markers by first converting the image to logical, complementing it, skeletonizing it, then using a modified chain code algorithm to detect the letters.
The red markers are:
110 287
123 325
115 150
109 185
120 219
The yellow markers are:
103 267
99 142
105 109
37 186
Having these coordinates I would like to isolate the letters as separate images or matrices. that is split up or extract the letters and save them individually for further processing.
I thought having the coordinates would make a simple procedure of just cropping out the original image but apparently that is not working. I have tried
test = img(:,109,:,120)
test = im(185:109,219:120);
And these are not working.
How would I go about splitting this up?
Thank you
댓글 수: 0
채택된 답변
Adam
2014년 8월 13일
The first of your options would only work on a 4d matrix.
The second would work if you swap round your indices - you have to have min:max:
test = im( 109:185, 120:219 ).
Assuming im is a matrix of size at least 185 * 219 that will cut out the rectangle you describe there, though not the individual letters distinct from each other.
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 3-D Volumetric Image Processing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!