Giáo trình xử lý ảnh y tế Tập 1a P5 pdf

11 617 1
Giáo trình xử lý ảnh y tế Tập 1a P5 pdf

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

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Hình 3.2 (a) Ảnh IKRAM.IMG gốc (b) Ảnh lọc thơng cao IKRAM.IMG (c) Ảnh lọc thông thấp IKRAM.IMG Bài tập 3.1 Viết chương trình C để trung bình ảnh Nếu ảnh thứ hai kết lọc ảnh thứ nhất, ảnh thứ hai dịch dọc và/hoặc ngang so với ảnh thứ Chương trình nhắc nhở người sử dụng nhập lượng dịch chuyển Hình 3.3 Ảnh gốc thêm ảnh lọc thơng cao Chương trình 3.2 "FIRSYM.C" Lọc ảnh dùng lọc tuần hoàn đối xứng /*Program 3.2 “FIRSYM.C” Filltering of digital images using circular symmetricals.*/ /*This Program is for filtering images using the algorithm described in the text The filter type is FIR Circular symmetry is assumed The FIR filter coefficients can be obtained using the Simpson's double integration program described in Chapter II */ #include #include #include #include #include #include #include #include void main() { int i,j,n1,n2,N,NT,N2,image_width, image_length,k1,k2,k; int true_length,true_width,ind; char file_name[14]; unsigned char **w, ch; unsigned char *temp; float **h,max,min,diff; float nsq, zn2, tmp; FILE *fptr, *fptr1, *fptr_tmp; unsigned int sum; clrscr(); printf ("Enter file name containing FIR filter coefficients ->" ); scanf ( "%s", file_name); if((fptr=fopen(file_name, "r" ))==NULL) { printf("%s does not exist.",file_name ); exit(1); /* calculating order of filter */ nsq=0; while(fscanf(fptr,"%f ", &tmp)!=EOF) nsq++; rewind(fptr); NT=sqrt(nsq); printf("Order of filter %d x %d",NT,NT); N=(NT-1)>>1; N2=N

Ngày đăng: 10/07/2014, 21:20

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