Rastercell Digital Rastrering Hybridraster, Rastervinkel, Rotation av digitala bilder, AM/FM rastrering Sasan Gooran (VT 2007) Önskat mått * 2* rastertätheten = inläsningsupplösning originalets mått 2 Utskriftsupplösning + 1 = antalet gråtoner rastertäthet Rastrering Rastercell AM & FM Raster AM FM Originalbild Konventionellt, AM Rastrerad bild Exponeringspunkt Rastercell AM & FM Raster lpi: Antalet rasterceller per tum dpi: Antalet exponeringspunkter per tum AM FM Plats för institutionslogo 1
Hybrid Raster Hybrid Raster FM är bättre på detaljåtergivning AM är bättre på homogena delar Hybrid, Använd AM i homogena delar och FM i detaljer FM_1 FM_2 AM Hybrid Raster Använd en FM metod i högdager och skuggor, med den minsta producerbara punkten. Använd en AM metod i resten av bilden. AM & Hybrid Raster AM Hybrid 2
3
function out=myrotate(in,a) ang=a*pi/180; [nr,nc]=size(in); NR=round(nr*cos(ang)+nc*abs(sin(ang))); NC=round(nc*cos(ang)+nr*abs(sin(ang))); for i=-round(nr/2):round(nr/2) for j=-round(nc/2):round(nc/2) x=round(cos(ang)*i+sin(ang)*j)+round(nr/2); y=round(-sin(ang)*i+cos(ang)*j)+round(nc/2); if (x<=0 x>nr y<=0 y>nc) out(i+round(nr/2)+1,j+round(nc/2)+1)=0; else out(i+round(nr/2)+1,j+round(nc/2)+1)=in(x,y); end; end; end; Rastervinkel function out=rastervinkel(in,tr,a) [nr,nc]=size(in); [rtr,ctr]=size(tr); ang=a*pi/180; NR=round(nr*cos(ang)+nc*abs(sin(ang))); NC=round(nc*cos(ang)+nr*abs(sin(ang))); M=ceil(NR/rtr); N=ceil(NC/ctr); TR=repmat(tr,M,N); 0 graders rastervinkel 15 graders rastervinkel TRang=imrotate(TR,a); s=round(nr*cos(ang)*sin(ang))+1; t=round(nc*cos(ang)*sin(ang))+1; TRf=TRang(s:s+nr-1,t:t+nc-1); out=in>=trf; Irrationella vinklar Hur roterar man en digitalbild??? Multi-level Halftoning There are printers that can generate more than two levels of gray Tas upp i föreläsningen The original image can therefore be quantized to the gray levels that the printer can generate (Multi-level halftoning) 4
Multi-level Error Diffusion Multi-level to Bi-level 5 levels: 0, 0.25, 0.5, 0.75, 1 Bi-level Halftoning based on Multi-level Error Diffusion 17 Levels, 4 x 4 halftone tables Compare with AM AM/FM Halftoning Start with multi-level halftoning, (FM), which means halftone your image to a number of levels, for example, 0, 0.25, 0.5, 0.75 and 1 Replace each level with a halftone table (designed as AM) The frequency and the amplitude are variable Any Bi-level FM Multi-level Assume first, halftoning to 5 levels, 0, 0.25, 0.5, 0.75 and 1 First, bi-level halftoning: Place a number of black dots (1 s) on white background (0 s) If image < 0.25, only two levels necessary, 0 and 0.25. Place 0.25 s on 0 s. Scale [0, 0.25] to [0, 1] and do bi-level halftoning and replace 1 s with 0.25 s Multi-level to Bi-level Replace each level by a halftone table that corresponds to that level. Example: 0 0.25 0.5 0.75 1 Any Bi-level FM Multi-level [0, 0.25] [0, 1], FM-Halftone, Replace 1 s with 0.25 [0.25, 0.5] [1, 0], FM-Halftone, Replace 1 s with 0.25 s and 0 s with 0.5 s [0.5, 0.75] [0, 1], FM-Halftone, Replace 0 s with 0.5 s and 1 s with 0.75 s [0.75, 1] [1, 0], FM-Halftone, Replace 0 s with 1 s and 1 s with 0.75 s See images 5
Any Bi-level FM Multi-level 17 levels [0, 1/16] [0, 1], FM-Halftone, Replace 1 s with 1/16 [1/16, 2/16] [1, 0], FM-Halftone, Replace 1 s with 1/16 s and 0 s with 2/16 s And so on IMCDP -> Multi-level -> Bi-level 17 levels, 4 x 4 halftone tables Also this image: With only 11 tables, White, H, A, L, F, T O, N, I, G, Black (Only 7 levels) Critical dot size Example, assume 17 levels of gray, thus 4 x 4 halftone tables. Assume that the smallest producible dot is 2 x 2, thus corresponding to 4/16 = 0.25. [0, 4/16] [0, 1], FM-halftone, replace 1 s with 0.25 s. [4/16, 5/16] [1, 0] [5/16, 6/16] [0, 1] 6
Critical dot size Maze-like Artifact reduced 17 levels Smallest possible dot is 2 x 2 Maze-like Artifact Using good FM halftoning (with Blue Noise characteristic) can cause the final AM/FM image suffer from Maze-like artifacts AM/FM Halftoning + Compared to FM, in the mid-tones gives less grainy impression. Dot gain is also less in mid-tones. Faster. + Compared to AM, in the highlights (shadows) less structure. Possible to build halftone with the smallest possible dots.? Color Plats för institutionslogo Maze-like Artifact Can be reduced by: Destroying the blue noise characteristic for gray tones Maze-like artifacts can occur Choosing the tables randomly FM halftoning by thresholding (B. Kruse) Use the same strategy as in IMCDP technique presented earlier and build appropriate threshold matrix The threshold matrix is independent of the image and therefore is built only once The process of halftoning will be very fast because the only operation is comparison 7
FM halftoning by thresholding (B. Kruse) Different filters give different characteristics 8