Burn multiple lines into a binary image problem

11 vues (au cours des 30 derniers jours)
Stefano Sironi
Stefano Sironi le 1 Fév 2020
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.

Réponse acceptée

Image Analyst
Image Analyst le 1 Fév 2020
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.

Plus de réponses (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by