Burn multiple lines into a binary image problem
조회 수: 11 (최근 30일)
이전 댓글 표시
I am working on images where I have to extract 24 cells. I should already have them, because by applying multiple lines (images.roi.Line) on the current binary image.

I thought(pretty convinced about it) to use createMask with these lines, and then using bwlabel to extract every cell portion with a certain range of quantity of pixels (and so on..)
The only problem is that, as I start processing this code for each line, I keep on getting discontinuous lines
roiLine = images.roi.Line(gca, 'Position', [x1, y1; x2, y2]);
mask = createMask(roiLine);
cumulativeBinaryImage = cumulativeBinaryImage | mask;
binaryImage(cumulativeBinaryImage) = 0;
Here's the problem

I also tried to use the hough transform but the problem is similar, I can't get these lines burned into the image.
Someone had also told me to use insertShape, but nothing new happened.
I look forward to your comments. Thanks.
댓글 수: 0
채택된 답변
Image Analyst
2020년 2월 1일
That should work. It's probably just because the line is so thin that when it subsamples the image for display, some pixels of the line are not chosen and it picks a neighboring background pixel instead. If you zoom in, or examine the image variable in the Variable Editor (double click the variable name in the workspace), you'll see that the line is in fact really there.
댓글 수: 0
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!