Borrar filtros
Borrar filtros

Position Of pixel

1 visualización (últimos 30 días)
Gova ReDDy
Gova ReDDy el 19 de Mayo de 2011
heyy.. can anyone help me out in finding out the position of pixel of an binaryimage and the grayscale value of pixel

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 19 de Mayo de 2011
Igray(Ibinary); %extract gray values of true binary values
true_locations = find(Ibinary); %indices of binary values
You'll have to be more specific if you want more information.
EDIT per comment/clarification:
%Ibinary is your logical map
%Igray is your grayscale image
%Conversions as necessary
if ~isa(Igray,'double');Igray = double(Igray);end
if ~islogical(Ibinary);Ibinary = logical(Ibinary);end
wtrr = bsxfun(@times,(1:size(Igray,1)).',Igray); %weighted Igray by rows
wtrr = sum(wtrr(Ibinary)); %Sum the ones that matter
wtcc = bsxfun(@times,1:size(Igray,2),Igray); %weighted Igray by columns
wtcc = sum(wtcc(Ibinary)); %sum the ones that matter
Gtot = sum(Igray(:));
CGr = sum(wtrr(:))/Gtot;
CGc = sum(wtcc(:))/Gtot;
%CGr is the CG amongst rows (y) and CGc is the CG amongst columns (x)
  7 comentarios
Sean de Wolski
Sean de Wolski el 20 de Mayo de 2011
Nope.
Gova ReDDy
Gova ReDDy el 20 de Mayo de 2011
thanks in advance....can u xplain me what %gauss2mf% function does in detail

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Images en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by