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 7956331
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T03:57:33+00:00 2026-06-04T03:57:33+00:00

Can anyone guide me in the best way of developing a filter algorithm for

  • 0

Can anyone guide me in the best way of developing a filter algorithm for video processing?

Say for example I wanted to apply a fisheye lens filter onto an image, how would I process the pixels so that it would mimic this effect?

If I wanted to make the picture look more red, then I would deduct values from the blue and green components at each pixel, leaving behind only the red component.

This kind of distortion is more than just color processing, so I’d like to know how to manipulate the pixels in the correct way to mimic a fisheye lens filter, or say a pinch filter, and so forth.

EDIT:

Filter algorithm for VIDEO PROCESSING*

  • 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-04T03:57:35+00:00Added an answer on June 4, 2026 at 3:57 am

    As Martin states, to apply a distortion to an image, rather than just a color correction, you need to somehow displace pixels within that image. You generally start with the output image and figure out which input pixel location to grab from to fill in each location in the output.

    For example, to generate the pinch distortion I show in this answer, I use an OpenGL ES fragment shader that looks like the following:

     varying highp vec2 textureCoordinate;
    
     uniform sampler2D inputImageTexture;
    
     uniform highp vec2 center;
     uniform highp float radius;
     uniform highp float scale;
    
     void main()
     {
         highp vec2 textureCoordinateToUse = textureCoordinate;
         highp float dist = distance(center, textureCoordinate);
         textureCoordinateToUse -= center;
         if (dist < radius)
         {
             highp float percent = 1.0 + ((0.5 - dist) / 0.5) * scale;
    
             textureCoordinateToUse = textureCoordinateToUse * percent;
         }
         textureCoordinateToUse += center;
    
         gl_FragColor = texture2D(inputImageTexture, textureCoordinateToUse );
    
     }
    

    This GLSL code is applied to every pixel in the output image. What it does is calculate the distance from the center of the region being pinched to the current pixel coordinate. It then takes that input distance and scales that based on the input scale parameter. This new scaled distance is used to displace the coordinate in the input image where the output color will be read from.

    Sampling a color from the input image at a displaced coordinate for each output pixel is what produces a distorted version of the input image. As you can see in my linked answer, slightly different functions for calculating this displacement can lead to very different distortions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please can anyone recommend a quick checklist / best practice guide to help us
Can anyone advise what is the best way of client and server side validation.
Can anyone guide me what could be the problem in the mentioned below:- alt
Can anyone point me to a guide for creating inf files? In particular, I'm
Does anyone know of an ASP.NET guide to implementing OpenID and what information can
Can any one guide me which file upload is best for an ASP.NET MVC
Hi can anyone guide me in this problem ? I am reading a .class
Hi i am new in java reflection domain.So can anyone guide me in this
can anyone guide me int he right direction? What i'm trying to achieve is
Can anyone guide me what C# code should I write for getting page load

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.