Max pixel value on satellite image

2 visualizaciones (últimos 30 días)
Emre
Emre el 2 de Abr. de 2014
Comentada: Image Analyst el 2 de Abr. de 2014
I have DailyET.tif map and I want to find max pixel value and pixel location (x,y)....
When I try it
a=imread('DailyET.tif');
than I open "A" at workspace I see pixel value but not have all pixels.(only have 7251*8091 single value)
how can I open image with all pixel information???

Respuestas (1)

Image Analyst
Image Analyst el 2 de Abr. de 2014
You can use the zoom() function. Set up a scroll bar to set different zoom factors.
To find the max value and location(s):
maxGrayLevel = max(grayImage(:));
[rowsMax, columnsMax] = find(grayImage == maxGrayLevel);
  2 comentarios
Image Analyst
Image Analyst el 2 de Abr. de 2014
Editada: Image Analyst el 2 de Abr. de 2014
Emre's "Answer" moved here:
when I try this code Matlab give me to error Undefined variable grayImage.
how can I use this code ???
maxGrayLevel = max(grayImage(:));
[rowsMax, columnsMax] = find(grayImage == maxGrayLevel);
Image Analyst
Image Analyst el 2 de Abr. de 2014
Well, you have to replace grayImage with the name of your image variable. Here's an example:
fullFileName = 'cameraman.tif';
grayImage = imread(fullFileName);
maxGrayLevel = max(grayImage(:))
[rowsMax, columnsMax] = find(grayImage == maxGrayLevel)
Of course you chose the very poor name of a so your code would look like this:
fullFileName = 'cameraman.tif';
a = imread(fullFileName);
maxGrayLevel = max(a(:))
[rowsMax, columnsMax] = find(a == maxGrayLevel)
I recommend that you use descriptive variable names and don't have your code look like an alphabet soup of random single letter variables.

Iniciar sesión para comentar.

Categorías

Más información sobre Image Processing Toolbox en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by