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

  • Home
  • SEARCH
  • 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 712405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:50:40+00:00 2026-05-14T04:50:40+00:00

There is a good function that I need, which is implemented in the Java

  • 0

There is a good function that I need, which is implemented in the Java program: ImageJ.
I need to understand the algorithm used there.
The function has several parameters:
link text

And before using FFT it converts image to a special one:
The Bandpass Filter uses a special algorithm to reduce edge artifacts (before the Fourier transform, the image is extended in size by attaching mirrored copies of image parts outside the original image, thus no jumps occur at the edges)

Can you tell me more about this special transform?
Actually tiling mirrored image.

I am writing on C++ and wish to rewrite that part of the program on C++.

EDIT1:
I need to understand how it does that tiling mirrored image operation, may be it is special one. Actually at first it converts image to a new sized image, so for my images it will be:
convertion from 600X480 to 1024X1024 sized image.
How the tiling is used here?

EDIT2:
Also it is hard to understand this description of tileMirrored function:

Puts ImageProcessor (ROI) into a new ImageProcessor of size width x height y at position (x,y). The image is mirrored around its edges to avoid wrap around effects of the FFT.
What is meant by “…of size width x height y at position (x,y). “?

EDIT3:
I implemented that bandpass filter, and it gives the same results as the original program.
But, the algorithm itself in original program (also in my program) is very slow
I want to use that filter not once in my program, but it calculates approximately 0.5 to 2 seconds each call (depending on parameter value).
There is used an FHT transform (not FFT), is it more quickly than FFT?
I think the filter itself is not optimized, please see filterLargeSmall function implementation:
source code

  • 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-05-14T04:50:41+00:00Added an answer on May 14, 2026 at 4:50 am

    I don’t know exactly how that function works, but here’s the basic algorithm for a similar function:

    1. Determine the smallest power of two (call it newSize) that is larger than the larger of the two dimensions of the image (call them xSize & ySize).

    2. Create a new square image of size newSize by newSize and copy the contents of the image to the center of the new image (ie. the top-left of the image should start at (newSize / 2 - xSize / 2, newSize / 2 - ySize / 2)).

    3. Fill in the remaining pixels as follows, for each pixel at (x, y):

      • if x < (newSize / 2 - xSize / 2), copy the pixel at column (newSize / 2 - xSize / 2) + (newSize / 2 - xSize / 2) - x and row y.
      • if y < (newSize / 2 - ySize / 2), copy the pixel at row (newSize / 2 - ySize / 2) + (newSize / 2 - ySize / 2) - y and column x.
      • if both of the above are true, copy the pixel at column (newSize / 2 - xSize / 2) + (newSize / 2 - xSize / 2) - x, row (newSize / 2 - ySize / 2) + (newSize / 2 - ySize / 2) - y.
      • if x > (newSize / 2 + xSize / 2), copy the pixel at column (newSize / 2 + xSize / 2) + (newSize / 2 + xSize / 2) - x and row y.
      • if y > (newSize / 2 + ySize / 2), copy the pixel at row (newSize / 2 + ySize / 2) + (newSize / 2 + ySize / 2) - y and column x.
      • if both of the above are true, copy the pixel at column (newSize / 2 + xSize / 2) + (newSize / 2 + xSize / 2) - x and row (newSize / 2 + ySize / 2) + (newSize / 2 + ySize / 2) - y.

    There are probably libraries that will make this easier (ie. flipping and copying image data), but I am not familiar with C++, and this should be pretty easy to code yourself as long as performance isn’t a huge issue. Be careful of rounding issues for images with odd dimensions: make sure they’re consistent.

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

Sidebar

Ask A Question

Stats

  • Questions 386k
  • Answers 386k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I'll try to explain: There is an application, with thrift… May 14, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer Should I be storing the Instance references in a structure… May 14, 2026 at 11:51 pm
  • Editorial Team
    Editorial Team added an answer Assuming the files are already in the proper project's directory… May 14, 2026 at 11:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.