matlab - Converting code to take RGB image instead of grayscale -


I'm trying to convert this fisheye image into a rectangular form, but the code is only going to perform this operation on a grayscale image Enabled. Does anyone help in converting code to operation on RGB image? The code is as follows:

EDIT: I have updated the code to include the projection functionality in each color channel, but these output images seem to be defective. See picture below

  function imP = FISHCOLOR (IMR) rMin = 0.1; RMax = 1; [MR, NR, DR] = size (IMR); % Size of rectangular image xRc = (Shree + 1) / 2; % Co-coordinate with the center of the image yRc = (NR + 1) / 2; Sx = (Mr. -1) / 2; % Scale factor sy = (NR-1) / 2; M = size (infant mortality, 1); N = size (infant mortality, 2); Dr. = (Rmx - RMIN) / (M-1); Dth = 2 * pi / N; R = rMin: Dr. rMin + (M1) * Dr; Th = (0: DTH: (N-1) * DTH); [R, th] = meshgrid (R, th); . X = r * because (th); . Y = R * sin (th); XR = x * sx + xRc; YR = y * sy + yRc; IMP = Nil (M, N); Start the last matrix for% k = 1: 3% color T = IMR (:,:, K); Ichannel = interp2 (T, XR, YR); IMP (:,:, K) = Ichannel; Add% K channel end   

resolve

- image link

& Lt; - Image link

Try changing these three rows:

  [Mr. NR] = size (IMR); % Size of rectangular image ... IMP = zero (m, n); ... IMP = Interp2 2 (IMR, XR, YR); % Interpolt (IMR, XR, YR);   

... here:

  [Mr. NR PR] = size (IMR); % Size of rectangular image ... IMP = zero (M, N, PR); ... for dim = 1: PR IPP (:,:, slow) = interposition 2 (IMR (:,:, dim), xr, yr); % Interpolt (IMR, XR, YR); End    

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -