Code Monkey home page Code Monkey logo

binary_cgh_by_lrds_aia's Introduction

binary_CGH_By_LRDS_AIA

Introduction

This project is the implementation for binary computer-generated holograms(CGH) with localized random down-sampling and adaptive intensity accumulation(AIA). A computer-generated complex Fresnel hologram is calculated by

Subsequently, a binary hologram is obtained by applying sign-thresholding binarization on the complex hologram, given by

It should be noted that sign-thresholding binarization will produce serious error on the binary hologram. The error can be suppressed by down sampling the object ref. That is, the object function must be replaced by a down-sampled version of the object,

where ๐‘†(๐‘ฅ,๐‘ฆ) is the function of down-sampling mask. One of the simplest masks is a regular point down sampling (RPDS) mask, which is defined as

where ๐‘,๐‘žโˆˆ1,2,3โ€ฆ, and k the down-sampling factor (an integer larger than one). The operator โˆฉ denotes the intersection of the two sets of data. Because only 1/๐‘˜2 over the total ๐‘‹๐‘Œ pixels are selected by ๐‘†๐‘Ÿ๐‘(๐‘ฅ,๐‘ฆ), the down sampling rate of ๐‘†๐‘Ÿ๐‘(๐‘ฅ,๐‘ฆ) is ๐‘…=1/๐‘˜2. Equation (4) only defines a single down-sampling mask. We can just shift the down-sampling points to generate other down-sampling masks. By this way, total ๐‘˜2 various masks can be generated, as shown in Fig. 1(a). Nevertheless, the number of RPDS masks is still limited. This issue can be solved by localized random down-sampling (LRDS).

In LRDS, the object space is divided to many tiles, and each tile contains ๐‘˜ร—๐‘˜ pixels. Subsequently, one over the ๐‘˜2 points in the tile is randomly selected as the down-sampling point. Therefore, the down-sampling rate is also ๐‘…=1/๐‘˜2. The LRDS mask can be modeled as

where both ๐œ๐‘Ž and ๐œ๐‘ are random integer and 0โ‰ค๐œ๐‘Ž,๐œ๐‘โ‰ค๐‘˜โˆ’1. Therefore, for every (๐‘,๐‘ž), i.e. within a tile, a combination of (๐œ๐‘Ž,๐œ๐‘) is randomly selected, as shown in Fig. 1(b). In this example, every point of a tile is selected once. However, there is no limitation on the selection rule and thus total ๐‘˜2๐‘‹๐‘Œ/๐‘˜2 various masks can be generated. The LRDS mask also have other advantages. The periodic structure due to regular-point down-sampling is significantly suppressed. In addition, the random process is localized in a tile. Thus, the sample points distribute uniformly on the whole object plane, which is unachievable for conventional random down sampling. An example of RPDS mask and LRDS mask is shown in figure.

The flow chart of generating the binary holograms for AIA is shown in figure.

Function description

AIA.m is the implementation for binary CGH reconstruction with localized random down-sampling and adaptive intensity accumulation(AIA).

DIA.m is the implementation for binary CGH reconstruction with localized random down-sampling and direct intensity accumulation(DIA).

generate_LRDS.m is the implementation for generate the localized random down-sampling mask, it will generate mask file(LRDS.mat).

The code as the following structure

โ”œโ”€โ”€ binary_CGH_By_LRDS_AIA
  โ”œโ”€โ”€ AIA.m
  โ”œโ”€โ”€ DIA.m
  โ”œโ”€โ”€ generate_LRDS.m
  โ”œโ”€โ”€ LRDS.mat 
  โ””โ”€โ”€ image.bmp

binary_cgh_by_lrds_aia's People

Contributors

hsuan0903 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.