ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Noise Removal 24-bit
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

w2m

USA
1990 Posts

Posted - Feb 18 2015 :  08:04:37  Show Profile  Reply
Has anyone been able to find noise removal code for 24-bit images? I have searched for years for this but have not been able to come up with a noise removal procedure for Delphi. If not what are the best ImageEnProc procedures to use?

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development

Uwe

284 Posts

Posted - Feb 18 2015 :  10:15:41  Show Profile  Reply
Bill,

This might be a starter (scroll to the bottom of the page):

http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_24377488.html

-Uwe
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 18 2015 :  10:17:46  Show Profile  Reply
Thanks Uwe, but I am not a member of experts-exchange.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

Uwe

284 Posts

Posted - Feb 18 2015 :  10:32:44  Show Profile  Reply
Bill, the cached version of that page is freely available. Here's the relevant code (not formatted):




{***********************************
 *  copy the image data to a Array of integer
 *
 ***********************************}
 
procedure ScanRasterValues (aBmp : TBitmap; xstart, ystart, xsteps, ysteps : Integer; var RvalueArray, GValueArray, BValueArray : TImageFilter);
var   ByteLine  : Pbytearray;
      i, j      : integer;
begin
 
 
 
   for j := ystart to ystart + ysteps  do
         begin
 
         ByteLine := aBmp.ScanLine[j];
 
         for  i:= xstart to xstart + xsteps  do
 
                begin
 
                   BvalueArray [i-xstart, j-ystart] := ByteLine[3*i];
                   GvalueArray [i-xstart, j-ystart] := ByteLine[3*i +1];
                   RvalueArray [i-xstart, j-ystart] := ByteLine[3*i +2];
 
 
                end;
 
         end;
 
end;
 
 
 
function FilterResult (aFilter, bFilter : TImageFilter) : word;
var  i,j   :  Integer;
     n,m     :  Integer;
 
begin
     n := length( aFilter );
     m:= n;
 
 
     for i := 1 to n do
       for j := 1 to m do
          result := aFilter[i][j] * bfilter[i,j];
end;
 
{******************************************************************************
 *      Input:
 *          bmp1, bm2 : TBitMap
 *          ImageFilter  : Image Filter array , size   FilterSize x  FilterSize
 *          assume filter size is always even !!  1,3,5, ...
 *
 *    OutPut:
 *
 *
 *
 *******************************************************************************}
 
procedure ReduceNoise_AnyFilter (bmp1, bmp2 : TBitMap; aImageFilter : TImageFilter );
 
var  P1                 :    pbytearray;  //  from Image 1
     FilterSize         :    Integer;     //  3,5,7
     FilterSize2        :    Integer;     //  2,3,4
     i,j,jj             :    Integer;
     RvalueArray        :    TImageFilter;    // Red Color Values
     GvalueArray        :    TImageFilter;    // Green Color Values
     BvalueArray        :    TImageFilter;    // Blue Color Values
 
begin
     //  the filter size
     FilterSize := length(aImageFilter);
 
     FilterSize2 := round((FilterSize-1)/2 +1);
 
      //  adjust dyn. arrays
 
     setlength ( RvalueArray, Filtersize, Filtersize );
 
     setlength ( GvalueArray, Filtersize, Filtersize );
 
     setlength ( BvalueArray, Filtersize, Filtersize );
 
 
     //  Loop through all Pixels
     for j := FilterSize2 to bmp1.Height - (FilterSize2 +1) do
         begin
 
             p1 := bmp1.ScanLine[j];
 
 
             for i := FilterSize2 to bmp1.Width - (FilterSize2+1)  do
 
               begin
 
                ScanRasterValues (bmp2, i-FilterSize2, j-FilterSize2, FilterSize, FilterSize,RvalueArray, GValueArray, BValueArray );
 
 
 
                p1[3 * i ]     :=  FilterResult ( aImageFilter,BvalueArray ) ;     //  Bvalue
                p1[3 * i + 1 ] :=  FilterResult ( aImageFilter,GvalueArray ) ;     //  Gvalue
                p1[3 * i + 2 ] :=  FilterResult ( aImageFilter,RvalueArray ) ;     //  Rvalue
 
 
               end; // i := ...
 
 
 
 
         end;  //  j:= ..
end;






http://en.wikipedia.org/wiki/Median_filter (also see links at page bottom)

http://www.student.kuleuven.be/~m0216922/CG/filtering.html
http://www.miszalok.de/Samples/IP/median_filter/median_filter.pdf

http://www.librow.com/articles/article-1/appendix-a-1 (look for the implementation file link)

http://ndevilla.free.fr/median/median.pdf



-Uwe
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 18 2015 :  10:53:43  Show Profile  Reply
Thanks Uwe... I guess I'll have to brush up on my C...

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Feb 18 2015 :  13:44:00  Show Profile  Reply
Hi,

besides median filter, you can use Kuwahara filter, as it preserves image edges much better then median filter.
I have implemented Kuwahara filter as a lua script in demo project posted in "User Demos and Applications" topic, but it seems there is Matlab and Delphi code available on this page:

http://old.rifqion.com/2009/05/09/kuwahara-filter-matlab-image-processing/

Go to Top of Page

xequte

38514 Posts

Posted - Feb 18 2015 :  18:59:28  Show Profile  Reply
Hi Bill

Can you email me some sample images you are looking to denoise?

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 18 2015 :  20:29:53  Show Profile  Reply
Nigel,

Sure... but I need to be able to de-noise most any jpg with noticeable noise for a commercial application.

Spetric, Thanks for the limk.

Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

spetric

Croatia
308 Posts

Posted - Feb 19 2015 :  01:46:39  Show Profile  Reply
Hi Bill,

A popular approach to image denoising is "non-local means noise reduction" or "non-local means denoising". However, I did not find any Delphi source around, only C.

Here is a good demo page:
http://demo.ipol.im/demo/bcm_non_local_means_denoising/

There is also article and source code available (C/C++).
Go to Top of Page

w2m

USA
1990 Posts

Posted - Feb 27 2015 :  08:01:04  Show Profile  Reply
Nigel,

Did you receive my email with sample images?


Bill Miller
Adirondack Software & Graphics
Email: w2m@hughes.net
EBook: http://www.imageen.com/ebook/
Custom Commercial ImageEn Development
Go to Top of Page

xequte

38514 Posts

Posted - Feb 27 2015 :  13:13:37  Show Profile  Reply
Hi

Yes, thanks, Bill,

Have not yet had time to investigate an algorithm yet though.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

xequte

38514 Posts

Posted - May 25 2015 :  18:22:48  Show Profile  Reply
FYI, next version of IEVision will support non-local means denoising.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: