Raw image recovery and 24-bit BMP images filter library in C & Python-matplotlib based digital image processing toolkit.
Python-matplotlib based digital image processing toolkit, based on :
- Spatial filtering
- Edge detection
- Histogram analysis
- Intensity windowing
- Thresholding
- Pixel-level transformations.
This project applies different image filters to 24-bit BMP images using C.
The program supports four filters:
- Grayscale (
-g) – Converts the image to grayscale. - Reflect (
-r) – Reflects the image horizontally. - Blur (
-b) – Applies a box blur to each pixel. - Edges (
-e) – Detects edges using the Sobel operator.
./filter -g images/yard.bmp output.bmpOther filters:
./filter -r images/yard.bmp output.bmp
./filter -b images/yard.bmp output.bmp
./filter -e images/yard.bmp output.bmp- Grayscale
Each pixel's red, green, and blue values are averaged:
average = (red + green + blue) / 3
The resulting average is assigned to all three color channels.
- Reflect
Pixels on each row are swapped from left to right, producing a horizontal mirror effect.
- Blur
Each pixel is replaced with the average color of itself and its neighboring pixels.
A copy of the original image is used so that modifying one pixel does not affect the calculations for other pixels.
- Edges
The edge detection filter uses the Sobel operator with horizontal (Gx) and vertical (Gy) kernels to detect changes in pixel intensity.
The resulting value is calculated using:
sqrt(Gx² + Gy²)
and capped at 255.
Recover is a C program that recovers JPEG images from a forensic image file containing raw data from a memory card.
The program reads the memory card data in blocks of 512 bytes, identifies JPEG file signatures, and writes each recovered JPEG to a separate file.
Run it with the forensic image:
./recover card.rawThe program generates recovered images with names such as:
000.jpg
001.jpg
002.jpg
...