Skip to content
Table of contents

RawAnalyser: From raw sensor values to diagnostic plots

RawAnalyser is an older Python image-analysis experiment for clipping, channel values, gamma and vignetting. Its input assumptions are visible in the implementation, including a fixed raw frame shape and regions selected through a JSON file.

Application and tools
  • Updated
  • Python · 100%
Documented components
2Explore modules
Source documents
1Read the instructions
Repository languagesPython 100%1

Shares calculated from GitHub Linguist bytes.

Python100%
100%101,536 bytes
Language%Bytes
Python100%101,536

1. Overview

1.1. Why it exists

Sensor pixel analysis tool computing clipping histograms and dynamic range for RAW camera frames.

1.2. Best fit

Camera sensor benchmarking and exposure verification in computational photography.

2. Use cases

Python 2 scripts for camera-tuning engineers to check clipping, gamma and vignetting in raw Bayer sensor captures.

Use-case diagram for RawAnalyser: Mark ROI and gray patches; Analyse each new raw capture; Detect black or white clipping; Measure gamma and vignetting; Inspect one pixel's value; Convert raw files to TIFFRawAnalyserMark ROI and gray patchesAnalyse each new raw captureDetect black or white clippingMeasure gamma and vignettingInspect one pixel's valueConvert raw files to TIFFImage quality engineer«system»Camera capture folder
People on the left, external systems on the right; each oval is a use case backed by the files cited below.
Mark ROI and gray patches
Image quality engineer

GUI.py (PyQt5) opens a .raw or .tiff file, converts raw to TIFF for display and saves the clicked region of interest and gray patch corners to json/points.json.

Analyse each new raw capture
Image quality engineerCamera capture folder

RawAnalyser.py uses a watchdog observer on the given folder; every new 1928 x 1088 16-bit raw file is split into Bayer channels, saved as TIFF and analysed.

Detect black or white clipping
Image quality engineer

clipping() prints per-channel minimum and maximum 10-bit levels and flags CLIPPING BLACK or white in colour when values reach the sensor limits.

Measure gamma and vignetting
Image quality engineer

gamma() samples the gray patches from points.json; vignette() subtracts the black level (--bl, default 1024), divides by a stored .npy vignette map and writes a corrected TIFF.

Inspect one pixel's value
Image quality engineer

RawPixel.py prints the value and Bayer colour of the pixel at x, y for a given width, height and bit depth, and dumps channels to array/*.txt.

Convert raw files to TIFF
Image quality engineerCamera capture folder

Raw2Tiff.py writes a TIFF from one raw file; 20MPto5MP.py bins 20 MP OV20880 frames by summing 2 x 2 same-colour pixels into a 5 MP image.

2.1. Scenario: Check an OV2740 colour-checker capture

  1. Install Python 2.7 and the packages in requirements.txt, plus tifffile.
  2. Run python GUI.py, open a capture from raw/ and click the ROI and gray patches to update json/points.json.
  3. Start python RawAnalyser.py raw json/points.json --func basic --bl 1024 to watch the folder.
  4. Copy a new .raw capture into raw/; the script prints clipping warnings and gamma figures and writes a TIFF under tiff/.
  5. Check a suspicious spot with python RawPixel.py <file> x y --width 1928 --height 1088.

Files readREADME.mdrequirements.txtRawAnalyser.pyGUI.pyRawPixel.pyRaw2Tiff.py20MPto5MP.pyjson/points.json

3. Getting started

These commands come from the repository documentation. They were not run during this review.

README.md · Usage
python RawAnalyser.py <pathfolder> <pointfile> --func <clipping,gamma,vignette,histogram,noHist,basic, default all> --bl <black level, default 1024> --vignette <pathvignette>
README.md · Usage
python GUI.py
README.md · Usage
python RawPixel.pt input<file> x y  --bitdepth <8,10,16,default 16>

4. Repository references

Excerpts from the repository’s guides, in their original language. Links open the inspected source revision.

Prerequisites and first run

4.1. Prerequisites

README.md

You need to have Python 2.7 installed and the following libraries:

  • json
  • time
  • numpy
  • scipy
  • pyqt5
  • argparse
  • argcomplete
  • watchdog
  • logging
  • colorama
  • plotly
  • matplotlib
Read the full instructions ↗
Configuration and usage

4.2. Usage

README.md

  1. Run the RawAnalyser script:
  2. Start the GUI:
  3. Check the value of the pixel and the color with the bayer pattern:
Read the full instructions ↗
Source documentation

1 documents read from 1 candidates.

5. Features and components 2

File watcher and raw layout
NewAnalyse reacts to file creation, loads region coordinates and reads uint16 data. The code reshapes the array to 1088 by 1928 pixels and writes a TIFF. Those dimensions are part of the implementation, not inferred from the file.
Regions and channels
The analysis builds crop and gray-reference matrices before separating channel samples with fixed index patterns. Plots and statistics therefore depend on both the region file and the assumed sensor layout.

6. Architecture

Expand a component to follow its connections, or explore the full diagram.

System components Context
Mermaid Interactive diagram

System overview of the components and connections verified in the repository.

Static architecture view for RawAnalyser
Static preview. The interactive diagram replaces it after Mermaid loads.
flowchart LR
  n0["Raw frame and region JSON"]
  n1["Watchdog event"]
  n2["uint16 array and reshape"]
  n3["Region and channel extraction"]
  n4["TIFF and diagnostic plots"]
  n0 --> n1
  n1 --> n2
  n2 --> n3
  n3 --> n4
Text version of the diagram
  • Raw frame and region JSON → Watchdog event
  • Watchdog event → uint16 array and reshape
  • uint16 array and reshape → Region and channel extraction
  • Region and channel extraction → TIFF and diagnostic plots
Follow one path through the code

Follow np.fromfile into reshape, then compare the crop bounds with the channel loops. A plausible-looking plot can still be wrong if the input dimensions or Bayer layout differ from those fixed assumptions.

7. Technical dossier

Built from the source at commit ff74580 (8 files). Each item comes from a pattern match in the code, so open the linked file before relying on it.

7.1. Layers and modules

Folders are sorted into layers by name, from the user interface down to data access. Because the sorting uses names only, the diagram says nothing about calls between layers.

Mermaid Layered view
flowchart TB
  subgraph L_core["Core source"]
    direction TB
    core_0["(root)<br/>6 files"]
  end
Modules and their main layer
ModuleLayerFilesTypesExtensions
(root)Core source63.py

7.2. C4 model

From system context to code declarations. Each level reflects the available source evidence.

UML 1 · System context
1 · System context

The widest C4 view: who uses the project and which outside systems and data stores it relies on. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Context>
LAYOUT_LEFT_RIGHT()
Person(P_cli, "CLI user")
System(SYS, "RawAnalyser", "RawAnalyser is an older Python image-analysis experiment for clipping…")
Rel(P_cli, SYS, "Uses")
@enduml
UML 2 · Containers
2 · Containers

One level closer: the parts that run separately inside the project, their main language and how calls flow between them. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Container>
LAYOUT_LEFT_RIGHT()
Person(P_cli, "CLI user")
System_Boundary(SYS, "RawAnalyser") {
  Container(APP, "RawAnalyser", "Python")
}
Rel(P_cli, APP, "Uses")
@enduml
UML 3 · Components and layers
3 · Components and layers

Modules grouped by source-layer classification. Boundaries show organization, not runtime isolation or call relationships. Rendered with uml-mcp.

PlantUML source
@startuml
!include <C4/C4_Component>
LAYOUT_TOP_DOWN()
System_Boundary(SYS, "RawAnalyser") {
Boundary(L0, "Core source", "layer") {
Component(M0_0, "(root)", "Python", "6 files")
}
}
@enduml
UML 4 · Code
4 · Code

Selected declarations, fields and methods grouped by source file. No inheritance or call edges are inferred. Rendered with uml-mcp.

PlantUML source
@startuml
skinparam backgroundColor transparent
skinparam shadowing false
skinparam roundCorner 10
skinparam defaultFontName Arial
skinparam defaultFontSize 13
skinparam ArrowColor #4e6070
skinparam ArrowFontColor #3d4f5f
skinparam titleFontSize 14
skinparam actorBorderColor #006a62
skinparam actorBackgroundColor #e9f3f4
skinparam usecaseBorderColor #006a62
skinparam usecaseBackgroundColor #e9f3f4
skinparam componentBorderColor #006a62
skinparam componentBackgroundColor #e9f3f4
skinparam interfaceBorderColor #006a62
skinparam interfaceBackgroundColor #ffffff
skinparam nodeBorderColor #4e6070
skinparam nodeBackgroundColor #f4f8fb
skinparam databaseBorderColor #006a62
skinparam databaseBackgroundColor #ffffff
skinparam cloudBorderColor #4e6070
skinparam cloudBackgroundColor #f0f5fa
skinparam artifactBorderColor #006a62
skinparam artifactBackgroundColor #ffffff
skinparam rectangleBorderColor #b0c2d3
skinparam activityBorderColor #006a62
skinparam activityBackgroundColor #e9f3f4
skinparam partitionBorderColor #b0c2d3
skinparam stereotypeCBackgroundColor #ffffff
top to bottom direction
hide empty members
package "RawAnalyser" {
package "GUI.py" as F0 {
class "FormWidget" as T0_0 {
  UI()
  eventFilter()
  getPos()
}
class "MenuFile" as T0_1 {
  Menu()
  showDialog()
}
}
}
@enduml

7.3. Public interface

Outside code can use everything listed here. The project also declares 3 public types.

Command line 12

7.4. Private interface

These names are internal by the language’s conventions: a leading underscore, private, static or pub(crate).

underscore helper
6

7.5. Business logic

Once UI code and the services and entities above are set aside, these classes have the most methods.

FormWidget Core source, 3 methods
UI, eventFilter, getPos
MenuFile Core source, 2 methods
Menu, showDialog

7.6. Database and persistence

7.7. Stack and dependencies

Python requirements.txt 10 runtime

Open the manifest

External dependencies

10 declared packages (10 runtime, 0 development) in requirements.txt.

Package table 10
External dependencies
PackageVersionScopePurposeRegistry
numpy—runtimeData analysispypi.org
scipy—runtimeData analysispypi.org
pyqt5—runtimePython bindings for the Qt cross platform application toolkitpypi.org
argparse—runtimePython command-line parsing librarypypi.org
argcomplete—runtimeBash tab completion for argparsepypi.org
watchdog—runtimeFilesystem events monitoringpypi.org
logging—runtimeLogging and observabilitypypi.org
colorama—runtimeCommand linepypi.org
plotly—runtimeChartspypi.org
matplotlib—runtimeChartspypi.org

7.8. CI/CD pipeline

No CI/CD pipeline in the repository. The code is built and run by hand, as described above.

7.9. Deployment

Mermaid Deployment diagram
flowchart LR
  repo[("GitHub repository")]
  local["Local machine<br/>Python"]
  repo -->|"clone and run"| local

The repository has no Dockerfile, Compose file or hosting configuration, so the code runs on the machine that clones it.

7.10. Monitoring

What the code logs, measures and exposes to tell whether it is working.

Nothing found for: Services, Entities, External integrations, Security, Testing.

8. Types and file structure

3 declared types, with 3 in the base-relationship overview.

Type diagram
classDiagram
direction TB
class t67aaaf89d49b["MenuFile"] {
  __init__()
  Menu()
  showDialog()
}
class t2831ebc76ef2["FormWidget"] {
  __init__()
  UI()
  eventFilter()
  getPos()
}
class tbf7f85dbbc2d["NewAnalyse"] {
  on_created()
}
class bc56111853d56["QMainWindow"] {
  <<unresolved_base>>
}
bc56111853d56 <|-- t67aaaf89d49b
class b8e0cc8fba905["QWidget"] {
  <<unresolved_base>>
}
b8e0cc8fba905 <|-- t2831ebc76ef2
class b5c54f16f78bf["FileSystemEventHandler"] {
  <<unresolved_base>>
}
b5c54f16f78bf <|-- tbf7f85dbbc2d

Unresolved bases remain labelled; full signatures are not reconstructed.

9. Reference

8 / 8 eligible files read (65 in the tree); 0 oversized, 0 failed reads and 0 syntax diagnostics.

What the scan covers

Known dependency/build folders, credential files and binaries are excluded. The scan covers READMEs, recognized manifests and parser-supported source files.

Linguist statistics cover the whole repository and may include other languages.

11. Files to read 3

12. Glossary

Repository

The versioned source files, configuration, and history of a project.

README

The repository’s entry document, usually covering its purpose and initial setup.

Dependency

A library, tool, or service that another component needs to build or run.

Build

The steps that turn source files and dependencies into a runnable program or distributable artifact.

13. References

  1. antoinebou12. (2026, November 5). RawAnalyser. [Software repository] github.com.
  2. antoinebou12. (2026, November 5). RawAnalyser: README. [Repository documentation] github.com.
  3. antoinebou12. (2026, November 5). RawAnalyser.py. [Source file] github.com.
  4. antoinebou12. (2026, November 5). GUI.py. [Source file] github.com.
  5. antoinebou12. (2026, November 5). RawPixel.py. [Source file] github.com.
  6. Boucher, A. (2021, September 6). RawAnalyser. [Project article] antoineboucher.info.
  7. Boucher, A. (2026, October 23). RawAnalyser: From raw sensor values to diagnostic plots. [Project article] antoineboucher.info.

Sources without a publication date show the date they were last checked, November 5, 2026. File links retain the inspected revision where available.