基于VC++的图像点运算实现
摘要:图像的点运算是图像处理中相对简单的技术,它主要用于改变一幅图像的灰度分布范围。点运算通过一个变换函数将图像的像素一一转换,最终构成一幅新的图像。由于操作对象是图像的一个个像素,故得名为"点运算"。点运算的最大特点是输出像素值只与当前输入像素值有关。点运算的图像处理过程可以用以下公式表示:g(x, y)=T[f(x, y)]其中f(x, y)表示输入图像,g(x, y)表示处理后的图像。函数T是对f的一种变换操作,在这里它表示灰度变换公式。可以看到,对于点运算而言,最重要的是确定灰度变换公式。变换公式一旦确定,点运算对于图像的处理效果就确定了。点运算主要包括灰度直方图、线性变换、非线性变换、阈值变换、灰度拉伸及灰度均衡等,本文所针对的待处理对象是256色位图。
关键词:点运算,线性变换,阈值变换,256色位图
The Image Point of Operation based on C++ to Achieve
ABSTRACT:Image point operation is relatively simple image processing techniques. It is mainly used to change an image intensity distribution. Through a transformation function, point of operation converts the image pixels one by one and eventually forms a new image. As the operation object is the image of a pixel, it was called the "point of operation." The biggest characteristic of point of operation is that output pixel value is only relevant with the current input pixel value. Point of image processing operations can be expressed with the following formula: g (x, y) = T [f (x, y)] where f (x, y) represents the input image and g (x, y) is the processed image. Function f is a transformation operation to T, where it said gray-scale transformation formula. We can see that for the point of operation, the most important thing is to determine the gray-scale transformation formula. Once the transformation formula was made, point computation for image processing effects on the set. The image point operation mainly includes point operations, anti-color image, linear transformation, histogram, threshold transform, gray stretch and gray balance. This text is aimed at 256 color location picture about which is waiting by target of handling.
KEY WORDS: point operations, linear transformation, threshold transform, 256 color location picture
1
系统总体
设计 1.1 总体设计
图像点运算处理,在现实生活中应用广泛,为了处理方便,本论文主要是处理8位灰度图,BMP格式的图像。点运算主要包括图像反色、图像线性变换、阈值变换、窗口变换、灰度拉伸和灰度均衡等。实现此设计需要考虑布局
问题和界面设计。这几部分可以由菜单部分来设计,总共六项,又考虑到每一步做完如果需要恢复原图像,所以加进一个恢复图像菜单选项,如果需要重新加载图像,可以在文件菜单中设置加载图像这一选项,每一个选项对应一个操作。每一个运算需要一些参数,所以需要设计5个对话框来设置相应的参数,对于其中的布局是按自己的喜好和习惯来设置。当然要通过键盘或鼠标直接与这些视窗交互操作,需要更加熟练MFC和Windows程序设计,对于所建立的每一个视窗,按钮,编辑器等都有响应的函数