TAILIEUCHUNG - Nén Ảnh part 2

Tham khảo tài liệu 'nén ảnh part 2', công nghệ thông tin, đồ họa - thiết kế - flash phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | void main int i j N M loc k ind xt yt unsigned char v L gray table_length unsigned long int code table_code ctemp2 unsigned long int aux1 aux2 Lmask act_len flength unsigned char mask Len int ch unsigned char ctemp Ltemp float temp sum pt p big unsigned long int histo double nsq char file_name1 14 file_name2 14 FILE fptr fptro clrscr printf Enter file name of image -- scanf s file_name1 fptr fopen file_name1 rb if fptr NULL printf s does not exist. file_name1 exit 1 printf nEnter file name for compressed image -- scanf s file_name2 k stricmp file_name1 file_name2 if k 0 printf nInput and output files cannot share the same name. fcloseall exit 1 ind access file_name2 0 while ind k stricmp file_name1 file_name2 if k 0 321 gotoxy 1 8 printf Input and output files cannot share the same name. exit 1 gotoxy 1 4 printf File exists. Wish to overwrite y or n -- while ch getch y ch n putch ch switch ch case y ind 1 break case n gotoxy 1 4 printf gotoxy 1 3 printf gotoxy 1 3 printf Enter file name -- scanf s file_name2 ind access file_name2 0 fptro fopen file_name2 wb xt wherex yt wherey gotoxy 70 25 textattr RED LIGHTGRAY 4 BLINK cputs WAIT Generate histogram. histo unsigned long int malloc 256 sizeof long int for i 0 i 256 i histo i 0 while ch getc fptr EOF histo ch p float malloc 256 sizeof float gray unsigned char malloc 256 sizeof char 322 k 0 for i 0 i 256 i if histo i 0 p k float histo j gray k i k free histo N k Normalize. sum for i 0 i N i sum p i for i 0 i N i p i sum Rearranging the probability values in ascending order. for i 0 i N-1 i big p i loc i for j i 1 j N j if p j big big p i loc j if loc i continue else temp p i ctemp gray j p i p loc gray i gray loc p loc temp gray loc ctemp .

TỪ KHÓA LIÊN QUAN
TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã 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.