pavel47
Member level 4
- Joined
- Nov 8, 2005
- Messages
- 68
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Location
- Switzerland
- Activity points
- 1,790
Hello,
In my project I need filter image from 3D scanner. The image delivered by such scanner is noisy and need to be filtered.
I did some excercises in Matlab. The filter I constructed is simple. Its frequency characteristic (OTF) merely repeats the most pronounced features of 3D scanner dâta FFT:
But the filtering isn't sufficient. If somebody has an idea how to filter moreover ?
Thanks in advance.
Pavel.
P.S. 1. Here is my approach in Matlab
In my project I need filter image from 3D scanner. The image delivered by such scanner is noisy and need to be filtered.
I did some excercises in Matlab. The filter I constructed is simple. Its frequency characteristic (OTF) merely repeats the most pronounced features of 3D scanner dâta FFT:
Code:
OTF = zeros(120, 160);
OTF(1,:) = 1;
OTF(:,1) = 1;
But the filtering isn't sufficient. If somebody has an idea how to filter moreover ?
Thanks in advance.
Pavel.
P.S. 1. Here is my approach in Matlab
Code:
clc;
clear;
close all;
points1 = 500;
ampl1=5;
points2 = 20;
ampl2=100;
corners = [0 0; 160 0; 160 120; 0 120];
x1 = vertcat(corners(:,1), rand(points1,1)*160);
y1 = vertcat(corners(:,2), rand(points1,1)*120);
z1 = ampl1*(rand(points1+4,1)-0.5);
x2 = rand(points2,1)*160;
y2 = rand(points2,1)*120;
z2 = ampl2*(rand(points2,1)-0.5);
x = vertcat(x1, x2);
y = vertcat(y1, y2);
z = vertcat(z1, z2);
F = TriScatteredInterp(x,y,z,'linear');
[qx,qy] = meshgrid(0:159,0:119);
scan = F(qx,qy);
scanID = zeros(120, 160);
for i=-size(scan,1)/2+1:size(scan,1)/2
for j=-size(scan,2)/2+1:size(scan,2)/2
k=i+size(scan,1)/2;
l=j+size(scan,2)/2;
scan_3D{k,l} = [i j scan(k,l)];
scanID_3D{k,l} = [i j scanID(k,l)];
end
end
alfa = 30;
beta = 30;
gama = 0;
yaw = beta*pi/180;
pitch = alfa*pi/180;
roll = gama*pi/180;
dcm = angle2dcm(yaw, pitch, roll);
for i=1:size(scan,1)
for j=1:size(scan,2)
scan_3Dr{i,j} = dcm*scan_3D{i,j}';
scan_r(i,j) = scan_3Dr{i,j}(3);
scanID_3Dr{i,j} = dcm*scanID_3D{i,j}';
scanID_r(i,j) = scanID_3Dr{i,j}(3);
end
end
subplot(2,2,1);
surf(scan);
Title('Original');
subplot(2,2,2);
surf(scan_r);
Title('Rotated');
scan_r_FFT = fft2(scan_r);
OTF = zeros(120, 160);
OTF(1,:) = 1;
OTF(:,1) = 1;
G = scan_r_FFT .* OTF;
scan_r_filt = real(ifft2(G));
subplot(2,2,3);
surf(scan_r_filt);
Title('Filtered');
subplot(2,2,4);
surf(OTF);
Title('OTF');
figure;
subplot(1,2,1);
imagesc(log(1 + abs(fftshift(scan_r_FFT))));
Title('FFT');
subplot(1,2,2);
imagesc(log(1 + abs(fftshift(OTF))));
Title('OTF');