using parfor loop for marking the image/advice on other method for marking image
Show older comments
Hello and good day,
im still new with using Parallel Computing Toolbox so im having a problem to apply parfor loop for marking the image. below is the codes that bottleneck my algorithm for majority of the time taken to process.
imshow(image);
axis on %this will show you the axis ticks; note the y axis is reversed!
hold on
for Y=1:length(Index)
sz = [XImage YImage];
[row,col] = ind2sub(sz,Index(Y));
Result=textureAnalysis(Index(Y),image,ClassificationFunc);
if Result =="Yes"
plot(col,row,'y.', 'MarkerSize', 10);
else
plot(col,row,'bx', 'MarkerSize', 10);
end
disp([Y,length(Index)]);%tracking progress of marking image
end
What the codes should happened:
this function will run and process each index for classification, if it is yes, mark it with yellow dot,and vice versa with blue 'X'. The image shown later will show yellow dot's and Blue 'X' in the image.
what the codes process happened:
the parfor loop works but however the image doesnt contain any of the marking at all.
i think i understand the reason why parfor loop wont work with marking image. it is due to using a graph plot on the image.my Index is averaging to 10,000 iteration thus the for loop is a long process . im pretty sure by doing parfor loop will substantially reduce the process time.
i wonder, did i have misunderstanding of how parfor loops works? or graph plot method arent possible for parfor loop?
i would to request help for current method and if it is not possible,an advice of any other method to mark the image without manipulating the real image(masking) that can be used with parfor loop or something similiar would be very appreciated.
Accepted Answer
More Answers (0)
Categories
Find more on MATLAB in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!