Welcome![Sign In][Sign Up]
Location:
Search - fprintf

Search list

[Compress-Decompress algrithmsSPIHT(Matlab).zip

Description:

% Matlab implementation of SPIHT (without Arithmatic coding stage)
%
% By Jing Tian, scuteejtian@hotmail.com

fprintf('-----------   Welcome to SPIHT Matlab Demo!   ----------------\n');

fprintf('-----------   Load Image   ----------------\n');
infilename = 'lena512.bmp';
outfilename = 'lena512_reconstruct.bmp';

Orig_I = double(imread(infilename));

rate = 1;

OrigSize = size(Orig_I, 1);
max_bits = floor(rate * OrigSize^2);
OutSize = OrigSize;
image_spiht = zeros(size(Orig_I));
[nRow, nColumn] = size(Orig_I);

fprintf('done!\n');
fprintf('-----------   Wavelet Decomposition   ----------------\n');
n = size(Orig_I,1);
n_log = log2(n);
level = n_log;
% wavelet decomposition level can be defined by users manually.
type = 'bior4.4';
[Lo_D,Hi_D,Lo_R,Hi_R] = wfilters(type);

[I_W, S] = func_DWT(Orig_I, level, Lo_D, Hi_D);

fprintf('done!\n');

fprintf('-----------   Encoding   ----------------\n');
img_enc = func_SPIHT_Enc(I_W, max_bits, nRow*nColumn, level);  

fprintf('done!\n');
fprintf('-----------   Decoding   ----------------\n');
img_dec = func_SPIHT_Dec(img_enc);

fprintf('done!\n');
fprintf('-----------   Wavelet Reconstruction   ----------------\n');
img_spiht = func_InvDWT(img_dec, S, Lo_R, Hi_R, level);

fprintf('done!\n');
fprintf('-----------   PSNR analysis   ----------------\n');

imwrite(img_spiht, gray(256), outfilename, 'bmp');

Q = 255;
MSE = sum(sum((img_spiht-Orig_I).^2))/nRow / nColumn;
fprintf('The psnr performance is %.2f dB\n', 10*log10(Q*Q/MSE));


Platform: | Size: 232873 | Author: jasonchang | Hits:

[Otherfprintf

Description: 这是一个小程序, 这是一个小程序, 这是一个小程序,-this a minor procedure, which is a small, this is a s mall procedure, This is a small, this is a small, this is a small procedure,
Platform: | Size: 817 | Author: jerry | Hits:

[Other resource45-70

Description: C语言精彩百例第45-70例 第二篇 深入提高篇 实例45 结构体变量 实例46 结构体数组 实例47 结构体指针变量 实例48 结构体指针数组 实例49 共用体变量 实例50 枚举类型 实例51 读写字符 实例52 读写字符串 实例53 格式化输出函数 实例54 格式化输入函数 实例55 打开和关闭文件 实例56 fputc()和fgetc() 实例57 函数rewind() 实例58 fread()和fwrite() 实例59 fprintf()和fscanf() 实例60 随机存取 实例61 错误处理 实例62 综合实例 实例63 动态分配函数 实例64 常用时间函数 实例65 转换函数 实例66 查找函数 实例67 跳转函数 实例68 排序函数 实例69 伪随机数生成 实例70 可变数目变元
Platform: | Size: 22329 | Author: 杨志亮 | Hits:

[Other resourceC_Function

Description: 相信长期编程的同志们总会为忘记了fprintf,strcpy,memcpy等常用函数的格式而烦心吧,为这点破事而装个MSDN实在不划算,因此小弟为大家提供了C语言函数库速查手册,CHM格式
Platform: | Size: 91753 | Author: | Hits:

[Other resourceDES_PC--k

Description: if (pfile() == 0) unlink(inname) else fprintf(stderr, \"%s: I/O Error -- File unchanged\\n\", inname) fclose(outfile) fclose(infile) } exit(0)
Platform: | Size: 7992 | Author: lith | Hits:

[source in ebookDES_PC--k

Description: if (pfile() == 0) unlink(inname) else fprintf(stderr, "%s: I/O Error -- File unchanged\n", inname) fclose(outfile) fclose(infile) } exit(0) - if (pfile() == 0) unlink(inname) else fprintf(stderr, "%s: I/O Error-- File unchanged\n", inname) fclose(outfile) fclose(infile) } exit(0)
Platform: | Size: 8192 | Author: lith | Hits:

[Otherfprintf

Description: 这是一个小程序, 这是一个小程序, 这是一个小程序,-this a minor procedure, which is a small, this is a s mall procedure, This is a small, this is a small, this is a small procedure,
Platform: | Size: 1024 | Author: | Hits:

[source in ebook45-70

Description: C语言精彩百例第45-70例 第二篇 深入提高篇 实例45 结构体变量 实例46 结构体数组 实例47 结构体指针变量 实例48 结构体指针数组 实例49 共用体变量 实例50 枚举类型 实例51 读写字符 实例52 读写字符串 实例53 格式化输出函数 实例54 格式化输入函数 实例55 打开和关闭文件 实例56 fputc()和fgetc() 实例57 函数rewind() 实例58 fread()和fwrite() 实例59 fprintf()和fscanf() 实例60 随机存取 实例61 错误处理 实例62 综合实例 实例63 动态分配函数 实例64 常用时间函数 实例65 转换函数 实例66 查找函数 实例67 跳转函数 实例68 排序函数 实例69 伪随机数生成 实例70 可变数目变元-err
Platform: | Size: 22528 | Author: 杨志亮 | Hits:

[VC/MFCC_Function

Description: 相信长期编程的同志们总会为忘记了fprintf,strcpy,memcpy等常用函数的格式而烦心吧,为这点破事而装个MSDN实在不划算,因此小弟为大家提供了C语言函数库速查手册,CHM格式 -Believe that the long-term programming Comrades Association for the forgotten fprintf, strcpy, memcpy, etc. format commonly used functions bother you, for this matter and point out the MSDN installed a really worthwhile, so younger brother has provided C language function library Info Manual, CHM format
Platform: | Size: 91136 | Author: | Hits:

[ActiveX/DCOM/ATLCommandDemo

Description: 化工计算的一个算例!基本的操作过程,如fprintf的应用等。-Chemical engineering
Platform: | Size: 2048 | Author: 清茗 | Hits:

[Windows DevelopBerndHafner

Description: C-mex files for MATLAB encounter the following problem when compiling them with WATCOM 11.0: All access-functions to files (fprintf, fscanf) cannot handle double variables, only integer and strings are read or written correctly. The file convert.c contains two functions: You may read a double-variable as a string from the file and convert it to a double (function string2double) and you may convert a double to a string (function double2string) and write it to a file (see main() in convert.c). The file conditio.dat is an example of numbers read by convert.c. The conv.exe was compiled on a Windows95-system. The files were tested for MATLAB 5.2 and WATCOM 11.0a result of "ver" is: MATLAB Version 5.2.1.1420 on PCWIN-C-mex files for MATLAB encounter the following problem when compiling them with WATCOM 11.0: All access-functions to files (fprintf, fscanf) cannot handle double variables, only integer and strings are read or written correctly. The file convert.c contains two functions: You may read a double-variable as a string from the file and convert it to a double (function string2double) and you may convert a double to a string (function double2string) and write it to a file (see main () in convert.c). The file conditio.dat is an example of numbers read by convert.c. The conv.exe was compiled on a Windows95-system. The files were tested for MATLAB 5.2 and WATCOM 11.0a result of " ver" is : MATLAB Version 5.2.1.1420 on PCWIN
Platform: | Size: 34816 | Author: 李维 | Hits:

[Linux-UnixUNIXCcode

Description: 用C语言编写的Unix代码实例 供大家参考 -#include <sys/sem.h> #include <sys/types.h> #include <sys/ipc.h> #include <stdio.h> #include <sys/stat.h> #define VERIFYERR(a, b) if (a) fprintf(stderr, " s failed.\n", b) else fprintf(stderr, " s success.\n", b) void main(int argc, char*argv[]) { int semid, index, i struct semid_ds ds unsigned short array[100] if (argc != 4) return semid = atoi(argv[1]) index = atoi(argv[2]) if (argv[3][0] == c ) { /* 创建信号量*/ VERIFYERR(semget(semid, index, 0666|IPC_CREAT|IPC_EXCL) < 0, "Create sem") } else if (argv[3][0] == d ) { /* 删除消息队列*/ VERIFYERR(semctl(semid, 0, IPC_RMID, NULL) < 0, "Delete sem") } else if (argv[3][0] == v ) { /* 查看信号量信息*/ fprintf(stderr, "T ID INDEX SEMVAL SEMPID SEMNCNT SEMZCNT\n") fprintf(stderr, "s 6d 6d 10d 10d 10d 10d\n", semid, /* 标识号*/ index, /* 信号量序号*/ semctl(semid, index, GETVAL), /* 信号量值*/ semct > Downloads > 源码/资料
Platform: | Size: 150528 | Author: netdavid | Hits:

[Othersortmac

Description: clear xi=100 W=1e6 L=1e3 fprintf( \n****************** Start ******************\n\n ) -clear xi=100 W=1e6 L=1e3 fprintf( \n****************** Start ******************\n\n )
Platform: | Size: 1024 | Author: Mostafa | Hits:

[SCMos

Description: 1.编写一个文件复制的C语言程序: 分别使用文件的系统调用read(fd, buf, nbytes), write(fd, buf, nbytes)和文件的库函数fread(buf, size, nitems, fp), fwrite(buf, size, nitems, fp),编写一个文件的复制程序。 当上述函数中nbytes, size和nitems都取值为1时(即一次读写一个字节),比较这两种程序的执行效率。当nbytes取1024字节,size取1024字节,且nitems取1时(即一次读写1024字节),再次比较这两种程序的执行效率。 2.分别使用fscanf和fprintf,fgetc和fputc,fgets和fputs(仅限于行结构的文本文件),实现上述的文件复制程序。你还可用其他的方法实现文件的复制功能吗? 3.编写一个父子进程之间用无名管道进行数据传送的C程序。父进程逐一读出一个文件的内容,并通过管道发送给子进程。子进程从管道中读出信息,再将其写入一个新的文件。程序结束后,对原文件和新文件的内容进行比较。 4.在两个用户的独立程序之间,使用有名管道,重新编写一个C程序,实现题3的功能。 -pipeline
Platform: | Size: 35840 | Author: yiyuzhiming | Hits:

[File Operatebbc_log_v2.0.1.1

Description: 使用该lib能够方便的像fprintf一样打印日志,封装了所有的文件操作,支持分级别日志打印,自动打印当前程序所在行、出错函数、出错文件名。支持多线程-An effective c++ lib for printing log
Platform: | Size: 1458176 | Author: Simon | Hits:

[matlabbinarytohexconversion

Description: this code is written to convert the decimal number to hexadecimal number in sixteen bit format. the decimal numbers are stored in a text file and after conversion to the hexadecimal format data are stored in a seperate file data that is written will be in the coe file format.function fscanf is used to read the txt file and function fprintf is used to to write a file in a particular location .function dectohex is used for decimal to hexadecimal conversion.
Platform: | Size: 1024 | Author: ashutosh kumar | Hits:

[matlabBinaryIntegerProg

Description: 也在找关于这方面的资料着~~我是有matlab程序,但是在Java里没法触发调用它~~ 付上matlab程序,有需要的自己拿吧。 function BinaryIntegerProg(f_file_name, A_file_name, b_file_name, Aeq_file_name, beq_file_name,write_file_name) f = load(f_file_name) A = load(A_file_name) b = load(b_file_name) Aeq = load(Aeq_file_name) Beq = load(beq_file_name) x = bintprog(f, A, b, Aeq, beq) fp = fopen(write_file_name, w ) fprintf(fp, d\n ,x) fclose(fp)-good daima!
Platform: | Size: 16384 | Author: 夏双喜 | Hits:

[matlabsol_fa2soundfcn20_May_2011

Description: 职能转换的纯文本唱名法记法矩阵或一个MIDI序列,代表的声音,或读取MIDI序列数据,并说明其转换为溶胶发符号。 图形用户界面是在一个唱名法编辑器的尝试,一个工作人员到唱名法的转换器。 而将工作职能溶胶fa2soundfcn文件夹在Matlabpath的。使用pathtool命令或设置路径...从文件菜单,并添加溶胶fa2soundfcn文件夹。 在M-代码计算从纯文本输入球场和持续时间,并生成用于扬声器作为信号 Ÿ Ÿ *罪=(2 * pi的*女*吨),0<吨<期限 或生成的MIDI数据序列做笔记 俯仰速度时间戳时间戳... 输出写入: *扬声器使用SOUNDSC * audioplayer对象使用AUDIOPLAYER *波形声音文件,并使用WAVWRITE * MIDI序列使用FWRITE 要生成唱名法记法,M码会从一个MIDI序列的说明使用从文件中读数据,将其转换唱名法符号和写入一个输出到一个文本文件(。txt)的使用FPRINTF 图形用户界面允许播放控制,文字编辑和独奏/静音选项。-The functions convert sol-fa notation in plain text to a matrix or to a MIDI sequence that represents the sound, or read the note data from a MIDI sequence and convert it to sol-fa notation. The GUI is an attempt at a sol-fa editor and a staff-to-sol-fa converter. Functions will work while the sol-fa2soundfcn folder is on the Matlabpath. Use the pathtool command or Set path... from the File menu, and add the sol-fa2soundfcn folder. The m-code calculates pitches and durations from the plain text input and generates a signal for the speakers as y = Y* sin(2* pi* f* t), 0 < t < duration or generates note data for a MIDI sequence as timestamp pitch velocity timestamp ... The output is written to: * speakers using SOUNDSC * audioplayer object using AUDIOPLAYER * WAVE Sound file using WAVWRITE * MIDI sequence using FWRITE To generate sol-fa notation, the m-code gets the note data from a MIDI sequence using FREAD, converts it to sol-fa symbol
Platform: | Size: 876544 | Author: driiawrl | Hits:

[File Operatefscanf-fprintf-method

Description: 运用fscanf,fprintf方法来读写文件,函数已封装好,非常好用!-Use the fscanf, fprintf way to read and write files, functions, packaged, very easy to use!
Platform: | Size: 180224 | Author: 黄树桂 | Hits:

[matlabfprintf

Description: fprintf函数,从matlab中导出数据!-fprintf function to export the data from matlab!
Platform: | Size: 10240 | Author: xuanliliang | Hits:
« 12 3 »

CodeBus www.codebus.net