Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Archive Image

Jia En Chua edited this page Oct 25, 2018 · 4 revisions

Introduction

In CAM2ImageArchiver.py, there is a function named archive() and it is what user need to download images. The function takes in a list of camera objects, duration of entire parsing process, time interval to parse image, result path and a flag to remove result folder if parsing fail. For example, user has a list of camera objects that they want to parse image from.

Example

camObj1 = {'camera_type': 'ip', 'is_active_image': True}
camObj2 = {...}
camObj3 = {...}
camList = [camObj1, camObj2, camObj3]
archiver = CAM2ImageArchiver()
archiver.archive(camList)

Above will generate a list of image folders if parse successfully.

What might went wrong if parse fail?
Wrong URL, Website down, Camera get migrated to other place

Technical Details

  1. Transform each dictionary inside of camera list into Camera Instances. There are three main type of camera class such as IPCamera, NonIPCamera and StreamCamera. First step is to turn each camera dictionary into their camera class accordingly.

  2. Then we create result directories to store images from each camera.

  3. Start multithreading on downloading images => Camera Handler

  4. Remove directory if downloading failed for that specific camera

Camera Handler

Clone this wiki locally