Solved

Unsharp filter: Matlab

Posted on 2009-03-29
3
2,461 Views
Last Modified: 2016-02-10
Hello,
I need to make an unsharp filter using following parameters:
%gaussian_size     size of the applied filter
&gaussian_std      standard deviation of the gaussian filter, sigma
for an image. in the folder images.
Following functions must be implemented:
Input:      <RGB frames>, Filterparameter
Output;    filtered <RGB frames>
Data: filter_unsharp.m

Would be grateful for your help
0
Comment
Question by:ihbemd6rb
3 Comments
 
LVL 1

Expert Comment

by:daviddoria
ID: 24015099
The basic setup is:

I = imread('cameraman.tif');
H = fspecial('unsharp');
sharpened = imfilter(I,H,'replicate');
subplot(2,2,4);
imshow(sharpened); title('Sharpened Image');

You can pass other options to fspecial (the filter parameters). Take a look at
doc fspecial
in Matlab. I'm assuming you have the Image Processing Toolbox?

Dave
0
 

Author Comment

by:ihbemd6rb
ID: 24017111
Hello and thanks for the answer, I have already seen this code on the mathworks website. My problem is how to make this function from it:
 function video = filter_unsharp(video, gaussian_size, gaussian_std);
    ......
As an example something similar to this:
function video = filter_rand_illumination(video, min_brightness, max_brightness)
    RGB = video.frame(1).filtered;
    HSV = rgb2hsv(RGB);
     luma_factor = 0;
          while(luma_factor < min_brightness || luma_factor > max_brightness)
           luma_factor = rand(1);
    end
      v = HSV(:,:,3);
      hue_v = v * luma_factor;
      HSV(:,:,3) = hue_v;
                 
RGB = hsv2rgb(HSV);
 video.frame(1).filtered = RGB;
This is just an example of how do I need to construct unsharp filter.

Thanks
0
 
LVL 15

Accepted Solution

by:
yuk99 earned 500 total points
ID: 24022453
AFAIK unsharp filter in Matlab does not use gaussian smoothing. It subtracts laplacian filter (with parameter ALPHA, which controls laplacian shape) from the original image.
If you  need to use those gaussian parameters, you'll have to develop your own filter function. Once you have it, run imfilter on separate frames within for-loop. Somethig like
H = fspecial('unsharp');
video2=video;
for i=1_numel(video)
    video2(i).cdata = imfilter(video(i).cdata,H,'replicate');
end

0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
copyEndy  challenge 15 84
mapShare challenge 13 88
How to access ANSI/IEEE Std 754 or equivalent information ? 3 44
One Standard Deviation from the Mean 2 0
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now