Image Normalization between range 0 - 1

5 ビュー (過去 30 日間)
Falola Damilola
Falola Damilola 2016 年 11 月 11 日
コメント済み: Guillaume 2016 年 11 月 11 日
I need help with my project. My supervisor said to normalize an image within the range of 0 - 1 which i did, but he wants it to give just one value instead of the matrix values its generating. This is the code i used to normalize
function normImage = NPSS(img)
clear all
img = imread('ps.jpg','jpg');
normImage = mat2gray(img);
  1 件のコメント
Guillaume
Guillaume 2016 年 11 月 11 日
編集済み: Guillaume 2016 年 11 月 11 日
What does "give just one value instead of the matrix values its generating" mean? Why don't you ask your supervisor if you haven't understood what he/she means?
Note that clear all must not be used in a function (and really shouldn't be used in scripts either). The only reason it doesn't cause your function to fail is that you're not using the function input.

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

回答 (2 件)

Bjorn Gustavsson
Bjorn Gustavsson 2016 年 11 月 11 日
It sounds like you need to ask your advisor what he wants. In my not necessarily humble opinion images ought to contain different values in many pixels. As a first guess I assume that he wants you to select some threshold level and set all pixel with intensities above that to 1 and those below to 0, but ask for clarification...
HTH,

Image Analyst
Image Analyst 2016 年 11 月 11 日
Offer him the value 42.
function justOneValue = NPSS(img)
justOneValue = 42;
If he's not happy with that then ask him why not.
  1 件のコメント
Guillaume
Guillaume 2016 年 11 月 11 日
Having been a supervisor to a few students, I strongly suspect that the issue is not with what the supervisor asked but with the student's understanding and rewording of what was asked.
... or we can build a supercomputer to know what the question was. Less than 2 millions more year to wait... as long as the Vogons don't build that highway...

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

カテゴリ

Help Center および File ExchangeImages についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by