TAILIEUCHUNG - Giáo trình xử lý ảnh y tế Tập 1a P9

Qua chiến lược chia để trị ta đạt được hiệu suất tính toán trên máy tính của giải thuật 1-D FFT. Thuật toán FFT vector 2-D sau đâylà cùng một chiến lược. Giải thuật DFT 2-D được xen kẽ với những giải thuật DFT 2-D nhỏ hơn, cuối cùng chỉ DFT 2-D của phần tử đơn được tính. Chúng ta sẽ kiểm tra vector FFT. | printf nPress any key to exit. getch exit 1 nsq filelength fileno fptr printf Is this a square image printf n . Is image_length image width y or n - while ch tolower getch y ch n putch ch switch ch case y image_length image_width sqrt nsq printf n Image size d x d image_length image_width break case n printf nEnter image_width-- scanf d image_width image_length nsq image_width printf image length is d image_length break printf nEnter file name for filtered image - scanf s file_name ind access file_name 0 while ind gotoxy 1 6 printf File exists. Wish to overwrite y or n -- while ch tolower getch y ch n putch ch switch ch case Y ind 1 break case n gotoxy 1 6 70 printf gotoxy 1 5 printf gotoxy 1 5 printf Enter file name -- scanf s file_name ind access file_name 0 . fptr1 fopen file_name wb gotoxy 70 25 textattr WHITE GREEN 4 BLINK cputs WAIT Allocating memory for Image Transfer Buffer w. w unsigned char malloc 3 sizeof char for i 0 i 3 i w i char calloc image_width sizeof char Clear Image Transfer Buffer. for i 0 i 3 i for j 0 j image_width j w i j unsigned char 0 Algorithm for n1 0 n1 image_length n1 gotoxy 1 9 printf Transfered line -4d to image transfer buffer. n1 Transfer row n2 of the image to the last row of W. for j 0 j image_width j ch char fg etc fptr w 2 j unsigned char ch for n2 0 n2 image_width n2 71 y1 y2 int 0 for k1 -1 k1 1 k1 for k2 -i k2 1 k2 __ _ _ if n2 k2 0 n2 k2-1 image_width continue tmp w 1 k1 n2 k2-1 y1 S1 1 k1 1 k2 tmp y2 S2 1 k1 1 k2 tmp . y1 abs y1 y2 abs y2 zn2 y1 y2 y1 y2 putc zn2 fptr1 The buffer is imPlicit in this last statement. . . . Shift rows of w temp w for j 0 j 2 j w j w j 1 w 2 temp gotoxy 70 25 textattr WHITE BLACK 4 cputs gotoxy 1 8 fclose fptr close input image file fclose fptr1 close output-image file Chương trình cho các phép xử lý Kirsh cũng được trình bày ở dưới đây. Chương trình Chương trình cho phát hiện đường biên ảnh dùng toán tử Kirsh. Program . Program for edge detection using the Kirsh

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.