Problem using blockproc for a very large image

1 view (last 30 days)
I'm trying to outline each cell in a large image.
Here is the relevant piece of code:
function blockanalyze(cells, rings)
fun = @(block_struct) outline(block_struct.data);
size = block_struct.imageSize/9
largesegmentedcells = blockproc(cells, size ,fun);
function outline(cellblock)
I = rgb2gray(cellblock);
threshold = graythresh(I);
bw = im2bw(I,threshold);
[~, threshold] = edge(I, 'sobel');
fudgeFactor = .5;
BW = edge(I,'sobel', threshold * fudgeFactor);
se90 = strel('line', 3, 90);
se0 = strel('line', 3, 0);
BWdilate = imdilate(BW, [se90 se0]);
BWnobord = imclearborder(BWdilate, 4);
BWopen = bwareaopen(BWnobord,500); %this is the filter
BWclose = bwmorph(BWopen,'close');
BWfill = imfill(BWclose, 'holes');
BWoutline = bwperim(BWfill);
segmentedcells(BWoutline) = 255;
end
end
But Matlab returns this error.
The class "block_struct" is undefined. Perhaps Java is not running.
... and I know Java is running.

Answers (0)

Community Treasure Hunt

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

Start Hunting!