Skip to content

This project was to gain experience in face detection and text from given images. Faces are then cropped and placed on to sheets that are saved

Notifications You must be signed in to change notification settings

Talhamuhammadali/Image-Processing-from-zipfile

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Processing from ZIP File

Description

This Python project involves processing images within a provided ZIP file containing newspaper images. The task is to search through these images for occurrences of names and faces. The script will utilize various libraries to perform tasks such as face detection, optical character recognition (OCR), and image composition to create contact sheets.

Requirements

  • Python
  • zipfile: Python's built-in library for working with ZIP files. Used to extract images from the provided ZIP file.
  • PIL: Python Imaging Library. Utilized for image processing tasks such as image opening, manipulation, and contact sheet creation.
  • pytesseract: Python wrapper for Google's Tesseract OCR engine. Enables optical character recognition to search for keywords within images.
  • OpenCV (cv2): Open Source Computer Vision Library. Used for face detection within images and other computer vision tasks.

Installation

  1. Clone the repository:
       gh repo clone Talhamuhammadali/Image-Processing-from-zipfile
    
  2. Setup Virtual Envirnoment: python3 -m venv myenv ON Windows: myenv\Scripts\activate ON Linux: source myenv/bin/activate
  3. Install dependencies:
    pip install -r requirements.txt
    

Usage

  1. Place the ZIP file containing newspaper images in the files folder.
  2. Run the script image_processing.py.
    python image_processing.py --name "anyname"
    
    Replace "anyname" with the desired name to search for.

Features

  • Face Detection: Utilizes OpenCV for detecting faces within images.
  • Keyword Search: Performs OCR using Tesseract to search for specific keywords within the images.
  • Contact Sheet Generation: Uses PIL to composite images with detected faces into contact sheets.

Example

A zip file is included in the files folder. Use script to find 'Christopher' by using:

    python image_processing.py files/project.zip --name "Christopher"

The processing takes ~15-20m for me as it was done on an old pc.The results are saved in the main folder. the result for this case is:

image

Try the following example:

    python image_processing.py files/project.zip --name "Mark"

About

This project was to gain experience in face detection and text from given images. Faces are then cropped and placed on to sheets that are saved

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages