IMPLEMENTATION OF AMPLITUDE MODULATED HALFTONING ON LASER ENGRAVING

7 130 1
IMPLEMENTATION OF AMPLITUDE MODULATED HALFTONING ON LASER ENGRAVING

Đang tải... (xem toàn văn)

Thông tin tài liệu

HỘI NGHỊ KHCN TỒN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM IMPLEMENTATION OF AMPLITUDE MODULATED HALFTONING ON LASER ENGRAVING Manh Truong Tran, Cong Bang Pham Ho Chi Minh City University of Technology, VNU-HCM ABSTRACT: Laser has been widely used to engrave portrait photos onto wood surface because it produces very precise engraved images Before engraving an image, the continuous tone image has to be transformed into a halftone image in which the color of each pixel is either black or white Many laser engravers have used frequency modulated (FM) halftoning algorithm to convert continuous tone images to halftone images and the resultant images usually have high spatial resolution However, it takes a lot of time to engrave an image by using FM method In this paper, amplitude modulated (AM) halftoning algorithm is explored instead of FM halftoning and proved to reduce the engraving time significantly The FM and AM engraved images are then compared in terms of quality and engraving time to evaluate the efficiency of AM method Keywords: laser engraver, parallel robot, halftoning INTRODUCTION The process of engraving a portrait photo onto wood surface using laser usually includes two steps The first step is to convert continuous tone images to halftone images The halftone images contain only two colors for each pixel, i.e black and white, but can produce the illusion of continuous tone [1] This format of image is suitable for laser engravers because laser is only capable of creating black dots by burning the wood surface The second step in the engraving process is to move the laser head to positions where the black dots are located and then burn the wood surface at these specific positions There are two main methods for the first step: FM halftoning and AM halftoning In the FM halftoning, the size of each black dot is fixed, which is equal to one pixel, and tone rendition is achieved by varying the dot density [2] This method is commonly used in laser engravers because it produces high spatial resolution of engraved images One of the most popular FM halftoning algorithm is Floyd Steinberg algorithm [3] The example of FM halftone image is illustrated in Figure It is seen that the black pixels are dispersed, which means they have to be engraved separately As a result, the laser head is turned on and off many times, and the laser-off distance increases The laser head is usually driven by a laser driver which receives the control signal from a controller Each time the laser head is turned on, it takes a certain amount of time for the laser head to burn the wood surface The more the number of on-off times, the longer the time required to engrave an image Figure FM halftone image In this paper, in order to reduce the number of on-off times as well as the laser-off distance, AM halftoning is used instead of FM halftoning In AM halftoning, the density of dot clusters, or the Trang 319 HỘI NGHỊ KHCN TỒN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM distance between dot clusters, is fixed Tone rendition is achieved by varying the size of each dot [2] In this method, each dot cluster, which is called a macrodot, consists of one or many black pixels For each macrodot, the laser head is turned on one time, so the number of on-off time in AM method is much smaller than in FM method, which is expected to reduce the engraving time Presented in this paper is the implementation of AM halftoning on laser engraving Section will explain the AM method in more details Laser path planning is shown in section Section will compare the images engraved by using FM and AM method The conclusion is addressed in the last section AM HALFTONING The transformation from a continuous tone image to a halftone image is called halftoning Continuous tone images includes color images and gray images A color image can be converted to a gray image, so in this paper the gray images are used for the halftoning process Each pixel in a gray image usually has a value between and 255, which represents the gray level from completely white to completely black, so a gray image contains 256 levels of gray shadows Each pixel in a halftone image, however, has only one of the two values: (completely white) or (completely black) The main principle of AM halftoning is to replace each gray cell in the gray image by its corresponding halftone cell in the halftone image A cell is a square containing a number of pixels, such as 2×2 pixels, 3×3 pixels and so on To represent a specific gray level of the gray cell, the number of black pixels is chosen so that the fraction of black pixels to all pixels in the halftone cell is approximately equal to the gray level of the gray cell as it is scaled between and When engraving a haftone cell, the black pixels are the burned dots and the white pixels are the unburned areas When seeing the halftone image from a certain distance, the eyes cannot detect the burned dots separately, instead they integrate the black burned dots and the white unburned areas as a particular gray level Trang 320 Assume n×n (pixels) is the size of the cell, m (pixels) is the number of black pixels in the halftone cell, ranging from to n The AM halftoning is carried out as follows: Step 1: Scan each gray cell in the gray image from left to right, top to bottom For each gray cell, calculate the mean gray value M of n×n pixels Step 2: Replace each gray cell by its corresponding halftone cell which has m black pixels so that the error e in equation is minimum | | (1) For an example in Figure 2, the size of the cell is 2×2 pixels, the upper-left cell in the gray image has the gray mean value M of 50 The number of black pixels in the halftone cell m is between and m=1 is chosen because it makes e minimum In other words, the halftone cell which contains one black pixel is chosen to represent the upper-left cell in the gray image Cell of 2×2 pixels m=0 m=1 m=2 m=3 m=4 Gray image Halftone image Figure AM halftoning process One aspect must be concerned is the size of the halftone cell It affects the number of represented gray tones N as described in the following equation: (2) For the example in Figure 2, there is only different gray tones ranging from to black pixels in halftone cells The size of the halftone cell also affects the spatial resolution of the HỘI NGHỊ KHCN TOÀN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM engraved image The spatial resolution is defined as the number of cell lines per inch (LPI) LPI relates to the resolution of a laser engraver by the following equation: (3) Where DPI (dots per inch) is the resolution of a laser engraver DPI is usually constant for each laser engraver From equation and 3, if the size of the halftone cell increases, the number of represented gray tones will increase but this will lead to the decrease of spatial resolution To illustrate the effect of the size of the halftone cell, Figure shows a variety of halftone images From an original gray image in Figure 3a, it is halftoned by using 3×3-pixel cell (Figure 3b), 4×4-pixel cell (Figure 3c), 5×5-pixel cell (Figure 3d), 6×6-pixel cell (Figure 3e) and 7×7-pixel cell (Figure 3f) It is realized that the abrupt changes in shade level, or the banding effect, in Figure 3b and 3c are quite noticeable due to the limited number of represented gray tones This phenomenon could be avoided with higher cell sizes as seen in Figure 3d, 3e and 3f However, the halftone cells with bigger sizes result in blurry halftone images To make the cells less noticeable, an observer can view them from a farther distance According to [4], the relationship between LPI and viewing distance d (feet) is as follows: (4) In equation 4, the value of 240 comes from establishing premium quality as 175 LPI at 16.5 inches from observer’s eyes (normal magazine high quality printing and viewing) [4] From equations and 4, the relationship between n and d is expressed in the following equation: (5) a) Original gray image c) Cell of 4×4 pixels e) Cell of 6×6 pixels b) Cell of 3×3 pixels d) Cell of 5×5 pixels f) Cell of 7×7-pixels Figure AM halftone images with different sizes of cell As discussed, choosing a proper cell size is a trade-off between the decrease of banding effect and the sharpness of the halftone image In this study, a halftone cell of 5×5 pixels is chosen As a result, the number of represented gray tones N is 26 Assume that a laser engraver has the DPI value of 220, the appropriate viewing distance d from equation is 5.45 (feet), or 1.66 (m) PATH PLANNING ON MACRODOTS As mentioned in Section 1, the second step in the engraving process is to move the laser head to burn the wood surface at specific positions In FM method, the black dots are dispersed so the best way to move the laser head is to move it row by row from top to bottom of the image In the first row the laser head is moved from left to right In the second row it is moved from right to left and then, the process is repeated as illustrated in Figure Trang 321 HỘI NGHỊ KHCN TỒN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM Black dot Laser path  Case 2: n ≤ m ≤ n2 The first black pixel is still positioned at (1, 1) If (m – n) is an even number, the last black pixel in the laser path is placed at position (n, 1) If (m – n) is an odd number, the position is (n, 2) as shown in Figure First black pixel Figure Laser path in FM method Case 1: m < n The last black pixel in the laser path is placed in the first row of the cell so that it is as close to the right end as possible The white arrow indicates the laser path as demonstrated in Figure 5 x y x Last black pixel (one of two positions) y Figure Position of the last black pixel in case The problem is to find a laser path for each halftone cell so that criterion and criterion are fulfilled First, black pixels in black-pixel cell (m = 5) and black-pixel cell (m = 6) are arranged as shown in Figure 5 x x y y m=5 m=6 Figure Black pixels arrangements in black-pixel cell and black-pixel cell m=1 m=2 m=3 m=4 Figure Arrangement of black pixels in case Trang 322 Criterion 1: the laser path must be continuous within a halftone cell so that the laser head operates without turning on/off within the cell  In this paper, AM method is used and the laser path is modified so that the number of on-off time of the laser head is minimum This is achieved by following criteria: Criterion 2: the first black pixel in the laser path is placed at the left-top corner in the halftone cell The last black pixel in the laser path is placed towards the right end of the cell so that it is time efficient when the laser head is moved from the current cell to the next cell There are two cases: When the number of black pixels increases, their laser paths are expanded from these two basic laser paths that are implemented through an algorithm in Figure For the cells of 5×5 pixels, the laser path of black-pixel cell is expanded from that of black-pixel cell The laser path of black-pixel cell goes through these positions: (1, 1), (2, 1), (3, 1), (4, 1), and (5, 1) The pixel at position (1, 1) is a black pixel, it has a downadjacent white pixel at position (1, 2) The next black pixel in the laser path is at position (2, 1), it has a down-adjacent white pixel at position (2, 2) So two pixels at position (1, 2) and (2, 2) are added to the laser path The laser path of black- HỘI NGHỊ KHCN TỒN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM pixel cell goes through these position: (1, 1), (1, 2), (2, 2), (2, 1), (3, 1), (4, 1), (5, 1) as shown in Figure Laser paths of other cells in which (m – n) is an even number are illustrated in Figure 10 m=9 m = 11 m = 13 m = 15 m = 17 m = 19 m = 21 m = 23 m = 25 Start Enter the number of black pixels (NoBP) Choose (NoBp - 2) black-pixel cell as the scanned cell (SC) x = 1, y = F SC[x, y] is a black pixel x=x+1 F T x>n Determine the next black pixel NBP of SC[x, y] in the laser path Figure 10 Laser paths of cells in which (m – n) is an T even number x=1 y=y+1 EXPERIMENTAL RESULTS SC[x, y] has a down-adjacent white pixel DWP1 F SC[x, y] has a right-adjacent white pixel RWP1 T F T NBP has a down-adjacent white pixel DWP2 F NBP has a right-adjacent white pixel RWP2 F T T Add DWP1 and DWP2 to the laser path after SC[x, y] Add RWP1 and RWP2 to the laser path after SC[x, y] In this paper, a 2-DOF parallel robot based on 5-bar linkage is used as the laser engraver as shown in Figure 11 in which a CNC USB controller MK1 is employed as a motion controller board [5] Importing motion data from the computer, the controller give pulse signals to the motor drivers manipulating two stepping motors in motion The value of DPI has been experimentally determined 220 Laser path of NoBP black-pixel cell End Figure Planning laser paths 1 3 x Figure 11 Laser engraver based on 5-bar linkage y Figure Laser path of black-pixel cell Figure 12 shows comparison of halftone images as well as engraved images using the FM method and the AM method All the images have the dimension of 60×60 mm The AM halftone image in Figure 12b is composed of 5×5-pixel cells The engraving factors in the AM method are set the same as those in the FM method as described in [5] It is seen that the FM engraved Trang 323 HỘI NGHỊ KHCN TOÀN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM image in Figure 12c is darker than the AM engraved image in Figure 12d This is because FM halftone images are more susceptible than AM halftone images to dot gain [1] The FM image looks more detailed than the AM image when viewing from a short distance However, the engraving time has been significantly shortened as it only takes 39 minutes to complete the AM engraved image in comparison of 207 minutes to complete the FM engraved image a) FM halftone image CONCLUSIONS In this paper, AM halftoning has been successfully implemented to engrave portrait images The relationship between the size of the halftone cell n, the resolution of the laser engraver DPI and the viewing distance d has been addressed These constraints are useful to select the halftone cell size properly In addition, path planning within a halftone cell to make an efficient transition from cell to cell has been also proposed The experimental data have shown that the engraving time has been significantly shortened using the AM halftoning in comparison with FM halftoning in which the quality of the AM engraved image is acceptable b) AM halftone image Acknowledgements The authors would like to acknowledge grants from the Faculty of Mechanical Engineering at Ho Chi Minh City University of Technology through CDIO Program 2015 c) FM engraved image d) AM engraved image Figure 12 Experimental results REFERENCES [1] Daniel L Lau, Gonzalo R Arce, and Neal C Gallagher, Digital halftoning by means of green-noise masks, Optical Society of America, Vol 16(7), July 1999 [4] Jerry Waite, Cheryl Willis, and Garth Oliver, Setting Halftone LPI: Taming the Beasts of Resolution, The Technology Teacher, October 2006 [2] Zhen He, Charles A Bouman, AM/FM halftoning: digital halftoning through simultaneous modulation of dot size and dot density, Journal of Electronic Imaging, Vol 13, April 2004 [5] Cong Bang Pham and Manh Truong Tran, Study and develop a low cost 2-D laser engraver based on 5-bar linkage, Proceedings of The 8th Viet Nam Conference on Mechatronics, pp 59-64, 2016 [3] R W Floyd and L Steinberg, An adaptive algorithm for spatial greyscale, Proceedings of the Society for Information Display 17(2), pp 75–77, 1976 Trang 324 HỘI NGHỊ KHCN TOÀN QUỐC VỀ CƠ KHÍ - ĐỘNG LỰC NĂM 2017 Ngày 14 tháng 10 năm 2017 Trường ĐH Bách Khoa – ĐHQG TP HCM ỨNG DỤNG PHƯƠNG PHÁP AMPLITUDE MODULATED HALFTONING VÀO KHẮC ẢNH LASER TÓM TẮT: Laser sử dụng rộng rãi để khắc ảnh chân dung bề mặt gỗ có khả tạo ảnh với độ xác cao Trước khắc ảnh, ảnh màu ảnh xám cần chuyển sang ảnh halftone, điểm ảnh có màu trắng màu đen Rất nhiều máy khắc laser sử dụng phương pháp frequency modulated (FM) halftoning để chuyển từ ảnh màu ảnh xám sang ảnh halftone kết ảnh thường có độ phân giải cao Tuy nhiên, khắc ảnh phương pháp FM tốn nhiều thời gian Trong báo này, giải thuật amplitude modulated (AM) halftoning sử dụng thay FM halftoning làm giảm đáng kể thời gian khắc ảnh Ảnh khắc phương pháp FM AM so sánh mặt chất lượng thời gian khắc ảnh để đánh giá hiệu phương pháp AM Từ khóa: máy khắc laser, robot song song, halftoning Trang 325 ... AM method The conclusion is addressed in the last section AM HALFTONING The transformation from a continuous tone image to a halftone image is called halftoning Continuous tone images includes... turned on one time, so the number of on- off time in AM method is much smaller than in FM method, which is expected to reduce the engraving time Presented in this paper is the implementation of AM halftoning. .. halftoning on laser engraving Section will explain the AM method in more details Laser path planning is shown in section Section will compare the images engraved by using FM and AM method The conclusion

Ngày đăng: 19/11/2017, 09:24

Từ khóa liên quan

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan