To detect a lens external condition, like dust, stain, illumination, ... ,etc, we build three algorithm to detect specific problem.
- Definition: The light fall-off observed towards the edges of an image.
- Reason:
- Lens vignetting
- The angular dependence of quantum efficiency due to use microlenses.
- ... etc.
- Detect environment: White card.
- Detect method
- Evaluate highest pixel block (
$\frac{1}{10}W\times\frac{1}{10}H$ ) average$Y_C$ from center block. - Evaluate corner pixel block average
$\text{Y}_1,\text{Y}_2,\text{Y}_3,\text{Y}_4$ ($\frac{1}{10}\text{W}\times\frac{1}{10}\text{H}$ ) . - Evaluate shading (%)
$\text{A}_i=\frac{\text{Y}_i}{\text{Y}_C}\times 100$ , where$1\leq i\leq4$ .
- Evaluate highest pixel block (
- Qualified condition
-
$\text{CenterLow}\leq\text{Y}_C\leq\text{CenterUp}$ . -
$\text{PassLevel}\leq \text{A}_i \leq \text{PassLevelUp}$ , where$1\leq i\leq4$ . -
$\max_{1\leq i\leq4}{A_i}-\min_{1\leq i\leq4}{\text{A}_i}\leq \text{Diff}$ .
-
- Definition: Unwanted light in an image that did not originate from the related scene object
- Reason:
- Everything between the object and the camera's front lens, e.g., haze or dust in the air.
- Interreflections between the optical parts of the lens and dust and dirt on the lens elements.
- Light reflected from the edges and framing of the lens or the shutter, diaphragm, camera body, etc.
- Light from the optical system itself with spherical aberration and chromatic aberrations etc.
- Light leakage
- Detect environment: ANSI Contrast
- Detect method
- Statistics all pixel value distribution.
- Evaluate standard deviation
$\sigma$ from pixel distribution.
- Qualified condition
-
$\text{StdThreshold}\leq\sigma$ .
-
- Definition: Visible spots or marks in the image.
- Reason:
- Sensor defects.
- Detect environment: White card.
- Detect method
- Pass image to fast difference filtering
- Pass image to filter to de-noise.
- Binarize image by
$\text{IntensityTolerance}$ .
- Qualified condition
- All pixel intensity
$\text{Img}_{ij}<\text{IntensityTolerance}$ .
- All pixel intensity
git clone https://github.com/ed28311/DITCamera.git --recursive [Target Directory]
cd [Target Directory]
mkdir build
cmake ..
make
./bin/main -{mode}{configMode} {config path} {image path}
./bin/main \
-{mode}{configMode} {config path} {image path} \
-{mode}{configMode} {config path} {image path} \
... \
-{mode}{configMode} {config path} {image path}
launch.bat ${Base directory} ${File_path}
.
├── CameraSpec.spe -> Basic config file.
├── CMakeLists.txt
├── launch.bat
├── launch.sh
├── README.md
├── LICENSE
├── str
│ ├── algorithmDispatcher.hpp -> Assign task to correspond algorithm.
│ ├── configLoader.hpp -> Load Config and constructure config class.
│ ├── DITAlgorithm.hpp -> Basic algorithm class structure.
│ ├── DITAlgorithms.hpp -> Header integrate all algorithm.
│ ├── DITConfig.hpp -> Basic config class structure.
│ ├── logger.hpp -> To log the result and save as file.
│ ├── method -> Directory to storage algorithm.
│ │ ├── blemish.hpp
│ │ ├── flare.hpp
│ │ └── shading.hpp
│ └── tool
│ └── displayer.hpp -> To prettify string and print variable info.
└── test_pic -> Test picture.
├── blemish.jpg
├── blemishNG.jpg
├── blemishOK.jpg
├── flare.jpg
├── flareNG.jpg
├── flareOK.jpg
├── shading.jpg
├── shadingNG.jpg
└── shadingOK.jpg