Menu

Synthetic images for deferred Slanted-Edge analysis

Denis
2022-01-04
2022-01-22
  • Denis

    Denis - 2022-01-04

    I've implemented a program for focusing cameras in real-time based on the kernel method of your paper "Robust edge spread function construction methods ...". To support lenses with significant distortion I'd like to extend my program based on your second paper "Deferred Slanted-Edge analysis ...". The synthetic images you provided for the first paper were very helpful for verifying the correctness of my implementation. You mentioned test images in your second paper, but they are not available on the download page. Can you please make these images accessible for download or provide the parameters to reproduce these images with mtf_generate_rectangle?

    Regards,
    Denis

     
    • Frans van den Bergh

      Hi Denis,

      I checked, and I agree that those images are not already available on sourceforge. When I started looking for them, I realised that they have most likely been lost; they were stored on another server that died two years ago, and I don't seem to have any backups.

      I did generate them with mtf_generate_rectangle, but with the help of some additional scripts (written in AWK, it seems). As you may already know, mtf_generate_rectangle can render user-defined input polygon geometry. What I did was take an input test target geometry (a handful of square targets, as in the paper), subdivide the each edge in the original geometry into about 90 points, and then applied the usual lens distortion models (radial polynomial) to those points to generate a new polygon (now with ~360 points). The distorted geometry was then rendered using mtf_generate_rectangle using various simulated PSFs and distortion parameters.

      I still have the scripts, and I should be able to give you something workable (maybe a quick port to Python?), but it will take me a few days. (Please let me know if you would like such scripts)

      In the meantime, I managed to find at least one example, although the parameters are not the same as used in the paper. Based on the filename, I'd say this one has the first radial polynomial coefficient set to 0.25. The expected MTF50 is 0.35 for this image.

      But I do wonder if you really want to implement the deferred slanted-edge algorithm to deal with lens distortion. I have personally moved on to use the piecewise-quadratic method of dealing with distortion, which appears to work well even for fish-eye lenses; this method is much faster than the deferred method in practice. Maybe you have some extreme distortion? Can you share details?

      Regards,
      Frans

       

      Last edit: Frans van den Bergh 2022-01-05
  • Denis

    Denis - 2022-01-10

    Hi Franz,

    thank you for the quick answer. I'm aware that the algorithm in your paper is probably not fast enough for real-time use. It serves as an reference implementation for my accuracy tests. I will implement the piecewise-quadratic method for dealing with distortion
    as well. I would be very thankfull for these additional python scripts to generate distorted synthetic images.

    Regards,
    Denis

     
    • Frans van den Bergh

      Hi Denis,

      As promised, I put together my old AWK scripts into a new Python script: here, also attached to this post.

      I have not tested it to death, so please let me know if you run into any unexpected issues.

      The script supports the full OpenCV radial model (both polynomial, division, and rational models if you like). It is important to note that my script performs the inverse distortion such that if you take the rendered image, you should apply the coefficients you passed to the script to undistort the rendered image.

      For example, if you specify "--k4 -0.25" (all other coefficients zero), then MTF Mapper's "--optimize-distortion --debug" option will actually echo that coefficient back to you.

      The script will also give you a starting point for an mtf_generate_rectangle command to render the image.

      Also note that specifying large coefficients could result in distortions that are non-invertible at larger radial values. The script should drop the squares affected by this, and warn you. Using the --prescale option could help to squeeze the initial geometry enough to fit all the targets inside the usable range of radial values, but obviously it is better to avoid non-invertible distortion models.

      Anyhow, let me know if you have any questions.

      Regards,
      Frans

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.