资源简介
花了10块钱买的,希望对大家有帮助。/*#############################################################################
* 文件名:file.c
* 功能: 实现了指纹相关文件的操作
* modified by PRTsinghua@hotmail.com
#############################################################################*/
#include
#include
#include
#include "file.h"
/* 对象的这些接口实现是私有的,不必为用户所知 */
typedef struct iFvsFile_t
{
FILE *pf; /* 文件指针 */
} iFvsFile_t;
/******************************************************************************
* 功能:创建一个新的文件对象,只有在创建之后,文件对象才能为其它函数所用。
* 参数:无
* 返回:若创建失败,返回NULL;否则返回新的对象句柄。
******************************************************************************/
FvsFile_t FileCreate()
{
iFvsFile_t* p = NULL;
p = (iFvsFile_t*)malloc(sizeof(iFvsFile_t));
if (p!=NULL)
p->pf = NULL;
return (FvsFile_t)p;
}
/******************************************************************************
* 功能:破坏一个已经存在的文件对象,在毁坏之后,文件对象不能再为其它函数所用。
* 参数:file 即将删除的文件对象指针
* 返回:无返回值
******************************************************************************/
void FileDestroy(FvsFile_t file)
{
iFvsFile_t* p = NULL;
if (file==NULL)
return;
/* 关闭文件,如果它还打开着 */
(void)FileClose(file);
p = file;
free(p);
}
/******************************************************************************
* 功能:打开一个新的文件。一个文件可以读打开,写打开,或者被创建。
* 参数:file 文件对象
* name 待打开文件的名字
* flags 打开标志
* 返回:错误编号
******************************************************************************/
FvsError_t FileOpen(FvsFile_t file, const FvsString_t name,
const FvsFileOptions_t flags)
{
iFvsFile_t* p = (iFvsFile_t*)file;
char strFlags[10];
int nflags = (int)flags;
/* 关闭文件,如果已经打开 */
(void)FileClose(p);
strcpy(strFlags, "");
if ( (nflags & FvsFileRead)!=0 &&
(nflags & FvsFileWrite)!=0 )
strcat(strFlags, "rw");
else
{
if ((nflags & FvsFileRead)!=0)
strcat(strFlags, "r");
if ((nflags & FvsFileWrite)!=0)
strcat(strFlags, "w");
}
strcat(strFlags, "b");
if ((nfl
代码片段和文件信息
/*#############################################################################
* 文件名:fvs_binarize.c
* 功能: 指纹图像二值化
* modified by PRTsinghua@hotmail.com
#############################################################################*/
#include “fvs.h“
int main(int argc char *argv[])
{
FvsImage_t image;
FvsImage_t mask;
FvsFloatField_t direction;
FvsFloatField_t frequency;
if (argc!=3)
{
printf(“Usage: fvs input.bmp output.bmp\n“);
return -1;
}
mask = ImageCreate();
image = ImageCreate();
direction = FloatFieldCreate();
frequency = FloatFieldCreate();
if (mask!=NULL && image!=NULL && direction!=NULL && frequency!=NULL)
{
(void)FvsImageImport(image argv[1]);
(void)ImageSoftenMean(image 3);
fprintf(stdout “1/5 Determining the ridge direction\n“);
(void)FingerprintGetDirection(image direction 5 8);
fprintf(stdout “2/5 Determining the ridge frequency\n“);
(void)FingerprintGetFrequency(image direction frequency);
fprintf(stdout “3/5 Creating the mask\n“);
(void)FingerprintGetMask(image direction frequency mask);
fprintf(stdout “4/5 Enhancing the fingerprint image\n“);
(void)ImageEnhanceGabor(image direction frequency mask 4.0);
fprintf(stdout “5/5 Binarize\n“);
(void)ImageBinarize(image (FvsByte_t)0x80);
(void)FvsImageExport(image argv[2]);
}
fprintf(stdout “Cleaning up and exiting...\n“);
ImageDestroy(image);
ImageDestroy(mask);
FloatFieldDestroy(direction);
FloatFieldDestroy(frequency);
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1675 2004-03-05 03:32 zwsb\demo\fvs_binarize.c
文件 2640 2004-03-08 01:53 zwsb\demo\fvs_createtestimages.c
文件 2198 2004-03-08 01:54 zwsb\demo\fvs_direction.c
文件 1787 2004-03-08 01:52 zwsb\demo\fvs_enhancer.c
文件 1434 2004-03-08 01:52 zwsb\demo\fvs_mask.c
文件 2136 2004-03-08 01:53 zwsb\demo\fvs_minutia.c
文件 1753 2004-03-08 01:53 zwsb\demo\fvs_thinner.c
文件 817 2004-03-04 03:12 zwsb\includes\export.h
文件 5709 2004-03-05 00:07 zwsb\includes\file.h
文件 4754 2004-03-07 23:25 zwsb\includes\floatfield.h
文件 1216 2004-03-04 14:31 zwsb\includes\fvs.h
文件 2133 2004-03-04 17:16 zwsb\includes\fvstypes.h
文件 2446 2004-03-07 23:28 zwsb\includes\histogram.h
文件 6010 2004-03-07 23:32 zwsb\includes\image.h
文件 5149 2004-03-05 00:59 zwsb\includes\imagemanip.h
文件 4614 2004-03-05 02:14 zwsb\includes\img_ba
文件 753 2004-03-07 04:29 zwsb\includes\import.h
文件 1421 2004-03-04 20:19 zwsb\includes\matching.h
文件 4665 2004-03-05 03:25 zwsb\includes\minutia.h
文件 3363 2004-03-05 00:05 zwsb\source\export.c
文件 7705 2004-03-05 00:21 zwsb\source\file.c
文件 7181 2004-03-05 00:31 zwsb\source\floatfield.c
文件 4716 2004-03-08 01:16 zwsb\source\histogram.c
文件 8908 2004-03-08 01:16 zwsb\source\image.c
文件 25818 2004-03-05 02:09 zwsb\source\imagemanip.c
文件 11155 2004-03-05 02:18 zwsb\source\img_ba
文件 5443 2004-03-08 01:27 zwsb\source\img_enhance.c
文件 2141 2004-03-05 02:43 zwsb\source\img_morphology.c
文件 6092 2004-03-08 01:36 zwsb\source\img_thin.c
文件 2082 2004-03-08 01:40 zwsb\source\import.c
............此处省略10个文件信息
- 上一篇:p2p通信的简单实现c语言
- 下一篇:谭浩强 C语言程序设计第三版视频教程BT种子
评论
共有 条评论