您的位置:首页 > 编程语言 > C语言/C++

基于标准C语言的数字图像处理基本框架

2009-10-21 22:25 465 查看
考虑到现有的数字图像处理都是基于Windows平台,都或多或少使用了Win32 API函数,不能移植到Linux或者嵌入式系统中。为了使程序可移植,采用标准C语言建立了数字图像处理的基本框架,如下图所示:

#ifndef BMP_H_INCLUDED
20#define BMP_H_INCLUDED
21
22#include <ctype.h>
23#include <stdio.h>
24#include <stdlib.h>
25#include <malloc.h>
26#include <string.h>
27
28typedef unsigned short WORD;
32typedef unsigned long DWORD;
33typedef long LONG;
34typedef unsigned char BYTE;
35
36
45
60
68
74typedef struct _Bitmap
76
87int CreateBitmap(Bitmap* bmp, int width, int height, int bitCount)
95
157void ReleaseBitmap(Bitmap* bmp)
164
171int CheckPath(char *path)
179
202int ReadBitmap(char* path, Bitmap* bmp)
211
281int SaveBitmap(char* path, Bitmap* bmp)
290
367#endif // BMP_H_INCLUDED
368
369
370
371
372
373
392#ifndef BASICPROCESS_H_
393#define BASICPROCESS_H_
394
395#include "bmp.h"
396#include <math.h>
397int RGB2Gray(Bitmap* src, Bitmap* dst)
401
440int Gray2RGB(Bitmap* src, Bitmap* dst)
450
488int Gray2BW(Bitmap* src, Bitmap* dst, int threshold)
498
539void rgb2hsv(float R, float G, float B, float *H, float *S, float* V)
548
579
580void hsv2rgb(float H, float S, float V, float *R, float *G, float *B)
589
641int HistEqualization(Bitmap* dstBmp, Bitmap* srcBmp)
646
650
654int MedFilt(Bitmap* dstBmp, Bitmap* srcBmp)
655
659#endif /* BASICPROCESS_H_ */
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: