Re: filtering specific pixels
- From: Leonard <voyager1@xxxxxxxxxxxxxxxx>
- Date: Thu, 26 Jan 2006 04:35:16 -0500
Dave Robinson wrote:
>
>
>> i have an original image, of which i used a canny edge detector
> on.
>> then, i have to remove the lines detected.
>> but the resultant image from the canny filter is a binary
image,
>> while my original is an indexed image.
>> how do i find the pixel location of the edges(white pixels) in
> the
>> filtered image, then command the filter to do 3x3 average
> filtering
>> on those pixels only in my original image, but not on the whole
>> image?
>
> The way I might be tempted to tackle this problem is as follows.
>
> 1) Take a copy of your image and apply your 3x3 filter to the lot.
>
> 2) Take your Canny image and filter it using something like a
> Gaussian with a few pixels standard deviation. This gives you a
> rough
> and ready measure of how close you are to one of your lines. That
> is
> to say it will have a value of '1' when you are sitting on top of a
> line, and will get smaller as you move away from it. We can call
> this
> the Alpha image
>
> 3) Take your original image and your filtered version of your image
> and mix them using something like
>
> Mixed_Pixel = Alpha_Pixel*Filtered_Pixel +
> (1-Alpha_Pixel)*Original_Pixel;
>
> What we are doing here is any pixel which is far away from your
> lines
> is pure original image, whereas the closer you get to a line, you
> undertake a graceful transition between the original pixel, and the
> filtered pixel. When you are exactly on a line you are purely using
> the filtered image.
>
> The width of the transition zone is controllable by the variance of
> the Gaussian you used to filter your Canny edge image with, and can
> be made as wide or as narrow as you require. I think this will
> generate a much more pleasing result than just treating the exact
> edge pixels shown by the Canny, which is probably only showing the
> position of the maximum slope of the edge.
>
> It will obviously automatically work for any image, once you have
> the
> parameters of your 3x3 filter, and the Gaussian variance specified.
>
> Hope this helps
>
> Dave Robinson
i tried your method, but it was disastrous - the lines appeared white
on the output image.
that is to say, there is no transition between the filtered and
original image, but thick white lines running through the output
image.
with regard to my previous post, am i doing anything wrong?
.
- Follow-Ups:
- Re: filtering specific pixels
- From: Dave Robinson
- Re: filtering specific pixels
- References:
- filtering specific pixels
- From: Leonard
- Re: filtering specific pixels
- From: Rune Allnor
- Re: filtering specific pixels
- From: Leonard
- Re: filtering specific pixels
- From: Dave Robinson
- filtering specific pixels
- Prev by Date: bidirectional electronic energy meter simulink model or block digram
- Next by Date: Re: Using varargout
- Previous by thread: Re: filtering specific pixels
- Next by thread: Re: filtering specific pixels
- Index(es):
Relevant Pages
|
Loading