Image Normalization between range 0 - 1

1 Ansicht (letzte 30 Tage)
Falola Damilola
Falola Damilola am 11 Nov. 2016
Kommentiert: Guillaume am 11 Nov. 2016
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 Kommentar
Guillaume
Guillaume am 11 Nov. 2016
Bearbeitet: Guillaume am 11 Nov. 2016
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.

Melden Sie sich an, um zu kommentieren.

Antworten (2)

Bjorn Gustavsson
Bjorn Gustavsson am 11 Nov. 2016
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 am 11 Nov. 2016
Offer him the value 42.
function justOneValue = NPSS(img)
justOneValue = 42;
If he's not happy with that then ask him why not.
  1 Kommentar
Guillaume
Guillaume am 11 Nov. 2016
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...

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Images finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by