Image Normalization between range 0 - 1
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Guillaume
le 11 Nov 2016
Modifié(e) : Guillaume
le 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.
Réponses (2)
Bjorn Gustavsson
le 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,
0 commentaires
Image Analyst
le 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 commentaire
Guillaume
le 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...
Voir également
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!