Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7750091
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:12:05+00:00 2026-06-01T11:12:05+00:00

I have to determine, which filter was used on a random picture – is

  • 0

I have to determine, which filter was used on a random picture – is there a common way to detect the right one (gaussian, prewitt, sobel, average, …) or would it be clever to code some sort of ‘brute force’-detection ?

I tried to find it with Matlab, but I have no glue how to search more efficiently. At the moment it`s like finding a needle in a Haystack. I also thought of using some bash-script and imagemagick, but this would be to resource hungry.

I tought this wouldn’t be a problem, but it’s very time-consuming to guess a filter and try it like this

f = fspecial('gaussian', [3 3], 1);
res = imfilter(orginal, f);
corr2(res, pic);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:12:07+00:00Added an answer on June 1, 2026 at 11:12 am

    Let f be the original image, g be the filtered one, and h the filter applied to f, so that:

    f * h = g
    

    Passing that to the frequency domain:

    F.H = G, so H = G/F
    

    The problem is that inverting F is VERY sensitive to noise.

    How to implement that in MATLAB:

    close all;
    f = imread('cameraman.tif');
    [x,y] = size(f);
    figure,imshow(f);
    h = fspecial('motion', 20, 40); % abitrary filter just for testing the algorithm
    F = fft2(f);
    H = fft2(h,x,y);
    G = F.*H;
    g = ifft2(G); % the filtered image
    figure, imshow(g/max(g(:)));
    % Inverting the original image
    epsilon = 10^(-10);
    small_values = find(abs(F)<epsilon);
    F(small_values) = epsilon;
    F_i = ones(x,y)./F;
    H_calculated = G.*F_i;
    
    h_calculated = ifft2(H_calculated);
    
    % remove really small values to try to infer the original size of h
    r = sum(h_calculated,1)<epsilon;
    c = sum(h_calculated,2)<epsilon;
    h_real = h_calculated(~r,~c);
    
    % Calculate error
    % redo the filtering with the found filter
    figure,g_comp = ifft2(fft2(f).*fft2(h_real,x,y));
    imshow(g_comp/max(g_comp(:)));
    rmse = sqrt(mean(mean((double(g_comp) - double(g)).^2,2),1))
    

    edit: Just to explain the epsilon part:

    It can be that some values in F are zero, or very close to zero. If we try to invert F with these small values, we would have problems with infinity. The easy way to solve that is to truncate every value in F that is smaller than an arbitrarily small limit, epsilon on the code.

    Mathematically, what was done is this:

    For all F < epsilon, F = epsilon
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is it possible to determine which submit button was used? I have a confirmation
I have a large list of email addresses, and I need to determine which
I'm doing work for college and I have to determine, which of the three
I am trying to find a way to determine which character in my string
Often i have a problem that I need to determine which assebmly to include
I need to write and algorithm that can detect which state an application (used
I have a web app which tries to determine when people are attending events.
I am attempting to use reflection to determine which Properties of a Type have
I have started a GlassFish server on my machine. How can I determine which
I have been trying to determine a best case solution for registering a COM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.