Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multithreaded image-processing application that efficiently applies filters (Sobel, grayscale, thresholding) to large images.

License

Notifications You must be signed in to change notification settings

niloufarnb/multithreaded-image-processing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multithreaded Image‑Processing

Objectives

  1. Load an image – Read a single copy of the image into memory in the main thread; worker threads treat it as a shared resource.
  2. Divide the image – Split the image into smaller, manageable sub‑matrices (chunks) and assign a specific range of the main matrix to each worker thread.
  3. Apply filters – Implement various filters; each thread writes its results into its own matrix for its pixel range.
  4. Multithreading – Process chunks in parallel using at least nine threads, chosen dynamically based on image size.
  5. Synchronization – Without cloning the whole matrix, threads modify the shared image safely, ensuring neighbouring chunks don’t overwrite each other’s border pixels.
  6. Reassemble and save – Merge all processed chunks back into a single image and write it to disk.

Demo: original vs. filtered output

Features

  • Sobel edge‑detection – 3 × 3 Sobel kernels highlight horizontal and vertical edges (apply_sobel).
  • Grayscale conversion – luminance transform via rgb_to_grayscale for downstream filters.
  • Mean thresholding – converts to high‑contrast black‑and‑white using the global mean (threshold_image).
  • Oil‑painting effect – radius / intensity‑based stylisation that mimics brush strokes (apply_oil_painting).
  • Warm tone filter – boosts reds and greens for a cosy film vibe (apply_warm_filter).
  • Negative filter – inverts colours to produce an x‑ray look (apply_negative).
  • Automatic chunking & thread poolingdivide_image splits the frame; number_of_threads scales from 9 → 25 threads depending on resolution.
  • Thread‑safe in‑place writes – a shared threading.Lock ensures each worker writes its stripe without data races or extra memory.
  • Pluggable architecture – add new effects by writing a filter_func(chunk, source_image, lock, **kwargs) and passing it to multi_threading.

About

Multithreaded image-processing application that efficiently applies filters (Sobel, grayscale, thresholding) to large images.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages