Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function filtered = demosaicPDI(img)
- A = im2double(img);
- [rows,cols] = size(A);
- cols = cols / 3;
- for x = 1:2:cols
- for y = 1:2:rows
- A(y,x,1) = A(y+1,x+1,1);
- A(y,x,2) = A(y,x+1,2);
- A(y+1,x,1) = A(y+1,x+1,1);
- A(y+1,x,3) = A(y,x,3);
- A(y,x+1,1) = A(y+1,x+1,1);
- A(y,x+1,3) = A(y,x,3);
- A(y+1,x+1,2) = A(y+1,x,2);
- A(y+1,x+1,3) = A(y,x,3);
- end
- end
- filtered = A;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement