Skip to content

Commit

Permalink
Camera-Guide For Vaaman/Axon
Browse files Browse the repository at this point in the history
    OV5647 / IMX219 Camera Supported
  • Loading branch information
avi951 committed Apr 19, 2024
1 parent 00adfa5 commit 7a245d8
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 0 deletions.
Binary file added source/_static/images/Camera_1.webp
Binary file not shown.
Binary file added source/_static/images/Camera_2.webp
Binary file not shown.
Binary file added source/_static/images/Camera_3.webp
Binary file not shown.
Binary file added source/_static/images/Camera_4.webp
Binary file not shown.
Binary file added source/_static/images/Camera_guide_0.webp
Binary file not shown.
Binary file added source/_static/images/Overlays_1.webp
Binary file not shown.
Binary file added source/_static/images/Overlays_2.webp
Binary file not shown.
Binary file added source/_static/images/Overlays_3.webp
Binary file not shown.
Binary file not shown.
Binary file not shown.
220 changes: 220 additions & 0 deletions source/accessory-raspi-cam.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,223 @@ Pi Camera documentation

Buy the `Raspberry Pi Camera Module v2
<https://www.raspberrypi.com/products/camera-module-v2/>`_.

|
#######################
Vaaman Camera Guide
#######################

1. Enable overlays options sutiable for your camera.
2. You can setup camera using cheese application or python source.

.. note::

If you do not have cheese application in your system, you can use camera by python source.


Pre-Requisites
---------------
- Camera ( OV5647 / IMX219 )
- FPC50 15 Pin 1mm Pitch Cable

Enable Overlays In Vaaman / Axon
------------------------

**Steps to follow for Configuration**

1. Open a terminal window(``Ctrl+Alt+T``).

2. Run command ``sudo vicharak-config`` in it.

3. Select ``Overlays`` options in it by pressing ``enter`` key.

.. image:: ./_static/images/Overlays_1.webp
:width: 50%

4. You will see Warning Page, click on ``yes`` and select ``Manage Overlays`` options.

.. image:: ./_static/images/Overlays_2.webp
:width: 50%

5. Select overlays as per your camera part number ``( OV5647 / IMX219 )`` by pressing ``spacebar`` on keyboard, then select ``Ok``.

.. image:: ./_static/images/Overlays_3.webp
:width: 50%

6. To return back to terminal, press the ``Esc`` key until you exit from it.

7. In order to enable your configuration, Restart your computer or Run command ``sudo reboot`` in terminal.

.. note::
Make sure that whenever you are going to connect Camera, Device shoule be power off.

Setup
------
.. tab-set::

.. tab-item:: Cheese Application

1. Attach the camera along with FPC50 15 Pin 1mm pitch cable to the CSI connector.

.. image:: ./_static/images/Camera_guide_0.webp
:width: 50%

2. Open the Cheese application in your Ubuntu Linux operating system.

.. image:: ./_static/images/Camera_1.webp
:width: 50%

3. You will be shown Cheese camera interface.

4. You have to click on hamburger button located at top right side.

5. Click on ``Preferences`` and select ``rkisp_mainpath`` in Device option.

.. image:: ./_static/images/Camera_2.webp
:width: 50%


.. image:: ./_static/images/Camera_3.webp
:width: 50%

6. Click on a webcam button in the middle of the bottom panel, or press the ``spacebar`` key, to take the photo.

.. image:: ./_static/images/Camera_4.webp
:width: 50%

7. There will be a short countdown, followed by a flash, and the photo will appear in the photo stream.

8. You can use camera as Photo mode and Video mode as well.

.. note::

In case above steps do not work, Follow below steps.

1. Open a terminal window(``Ctrl+Alt+T``).

2. To open cheese application, Run command ``sudo cheese``.


.. tab-item:: Python Source

|
**Introduction**

This documentation provides instructions on how to run the Python to open the camera frame and capture an image using OpenCV.

|
**Pre-Requisites**


1. Python3 installed on your system.

2. OpenCV library installed (`opencv-python`).

3. Any Text Editor Software like, Vim, gedit, nano etc.


To Install Vim:

.. code::
sudo apt update
sudo apt install vim
To Install Gedit:

.. code::
sudo apt update
sudo apt-get install gedit
|
**Setup**


1. Attach the camera along with FPC50 15 Pin 1mm pitch cable to the CSI connector.

.. image:: ./_static/images/Camera_guide_0.webp
:width: 50%

2. Install Python if not already installed. You can download Python from the official website: `Python Downloads <https://www.python.org/downloads/>`__.

for Debian-based systems (like Ubuntu):

.. code::
sudo apt update
sudo apt install python3-pip
3. Install the OpenCV library using pip

for Debian-based systems (like Ubuntu):

.. code::
pip install opencv-python
|
**Execution of Program**

1. Open a terminal window(``Ctrl+Alt+T``).

2. To create a (``.py``) file in vim editor, Run command ``vim <file_name>.py`` in terminal.

3. Copy this below content into the file and paste it by pressing ``Ctrl + Shift + v``, then press ``Esc`` and to save this file, type ``:wq``.

.. code::
# !/bin/env python3
import cv2
cap = cv2.VideoCapture(0)
while True:
ret, frame = cap.read()
cv2.imshow('frame', frame)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
# After the loop release the cap object
cap.release()
# Destroy all the windows
cv2.destroyAllWindows()
4. Open a terminal window(``Ctrl+Alt+T``).

5. Navigate to the directory where your Python program is located using the ``cd`` command.

6. Run Python program using the following command:

.. code::
python3 <file_name>.py
If you have multiple versions of Python installed, ensure you use ``python3`` to run the program for Python 3.x.


|
**Expected Behavior**


1. Upon running the program, the camera frame will open.

.. image:: ./_static/images/python-script-camera-frame.webp
:alt: Image Description
:width: 650

2. Press the ``Ctrl+S`` key on your keyboard to capture an image.

.. image:: ./_static/images/python-script-save-image.webp
:alt: Image Description
:width: 650

3. The captured image will be saved in the current directory unless the directory location has been changed.

4. Press the key ``Q`` on your keyboard to exit the camera frame.


|
**Troubleshooting**


- If you encounter any errors related to missing modules or libraries, ensure that Python and OpenCV are properly installed on your system.
- If the camera frame does not open or the program does not behave as expected, check for any
errors in the terminal output and review your program for potential issues.

0 comments on commit 7a245d8

Please sign in to comment.