No BSD License
Highlights from
GeoML
-
GeoML: intro
-
ATE_EdgeDistance(varargin)
ATE_EDGEDISTANCE Computes the energy using the distance from edges.
-
ATE_GradientNorm(varargin)
ATE_GRADIENTNORM Computes the energy using the norm of gradient.
-
ATOptimize(img,model,free,Eex...
ATOPTIMIZE Optimizes a shape model over an image.
-
GeoMLConvertToTree(model,visi...
GEOMLCONVERTTOTREE Converts a tree containing a model.
-
GeoMLGenerateTree(model,visib...
GEOMLGENERATETREE Generates a tree containing a model.
-
GeoMLIterate(model,join,mode)
GEOMLITERATE Iterate on a model.
-
GeoMLParseModel(modelname)
GEOMLPARSEMODEL Parsing of a GeoML XML model description.
-
gauss(x, sigma, mu, norm)
GAUSS Return the monodimensional gaussian function
-
gaussianFilter(varargin)
GAUSSIANFILTER Filters an image using the gaussian derivative filter
-
impixels(img,P)
IMPIXELS Get the values of image pixels at defined points.
-
imscale(img, range)
IMSCALE Scale an image to fit the range
-
imtype(img, type)
IMTYPE Chenges the type of an image
-
plotpoints(X,symbol)
PLOTPOINTS This function allow to plot a series of points
-
plotshape(X, closed, symbol)
PLOTSHAPE This function allow to plot a single shape
-
points2dnormalize(Pi,mustRemo...
POINTS2DNORMALIZE Normalize 2d points
-
points2domogenize(Pi)
POINTS2DOMOGENIZE Enshure a 3-coords omogeneous set of points
-
View all files
from
GeoML
by Gabriele Lombardi
A general morphable template tool for image segmentation.
|
| impixels(img,P) |
function vals = impixels(img,P)
% IMPIXELS Get the values of image pixels at defined points.
%
% Given an image and a set of points the image values are returned in a
% matrix containing all the channels on the rows and the pixels values on
% the colums.
%
% Params
% ------
% IN:
% img = The image.
% P = The points.
% OUT:
% vals = The pixels values.
% Check params:
if nargin<2 error('An image and a set of points must be provided!'); end
% Converting the points:
P = ceil(points2dnormalize(P));
% The image and points sizes:
[h,w,c] = size(img);
npts = size(P,2);
% Computing output:
vals = zeros([c,npts]);
% Iterating on pixels:
for ind=1:npts
% Check if the point is in the pixel:
if P(1,ind)>0 && P(2,ind)>0 && P(1,ind)<w && P(2,ind)<h
% Get the pixel value:
vals(:,ind) = img(P(2,ind),P(1,ind),:);
else
% Set the value to NaN:
vals(:,ind) = NaN;
end
end
|
|
Contact us at files@mathworks.com