Facebook
From Queen Hog, 9 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 696
  1. function [ image ] = inversHaarTransform( obraz,im )
  2. %COS Summary of this function goes here
  3. %   Detailed explanation goes here
  4.     if ~isempty(im)
  5.         obraz.image_1 = im;
  6.     end
  7.     [n, m] = size(obraz.image_1);
  8.     image_1 = zeros(n*2,m);
  9.     for i = 1:m
  10.         np = obraz.detale_2(:,i) - obraz.detale_3(:,i)./2;
  11.         p = np + obraz.detale_3(:,i);
  12.         image_1(1:2:end,i) = np;
  13.         image_1(2:2:end,i) = p;
  14.     end  
  15.     image_2 = zeros(n*2,m);
  16.     for i= 1:m
  17.         np = obraz.image_1(:,i) - obraz.detale_1(:,i)./2;
  18.         p = np + obraz.detale_1(:,i);
  19.         image_2(1:2:end,i) = np;
  20.         image_2(2:2:end,i) = p;  
  21.     end
  22.     image = zeros(n*2,m*2);
  23.     for i = 1:2*n
  24.         np = image_2(i,:) - image_1(i,:)./2;
  25.         p = np + image_1(i,:);
  26.         image(i,1:2:end) = np;
  27.         image(i,2:2:end) = p;
  28.     end
  29. end
  30.    
  31. % function [ image ] = inversHaarTransform( new_i,d )
  32. % %INVERSHAARTRANSFORM Summary of this function goes here
  33. % %   Detailed explanation goes here
  34. %     new_i = new_i(1:length(d));
  35. %     np = new_i - d./2;
  36. %     p = np + d;
  37. %     image = [];
  38. %     image = zeros(length(p)+length(np),1);
  39. %     image(1:2:end) = np;
  40. %     image(2:2:end) = p;
  41. % end
  42. %
  43.