如何对图像进行色彩度、对比度、明亮度、清晰度调整?
初学者,希望高手能给份源码,最好调试无误并带有详细点的注释,小弟万分感激,谢谢!可以寄到

解决方案 »

  1.   

    www.2ccc.com上可以找到相应的源代码。
      

  2.   


    给你一个很好的图象处理工具的源代码下载: Emage下载
     操作系统: 
     Win95/Win98/WinNT/Win2000          
    软件大小: 
     395K,下载后用winzip解压缩后直接运行,就一个执行文件。  
    基本功能:
     支持旋转-镜像-缩放-截取-对比度及亮度调节-反色-伪彩色化  
    -滤镜 -灰度化- 平滑-去噪-锐化-文件格式转换等  
    智能处理:
     近20种边缘检测方法 以及 快速自动识别(匹配)。  
    科学分析:
     彩色直方图分析处理-中值滤波-高低通滤波-二值化 
     注意:  下载Emage软件请到新作下载    
     
      如果想自己做一个图像处理软件,可以向作者索取 Emage源码
      
    斑竹留言:
         图像编程主要难点集中在算法上,在图像识别上对算法的优化极其重要,
     因为速度是图像处理的关键。我有一些这方面成功的经验,愿与同行者共享。     另外,哪位大虾有图像恢复方面资料收集信息,望告知。          
      
     
      Emage源代码http://www.lianxue.nease.net/
     
      

  3.   

    http://www.2ccc.com/article.asp?articleid=1058
      

  4.   

    机器没有了Delphi,没法帮你写!你看看《Delphi6数字图象处理及应用》的随书源码吧!www.2ccc.com上有,里面肯定有你要要的!!
      

  5.   

    //亮度增强
    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;
      

  6.   

    //灰度效果
    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;