如何对图像进行色彩度、对比度、明亮度、清晰度调整?
初学者,希望高手能给份源码,最好调试无误并带有详细点的注释,小弟万分感激,谢谢!可以寄到
初学者,希望高手能给份源码,最好调试无误并带有详细点的注释,小弟万分感激,谢谢!可以寄到
解决方案 »
- ScrollBox变化时怎样设置Form的高度?
- delphi 中怎么实现主界面的分页显示(就像360,QQ医生)
- 存储过程的参数传递问题,高手们帮忙看看,给分!!
- 关于clientsocket的问题!!!
- 一个高难度的打印问题!
- 对Object Pascal编译器给类对象分配堆内存细节的一种大胆猜
- delphi firemonkey 里获取汉字的拼音首字母 出错了。。帮我看看。。
- delphi怎么把xml文件转成html文件了??
- 一个新手的求救!我已经发了很多帖子了,但是怎么没有人理我呢,我开始失去信心了!
- Delphi与Oracle的问题?Why???ApplyUpdates用不了了???
- 成都的朋友,在成都普通程序员每月能拿多少?
- 为什么我用谁的用户名和密码登陆都是显示数据库中第一个记录的信息??
给你一个很好的图象处理工具的源代码下载: Emage下载
操作系统:
Win95/Win98/WinNT/Win2000
软件大小:
395K,下载后用winzip解压缩后直接运行,就一个执行文件。
基本功能:
支持旋转-镜像-缩放-截取-对比度及亮度调节-反色-伪彩色化
-滤镜 -灰度化- 平滑-去噪-锐化-文件格式转换等
智能处理:
近20种边缘检测方法 以及 快速自动识别(匹配)。
科学分析:
彩色直方图分析处理-中值滤波-高低通滤波-二值化
注意: 下载Emage软件请到新作下载
如果想自己做一个图像处理软件,可以向作者索取 Emage源码
斑竹留言:
图像编程主要难点集中在算法上,在图像识别上对算法的优化极其重要,
因为速度是图像处理的关键。我有一些这方面成功的经验,愿与同行者共享。 另外,哪位大虾有图像恢复方面资料收集信息,望告知。
Emage源代码http://www.lianxue.nease.net/
var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;begin
Bmp := TBitmap.Create;
Bmp.Assign(Image2.Picture.Bitmap);
Bmp.PixelFormat := pf24Bit;
for y := 0 to Bmp.Height - 1 do
begin
p := Bmp.scanline[y];
for x := 0 to Bmp.Width - 1 do
begin
p[x * 3] := max(0,min(255,(P[3*x]+5)));
p[x * 3 + 1] := max(0,min(255,(P[3*x+1]+5)));
p[x * 3 + 2] := max(0,min(255,(P[3*x+2]+5)));
end
end;
image2.Picture.Bitmap.Assign(Bmp);
bmp.free;
end;
//亮度减弱
var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;begin
Bmp := TBitmap.Create;
Bmp.Assign(Image2.Picture.Bitmap);
Bmp.PixelFormat := pf24Bit;
for y := 0 to Bmp.Height - 1 do
begin
p := Bmp.scanline[y];
for x := 0 to Bmp.Width - 1 do
begin
p[x * 3] := max(0,min(255,(P[3*x]-5)));
p[x * 3 + 1] := max(0,min(255,(P[3*x+1]-5)));
p[x * 3 + 2] := max(0,min(255,(P[3*x+2]-5)));
end
end;
image2.Picture.Bitmap.Assign(Bmp);
bmp.free;
end;
var
p :PByteArray;
Gray,x,y :Integer;
Bmp :TBitmap;
begin
Bmp :=TBitmap.Create;
Bmp.Assign(Image2.Picture.Bitmap);
Bmp.PixelFormat :=pf24Bit;
for y:=0 to Bmp.Height-1 do
begin
p:=Bmp.scanline[y];
for x:=0 to Bmp.Width-1 do
begin
Gray:=Round(p[x*3+2]*0.3+p[x*3+1]*0.59+p[x*3]*0.11);
p[x*3]:=Gray;
p[x*3+1]:=Gray;
p[x*3+2]:=Gray;
end;
end;
Image2.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
end;//浮雕效果
var
i, j: integer;
p1, p2: pbyteArray;
Value: integer;
BMP: Tbitmap;
begin
bmp := TBITMAP.Create;
BMP.Assign(Image2.Picture.Bitmap);
bmp.PixelFormat := pf24bit;
for i := 0 to bmp.Height - 2 do
begin
p1 := Bmp.ScanLine[i];
p2 := Bmp.ScanLine[i + 1];
for j := 0 to Bmp.Width - 1 do
begin
Value := (p1[3 * j + 2] - p2[3 * j + 2]) + 128;
p1[3 * j + 2] := Min(255, Max(0, Value));
Value := p1[3 * j + 1] - p2[3 * j + 1] + 128;
p1[3 * j + 1] := Min(255, Max(0, Value));
Value := p1[3 * j] - p2[3 * j] + 128;
p1[3 * j] := Min(255, Max(0, Value));
end;
end;
Image2.Picture.Bitmap.Assign(bmp);
bmp.Free;
end;
//伪彩
var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;
Gray: byte;
begin
Bmp := TBitmap.Create;
Bmp.Assign(Image2.Picture.Bitmap);
Bmp.PixelFormat := pf24Bit;
for y := 0 to Bmp.Height - 1 do
begin
p := Bmp.scanline[y];
for x := 0 to Bmp.Width - 1 do
begin
Gray := Round(p[x * 3 + 2] * 0.3 + p[x * 3 + 1] * 0.59 + p[x
* 3]
* 0.11);
if gray < 63 then
begin
//伪彩色处理的算法
p[x * 3 + 2] := 0;
p[x * 3 + 1] := 254 - 4 * gray;
p[x * 3] := 255;
end;
if (64 <= gray) and (gray < 127) then
begin
p[x * 3 + 2] := 0;
p[x * 3 + 1] := 4 * gray - 254;
p[x * 3] := 510 - 4 * gray;
end;
if (128 <= gray) and (gray < 191) then
begin
p[x * 3 + 2] := 4 * gray - 510;
p[x * 3 + 1] := 255;
p[x * 3] := 0;
end;
if (192 <= gray) then
begin
p[x * 3 + 2] := 255;
p[x * 3 + 1] := 1022 - 4 * gray;
p[x * 3] := 0;
end; end;
end; Image2.Picture.Bitmap.Assign(Bmp);
end;