フィルターのクリア

collect data but has inF

2 ビュー (過去 30 日間)
bozheng
bozheng 2023 年 11 月 7 日
コメント済み: Walter Roberson 2023 年 11 月 7 日
img1= imread('SCM Data.jpg');
img = (-0.18 / (-0.28 / (45.39 /double(img1) - 1))+1) * 5.3
and then The numbers that appear when executing are a bit strange How do I define inF

回答 (1 件)

Walter Roberson
Walter Roberson 2023 年 11 月 7 日
You should be vectorizing your code:
img = (-0.18 ./ (-0.28 ./ (45.39 ./ double(img1) - 1))+1) * 5.3;
The result will be something that is infinity where img1 is 0. How do you want to handle that case?
Your expression works out to be of the form A/x + B for constant A and B. That inherently trends towards infinity as img1 becomes small.
  1 件のコメント
Walter Roberson
Walter Roberson 2023 年 11 月 7 日
Question: does that image even have anything to do with what you are doing? Because the colorbar clearly shows values between -91.8 and 236.8 but when you read from png files you are going to get values between 0 and 255.

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

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

タグ

製品


リリース

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by