ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/cal/cal/filt.cal
Revision: 1.3
Committed: Tue Nov 3 20:19:02 2020 UTC (3 years, 6 months ago) by greg
Branch: MAIN
CVS Tags: rad5R4, HEAD
Changes since 1.2: +8 -8 lines
Log Message:
feat: Added argument for filtering multiple input pictures

File Contents

# Content
1 { RCSid $Id: filt.cal,v 1.2 2018/11/21 18:10:45 greg Exp $ }
2 {
3 Filter Kernal set-up for pcomb.
4
5 5/22/92 Greg Ward
6
7 Usage:
8 pcomb -x xres -y yres -f kern.cal -f filt.cal input.hdr > output.hdr
9
10 The file "kern.cal" must define the constant function kern(x,y), which
11 describes how the kernal behaves as a function of offset in x and y
12 (measured in fractional pixels in the destination image).
13 }
14 hmag : xres/xmax;
15 vmag : yres/ymax;
16 step : (hmag+vmag)/8;
17 hsum(xmin,xmax,y) : if(step/2+xmin-xmax, 0,
18 kern(xmin+step/2,y) + hsum(xmin+step,xmax,y));
19 sum(xmin,ymin,xmax,ymax) : if(step/2+ymin-ymax, 0,
20 hsum(xmin,xmax,ymin+step/2) + sum(xmin,ymin+step,xmax,ymax));
21 k(ox,oy) : sum(ox-hmag/2,oy-vmag/2,ox+hmag/2,oy+vmag/2);
22 K00 : k(-1,-1); K01 : k(-1, 0); K02 : k(-1, 1);
23 K10 : k( 0,-1); K11 : k( 0, 0); K12 : k( 0, 1);
24 K20 : k( 1,-1); K21 : k( 1, 0); K22 : k( 1, 1);
25 sumtotal : K00+K01+K02+K10+K11+K12+K20+K21+K22;
26
27 f(p,i) = ( K00*p(i,-1,-1) + K01*p(i,-1, 0) + K02*p(i,-1, 1) +
28 K10*p(i, 0,-1) + K11*p(i, 0, 0) + K12*p(i, 0, 1) +
29 K20*p(i, 1,-1) + K21*p(i, 1, 0) + K22*p(i, 1, 1) ) / sumtotal;
30
31 ro = f(ri,1);
32 go = f(gi,1);
33 bo = f(bi,1);