Blob segmentation and writing it to folder

조회 수: 1 (최근 30일)
Elysi Cochin
Elysi Cochin 2020년 5월 24일
댓글: Elysi Cochin 2020년 6월 6일
i have segmented few blobs using the below code
ccnt = 1;
for blob = 1 : n
thisBoundingBox = measurements(blob).BoundingBox;
[new_blob, pos] = imcrop(binaryImage, thisBoundingBox);
fileName = sprintf('FolderName/%d.bmp',ccnt);
imwrite(new_blob, fileName); ccnt = ccnt + 1;
end
When using the above code, i get all the blobs, but the order of the blobs written in the folder is not as i want
If my image is
i want each segmented blob to be written in the folder in the left to right order as
but i get it as
what should i do to get it in left to right order

채택된 답변

Image Analyst
Image Analyst 2020년 5월 24일
m = [...
1,2,3,4;
5,6,7,8;
9,10,11,12]
m2 = reshape(m', 1, []) % Transpose then reshape into row vector.
m =
1 2 3 4
5 6 7 8
9 10 11 12
m2 =
1 2 3 4 5 6 7 8 9 10 11 12
  댓글 수: 12
Image Analyst
Image Analyst 2020년 5월 27일
I think you'd be best off picking a handwriting algorithm here: VisionBib
There are papers there that have successfully done it.
Elysi Cochin
Elysi Cochin 2020년 6월 6일
Sir i found a paper, using histogram peak

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile 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!

Translated by