Exclude from plotting some coordinates (born from blank .png images)

Hello! Maybe the title will not be well clear but I hope I am clear in my goal.
I have the attached code along with some .png figures.
What I want to achieve is the figure below though with the exclusion of those nodes that are created when a "white" .png image is read (.png image with no black curve).
I also want to keep the position of the white .png image with that Y coordinate (z in the code).
I had thought about the "isempty" command but I am not clear where and how to use it in my code (and also if it is suitable to use it).
I hope I have been clear. I thank to those who can help me.

1 件のコメント

Fifteen12
Fifteen12 2022 年 12 月 19 日
Hi Alberto, I'm not sure I know what you're trying to do--are you trying to parse PNGs? How are these nodes arising? Can you share more information about what is causing these nodes to occur?

サインインしてコメントする。

 採用された回答

DGM
DGM 2022 年 12 月 19 日

0 投票

One simple way to skip plotting those cases would be to just do this modification:
for k = 1:length(imageFiles)
baseFileName = imageFiles(k).name;
fullFileName = fullfile(myFolder, baseFileName);
fprintf('Now reading %s\n', fullFileName);
imageArray = imread(fullFileName);
binaryImage = imageArray;
binaryImage = ~binaryImage;
M1 = function_verification_code(binaryImage);
% only plot if there's more than one point
if size(M1,1)>1
% Switch to the figure for the 3-D plotting:
figure(hFig3);
current_z = z(k) * ones(size(M1, 1), 1);
plot3(M1(:, 2), current_z, M1(:, 1), 'b.');
hold on
drawnow;
end
end

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeStartup and Shutdown についてさらに検索

製品

リリース

R2021b

質問済み:

2022 年 12 月 19 日

回答済み:

DGM
2022 年 12 月 19 日

Community Treasure Hunt

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

Start Hunting!

Translated by