Filter löschen
Filter löschen

Error in pixeldup function, Please help !!

5 Ansichten (letzte 30 Tage)
Amrinder Brar
Amrinder Brar am 31 Mär. 2015
Kommentiert: Image Analyst am 13 Mai 2015
CODE: w = [2 -1 -1; -1 2 -1;-1 -1 2];
>> g = imfilter(tofloat(f), w);
>> imshow(g, [])
>> gtop = g(1:120, 1:120);
>> gtop = pixeldup(gtop, 4);
ERROR: Undefined function 'pixeldup' for input arguments of type 'single'.
  2 Kommentare
ALEXANDER RECALDE
ALEXANDER RECALDE am 13 Mai 2015
Bearbeitet: ALEXANDER RECALDE am 13 Mai 2015
is a function, book ---------------------------- Digital image processing using matlab
uhm for tofloat use g = (double(f),w);
function B = pixeldup(A, m, n)
%PIXELDUP Duplicates pixels of an image in both directions.
% B = PIXELDUP(A, M, N) duplicates each pixel of A M times in the
% vertical direction and N times in the horizontal direction.
% Parameters M and N must be integers. If N is not included, it
% defaults to M.
% Check inputs.
if nargin < 2
error('At least two inputs are required. ');
end
if nargin == 2
n = m;
end
% Generate a vector with elements 1:size(A, 1).
u = 1 :size(A, 1);
% Duplicate each element of the vector m times.
m = round(m); % Protect against nonintegers.
u = u(ones(1, m), :);
u = u (:);
% Now repeat for the other direction.
v = 1:size(A, 2);
n = round(n);
v = v(ones(1, n) , :);
v = v(:) ;
B = A(u, v) ;
Image Analyst
Image Analyst am 13 Mai 2015
So now that you've found it, do you still have a problem calling it?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Image Analyst
Image Analyst am 31 Mär. 2015
Beats me. I've never heard of it either. Why did you write code to call a function that you don't even know what it is, and don't have it? Ask your buddies - maybe someone else has heard of it.

Kategorien

Mehr zu Get Started with MATLAB 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