🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: sci.image.processing
4 messages
4 total messages Started by singlis Sun, 26 Jul 1992 22:01
Filter Ranges for Enhancement, HELP!?!
#188
Author: singlis
Date: Sun, 26 Jul 1992 22:01
20 lines
951 bytes
Greetings,

when filtering with a standard Laplacian filter
	[ -1  -1  -1 ]
	[ -1   8  -1 ]
	[ -1  -1  -1 ]
and assuming the pixel values from 0..1 in intensity, the result of the 
operation can range from -8.0 to 8.0. What is the standard way of
mapping this result to a pixel range.

I have tried just diving by 8.0, and if negative ignore but this just gives
"black" images, I also tried /8.0 and the absolute, still it looks terrible.

I have a program for the PC, Improces which does a nice job.

Could anyone give me some tips??

thanks in advance

-Stuart Inglis, Waikato University, Hamilton, New Zealand.
Re: Filter Ranges for Enhancement, HELP!?!
#191
Author: Steve Lamont
Date: Mon, 27 Jul 1992 01:48
24 lines
1351 bytes
In article <1992Jul27.100116.9655@waikato.ac.nz> singlis@waikato.ac.nz writes:
>when filtering with a standard Laplacian filter
> ...
>and assuming the pixel values from 0..1 in intensity, the result of the 
>operation can range from -8.0 to 8.0. What is the standard way of
>mapping this result to a pixel range.
>
>I have tried just diving by 8.0, and if negative ignore but this just gives
>"black" images, I also tried /8.0 and the absolute, still it looks terrible.

How about 

	new_pixel_value = ( old_pixel_value + 8.0 ) / 16.0

?

This puts the pixels back into a 0..1 intensity range.

							spl
-- 
Steve Lamont, SciViGuy -- (619) 534-7968 -- spl@dim.ucsd.edu
UCSD Microscopy and Imaging Resource/UCSD Med School/La Jolla, CA 92093-0608
"Out of the ash/I rise with my red hair/And I eat men like air."
                        - Sylvia Plath, "Lady Lazarus"
Re: Filter Ranges for Enhancement, HELP!?!
#192
Author: Iftekhar Hussain
Date: Mon, 27 Jul 1992 01:50
50 lines
2134 bytes
In article <1992Jul27.100116.9655@waikato.ac.nz>, singlis@waikato.ac.nz writes:
|> Path: ucdavis!ucbvax!agate!ames!sun-barr!cs.utexas.edu!wupost!waikato.ac.nz!singlis
|> From: singlis@waikato.ac.nz
|> Newsgroups: sci.image.processing
|> Subject: Filter Ranges for Enhancement, HELP!?!
|> Message-ID: <1992Jul27.100116.9655@waikato.ac.nz>
|> Date: Sun, 26 Jul 92 15:01:16 GMT-0:06
|> Organization: University of Waikato, Hamilton, New Zealand
|> Lines: 20
|> 
|> Greetings,
|> 
|> when filtering with a standard Laplacian filter
|> 	[ -1  -1  -1 ]
|> 	[ -1   8  -1 ]
|> 	[ -1  -1  -1 ]
|> and assuming the pixel values from 0..1 in intensity, the result of the 
|> operation can range from -8.0 to 8.0. What is the standard way of
|> mapping this result to a pixel range.
|> 
|> I have tried just diving by 8.0, and if negative ignore but this just gives
|> "black" images, I also tried /8.0 and the absolute, still it looks terrible.
|> 
|> I have a program for the PC, Improces which does a nice job.
|> 
|> Could anyone give me some tips??
|> 
|> thanks in advance
|> 
|> -Stuart Inglis, Waikato University, Hamilton, New Zealand.
|> 


scale it up beteen 0-range as follows:

range = 1.0;

for(i=0; i<dimension; i++)
  for(j=0; j<dimension; j++)
   scaled_image[i][j] = (range(image[i][j] - minimum))/(maximum-minimum);

/* where image[i][j] is your filtered image 
   minimum is minimum value of the filtered image 
   maximum  is maximum value of the filtered image 

   if you want to map between 0-255 simply change the range to 255

*/

-Iftekhar
Re: Filter Ranges for Enhancement, HELP!?!
#197
Author: Charles Brabec
Date: Mon, 27 Jul 1992 03:24
46 lines
2000 bytes
In article <1992Jul27.100116.9655@waikato.ac.nz> singlis@waikato.ac.nz writes:
>Greetings,
>
>when filtering with a standard Laplacian filter
>	[ -1  -1  -1 ]
>	[ -1   8  -1 ]
>	[ -1  -1  -1 ]
>and assuming the pixel values from 0..1 in intensity, the result of the 
>operation can range from -8.0 to 8.0. What is the standard way of
>mapping this result to a pixel range.
>
>I have tried just diving by 8.0, and if negative ignore but this just gives
>"black" images, I also tried /8.0 and the absolute, still it looks terrible.
>
>Could anyone give me some tips??

Scale the result of the filter as you like, then add to it the value of the
central pixel and clip the results to your pixel range.

So for example, using the 1/8th filter on the pixels (range = 0-256)
      16  16  16
      32  32  32
      64  64  64

your filter value is: 32 - 2 - 2 - 2 - 4 - 4 - 8 - 8 - 8 = -6
Added to your original value: 32 + (-6) = 26
so 26 is your new value.

If your pixels were:
       0  0  0
       0  0  0
      16 16 16
your filter value is: 0 - 0 - 0 - 0 - 0 - 0 - 2 - 2 - 2 = -6
Added to your original value: 0 + (-6) = -6
Clip to the range: = 0
so 0 is your new value.

Experiment with the scaling of the Filter to increase or decrease the amount 
of edge enchancement. 1/8th and 1/16th are good to try, especially if you're
doing integer math.

Charles
-- 
--------------------------------------------------------------
Charles Brabec 					304 Cox Hall
brabec@pysgjb.physics.ncsu.edu			(919) 515-7228
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads