Module3. Unsuspected person detection - GachonCapstoneDesign/DoorWatcher GitHub Wiki

We use Raspberry Pi camera to do image processing and detect suspicious people through our algorithms.

First, to use OpenCV in raspberry pi, the following process is required.

1. Installing

You need to install the following OpenCV in the raspberry pi. First update the basic packages installed in the raspberry pi.

sudo apt-get update   
sudo apt-get upgrade  

The list below is a required package when using OpenCV.

build-essential
cmake
pkg-config
libjpeg-dev
libtiff5-dev
libjasper-dev
libpng12-dev
libavcodec-dev
libavformat-dev
libswscale-dev
libv4l-dev
libxvidcore-dev
libx264-dev
libgtk2.0-dev
libatlas-base-dev
gfortran
python2.7-dev
python3-dev

sudo apt-get install {Package name}

Now download the OpenCV and unzip it.

wget -O openCV2.4.9.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv 2.4.9.zip/download
unzip openCV-2.4.9.zip  

If you do not have the unzip package, install it through sudo apt-get install unzip.

Now go to the folder where you unzipped and go through the following process.

cd openCV-2.4.9
cmake .
make -j4

'cmake' checks the packages installed on your system and automatically creates a Makefile for your build. Then builds through make -j4. Usually oepncv build time is very long. Once the build is finished, the installation will complete the installation of opencv.

sudo make install

When the installation is complete, type pkg-config --modversion opencv to verify the version.

motion detection

This code is now on the github.

  • Github. Click the hyperlink to go to the github repository.

When you run 'doorwatcher.py' in Python, it will take the first picture taken by the camera. When the image frame changes on the screen, it starts counting itself (set to count up to 100). When the motion disappears from the screen, the count is reset.

Videos

The following images are images that are operated using a notebook camera, not a Raspberry pi camera module.

Youtube

IMAGE ALT TEXT



[ 한글 위키 ]

라즈베리파 카메라를 이용해서 이미지 프로세싱을 하고 저희의 알고리즘을 통하여 수상한 사람을 감지합니다.

먼저 라즈베리파이에서 OpenCV 를 사용화기 위해선 다음과 같은 과정이 필요합니다.

1. Installing

라즈베리파이에 다음 OpenCV를 설치해야합니다.
먼저 라즈베리파이에 설치된 기본 패키지들을 업데이트 합니다.

sudo apt-get update   
sudo apt-get upgrade  

아래 목록은 OpenCV를 사용할 때 요구되는 패키지 입니다.

build-essential
cmake
pkg-config
libjpeg-dev
libtiff5-dev
libjasper-dev
libpng12-dev
libavcodec-dev
libavformat-dev
libswscale-dev
libv4l-dev
libxvidcore-dev
libx264-dev
libgtk2.0-dev
libatlas-base-dev
gfortran
python2.7-dev
python3-dev

sudo apt-get install {패키지명}으로 설치합니다.

이제 OpenCV를 다운받고 알집을 해제합니다.

wget -O openCV2.4.9.zip http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/2.4.9/opencv 2.4.9.zip/download
unzip openCV-2.4.9.zip  

만약 unzip패키지가 없다면 sudo apt-get install unzip 를 통해 설치합니다.


이제 압축을 해제한 폴더로 들어가서 다음과 같은 과정을 거칩니다.

cd openCV-2.4.9
cmake .
make -j4

cmake가 시스템에 설치된 패키지들을 확인하여 빌드를 위한 Makefile을 자동으로 생성합니다.
그다음 make -j4를 통해서 빌드를 수행합니다.
보통 oepncv 빌드시간은 매우 오래 걸립니다. 빌드가 마무리되면 이제 설치를 하면 opencv의 설치가 끝납니다.

sudo make install

설치가 완료되면 버전확인을 위해서 pkg-config --modversion opencv 을 입력합니다.

motion detection

이 코드는 현재 깃허브에 올려놨습니다.

  • Github. 하이퍼링크를 클릭하시면 깃허브 페이지로 이동합니다.

파이썬에서 doorwatcher.py를 실행시키면 카메라가 처음 찍은 화면을 기준으로 잡습니다. 화면에서 이미지 프레임이 변경되게 되면 자체적으로 카운트를 세기 시작합니다 (최대 100까지 카운트하게 설정했습니다.) 화면에서 움직임이 없어지면 카운트를 초기화합니다.

Videos

다음영상은 라즈베리파이 카메라 모듈이 아닌 노트북 카메라를 이용해서 동작하는 영상입니다.

Youtube

IMAGE ALT TEXT

⚠️ **GitHub.com Fallback** ⚠️